1#ifndef included_AMP_NativePetscVectorData
2#define included_AMP_NativePetscVectorData
4#include "AMP/utils/AMP_MPI.h"
5#include "AMP/vectors/data/GhostDataHelper.hpp"
6#include "AMP/vectors/data/VectorData.h"
61 typeID getType(
size_t )
const override {
return getTypeID<PetscScalar>(); }
66 std::shared_ptr<VectorData>
cloneData(
const std::string &name =
"" )
const override;
Provides C++ wrapper around MPI routines.
virtual ~NativePetscVectorData()
Destructor.
std::shared_ptr< VectorData > cloneData(const std::string &name="") const override
Clone the data.
void * getRawDataBlockAsVoid(size_t i) override
Return a pointer to a particular block of memory in the vector.
size_t sizeofDataBlockType(size_t) const override
Return the result of sizeof(TYPE) for the given data block.
std::string VectorDataName() const override
Get the type name.
void makeConsistent() override
Update shared values on entire communicator.
void assemble() override
This method is used to implement the assemble interface of PETSc.
void makeConsistent(ScatterType t) override
Update shared values on entire communicator.
void getValuesByLocalID(size_t, const size_t *, void *, const typeID &) const override
Get local values in the vector by their global offset.
const void * getRawDataBlockAsVoid(size_t i) const override
Return a pointer to a particular block of memory in the vector.
const Vec & getVec() const
Get the PETSc vector.
NativePetscVectorData(Vec v, bool deleteable, AMP_MPI comm=AMP_MPI())
Construct a wrapper for a PETSc Vec from a set of parameters.
typeID getType(size_t) const override
Return the typeid of the given block.
size_t sizeOfDataBlock(size_t i) const override
Number of elements in a data block.
uint64_t getDataID() const override
A unique id for the underlying data allocation.
void addValuesByLocalID(size_t, const size_t *, const void *, const typeID &) override
Add values to vector entities by their local offset.
void getRawData(void *, const typeID &) const override
Copy data out of this vector.
void setValuesByLocalID(size_t, const size_t *, const void *, const typeID &) override
Set values in the vector by their local offset.
void putRawData(const void *, const typeID &) override
Copy data into this vector.
const PetscScalar * d_pArrayRead
size_t numberOfDataBlocks() const override
Number of blocks of contiguous data in the Vector.
Vec & getVec()
Get the PETSc vector.
void swapData(VectorData &rhs) override
Swap the data with another VectorData object.
A class used to hold vector data.
ScatterType
Flag to choose algorithm for makeConsistent.
Class to store type info.