Advanced Multi-Physics (AMP)
On-Line Documentation
IdentityOperator.h
Go to the documentation of this file.
1#ifndef included_AMP_IdentityOperator
2#define included_AMP_IdentityOperator
3
4#include "AMP/operators/LinearOperator.h"
5#include "AMP/operators/OperatorParameters.h"
6#include "AMP/vectors/Vector.h"
7
8namespace AMP::Operator {
9
10
15{
16public:
19
24 explicit IdentityOperator( std::shared_ptr<const OperatorParameters> params );
25
27 virtual ~IdentityOperator() {}
28
30 std::string type() const override { return "IdentityOperator"; }
31
41
47 void reset( std::shared_ptr<const OperatorParameters> params ) override;
48
49 std::shared_ptr<OperatorParameters>
50 getParameters( const std::string &type,
51 std::shared_ptr<const AMP::LinearAlgebra::Vector> u,
52 std::shared_ptr<OperatorParameters> params = nullptr ) override;
57 void setMatrix( std::shared_ptr<AMP::LinearAlgebra::Matrix> in_mat ) override;
58
60 virtual void setInputVariable( std::shared_ptr<AMP::LinearAlgebra::Variable> var )
61 {
63 }
64
66 virtual void setOutputVariable( std::shared_ptr<AMP::LinearAlgebra::Variable> var )
67 {
69 }
70
74 std::shared_ptr<AMP::LinearAlgebra::Vector> createInputVector() const override;
75
80 std::shared_ptr<AMP::LinearAlgebra::Vector> createOutputVector() const override;
81
82private:
83 size_t d_localSize = 0;
84};
85} // namespace AMP::Operator
86
87#endif
std::shared_ptr< Vector > shared_ptr
Shorthand for shared pointer to Vector.
Definition Vector.h:60
std::shared_ptr< const Vector > const_shared_ptr
Definition Vector.h:65
void setMatrix(std::shared_ptr< AMP::LinearAlgebra::Matrix > in_mat) override
std::shared_ptr< AMP::LinearAlgebra::Vector > createOutputVector() const override
Get a left vector ( For , is a left vector )
virtual ~IdentityOperator()
Destructor.
IdentityOperator()
Constructor. This resets the matrix shared pointer.
std::shared_ptr< OperatorParameters > getParameters(const std::string &type, std::shared_ptr< const AMP::LinearAlgebra::Vector > u, std::shared_ptr< OperatorParameters > params=nullptr) override
std::string type() const override
Return the name of the operator.
virtual void setOutputVariable(std::shared_ptr< AMP::LinearAlgebra::Variable > var)
Set the output variable.
IdentityOperator(std::shared_ptr< const OperatorParameters > params)
void reset(std::shared_ptr< const OperatorParameters > params) override
virtual void setInputVariable(std::shared_ptr< AMP::LinearAlgebra::Variable > var)
Set the input variable.
void apply(AMP::LinearAlgebra::Vector::const_shared_ptr u, AMP::LinearAlgebra::Vector::shared_ptr f) override
std::shared_ptr< AMP::LinearAlgebra::Vector > createInputVector() const override
Get a right vector ( For , is a right vector )
std::shared_ptr< AMP::LinearAlgebra::Variable > d_outputVariable
std::shared_ptr< AMP::LinearAlgebra::Variable > d_inputVariable
std::shared_ptr< AMP::Operator::Operator > shared_ptr
Definition Operator.h:29



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