Advanced Multi-Physics (AMP)
On-Line Documentation
EpetraVectorFactory.h
Go to the documentation of this file.
1#ifndef included_AMP_EpetraVectorFactor
2#define included_AMP_EpetraVectorFactor
3
4
5#include "AMP/utils/UnitTest.h"
6#include "AMP/vectors/Vector.h"
7#include "AMP/vectors/testHelpers/VectorTests.h"
8
9
11
12
13namespace AMP::LinearAlgebra {
14
15
16class NativeEpetraFactory : public VectorFactory
17{
18public:
19 NativeEpetraFactory() {}
20 AMP::LinearAlgebra::Vector::shared_ptr getVector() const override
21 {
22 const int nLocal = 210;
23 AMP::AMP_MPI globalComm( AMP_COMM_WORLD );
24 const int start = nLocal * globalComm.getRank();
25 const int nGlobal = nLocal * globalComm.getSize();
26 auto commList = std::make_shared<CommunicationList>( nLocal, globalComm );
27 auto dofManager = std::make_shared<AMP::Discretization::DOFManager>( nLocal, globalComm );
28 auto buffer = std::make_shared<AMP::LinearAlgebra::VectorDataDefault<double>>(
29 start, nLocal, nGlobal );
30 auto vec = createEpetraVector( commList, dofManager, buffer );
31 return vec;
32 }
33 std::string name() const override { return "NativeEpetraFactory"; }
34};
35
36
37} // namespace AMP::LinearAlgebra
38
40
41#endif
#define AMP_COMM_WORLD
Definition AMP_MPI.h:32
Provides C++ wrapper around MPI routines.
Definition AMP_MPI.h:63
std::shared_ptr< Vector > shared_ptr
Shorthand for shared pointer to Vector.
Definition Vector.h:60
std::shared_ptr< Vector > createEpetraVector(std::shared_ptr< CommunicationList > commList, std::shared_ptr< AMP::Discretization::DOFManager > DOFs, std::shared_ptr< VectorData > p=nullptr)
Create an epetra vector.



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