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

A class for representing the neutronics source operator. More...

#include <NeutronicsRhs.h>

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

Public Types

typedef std::shared_ptr< AMP::Operator::Operatorshared_ptr
 
enum  SourceType {
  Power , Oxygen , Metal , FissionGas ,
  Isotopes , NUM_SOURCE_TYPES
}
 Neutronics Input Types. More...
 

Public Member Functions

void apply (AMP::LinearAlgebra::Vector::const_shared_ptr u, AMP::LinearAlgebra::Vector::shared_ptr f) override
 
virtual void apply (std::shared_ptr< const AMP::LinearAlgebra::Vector > u, std::shared_ptr< AMP::LinearAlgebra::Vector > f)=0
 
virtual std::shared_ptr< AMP::LinearAlgebra::VectorcreateInputVector () const
 Get a input vector ( For \(\mathbf{A(x)}\), \(\mathbf{x}\) is a input vector )
 
virtual std::shared_ptr< AMP::LinearAlgebra::VectorcreateOutputVector () const
 Get a left vector ( For \(\mathbf{y=A(x)}\), \(\mathbf{y}\) is an output vector )
 
virtual std::shared_ptr< AMP::LinearAlgebra::VariablegetInputVariable () const
 Return the input variable.
 
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.
 
virtual std::shared_ptr< OperatorParametersgetParameters (const std::string &type, std::shared_ptr< const AMP::LinearAlgebra::Vector > u, std::shared_ptr< OperatorParameters > params=nullptr)
 
virtual bool isValidVector (std::shared_ptr< const AMP::LinearAlgebra::Vector >)
 given a vector return whether it is valid or not
 
virtual void makeConsistent (std::shared_ptr< AMP::LinearAlgebra::Vector > vec)
 
 NeutronicsRhs (std::shared_ptr< OperatorParameters > parameters)
 
void printClassData (std::ostream &os) const
 
void putToDatabase (std::shared_ptr< AMP::Database > db)
 
virtual void reInitializeVector (std::shared_ptr< AMP::LinearAlgebra::Vector >)
 
void reset (std::shared_ptr< const OperatorParameters > parameters) override
 
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)
 
virtual std::shared_ptr< AMP::LinearAlgebra::VectorSelectorselectInputVector () const
 Return the selector for input vectors.
 
virtual std::shared_ptr< AMP::LinearAlgebra::VectorSelectorselectOutputVector () const
 Return the selector for output vectors.
 
virtual void setDebugPrintInfoLevel (int level)
 
void setOutputVariableName (const std::string &name, int varId=-1)
 
void setTimeInDays (double days)
 
void setTimeInSeconds (double seconds)
 
void setTimeStep (int tStep)
 
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 ~NeutronicsRhs ()
 

Protected Member Functions

void getBackendFromInput (std::shared_ptr< AMP::Database > db)
 
void getFromInput (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)
 
SourceType str2id (const std::string &str)
 

Protected Attributes

AMP::Utilities::Backend d_backend = AMP::Utilities::Backend::Serial
 
std::shared_ptr< AMP::Databased_db
 
std::vector< doubled_fixedValues
 
int d_iDebugPrintInfoLevel = 0
 
int d_iObject_id
 
AMP::Utilities::MemoryType d_memory_location = AMP::Utilities::MemoryType::none
 
std::shared_ptr< AMP::Mesh::Meshd_Mesh
 
int d_numTimeSteps
 
std::shared_ptr< AMP::LinearAlgebra::Variabled_outputVariable
 
double d_secondsPerDay
 
int d_timeStep
 
double d_timeStepInSeconds
 
std::vector< doubled_timeStepsInDays
 
SourceType d_type
 
bool d_useFixedValue
 
std::vector< std::vector< double > > d_values
 

Static Protected Attributes

static int d_iInstance_id
 

Detailed Description

A class for representing the neutronics source operator.

Definition at line 21 of file NeutronicsRhs.h.

Member Typedef Documentation

◆ shared_ptr

Definition at line 29 of file Operator.h.

Member Enumeration Documentation

◆ SourceType

Neutronics Input Types.

Enumerator
Power 
Oxygen 
Metal 
FissionGas 
Isotopes 
NUM_SOURCE_TYPES 

Definition at line 25 of file NeutronicsRhs.h.

Constructor & Destructor Documentation

◆ NeutronicsRhs()

AMP::Operator::NeutronicsRhs::NeutronicsRhs ( std::shared_ptr< OperatorParameters parameters)
explicit

◆ ~NeutronicsRhs()

virtual AMP::Operator::NeutronicsRhs::~NeutronicsRhs ( )
virtual

Empty destructor for NeutronicsRhs

Member Function Documentation

◆ apply() [1/2]

void AMP::Operator::NeutronicsRhs::apply ( AMP::LinearAlgebra::Vector::const_shared_ptr  u,
AMP::LinearAlgebra::Vector::shared_ptr  f 
)
override

The function that computes the residual.

Parameters
umultivector of the state.
fThe result of apply is f = A(u)

◆ apply() [2/2]

virtual void AMP::Operator::Operator::apply ( std::shared_ptr< const AMP::LinearAlgebra::Vector u,
std::shared_ptr< AMP::LinearAlgebra::Vector f 
)
pure virtualinherited

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

Implemented in AMP::Operator::RadDifOp, AMP::Operator::RadDifOpPJac, AMP::Operator::FunctionOperator, AMP::Operator::MemorySpaceMigrationLinearOperator, and AMP::Operator::MemorySpaceMigrationOperator.

◆ createInputVector()

virtual std::shared_ptr< AMP::LinearAlgebra::Vector > AMP::Operator::Operator::createInputVector ( ) const
virtualinherited

◆ createOutputVector()

virtual std::shared_ptr< AMP::LinearAlgebra::Vector > AMP::Operator::Operator::createOutputVector ( ) const
virtualinherited

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

Returns
A newly created output vector

Reimplemented in AMP::Operator::IdentityOperator, AMP::Operator::LinearOperator, AMP::Operator::MemorySpaceMigrationLinearOperator, and AMP::Operator::MemorySpaceMigrationOperator.

◆ getBackendFromInput()

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

◆ getFromInput()

void AMP::Operator::NeutronicsRhs::getFromInput ( std::shared_ptr< AMP::Database db)
protected

◆ getInputVariable()

virtual std::shared_ptr< AMP::LinearAlgebra::Variable > AMP::Operator::Operator::getInputVariable ( ) const
inlinevirtualinherited

◆ 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.

◆ 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::NeutronicsRhs::getOutputVariable ( ) const
overridevirtual

Return the output variable.

Reimplemented from AMP::Operator::Operator.

◆ getParameters()

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

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 in AMP::Operator::IdentityOperator, AMP::Operator::MemorySpaceMigrationLinearOperator, and AMP::Operator::MemorySpaceMigrationOperator.

◆ isValidVector()

virtual bool AMP::Operator::Operator::isValidVector ( std::shared_ptr< const AMP::LinearAlgebra::Vector )
inlinevirtualinherited

◆ makeConsistent()

virtual void AMP::Operator::Operator::makeConsistent ( std::shared_ptr< AMP::LinearAlgebra::Vector vec)
virtualinherited

virtual 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 in AMP::Operator::MemorySpaceMigrationLinearOperator, AMP::Operator::MemorySpaceMigrationOperator, and AMP::TimeIntegrator::TimeOperator.

◆ printClassData()

void AMP::Operator::NeutronicsRhs::printClassData ( std::ostream &  os) const

Print out all members of integrator instance to given output stream.

◆ putToDatabase()

void AMP::Operator::NeutronicsRhs::putToDatabase ( std::shared_ptr< AMP::Database db)

Write out state of object to given database.

When assertion checking is active, the database pointer must be non-null.

◆ reInitializeVector()

virtual void AMP::Operator::Operator::reInitializeVector ( std::shared_ptr< AMP::LinearAlgebra::Vector )
inlinevirtualinherited

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 in AMP::TimeIntegrator::TimeOperator, AMP::Operator::MemorySpaceMigrationLinearOperator, and AMP::Operator::MemorySpaceMigrationOperator.

Definition at line 167 of file Operator.h.

◆ reset()

void AMP::Operator::NeutronicsRhs::reset ( std::shared_ptr< const OperatorParameters parameters)
overridevirtual

A function to reinitialize this object.

Reimplemented from AMP::Operator::Operator.

◆ residual()

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

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 in AMP::Solver::AMG::HasDeferConsistency< AMP::Operator::LinearOperator >, AMP::Operator::MemorySpaceMigrationLinearOperator, AMP::Operator::MemorySpaceMigrationOperator, AMP::TimeIntegrator::IDATimeOperator, and AMP::TimeIntegrator::TimeOperator.

◆ selectInputVector()

virtual std::shared_ptr< AMP::LinearAlgebra::VectorSelector > AMP::Operator::Operator::selectInputVector ( ) const
virtualinherited

◆ selectOutputVector()

virtual std::shared_ptr< AMP::LinearAlgebra::VectorSelector > AMP::Operator::Operator::selectOutputVector ( ) const
virtualinherited

◆ setDebugPrintInfoLevel()

virtual void AMP::Operator::Operator::setDebugPrintInfoLevel ( int  level)
inlinevirtualinherited

Specify level of diagnostic information printed during iterations.

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

Reimplemented in AMP::Operator::MemorySpaceMigrationLinearOperator, and AMP::Operator::MemorySpaceMigrationOperator.

Definition at line 97 of file Operator.h.

References AMP::Operator::Operator::d_iDebugPrintInfoLevel.

◆ setMemoryAndBackendParameters()

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

◆ setOutputVariableName()

void AMP::Operator::NeutronicsRhs::setOutputVariableName ( const std::string &  name,
int  varId = -1 
)

◆ setTimeInDays()

void AMP::Operator::NeutronicsRhs::setTimeInDays ( double  days)

◆ setTimeInSeconds()

void AMP::Operator::NeutronicsRhs::setTimeInSeconds ( double  seconds)

◆ setTimeStep()

void AMP::Operator::NeutronicsRhs::setTimeStep ( int  tStep)
inline

Definition at line 71 of file NeutronicsRhs.h.

References d_timeStep.

◆ str2id()

SourceType AMP::Operator::NeutronicsRhs::str2id ( const std::string &  str)
protected

◆ 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::NeutronicsRhs::type ( ) const
inlineoverridevirtual

Return the name of the operator.

Implements AMP::Operator::Operator.

Definition at line 37 of file NeutronicsRhs.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_db

std::shared_ptr<AMP::Database> AMP::Operator::NeutronicsRhs::d_db
protected

Definition at line 85 of file NeutronicsRhs.h.

◆ d_fixedValues

std::vector<double> AMP::Operator::NeutronicsRhs::d_fixedValues
protected

Definition at line 90 of file NeutronicsRhs.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_iObject_id

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

Definition at line 189 of file Operator.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_numTimeSteps

int AMP::Operator::NeutronicsRhs::d_numTimeSteps
protected

Definition at line 87 of file NeutronicsRhs.h.

◆ d_outputVariable

std::shared_ptr<AMP::LinearAlgebra::Variable> AMP::Operator::NeutronicsRhs::d_outputVariable
protected

Definition at line 93 of file NeutronicsRhs.h.

◆ d_secondsPerDay

double AMP::Operator::NeutronicsRhs::d_secondsPerDay
protected

Definition at line 95 of file NeutronicsRhs.h.

◆ d_timeStep

int AMP::Operator::NeutronicsRhs::d_timeStep
protected

Definition at line 91 of file NeutronicsRhs.h.

Referenced by setTimeStep().

◆ d_timeStepInSeconds

double AMP::Operator::NeutronicsRhs::d_timeStepInSeconds
protected

Definition at line 92 of file NeutronicsRhs.h.

◆ d_timeStepsInDays

std::vector<double> AMP::Operator::NeutronicsRhs::d_timeStepsInDays
protected

Definition at line 88 of file NeutronicsRhs.h.

◆ d_type

SourceType AMP::Operator::NeutronicsRhs::d_type
protected

Definition at line 89 of file NeutronicsRhs.h.

◆ d_useFixedValue

bool AMP::Operator::NeutronicsRhs::d_useFixedValue
protected

Definition at line 86 of file NeutronicsRhs.h.

◆ d_values

std::vector<std::vector<double> > AMP::Operator::NeutronicsRhs::d_values
protected

Definition at line 94 of file NeutronicsRhs.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