Advanced Multi-Physics (AMP)
On-Line Documentation
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Attributes | List of all members
AMP::Operator::MemorySpaceMigrationLinearOperator Class Reference

#include <MemorySpaceMigrationLinearOperator.h>

Inheritance diagram for AMP::Operator::MemorySpaceMigrationLinearOperator:
Inheritance graph
[legend]

Public Types

typedef std::shared_ptr< AMP::Operator::Operatorshared_ptr
 

Public Member Functions

virtual void apply (AMP::LinearAlgebra::Vector::const_shared_ptr u, AMP::LinearAlgebra::Vector::shared_ptr f) override
 
void apply (std::shared_ptr< const AMP::LinearAlgebra::Vector > u, std::shared_ptr< AMP::LinearAlgebra::Vector > f) override
 
std::shared_ptr< AMP::LinearAlgebra::VectorcreateInputVector () const override
 Get a input vector ( For \(\mathbf{A(x)}\), \(\mathbf{x}\) is a input vector )
 
std::shared_ptr< AMP::LinearAlgebra::VectorcreateOutputVector () const override
 Get an output vector ( For \(\mathbf{y=A(x)}\), \(\mathbf{y}\) is an output vector )
 
std::shared_ptr< AMP::LinearAlgebra::VariablegetInputVariable () const override
 Return the input variable.
 
std::shared_ptr< AMP::LinearAlgebra::MatrixgetMatrix () override
 
AMP::Utilities::MemoryType getMemoryLocation () const
 
std::shared_ptr< AMP::Mesh::MeshgetMesh ()
 Return the mesh.
 
std::shared_ptr< const AMP::Mesh::MeshgetMesh () const
 Return the mesh.
 
std::shared_ptr< AMP::LinearAlgebra::VariablegetOutputVariable () const override
 Return the output variable.
 
std::shared_ptr< OperatorParametersgetParameters (const std::string &type, std::shared_ptr< const AMP::LinearAlgebra::Vector > u, std::shared_ptr< OperatorParameters > params=nullptr) override
 
bool isValidVector (std::shared_ptr< const AMP::LinearAlgebra::Vector >) override
 given a vector return whether it is valid or not
 
void makeConsistent (std::shared_ptr< AMP::LinearAlgebra::Vector > vec) override
 
 MemorySpaceMigrationLinearOperator (std::shared_ptr< const OperatorParameters > params)
 Constructor.
 
 MemorySpaceMigrationLinearOperator (void)
 Default constructor.
 
void reInitializeVector (std::shared_ptr< AMP::LinearAlgebra::Vector >) override
 
void reset (std::shared_ptr< const OperatorParameters > params) override
 
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) override
 
std::shared_ptr< AMP::LinearAlgebra::VectorSelectorselectInputVector () const override
 Return the selector for input vectors.
 
std::shared_ptr< AMP::LinearAlgebra::VectorSelectorselectOutputVector () const override
 Return the selector for output vectors.
 
void setDebugPrintInfoLevel (int level) override
 
virtual void setMatrix (std::shared_ptr< AMP::LinearAlgebra::Matrix > in_mat)
 
virtual void setVariables (std::shared_ptr< AMP::LinearAlgebra::Variable > in, std::shared_ptr< AMP::LinearAlgebra::Variable > out)
 
std::shared_ptr< AMP::LinearAlgebra::VectorsubsetInputVector (std::shared_ptr< AMP::LinearAlgebra::Vector > vec) const
 Subset input vector.
 
std::shared_ptr< const AMP::LinearAlgebra::VectorsubsetInputVector (std::shared_ptr< const AMP::LinearAlgebra::Vector > vec) const
 Subset input vector.
 
std::shared_ptr< AMP::LinearAlgebra::VectorsubsetOutputVector (std::shared_ptr< AMP::LinearAlgebra::Vector > vec) const
 Subset output vector.
 
std::shared_ptr< const AMP::LinearAlgebra::VectorsubsetOutputVector (std::shared_ptr< const AMP::LinearAlgebra::Vector > vec) const
 Subset output vector.
 
std::string type () const override
 Return the name of the operator.
 
virtual ~MemorySpaceMigrationLinearOperator ()
 Destructor.
 

Protected Member Functions

void getBackendFromInput (std::shared_ptr< AMP::Database > db)
 
virtual std::shared_ptr< OperatorParametersgetJacobianParameters (std::shared_ptr< const AMP::LinearAlgebra::Vector >)
 
void setMemoryAndBackendParameters (std::shared_ptr< AMP::Database > db)
 

Protected Attributes

AMP::Utilities::Backend d_backend = AMP::Utilities::Backend::Serial
 
int d_iDebugPrintInfoLevel = 0
 
std::shared_ptr< AMP::LinearAlgebra::Variabled_inputVariable
 
int d_iObject_id
 
std::shared_ptr< AMP::LinearAlgebra::Matrixd_matrix
 
AMP::Utilities::MemoryType d_memory_location = AMP::Utilities::MemoryType::none
 
std::shared_ptr< AMP::Mesh::Meshd_Mesh
 
std::shared_ptr< AMP::LinearAlgebra::Variabled_outputVariable
 

Static Protected Attributes

static int d_iInstance_id
 

Private Attributes

std::shared_ptr< AMP::LinearAlgebra::Vectord_inputVec
 scratch space for input vectors
 
bool d_migrate_data
 
std::shared_ptr< AMP::LinearAlgebra::Vectord_outputVec
 scratch space for output vectors
 
std::shared_ptr< Operatord_pOperator
 Operator being adapted for memory operations.
 
std::shared_ptr< AMP::LinearAlgebra::Vectord_resVec
 scratch space for residuals
 

Detailed Description

This operator serves as an adaptor for an existing LinearOperator, Op, It accepts vectors potentially in another memory address space, copies them to the address space of Op so that Op can be used without modification.

Definition at line 13 of file MemorySpaceMigrationLinearOperator.h.

Member Typedef Documentation

◆ shared_ptr

Definition at line 29 of file Operator.h.

Constructor & Destructor Documentation

◆ MemorySpaceMigrationLinearOperator() [1/2]

AMP::Operator::MemorySpaceMigrationLinearOperator::MemorySpaceMigrationLinearOperator ( void  )

Default constructor.

◆ MemorySpaceMigrationLinearOperator() [2/2]

AMP::Operator::MemorySpaceMigrationLinearOperator::MemorySpaceMigrationLinearOperator ( std::shared_ptr< const OperatorParameters params)
explicit

Constructor.

◆ ~MemorySpaceMigrationLinearOperator()

virtual AMP::Operator::MemorySpaceMigrationLinearOperator::~MemorySpaceMigrationLinearOperator ( )
inlinevirtual

Destructor.

Definition at line 24 of file MemorySpaceMigrationLinearOperator.h.

Member Function Documentation

◆ apply() [1/2]

virtual void AMP::Operator::LinearOperator::apply ( AMP::LinearAlgebra::Vector::const_shared_ptr  u,
AMP::LinearAlgebra::Vector::shared_ptr  f 
)
overridevirtualinherited

The apply function for this operator, A, performs the following operation: f = A(u) Here, A(u) is simply a Matrix-Vector multiplication.

Parameters
[in]uinput vector.
[out]fresidual/output vector.

Reimplemented in AMP::Operator::IdentityOperator, AMP::Operator::PetscMatrixShellOperator, AMP::Operator::TrilinosMatrixShellOperator, and AMP::Operator::BDFRadDifOpPJac.

◆ apply() [2/2]

void AMP::Operator::MemorySpaceMigrationLinearOperator::apply ( std::shared_ptr< const AMP::LinearAlgebra::Vector u,
std::shared_ptr< AMP::LinearAlgebra::Vector f 
)
overridevirtual

This base class can not give a meaningful definition of apply. See the derived classes for how they define apply. Each operator is free to define apply in a way that is appropriate for that operator.

Parameters
ushared pointer to const input vector u
fshared pointer to output vector storing result of applying this operator

Implements AMP::Operator::Operator.

◆ createInputVector()

std::shared_ptr< AMP::LinearAlgebra::Vector > AMP::Operator::MemorySpaceMigrationLinearOperator::createInputVector ( ) const
overridevirtual

Get a input vector ( For \(\mathbf{A(x)}\), \(\mathbf{x}\) is a input vector )

Returns
A newly created input vector

Reimplemented from AMP::Operator::LinearOperator.

◆ createOutputVector()

std::shared_ptr< AMP::LinearAlgebra::Vector > AMP::Operator::MemorySpaceMigrationLinearOperator::createOutputVector ( ) const
overridevirtual

Get an output vector ( For \(\mathbf{y=A(x)}\), \(\mathbf{y}\) is an output vector )

Returns
A newly created output vector

Reimplemented from AMP::Operator::LinearOperator.

◆ getBackendFromInput()

void AMP::Operator::Operator::getBackendFromInput ( std::shared_ptr< AMP::Database db)
protectedinherited

◆ getInputVariable()

std::shared_ptr< AMP::LinearAlgebra::Variable > AMP::Operator::MemorySpaceMigrationLinearOperator::getInputVariable ( ) const
overridevirtual

Return the input variable.

Reimplemented from AMP::Operator::LinearOperator.

◆ getJacobianParameters()

virtual std::shared_ptr< OperatorParameters > AMP::Operator::Operator::getJacobianParameters ( std::shared_ptr< const AMP::LinearAlgebra::Vector )
inlineprotectedvirtualinherited

This function returns a OperatorParameters object constructed by the operator which contains parameters from which new Jacobian operators can be created. Returning a parameter object instead of an Operator itself is meant to give users more flexibility.

Definition at line 180 of file Operator.h.

◆ getMatrix()

std::shared_ptr< AMP::LinearAlgebra::Matrix > AMP::Operator::MemorySpaceMigrationLinearOperator::getMatrix ( )
overridevirtual
Returns
The matrix representation of this linear operator.

Reimplemented from AMP::Operator::LinearOperator.

◆ getMemoryLocation()

AMP::Utilities::MemoryType AMP::Operator::Operator::getMemoryLocation ( ) const
inlineinherited

Definition at line 89 of file Operator.h.

References AMP::Operator::Operator::d_memory_location.

◆ getMesh() [1/2]

std::shared_ptr< AMP::Mesh::Mesh > AMP::Operator::Operator::getMesh ( )
inlineinherited

Return the mesh.

Definition at line 149 of file Operator.h.

References AMP::Operator::Operator::d_Mesh.

◆ getMesh() [2/2]

std::shared_ptr< const AMP::Mesh::Mesh > AMP::Operator::Operator::getMesh ( ) const
inlineinherited

Return the mesh.

Definition at line 152 of file Operator.h.

References AMP::Operator::Operator::d_Mesh.

◆ getOutputVariable()

std::shared_ptr< AMP::LinearAlgebra::Variable > AMP::Operator::MemorySpaceMigrationLinearOperator::getOutputVariable ( ) const
overridevirtual

Return the output variable.

Reimplemented from AMP::Operator::LinearOperator.

◆ getParameters()

std::shared_ptr< OperatorParameters > AMP::Operator::MemorySpaceMigrationLinearOperator::getParameters ( const std::string &  type,
std::shared_ptr< const AMP::LinearAlgebra::Vector u,
std::shared_ptr< OperatorParameters params = nullptr 
)
overridevirtual

This function returns a OperatorParameters object constructed by the operator which contains parameters from which new operators can be created. Returning a parameter object instead of an Operator itself is meant to give users more flexibility. Examples of how this functionality might be used would be the construction of Jacobian, frozen Jacobian, preconditioner approximations to the Jacobian, adjoint operators etc

Parameters
typestd:string specifying type of return operator parameters being requested. Currently the valid option is Jacobian
uconst pointer to current solution vector
paramspointer to additional parameters that might be required to construct the return parameters

Reimplemented from AMP::Operator::Operator.

◆ isValidVector()

bool AMP::Operator::MemorySpaceMigrationLinearOperator::isValidVector ( std::shared_ptr< const AMP::LinearAlgebra::Vector )
overridevirtual

given a vector return whether it is valid or not

Reimplemented from AMP::Operator::Operator.

◆ makeConsistent()

void AMP::Operator::MemorySpaceMigrationLinearOperator::makeConsistent ( std::shared_ptr< AMP::LinearAlgebra::Vector vec)
overridevirtual

interface used to make a vector consistent in an operator defined way. An example of where an operator is required to make a vector consistent is in the context of AMR where ghost values on coarse-fine interfaces are filled in an operator dependent way. The default implementation is to simply call the vector makeConsistent(SET)

Reimplemented from AMP::Operator::Operator.

◆ reInitializeVector()

void AMP::Operator::MemorySpaceMigrationLinearOperator::reInitializeVector ( std::shared_ptr< AMP::LinearAlgebra::Vector )
overridevirtual

re-initialize a vector, e.g. after a regrid operation has happened. This is useful for example when numerical overshoots or undershoots have happened due to interpolation for example The default is a null op

Reimplemented from AMP::Operator::Operator.

◆ reset()

void AMP::Operator::MemorySpaceMigrationLinearOperator::reset ( std::shared_ptr< const OperatorParameters params)
overridevirtual

This function is useful for re-initializing/updating an operator

Parameters
paramsparameter object containing parameters to change

Reimplemented from AMP::Operator::Operator.

◆ residual()

void AMP::Operator::MemorySpaceMigrationLinearOperator::residual ( std::shared_ptr< const AMP::LinearAlgebra::Vector f,
std::shared_ptr< const AMP::LinearAlgebra::Vector u,
std::shared_ptr< AMP::LinearAlgebra::Vector r 
)
overridevirtual

Default base class implementation of the residual: f-L(u)

Parameters
fshared pointer to const vector rhs
ushared pointer to const vector u
rshared pointer to vector residual

Reimplemented from AMP::Operator::Operator.

◆ selectInputVector()

std::shared_ptr< AMP::LinearAlgebra::VectorSelector > AMP::Operator::MemorySpaceMigrationLinearOperator::selectInputVector ( ) const
overridevirtual

Return the selector for input vectors.

Reimplemented from AMP::Operator::Operator.

◆ selectOutputVector()

std::shared_ptr< AMP::LinearAlgebra::VectorSelector > AMP::Operator::MemorySpaceMigrationLinearOperator::selectOutputVector ( ) const
overridevirtual

Return the selector for output vectors.

Reimplemented from AMP::Operator::Operator.

◆ setDebugPrintInfoLevel()

void AMP::Operator::MemorySpaceMigrationLinearOperator::setDebugPrintInfoLevel ( int  level)
overridevirtual

Specify level of diagnostic information printed during iterations.

Parameters
levelzero prints none or minimal information, higher numbers provide increasingly verbose debugging information.

Reimplemented from AMP::Operator::Operator.

◆ setMatrix()

virtual void AMP::Operator::LinearOperator::setMatrix ( std::shared_ptr< AMP::LinearAlgebra::Matrix in_mat)
virtualinherited

Copies the shared pointer for the matrix representation of this linear operator.

Parameters
[in]in_matThe matrix representation of this linear operator.

Reimplemented in AMP::Operator::IdentityOperator.

Referenced by AMP::Solver::AMG::coarse_operator< Config >::coarse_operator(), and AMP::Operator::EpetraMatrixOperator::EpetraMatrixOperator().

◆ setMemoryAndBackendParameters()

void AMP::Operator::Operator::setMemoryAndBackendParameters ( std::shared_ptr< AMP::Database db)
protectedinherited

◆ setVariables()

virtual void AMP::Operator::LinearOperator::setVariables ( std::shared_ptr< AMP::LinearAlgebra::Variable in,
std::shared_ptr< AMP::LinearAlgebra::Variable out 
)
inlinevirtualinherited

◆ subsetInputVector() [1/2]

std::shared_ptr< AMP::LinearAlgebra::Vector > AMP::Operator::Operator::subsetInputVector ( std::shared_ptr< AMP::LinearAlgebra::Vector vec) const
inherited

Subset input vector.

◆ subsetInputVector() [2/2]

std::shared_ptr< const AMP::LinearAlgebra::Vector > AMP::Operator::Operator::subsetInputVector ( std::shared_ptr< const AMP::LinearAlgebra::Vector vec) const
inherited

Subset input vector.

◆ subsetOutputVector() [1/2]

std::shared_ptr< AMP::LinearAlgebra::Vector > AMP::Operator::Operator::subsetOutputVector ( std::shared_ptr< AMP::LinearAlgebra::Vector vec) const
inherited

Subset output vector.

◆ subsetOutputVector() [2/2]

std::shared_ptr< const AMP::LinearAlgebra::Vector > AMP::Operator::Operator::subsetOutputVector ( std::shared_ptr< const AMP::LinearAlgebra::Vector vec) const
inherited

Subset output vector.

◆ type()

std::string AMP::Operator::MemorySpaceMigrationLinearOperator::type ( ) const
inlineoverridevirtual

Return the name of the operator.

Reimplemented from AMP::Operator::LinearOperator.

Definition at line 27 of file MemorySpaceMigrationLinearOperator.h.

Member Data Documentation

◆ d_backend

AMP::Utilities::Backend AMP::Operator::Operator::d_backend = AMP::Utilities::Backend::Serial
protectedinherited

Definition at line 197 of file Operator.h.

◆ d_iDebugPrintInfoLevel

int AMP::Operator::Operator::d_iDebugPrintInfoLevel = 0
protectedinherited

Definition at line 187 of file Operator.h.

Referenced by AMP::Operator::Operator::setDebugPrintInfoLevel().

◆ d_iInstance_id

int AMP::Operator::Operator::d_iInstance_id
staticprotectedinherited

Definition at line 191 of file Operator.h.

◆ d_inputVariable

std::shared_ptr<AMP::LinearAlgebra::Variable> AMP::Operator::LinearOperator::d_inputVariable
protectedinherited

◆ d_inputVec

std::shared_ptr<AMP::LinearAlgebra::Vector> AMP::Operator::MemorySpaceMigrationLinearOperator::d_inputVec
private

scratch space for input vectors

Definition at line 134 of file MemorySpaceMigrationLinearOperator.h.

◆ d_iObject_id

int AMP::Operator::Operator::d_iObject_id
protectedinherited

Definition at line 189 of file Operator.h.

◆ d_matrix

std::shared_ptr<AMP::LinearAlgebra::Matrix> AMP::Operator::LinearOperator::d_matrix
protectedinherited

Definition at line 92 of file LinearOperator.h.

◆ d_memory_location

AMP::Utilities::MemoryType AMP::Operator::Operator::d_memory_location = AMP::Utilities::MemoryType::none
protectedinherited

Definition at line 195 of file Operator.h.

Referenced by AMP::Operator::Operator::getMemoryLocation().

◆ d_Mesh

std::shared_ptr<AMP::Mesh::Mesh> AMP::Operator::Operator::d_Mesh
protectedinherited

◆ d_migrate_data

bool AMP::Operator::MemorySpaceMigrationLinearOperator::d_migrate_data
private

Definition at line 131 of file MemorySpaceMigrationLinearOperator.h.

◆ d_outputVariable

std::shared_ptr<AMP::LinearAlgebra::Variable> AMP::Operator::LinearOperator::d_outputVariable
protectedinherited

◆ d_outputVec

std::shared_ptr<AMP::LinearAlgebra::Vector> AMP::Operator::MemorySpaceMigrationLinearOperator::d_outputVec
private

scratch space for output vectors

Definition at line 136 of file MemorySpaceMigrationLinearOperator.h.

◆ d_pOperator

std::shared_ptr<Operator> AMP::Operator::MemorySpaceMigrationLinearOperator::d_pOperator
private

Operator being adapted for memory operations.

Definition at line 141 of file MemorySpaceMigrationLinearOperator.h.

◆ d_resVec

std::shared_ptr<AMP::LinearAlgebra::Vector> AMP::Operator::MemorySpaceMigrationLinearOperator::d_resVec
private

scratch space for residuals

Definition at line 138 of file MemorySpaceMigrationLinearOperator.h.


The documentation for this class was generated from the following file:



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:44.
Comments on this page