1#ifndef included_AMP_MultiVectorData
2#define included_AMP_MultiVectorData
4#include "AMP/discretization/DOF_Manager.h"
5#include "AMP/discretization/MultiDOFHelper.h"
6#include "AMP/vectors/data/DataChangeListener.h"
7#include "AMP/vectors/data/VectorData.h"
63 std::shared_ptr<const VectorData>
getComponent(
size_t i = 0 )
const override;
116 std::shared_ptr<VectorData>
cloneData(
const std::string &name =
"" )
const override;
121 dumpOwnedData( std::ostream &out,
size_t GIDoffset = 0,
size_t LIDoffset = 0 )
const override;
143 const std::vector<VectorData *> &data );
183 const size_t *indices,
186 std::vector<std::vector<size_t>> &out_indices,
187 std::vector<std::vector<std::byte>> &out_vals,
188 std::vector<std::vector<int>> *remap =
nullptr )
const;
203 const size_t *indices,
206 std::vector<std::vector<size_t>> &out_indices,
207 std::vector<std::vector<std::byte>> &out_vals,
208 std::vector<std::vector<int>> *remap =
nullptr )
const;
Provides C++ wrapper around MPI routines.
A class to manage mapping multiple DOFs to global indicies.
Class to manage reading/writing restart data.
virtual void fireDataChange()
Notify all listeners of a data change event.
Interface for managing classes that need to know when managed data has changed.
A class used to hold vector data.
std::shared_ptr< UpdateState > getUpdateStatusPtr() const override
Return the current update state of this Vector.
std::shared_ptr< UpdateState > d_UpdateState
std::shared_ptr< CommunicationList > getCommunicationList() const override
Get the CommunicationList for this Vector.
void assemble() override
This method is used to implement the assemble interface of PETSc.
std::vector< size_t > getLocalSizes() const override
The local sizes on each rank.
void setUpdateStatus(UpdateState state) override
Sets the current update state of the Vector.
size_t sizeofDataBlockType(size_t i) const override
Return the result of sizeof(TYPE) for the given data block.
void dataChanged() override
Notify listeners that data has changed in this vector.
void setValuesByLocalID(size_t, const size_t *, const void *, const typeID &) override
Set values in the vector by their local offset.
virtual ~MultiVectorData()
Virtual destructor.
void putRawData(const void *buf, const typeID &id) override
Copy data into this vector.
AMP::Utilities::MemoryType getMemoryLocation() const override
returns the memory location for data
void copyGhostValues(const VectorData &rhs) override
Copy ghosted vlues to a vector.
void getValuesByLocalID(size_t, const size_t *, void *, const typeID &) const override
Get local values in the vector by their global offset.
bool hasGhosts() const override
Check if any entries "owned" by other cores are stored on this core.
const void * getRawDataBlockAsVoid(size_t i) const override
Return a pointer to a particular block of memory in the vector.
void registerChildObjects(AMP::IO::RestartManager *manager) const override
Register any child objects.
size_t getNumberOfComponents() const override
Return integer number of data components.
void makeConsistent(ScatterType t) override
Update shared values on entire communicator.
size_t numberOfDataBlocks() const override
Number of blocks of contiguous data in the Vector.
void setGhostValuesByGlobalID(size_t, const size_t *, const void *, const typeID &) override
Set ghost values using global identifier.
void partitionLocalValues(const int num, const size_t *indices, const void *vals, const size_t bytes, std::vector< std::vector< size_t > > &out_indices, std::vector< std::vector< std::byte > > &out_vals, std::vector< std::vector< int > > *remap=nullptr) const
void setUpdateStatusPtr(std::shared_ptr< UpdateState > rhs) override
Tie the current update state to another.
MultiVectorData(const AMP::AMP_MPI &comm)
void addValuesByLocalID(size_t, const size_t *, const void *, const typeID &) override
Add values to vector entities by their local offset.
void receiveDataChanged() override
The method called when a data change event occurs.
const VectorData * getVectorData(size_t i) const
void partitionGlobalValues(const int num, const size_t *indices, const void *vals, const size_t bytes, std::vector< std::vector< size_t > > &out_indices, std::vector< std::vector< std::byte > > &out_vals, std::vector< std::vector< int > > *remap=nullptr) const
void dumpOwnedData(std::ostream &out, size_t GIDoffset=0, size_t LIDoffset=0) const override
Write owned data to an std::ostream.
AMP::Discretization::multiDOFHelper d_dofMap
size_t getAllGhostValues(void *, const typeID &) const override
Get all ghost values in the vector.
void resetMultiVectorData(const AMP::Discretization::DOFManager *manager, const std::vector< VectorData * > &data)
void dumpGhostedData(std::ostream &out, size_t offset=0) const override
Write data owned by other processors to an std::ostream.
void setCommunicationList(std::shared_ptr< CommunicationList > comm) override
Set the CommunicationList for this Vector.
std::vector< VectorData * > d_data
size_t getGhostSize() const override
Number of entries "owned" by other cores stored on this core.
void addGhostValuesByGlobalID(size_t, const size_t *, const void *, const typeID &) override
Add shared values using global identifier.
size_t getAllGhostValues(TYPE *) const
MultiVectorData(int64_t fid, AMP::IO::RestartManager *manager)
Write restart data to file.
bool containsGlobalElement(size_t) const override
UpdateState getLocalUpdateStatus() const override
Return the current update state of the Vector.
void getRawData(void *buf, const typeID &id) const override
Copy data out of this vector.
uint64_t getDataID() const override
A unique id for the underlying data allocation.
MultiVectorData(VectorData *data, const AMP::Discretization::DOFManager *manager=nullptr)
size_t sizeOfDataBlock(size_t i=0) const override
Number of elements in a data block.
void getGhostValuesByGlobalID(size_t, const size_t *, void *, const typeID &) const override
Get ghost values in the vector by their global offset.
bool hasContiguousData() const override
returns whether all data for the vector on a single process is contiguous
void getGhostAddValuesByGlobalID(size_t, const size_t *, void *, const typeID &) const override
get ghosted values to add to off-proc elements
void fillGhosts(const Scalar &) override
Zero all ghost data (does not modify consistent status)
void setNoGhosts() override
Ensure this vector has no ghosts.
typeID getType(size_t block) const override
Return the typeid of the given block.
std::shared_ptr< VectorData > cloneData(const std::string &name="") const override
Clone the data.
void swapData(VectorData &rhs) override
Swap the data with another VectorData object.
const AMP_MPI & getComm() const override
Get the communicator.
void * getRawDataBlockAsVoid(size_t i) override
Return a pointer to a particular block of memory in the vector.
size_t getVectorDataSize() const
std::string VectorDataName() const override
Get the type name.
std::shared_ptr< const VectorData > getComponent(size_t i=0) const override
Number of elements in the ith component.
void makeConsistent() override
Update shared values on entire communicator.
std::shared_ptr< VectorData > getComponent(size_t i=0) override
Number of elements in the ith component.
VectorData * getVectorData(size_t i)
void writeRestart(int64_t fid) const override
Write restart data to file.
A class used to hold vector data.
Scalar is a class used to store a scalar variable that may be different types/precision.
UpdateState
The four states a Vector can be in.
ScatterType
Flag to choose algorithm for makeConsistent.
MemoryType
Enum to store pointer type.
Class to store type info.