Advanced Multi-Physics (AMP)
On-Line Documentation
VectorDataNull.h
Go to the documentation of this file.
1#ifndef included_AMP_VectorDataNull
2#define included_AMP_VectorDataNull
3
4#include "AMP/utils/typeid.h"
5#include "AMP/vectors/data/VectorData.h"
6
7
8namespace AMP::LinearAlgebra {
9
10
17{
18public: // Functions inherited from VectorData
19 VectorDataNull() = delete;
20 VectorDataNull( const typeID &type ) : d_type( type ) {}
21 std::string VectorDataName() const override { return "VectorDataNull"; }
22 inline size_t numberOfDataBlocks() const override { return 0; }
23 inline size_t sizeOfDataBlock( size_t = 0 ) const override { return 0; }
24 inline void putRawData( const void *, const typeID & ) override {}
25 inline void getRawData( void *, const typeID & ) const override {}
26 bool hasGhosts() const override { return false; }
27 void fillGhosts( const Scalar & ) override {}
28 void getValuesByLocalID( size_t N, const size_t *, void *, const typeID & ) const override;
29 void setValuesByLocalID( size_t N, const size_t *, const void *, const typeID & ) override;
30 void addValuesByLocalID( size_t N, const size_t *, const void *, const typeID & ) override;
31 void setGhostValuesByGlobalID( size_t, const size_t *, const void *, const typeID & ) override;
32 void addGhostValuesByGlobalID( size_t, const size_t *, const void *, const typeID & ) override;
33 void getGhostValuesByGlobalID( size_t, const size_t *, void *, const typeID & ) const override;
34 void
35 getGhostAddValuesByGlobalID( size_t, const size_t *, void *, const typeID & ) const override;
36 size_t getAllGhostValues( void *, const typeID & ) const override;
37 typeID getType( size_t ) const override { return d_type; }
39 void setUpdateStatus( UpdateState ) override {}
40 void setUpdateStatusPtr( std::shared_ptr<UpdateState> ) override {}
41 std::shared_ptr<UpdateState> getUpdateStatusPtr() const override { return nullptr; }
42 bool containsGlobalElement( size_t ) const override { return false; }
43 void dataChanged() override {}
44 void dumpGhostedData( std::ostream &, size_t ) const override {}
45 void copyGhostValues( const VectorData & ) override {}
46 std::shared_ptr<CommunicationList> getCommunicationList() const override { return nullptr; }
47 void setCommunicationList( std::shared_ptr<CommunicationList> ) override {}
48 const AMP_MPI &getComm() const override;
49 size_t getGhostSize() const override { return 0; }
50 uint64_t getDataID() const override { return 0; }
51 void *getRawDataBlockAsVoid( size_t ) override { return nullptr; }
52 const void *getRawDataBlockAsVoid( size_t ) const override { return nullptr; }
53 size_t sizeofDataBlockType( size_t ) const override { return sizeof( d_type.bytes ); }
54 void swapData( VectorData & ) override { AMP_ERROR( "Not finished" ); }
55 std::shared_ptr<VectorData> cloneData( const std::string & = "" ) const override;
56 void makeConsistent( ScatterType ) override {}
58
59private:
61};
62
63
64} // namespace AMP::LinearAlgebra
65
66
67#endif
Provides C++ wrapper around MPI routines.
Definition AMP_MPI.h:63
A class used to hold vector data.
void setCommunicationList(std::shared_ptr< CommunicationList >) override
Set the CommunicationList for this Vector.
void getValuesByLocalID(size_t N, const size_t *, void *, const typeID &) const override
Get local values in the vector by their global offset.
std::shared_ptr< UpdateState > getUpdateStatusPtr() const override
Return the current update state of this Vector.
void addGhostValuesByGlobalID(size_t, const size_t *, const void *, const typeID &) override
Add shared values using global identifier.
size_t getGhostSize() const override
Number of entries "owned" by other cores stored on this core.
size_t numberOfDataBlocks() const override
Number of blocks of contiguous data in the Vector.
bool containsGlobalElement(size_t) const override
void getGhostAddValuesByGlobalID(size_t, const size_t *, void *, const typeID &) const override
get ghosted values to add to off-proc elements
const void * getRawDataBlockAsVoid(size_t) const override
Return a pointer to a particular block of memory in the vector.
void addValuesByLocalID(size_t N, const size_t *, const void *, const typeID &) override
Add values to vector entities by their local offset.
bool hasGhosts() const override
Check if any entries "owned" by other cores are stored on this core.
void setUpdateStatus(UpdateState) override
Sets the current update state of the Vector.
void dumpGhostedData(std::ostream &, size_t) const override
Write data owned by other processors to an std::ostream.
typeID getType(size_t) const override
Return the typeid of the given block.
uint64_t getDataID() const override
A unique id for the underlying data allocation.
void fillGhosts(const Scalar &) override
Zero all ghost data (does not modify consistent status)
void * getRawDataBlockAsVoid(size_t) override
Return a pointer to a particular block of memory in the vector.
size_t sizeOfDataBlock(size_t=0) const override
Number of elements in a data block.
void swapData(VectorData &) override
Swap the data with another VectorData object.
std::string VectorDataName() const override
Get the type name.
UpdateState getLocalUpdateStatus() const override
Return the current update state of the Vector.
std::shared_ptr< CommunicationList > getCommunicationList() const override
Get the CommunicationList for this Vector.
void setValuesByLocalID(size_t N, const size_t *, const void *, const typeID &) override
Set values in the vector by their local offset.
size_t getAllGhostValues(void *, const typeID &) const override
Get all ghost values in the vector.
size_t sizeofDataBlockType(size_t) const override
Return the result of sizeof(TYPE) for the given data block.
void makeConsistent(ScatterType) override
Update shared values on entire communicator.
void setUpdateStatusPtr(std::shared_ptr< UpdateState >) override
Tie the current update state to another.
void dataChanged() override
Notify listeners that data has changed in this vector.
void putRawData(const void *, const typeID &) override
Copy data into this vector.
std::shared_ptr< VectorData > cloneData(const std::string &="") const override
Clone the data.
void copyGhostValues(const VectorData &) override
Copy ghosted vlues to a vector.
void getGhostValuesByGlobalID(size_t, const size_t *, void *, const typeID &) const override
Get ghost values in the vector by their global offset.
const AMP_MPI & getComm() const override
Get the communicator.
void getRawData(void *, const typeID &) const override
Copy data out of this vector.
void setGhostValuesByGlobalID(size_t, const size_t *, const void *, const typeID &) override
Set ghost values using global identifier.
A class used to hold vector data.
Definition VectorData.h:38
virtual void makeConsistent()
Update shared values on entire communicator.
Scalar is a class used to store a scalar variable that may be different types/precision.
Definition Scalar.h:21
#define AMP_ERROR(MSG)
Throw error.
UpdateState
The four states a Vector can be in.
Definition Variable.h:26
ScatterType
Flag to choose algorithm for makeConsistent.
Definition Variable.h:21
Class to store type info.
Definition typeid.h:210
uint32_t bytes
Size of object (bytes)
Definition typeid.h:211



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:41.
Comments on this page