1#ifndef included_AMP_test_VectorFactory
2#define included_AMP_test_VectorFactory
4#include "AMP/mesh/testHelpers/meshTests.h"
5#include "AMP/utils/AMP_MPI.h"
6#include "AMP/vectors/MultiVariable.h"
7#include "AMP/vectors/MultiVector.h"
8#include "AMP/vectors/Variable.h"
9#include "AMP/vectors/VectorBuilder.hpp"
10#include "AMP/vectors/testHelpers/VectorTests.h"
21 std::string
name()
const override;
30 std::string
name()
const override;
38 explicit CloneFactory( std::shared_ptr<const VectorFactory> factory );
40 std::string
name()
const override;
49template<
class TYPE = double,
61 auto var = std::make_shared<AMP::LinearAlgebra::Variable>(
"simple" );
63 return AMP::LinearAlgebra::createSimpleVector<TYPE, VecOps, VecData>(
66 return AMP::LinearAlgebra::createSimpleVector<TYPE, VecOps, VecData>(
I, var );
68 std::string
name()
const override {
return NAME; }
79template<
class TYPE =
double>
86 auto var = std::make_shared<AMP::LinearAlgebra::Variable>(
"array" );
90 return AMP::LinearAlgebra::createArrayVector<TYPE>( {
D,
I },
index, comm, var );
92 return AMP::LinearAlgebra::createArrayVector<TYPE>( {
D,
I }, var );
95 std::string
name()
const override {
return "ArrayVectorFactory"; }
109 std::string
name()
const override {
return "CubeMeshVectorFactory"; }
118template<
typename TYPE>
125 auto vec = TYPE::view(
d_factory->getVector() );
126 AMP_INSIST( vec !=
nullptr,
"Failed to cast view to type" );
127 [[maybe_unused]]
auto native = vec->getNativeVec();
128 return vec->getManagedVec();
130 std::string
name()
const override {
return "ViewFactory<" +
d_factory->name() +
">"; }
144 std::shared_ptr<const VectorFactory> factory2,
147 std::string
name()
const override;
Provides C++ wrapper around MPI routines.
Simple class to store the array dimensions.
ArrayVectorFactory(size_t d, size_t i, bool global)
std::string name() const override
AMP::LinearAlgebra::Vector::shared_ptr getVector() const override
ArrayVectorFactory()=delete
CloneFactory(std::shared_ptr< const VectorFactory > factory)
AMP::LinearAlgebra::Vector::shared_ptr getVector() const override
std::shared_ptr< const VectorFactory > d_factory
std::string name() const override
static std::shared_ptr< AMP::Mesh::Mesh > generateMesh(int N)
CubeMeshVectorFactory()=delete
CubeMeshVectorFactory(int N)
std::string name() const override
AMP::LinearAlgebra::Vector::shared_ptr getVector() const override
MultiVectorFactory()=delete
MultiVectorFactory(std::shared_ptr< const VectorFactory > factory1, int N1, std::shared_ptr< const VectorFactory > factory2, int N2)
std::string name() const override
std::shared_ptr< const VectorFactory > FACTORY2
std::shared_ptr< const VectorFactory > FACTORY1
AMP::LinearAlgebra::Vector::shared_ptr getVector() const override
std::string name() const override
AMP::LinearAlgebra::Vector::shared_ptr getVector() const override
std::string name() const override
std::string name() const override
AMP::LinearAlgebra::Vector::shared_ptr getVector() const override
SimpleVectorFactory(int i, bool global, std::string name="SimpleVectorFactory")
SimpleVectorFactory()=delete
A class used to hold vector data.
A default set of vector operations.
std::shared_ptr< Vector > shared_ptr
Shorthand for shared pointer to Vector.
AMP::LinearAlgebra::Vector::shared_ptr getVector() const override
std::shared_ptr< const VectorFactory > d_factory
ViewFactory(std::shared_ptr< const VectorFactory > factory)
std::string name() const override
Factory to create a vector from a mesh.
#define AMP_INSIST(EXP, MSG)
Insist error.