Advanced Multi-Physics (AMP)
On-Line Documentation
FirstOperator.h
Go to the documentation of this file.
1
2#ifndef included_AMP_FirstOperator
3#define included_AMP_FirstOperator
4
5#include "AMP/operators/newFrozenVectorDesign/OnePointOperator.h"
6
7namespace AMP::Operator {
8
10{
11public:
12 explicit FirstOperator( std::shared_ptr<const OperatorParameters> params )
13 : OnePointOperator( params )
14 {
15 d_constant = 2.0;
16 d_var.reset( new AMP::LinearAlgebra::Variable( params->d_db->getString( "Variable" ) ) );
17 }
18
21 {
22 auto in = u->subsetVectorForVariable( d_var );
23 auto out = r->subsetVectorForVariable( d_var );
24 out->scale( d_constant, *in );
25 }
26
27 std::string type() const override { return "FirstOperator"; }
28
29 std::shared_ptr<AMP::LinearAlgebra::Variable> getInputVariable() const override
30 {
31 return d_var;
32 }
33
34 std::shared_ptr<AMP::LinearAlgebra::Variable> getOutputVariable() const override
35 {
36 return d_var;
37 }
38
39protected:
40 std::shared_ptr<AMP::LinearAlgebra::Variable> d_var;
41
42private:
43};
44} // namespace AMP::Operator
45
46#endif
A description of the data in the vector.
Definition Variable.h:46
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.
FirstOperator(std::shared_ptr< const OperatorParameters > params)
void apply(AMP::LinearAlgebra::Vector::const_shared_ptr u, AMP::LinearAlgebra::Vector::shared_ptr r) override
std::shared_ptr< AMP::LinearAlgebra::Variable > d_var
std::string type() const override
Return the name of the operator.
std::shared_ptr< AMP::LinearAlgebra::Variable > getInputVariable() const override
Return the input variable.
virtual void reset(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