Advanced Multi-Physics (AMP)
On-Line Documentation
NativeThyraVectorData.h
Go to the documentation of this file.
1#ifndef included_AMP_NativeThyraVectorData
2#define included_AMP_NativeThyraVectorData
3
4#include "AMP/vectors/data/GhostDataHelper.hpp"
5#include "AMP/vectors/data/VectorData.h"
6#include "AMP/vectors/trilinos/thyra/ThyraVector.h"
7
8namespace AMP::LinearAlgebra {
9
10
23{
24public:
30 explicit NativeThyraVectorData( Teuchos::RCP<Thyra::VectorBase<double>> vec,
31 size_t localsize,
32 AMP_MPI comm );
33
36
37 std::string VectorDataName() const override { return "NativeThyraVector"; }
38 size_t numberOfDataBlocks() const override;
39 size_t sizeOfDataBlock( size_t i ) const override;
40
41 void addValuesByLocalID( size_t, const size_t *, const void *, const typeID & ) override;
42 void setValuesByLocalID( size_t, const size_t *, const void *, const typeID & ) override;
43 void getValuesByLocalID( size_t, const size_t *, void *, const typeID & ) const override;
44 void putRawData( const void *, const typeID & ) override;
45 void getRawData( void *, const typeID & ) const override;
46 uint64_t getDataID() const override
47 {
48 return reinterpret_cast<uint64_t>( getRawDataBlockAsVoid( 0 ) );
49 }
50 void *getRawDataBlockAsVoid( size_t i ) override;
51 const void *getRawDataBlockAsVoid( size_t i ) const override;
52 size_t sizeofDataBlockType( size_t ) const override { return sizeof( double ); }
53 typeID getType( size_t ) const override { return getTypeID<double>(); }
54 void swapData( VectorData & ) override;
55 std::shared_ptr<VectorData> cloneData( const std::string &name = "" ) const override;
56
59
60protected:
63
64
65private:
67
69 getThyraVec( std::shared_ptr<const VectorData> vec );
70
73};
74
75
76} // namespace AMP::LinearAlgebra
77
78#endif
Provides C++ wrapper around MPI routines.
Definition AMP_MPI.h:63
size_t sizeOfDataBlock(size_t i) const override
Number of elements in a data block.
size_t sizeofDataBlockType(size_t) const override
Return the result of sizeof(TYPE) for the given data block.
void setValuesByLocalID(size_t, const size_t *, const void *, const typeID &) override
Set values in the vector by their local offset.
static Teuchos::RCP< const Thyra::VectorBase< double > > getThyraVec(std::shared_ptr< const VectorData > vec)
void putRawData(const void *, const typeID &) override
Copy data into this vector.
void swapData(VectorData &) override
Swap the data with another VectorData object.
static Teuchos::RCP< Thyra::VectorBase< double > > getThyraVec(VectorData &v)
size_t numberOfDataBlocks() const override
Number of blocks of contiguous data in the Vector.
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.
const void * getRawDataBlockAsVoid(size_t i) const override
Return a pointer to a particular block of memory in the vector.
void getRawData(void *, const typeID &) const override
Copy data out of this vector.
std::string VectorDataName() const override
Get the type name.
void * getRawDataBlockAsVoid(size_t i) override
Return a pointer to a particular block of memory in the vector.
Teuchos::RCP< Thyra::VectorBase< double > > getVec()
NativeThyraVectorData(Teuchos::RCP< Thyra::VectorBase< double > > vec, size_t localsize, AMP_MPI comm)
Construct a wrapper for a Thyra Vec from a set of parameters.
uint64_t getDataID() const override
A unique id for the underlying data allocation.
Teuchos::RCP< const Thyra::VectorBase< double > > getVec() const
static Teuchos::RCP< const Thyra::VectorBase< double > > getThyraVec(const VectorData &v)
void getValuesByLocalID(size_t, const size_t *, void *, const typeID &) const override
Get local values in the vector by their global offset.
Teuchos::RCP< Thyra::VectorBase< double > > d_thyraVec
std::shared_ptr< VectorData > cloneData(const std::string &name="") const override
Clone the data.
A class used to hold vector data.
Definition VectorData.h:38
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