Advanced Multi-Physics (AMP)
On-Line Documentation
LinearOperator.h
Go to the documentation of this file.
1
2#ifndef included_AMP_LinearOperator
3#define included_AMP_LinearOperator
4
5#include "AMP/matrices/Matrix.h"
6#include "AMP/operators/Operator.h"
7#include "AMP/operators/OperatorParameters.h"
8#include "AMP/vectors/Vector.h"
9#include <memory>
10
11namespace AMP::Operator {
12
13
21{
22public:
27 explicit LinearOperator( std::shared_ptr<const OperatorParameters> params );
28
30 virtual ~LinearOperator() {}
31
33 std::string type() const override { return "LinearOperator"; }
34
44
48 virtual std::shared_ptr<AMP::LinearAlgebra::Matrix> getMatrix();
49
54 virtual void setMatrix( std::shared_ptr<AMP::LinearAlgebra::Matrix> in_mat );
55
56 virtual void setVariables( std::shared_ptr<AMP::LinearAlgebra::Variable> in,
57 std::shared_ptr<AMP::LinearAlgebra::Variable> out )
58 {
59 d_inputVariable = in;
60 d_outputVariable = out;
61 }
62
63 std::shared_ptr<AMP::LinearAlgebra::Variable> getInputVariable() const override
64 {
65 return d_inputVariable;
66 }
67 std::shared_ptr<AMP::LinearAlgebra::Variable> getOutputVariable() const override
68 {
69 return d_outputVariable;
70 }
71
75 std::shared_ptr<AMP::LinearAlgebra::Vector> createInputVector() const override;
76
81 std::shared_ptr<AMP::LinearAlgebra::Vector> createOutputVector() const override;
82
83protected:
86
87 // input and output variables
88 std::shared_ptr<AMP::LinearAlgebra::Variable> d_inputVariable;
89
90 std::shared_ptr<AMP::LinearAlgebra::Variable> d_outputVariable;
91
92 std::shared_ptr<AMP::LinearAlgebra::Matrix> d_matrix; // The matrix shared pointer
93
94private:
95};
96} // namespace AMP::Operator
97
98#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
std::shared_ptr< AMP::LinearAlgebra::Variable > getOutputVariable() const override
Return the output variable.
virtual void setMatrix(std::shared_ptr< AMP::LinearAlgebra::Matrix > in_mat)
std::shared_ptr< AMP::LinearAlgebra::Variable > d_outputVariable
std::string type() const override
Return the name of the operator.
virtual void apply(AMP::LinearAlgebra::Vector::const_shared_ptr u, AMP::LinearAlgebra::Vector::shared_ptr f) override
virtual std::shared_ptr< AMP::LinearAlgebra::Matrix > getMatrix()
virtual ~LinearOperator()
Destructor.
std::shared_ptr< AMP::LinearAlgebra::Variable > getInputVariable() const override
Return the input variable.
std::shared_ptr< AMP::LinearAlgebra::Matrix > d_matrix
LinearOperator()
Empty constructor.
virtual void setVariables(std::shared_ptr< AMP::LinearAlgebra::Variable > in, std::shared_ptr< AMP::LinearAlgebra::Variable > out)
std::shared_ptr< AMP::LinearAlgebra::Variable > d_inputVariable
std::shared_ptr< AMP::LinearAlgebra::Vector > createOutputVector() const override
Get an output vector ( For , is an output vector )
std::shared_ptr< AMP::LinearAlgebra::Vector > createInputVector() const override
Get a input vector ( For , is a input vector )
LinearOperator(std::shared_ptr< const OperatorParameters > params)
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