Advanced Multi-Physics (AMP)
On-Line Documentation
VectorBuilder.h
Go to the documentation of this file.
1#ifndef included_AMP_VectorBuider
2#define included_AMP_VectorBuider
3
4#include "AMP/AMP_TPLs.h"
5#include "AMP/discretization/DOF_Manager.h"
6#include "AMP/utils/Backend.h"
7#include "AMP/utils/Memory.h"
8#include "AMP/utils/Utilities.h"
9#include "AMP/vectors/Vector.h"
10#include "AMP/vectors/data/VectorDataDefault.h"
11#include "AMP/vectors/operations/default/VectorOperationsDefault.h"
12
13#include <string>
14
15
16// Forward declares
17extern "C" {
18typedef struct _p_Vec *Vec;
19}
20#if defined( AMP_USE_TRILINOS )
21namespace Teuchos {
22template<class TYPE>
23class RCP;
24}
25
26 #if defined( AMP_USE_TRILINOS_THYRA )
27namespace Thyra {
28template<class TYPE>
29class VectorBase;
30}
31 #endif
32
33#endif
34
35namespace AMP::LinearAlgebra {
36
37
38// Forward declerations
39class EpetraVectorEngineParameters;
40
41
50template<typename TYPE = double,
51 typename OPS = VectorOperationsDefault<TYPE>,
52 typename DATA = VectorDataDefault<TYPE>>
54createVector( std::shared_ptr<AMP::Discretization::DOFManager> DOFs,
55 std::shared_ptr<AMP::LinearAlgebra::Variable> variable,
56 bool split = true );
57
61template<typename TYPE = double, typename DATA = VectorDataDefault<TYPE>>
63createVector( std::shared_ptr<AMP::Discretization::DOFManager> DOFs,
64 std::shared_ptr<AMP::LinearAlgebra::Variable> variable,
65 bool split,
67
77template<typename TYPE = double>
79createVector( std::shared_ptr<AMP::Discretization::DOFManager> DOFs,
80 std::shared_ptr<AMP::LinearAlgebra::Variable> variable,
81 bool split,
83
94template<typename TYPE = double>
96createVector( std::shared_ptr<AMP::Discretization::DOFManager> DOFs,
97 std::shared_ptr<AMP::LinearAlgebra::Variable> variable,
98 bool split,
100 AMP::Utilities::Backend backend );
101
108template<typename TYPE = double>
110createVector( std::shared_ptr<AMP::LinearAlgebra::Vector> vector,
112
113
121createVector( std::shared_ptr<const AMP::LinearAlgebra::Vector> vector,
123
131template<typename TYPE = double>
133createVector( std::shared_ptr<AMP::LinearAlgebra::Vector> vector,
135 AMP::Utilities::Backend backend );
136
137
146createVector( std::shared_ptr<const AMP::LinearAlgebra::Vector> vector,
148 AMP::Utilities::Backend backend );
149
158std::shared_ptr<Vector> createVector( Vec v,
159 bool deleteable,
160 AMP_MPI comm = AMP_MPI(),
161 std::shared_ptr<Variable> var = nullptr );
162
163
170std::shared_ptr<Vector> createEpetraVector( std::shared_ptr<CommunicationList> commList,
171 std::shared_ptr<AMP::Discretization::DOFManager> DOFs,
172 std::shared_ptr<VectorData> p = nullptr );
173
174
181std::shared_ptr<Vector> createTpetraVector( std::shared_ptr<CommunicationList> commList,
182 std::shared_ptr<AMP::Discretization::DOFManager> DOFs,
183 std::shared_ptr<VectorData> p = nullptr );
184
185#if defined( AMP_USE_TRILINOS ) && defined( AMP_USE_TRILINOS_THYRA )
186
195std::shared_ptr<Vector> createVector( Teuchos::RCP<Thyra::VectorBase<double>> vec,
196 size_t local,
197 AMP_MPI comm,
198 std::shared_ptr<Variable> var = nullptr );
199#endif
200
206template<typename TYPE,
207 typename VecOps = VectorOperationsDefault<TYPE>,
208 typename VecData = VectorDataDefault<TYPE>>
209Vector::shared_ptr createSimpleVector( size_t localSize, const std::string &var );
210
211
217template<typename TYPE,
218 typename VecOps = VectorOperationsDefault<TYPE>,
219 typename VecData = VectorDataDefault<TYPE>>
220Vector::shared_ptr createSimpleVector( size_t localSize, std::shared_ptr<Variable> var );
221
222
229template<typename TYPE,
230 typename VecOps = VectorOperationsDefault<TYPE>,
231 typename VecData = VectorDataDefault<TYPE>>
233createSimpleVector( size_t localSize, std::shared_ptr<Variable> var, AMP_MPI comm );
234
235
243template<typename TYPE,
244 typename VecOps = VectorOperationsDefault<TYPE>,
245 typename VecData = VectorDataDefault<TYPE>>
246Vector::shared_ptr createSimpleVector( std::shared_ptr<Variable> var,
247 std::shared_ptr<AMP::Discretization::DOFManager> DOFs,
248 std::shared_ptr<CommunicationList> commlist );
249
250
256template<typename T, typename FUN = FunctionTable<T>, typename Allocator = AMP::HostAllocator<void>>
257Vector::shared_ptr createArrayVector( const ArraySize &localSize, const std::string &var );
258
265template<typename T, typename FUN = FunctionTable<T>, typename Allocator = AMP::HostAllocator<void>>
266Vector::shared_ptr createArrayVector( const ArraySize &localSize, std::shared_ptr<Variable> var );
267
268
276template<typename T, typename FUN = FunctionTable<T>, typename Allocator = AMP::HostAllocator<void>>
278 const ArraySize &blockIndex,
279 const AMP_MPI &comm,
280 std::shared_ptr<Variable> var );
281
285template<typename T>
287 std::shared_ptr<AMP::Discretization::DOFManager> DOFs,
288 T *data );
289
290} // namespace AMP::LinearAlgebra
291
292#endif
struct _p_Vec * Vec
Provides C++ wrapper around MPI routines.
Definition AMP_MPI.h:63
Simple class to store the array dimensions.
Definition ArraySize.h:138
A class used to hold vector data.
std::shared_ptr< Vector > shared_ptr
Shorthand for shared pointer to Vector.
Definition Vector.h:60
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.
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.
Vector::shared_ptr createArrayVector(const ArraySize &localSize, const std::string &var)
Create a ArrayVector.
Vector::shared_ptr createVectorAdaptor(const std::string &name, std::shared_ptr< AMP::Discretization::DOFManager > DOFs, T *data)
Create a view to raw vector data.
AMP::LinearAlgebra::Vector::shared_ptr createVector(std::shared_ptr< AMP::Discretization::DOFManager > DOFs, std::shared_ptr< AMP::LinearAlgebra::Variable > variable, bool split=true)
This function will create a vector from an arbitrary DOFManager.
Vector::shared_ptr createSimpleVector(size_t localSize, const std::string &var)
Create a simple AMP vector.
Backend
Enum to store the backend used for gpu acceleration.
Definition Backend.h:21
MemoryType
Enum to store pointer type.
Definition Memory.h:21
PETSc 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