1#ifndef included_AMP_Operator
2#define included_AMP_Operator
6#include "AMP/operators/OperatorParameters.h"
8#include "AMP/utils/Utilities.h"
10#include "AMP/vectors/Variable.h"
11#include "AMP/vectors/Vector.h"
29 typedef std::shared_ptr<AMP::Operator::Operator>
shared_ptr;
35 explicit Operator( std::shared_ptr<const OperatorParameters> params );
41 virtual std::string
type()
const = 0;
48 virtual void reset( std::shared_ptr<const OperatorParameters> params );
57 virtual void apply( std::shared_ptr<const AMP::LinearAlgebra::Vector>
u,
58 std::shared_ptr<AMP::LinearAlgebra::Vector> f ) = 0;
66 virtual void residual( std::shared_ptr<const AMP::LinearAlgebra::Vector> f,
67 std::shared_ptr<const AMP::LinearAlgebra::Vector>
u,
68 std::shared_ptr<AMP::LinearAlgebra::Vector> r );
84 virtual std::shared_ptr<OperatorParameters>
86 std::shared_ptr<const AMP::LinearAlgebra::Vector>
u,
87 std::shared_ptr<OperatorParameters> params =
nullptr );
129 std::shared_ptr<AMP::LinearAlgebra::Vector>
133 std::shared_ptr<const AMP::LinearAlgebra::Vector>
137 std::shared_ptr<AMP::LinearAlgebra::Vector>
141 std::shared_ptr<const AMP::LinearAlgebra::Vector>
146 virtual bool isValidVector( std::shared_ptr<const AMP::LinearAlgebra::Vector> ) {
return true; }
179 virtual std::shared_ptr<OperatorParameters>
AMP::Utilities::MemoryType getMemoryLocation() const
virtual void apply(std::shared_ptr< const AMP::LinearAlgebra::Vector > u, std::shared_ptr< AMP::LinearAlgebra::Vector > f)=0
virtual ~Operator()
Destructor.
std::shared_ptr< const AMP::LinearAlgebra::Vector > subsetOutputVector(std::shared_ptr< const AMP::LinearAlgebra::Vector > vec) const
Subset output vector.
void getBackendFromInput(std::shared_ptr< AMP::Database > db)
AMP::Utilities::Backend d_backend
virtual std::shared_ptr< AMP::LinearAlgebra::Vector > createOutputVector() const
Get a left vector ( For , is an output vector )
virtual std::shared_ptr< AMP::LinearAlgebra::Vector > createInputVector() const
Get a input vector ( For , is a input vector )
void setMemoryAndBackendParameters(std::shared_ptr< AMP::Database > db)
std::shared_ptr< AMP::LinearAlgebra::Vector > subsetInputVector(std::shared_ptr< AMP::LinearAlgebra::Vector > vec) const
Subset input vector.
int d_iDebugPrintInfoLevel
virtual void makeConsistent(std::shared_ptr< AMP::LinearAlgebra::Vector > vec)
Operator(std::shared_ptr< const OperatorParameters > params)
Constructor.
virtual std::shared_ptr< AMP::LinearAlgebra::VectorSelector > selectOutputVector() const
Return the selector for output vectors.
static int d_iInstance_id
std::shared_ptr< const AMP::Mesh::Mesh > getMesh() const
Return the mesh.
std::shared_ptr< AMP::Mesh::Mesh > d_Mesh
virtual std::shared_ptr< OperatorParameters > getParameters(const std::string &type, std::shared_ptr< const AMP::LinearAlgebra::Vector > u, std::shared_ptr< OperatorParameters > params=nullptr)
virtual void setDebugPrintInfoLevel(int level)
virtual std::shared_ptr< AMP::LinearAlgebra::Variable > getOutputVariable() const
Return the output variable.
virtual void reset(std::shared_ptr< const OperatorParameters > params)
Operator(void)
Default constructor.
virtual bool isValidVector(std::shared_ptr< const AMP::LinearAlgebra::Vector >)
given a vector return whether it is valid or not
virtual std::string type() const =0
Return the name of the operator.
virtual void residual(std::shared_ptr< const AMP::LinearAlgebra::Vector > f, std::shared_ptr< const AMP::LinearAlgebra::Vector > u, std::shared_ptr< AMP::LinearAlgebra::Vector > r)
std::shared_ptr< AMP::Operator::Operator > shared_ptr
virtual std::shared_ptr< OperatorParameters > getJacobianParameters(std::shared_ptr< const AMP::LinearAlgebra::Vector >)
std::shared_ptr< AMP::LinearAlgebra::Vector > subsetOutputVector(std::shared_ptr< AMP::LinearAlgebra::Vector > vec) const
Subset output vector.
std::shared_ptr< const AMP::LinearAlgebra::Vector > subsetInputVector(std::shared_ptr< const AMP::LinearAlgebra::Vector > vec) const
Subset input vector.
std::shared_ptr< AMP::Mesh::Mesh > getMesh()
Return the mesh.
virtual std::shared_ptr< AMP::LinearAlgebra::VectorSelector > selectInputVector() const
Return the selector for input vectors.
virtual std::shared_ptr< AMP::LinearAlgebra::Variable > getInputVariable() const
Return the input variable.
virtual void reInitializeVector(std::shared_ptr< AMP::LinearAlgebra::Vector >)
AMP::Utilities::MemoryType d_memory_location
Backend
Enum to store the backend used for gpu acceleration.
MemoryType
Enum to store pointer type.