1#ifndef included_AMP_TpetraVectorFactor
2#define included_AMP_TpetraVectorFactor
5#include "AMP/utils/UnitTest.h"
6#include "AMP/vectors/Vector.h"
7#include "AMP/vectors/testHelpers/VectorTests.h"
9#include "Tpetra_Vector_decl.hpp"
16template<
typename ST = double,
17 typename LO = int32_t,
18 typename GO =
long long,
19 typename NT = Tpetra::Vector<>::node_type>
20class NativeTpetraFactory :
public VectorFactory
23 NativeTpetraFactory() {}
26 const int nLocal = 210;
28 const int start = nLocal * globalComm.getRank();
29 const int nGlobal = nLocal * globalComm.getSize();
30 auto commList = std::make_shared<CommunicationList>( nLocal, globalComm );
31 auto dofManager = std::make_shared<AMP::Discretization::DOFManager>( nLocal, globalComm );
33 std::make_shared<AMP::LinearAlgebra::VectorDataDefault<ST>>( start, nLocal, nGlobal );
37 std::string name()
const override {
return "NativeTpetraFactory"; }
Provides C++ wrapper around MPI routines.
std::shared_ptr< Vector > shared_ptr
Shorthand for shared pointer to Vector.
std::shared_ptr< Vector > createTpetraVector(std::shared_ptr< CommunicationList > commList, std::shared_ptr< AMP::Discretization::DOFManager > DOFs, std::shared_ptr< VectorData > p=nullptr)
Create a Tpetra vector.