Advanced Multi-Physics (AMP)
On-Line Documentation
TpetraVectorData.h
Go to the documentation of this file.
1#ifndef included_TpetraVectorData_H_
2#define included_TpetraVectorData_H_
3
4#include "AMP/discretization/DOF_Manager.h"
5#include "AMP/vectors/data/GhostDataHelper.hpp"
6#include "AMP/vectors/data/VectorData.h"
7
8#include <Teuchos_Comm.hpp>
9#include <Teuchos_OrdinalTraits.hpp>
10#include <Tpetra_Core.hpp>
11#include <Tpetra_Vector.hpp>
12#include <Tpetra_Version.hpp>
13
14
15namespace AMP::LinearAlgebra {
16
17
18template<typename ST = double,
19 typename LO = int32_t,
20 typename GO = int64_t,
21 typename NT = Tpetra::Vector<>::node_type>
23{
24public:
25 TpetraVectorData( std::shared_ptr<CommunicationList> commList,
26 std::shared_ptr<AMP::Discretization::DOFManager> dofManager );
27 std::string VectorDataName() const override { return "TpetraVectorData"; }
28 size_t numberOfDataBlocks() const override { return 1; }
29 size_t sizeOfDataBlock( size_t i ) const override { return i == 0 ? this->d_localSize : 0; }
30 void setValuesByLocalID( size_t, const size_t *, const void *, const typeID & ) override;
31 void addValuesByLocalID( size_t, const size_t *, const void *, const typeID & ) override;
32 void getValuesByLocalID( size_t, const size_t *, void *, const typeID & ) const override;
33 void putRawData( const void *in, const typeID &id ) override;
34 void getRawData( void *out, const typeID &id ) const override;
35 uint64_t getDataID() const override
36 {
37 return reinterpret_cast<uint64_t>( this->getRawDataBlockAsVoid( 0 ) );
38 }
39 void *getRawDataBlockAsVoid( size_t i ) override;
40 const void *getRawDataBlockAsVoid( size_t i ) const override;
41 size_t sizeofDataBlockType( size_t ) const override { return sizeof( ST ); }
42 typeID getType( size_t ) const override { return getTypeID<ST>(); }
43 void swapData( VectorData & ) override;
44 std::shared_ptr<VectorData> cloneData( const std::string &name = "" ) const override;
45
51
52protected:
53 std::shared_ptr<AMP::Discretization::DOFManager> d_pDOFManager;
55};
56
57} // namespace AMP::LinearAlgebra
58#endif
size_t numberOfDataBlocks() const override
Number of blocks of contiguous data in the Vector.
const void * getRawDataBlockAsVoid(size_t i) const override
Return a pointer to a particular block of memory in the vector.
void * getRawDataBlockAsVoid(size_t i) override
Return a pointer to a particular block of memory in the vector.
std::shared_ptr< VectorData > cloneData(const std::string &name="") const override
Clone the data.
void swapData(VectorData &) override
Swap the data with another VectorData object.
std::shared_ptr< AMP::Discretization::DOFManager > d_pDOFManager
void addValuesByLocalID(size_t, const size_t *, const void *, const typeID &) override
Add values to vector entities by their local offset.
typeID getType(size_t) const override
Return the typeid of the given block.
Teuchos::RCP< Tpetra::Vector< ST, LO, GO, NT > > getTpetraVector()
void putRawData(const void *in, const typeID &id) override
Copy data into this vector.
Teuchos::RCP< Tpetra::Vector< ST, LO, GO, NT > > d_pTpetraVector
void getValuesByLocalID(size_t, const size_t *, void *, const typeID &) const override
Get local values in the vector by their global offset.
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.
TpetraVectorData(std::shared_ptr< CommunicationList > commList, std::shared_ptr< AMP::Discretization::DOFManager > dofManager)
void getRawData(void *out, const typeID &id) const override
Copy data out of this 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.
Teuchos::RCP< const Tpetra::Vector< ST, LO, GO, NT > > getTpetraVector() const
void setValuesByLocalID(size_t, const size_t *, const void *, const typeID &) override
Set values in the vector by their local offset.
A class used to hold vector data.
Definition VectorData.h:38
MueLu::GlobalOrdinal GO
MueLu::LocalOrdinal LO
Class to store type info.
Definition typeid.h:210



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