https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Private Member Functions | Friends | List of all members
FunctionSeries Class Referenceabstract

This class uses implementations of CompositeSeriesBasisInterface to generate a function based on convolved function series. More...

#include <FunctionSeries.h>

Inheritance diagram for FunctionSeries:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 
typedef FunctorBase< RealFunctorType
 
typedef Real ValueType
 
typedef typename FunctorReturnType< Real, FunctorEvaluationKind::Gradient >::type GradientType
 
typedef ValueType DotType
 

Public Member Functions

 FunctionSeries (const InputParameters &parameters)
 
virtual Real evaluateValue (Real t, const Point &p) override
 Used in derived classes, equivalent to Function::value() More...
 
Real expand ()
 Expand the function series at the current location and with the current coefficients. More...
 
Real expand (const std::vector< Real > &coefficients)
 Expand the function using the provided coefficients at the current location. More...
 
std::size_t getNumberOfTerms () const
 Returns the number of terms (coefficients) in the underlying function series. More...
 
Real getStandardizedFunctionVolume () const
 Returns the volume of evaluation in the functional series standardized space. More...
 
const std::vector< std::size_t > & getOrders () const
 Returns a vector of the functional orders in the underlying functional series. More...
 
const std::vector< Real > & getGeneration ()
 Returns a vector of the generation-evaluated functional series at the current location. More...
 
const std::vector< Real > & getExpansion ()
 Returns a vector of the expansion-evaluated functional series at the current location. More...
 
bool isInPhysicalBounds (const Point &point) const
 Returns true if the provided point is within the set physical boundaries. More...
 
void setLocation (const Point &point)
 Set the current evaluation location. More...
 
virtual void meshChanged () override
 
void useCache (bool use)
 Enable/disable the cache. More...
 
virtual Real value (Real time, const Point &point) const final
 
virtual ADReal value (const ADReal &time, const ADPoint &point) const final
 
virtual Real value (Real t, const Point &p) const
 
virtual ADReal value (const ADReal &t, const ADPoint &p) const
 
ChainedReal value (const ChainedReal &t) const
 
auto value (const U &t) const
 
auto value (const U &t, const U &x, const U &y=0, const U &z=0) const
 
ChainedReal value (const ChainedReal &t) const
 
auto value (const U &t) const
 
auto value (const U &t, const U &x, const U &y=0, const U &z=0) const
 
ChainedReal value (const ChainedReal &t) const
 
auto value (const U &t) const
 
auto value (const U &t, const U &x, const U &y=0, const U &z=0) const
 
virtual RealVectorValue vectorValue (Real t, const Point &p) const
 
virtual RealVectorValue curl (Real t, const Point &p) const
 
virtual Real div (Real t, const Point &p) const
 
virtual RealGradient gradient (Real t, const Point &p) const
 
GradientType gradient (const ElemArg &elem, const StateArg &state) const
 
GradientType gradient (const FaceArg &face, const StateArg &state) const
 
GradientType gradient (const ElemQpArg &qp, const StateArg &state) const
 
GradientType gradient (const ElemSideQpArg &qp, const StateArg &state) const
 
GradientType gradient (const ElemPointArg &elem_point, const StateArg &state) const
 
GradientType gradient (const NodeArg &node, const StateArg &state) const
 
GradientType gradient (const ElemArg &elem, const StateArg &state) const
 
GradientType gradient (const FaceArg &face, const StateArg &state) const
 
GradientType gradient (const ElemQpArg &qp, const StateArg &state) const
 
GradientType gradient (const ElemSideQpArg &qp, const StateArg &state) const
 
GradientType gradient (const ElemPointArg &elem_point, const StateArg &state) const
 
GradientType gradient (const NodeArg &node, const StateArg &state) const
 
GradientType gradient (const ElemArg &elem, const StateArg &state) const
 
GradientType gradient (const FaceArg &face, const StateArg &state) const
 
GradientType gradient (const ElemQpArg &qp, const StateArg &state) const
 
GradientType gradient (const ElemSideQpArg &qp, const StateArg &state) const
 
GradientType gradient (const ElemPointArg &elem_point, const StateArg &state) const
 
GradientType gradient (const NodeArg &node, const StateArg &state) const
 
virtual Real timeDerivative (Real t, const Point &p) const
 
auto timeDerivative (const U &t) const
 
auto timeDerivative (const U &t, const U &x, const U &y=0, const U &z=0) const
 
auto timeDerivative (const U &t) const
 
auto timeDerivative (const U &t, const U &x, const U &y=0, const U &z=0) const
 
virtual Real integral () const
 
virtual Real average () const
 
virtual Real timeIntegral (Real t1, Real t2, const Point &p) const
 
void timestepSetup () override
 
void residualSetup () override final
 
void jacobianSetup () override final
 
void customSetup (const ExecFlagType &exec_type) override final
 
bool hasBlocks (SubdomainID) const override
 
bool supportsFaceArg () const override final
 
bool supportsElemSideQpArg () const override final
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
virtual const std::string & name () const
 
std::string typeAndName () const
 
std::string errorPrefix (const std::string &error_type) const
 
void callMooseError (std::string msg, const bool with_prefix) const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
const InputParametersparameters () const
 
MooseObjectName uniqueName () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T * queryParam (const std::string &name) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &nm) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void mooseError (Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
virtual void initialSetup ()
 
virtual void subdomainSetup ()
 
const ExecFlagEnumgetExecuteOnEnum () const
 
bool isImplicit ()
 
Moose::StateArg determineState () const
 
bool isDefaultPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessor (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessorByName (const PostprocessorName &name) const
 
std::size_t coupledPostprocessors (const std::string &param_name) const
 
const PostprocessorName & getPostprocessorName (const std::string &param_name, const unsigned int index=0) const
 
UserObjectName getUserObjectName (const std::string &param_name) const
 
const T & getUserObject (const std::string &param_name, bool is_dependency=true) const
 
const T & getUserObjectByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const UserObjectgetUserObjectBase (const std::string &param_name, bool is_dependency=true) const
 
const UserObjectgetUserObjectBaseByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const std::vector< MooseVariableScalar *> & getCoupledMooseScalarVars ()
 
const std::set< TagID > & getScalarVariableCoupleableVectorTags () const
 
const std::set< TagID > & getScalarVariableCoupleableMatrixTags () const
 
FunctorReturnType< Real, FET >::type genericEvaluate (const Space &r, const State &state) const
 
const MooseFunctorName & functorName () const
 
void setCacheClearanceSchedule (const std::set< ExecFlagType > &clearance_schedule)
 
virtual bool isExtrapolatedBoundaryFace (const FaceInfo &, const Elem *, const StateArg &) const
 
bool isInternalFace (const FaceInfo &) const
 
virtual bool isConstant () const
 
virtual bool hasFaceSide (const FaceInfo &fi, const bool fi_elem_side) const override
 
void checkFace (const Moose::FaceArg &face) const
 
const PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
ValueType operator() (const ElemArg &elem, const StateArg &state) const
 
ValueType operator() (const FaceArg &face, const StateArg &state) const
 
ValueType operator() (const ElemQpArg &qp, const StateArg &state) const
 
ValueType operator() (const ElemSideQpArg &qp, const StateArg &state) const
 
ValueType operator() (const ElemPointArg &elem_point, const StateArg &state) const
 
ValueType operator() (const NodeArg &node, const StateArg &state) const
 
ValueType operator() (const ElemArg &elem, const StateArg &state) const
 
ValueType operator() (const FaceArg &face, const StateArg &state) const
 
ValueType operator() (const ElemQpArg &qp, const StateArg &state) const
 
ValueType operator() (const ElemSideQpArg &qp, const StateArg &state) const
 
ValueType operator() (const ElemPointArg &elem_point, const StateArg &state) const
 
ValueType operator() (const NodeArg &node, const StateArg &state) const
 
ValueType operator() (const ElemArg &elem, const StateArg &state) const
 
ValueType operator() (const FaceArg &face, const StateArg &state) const
 
ValueType operator() (const ElemQpArg &qp, const StateArg &state) const
 
ValueType operator() (const ElemSideQpArg &qp, const StateArg &state) const
 
ValueType operator() (const ElemPointArg &elem_point, const StateArg &state) const
 
ValueType operator() (const NodeArg &node, const StateArg &state) const
 
DotType dot (const ElemArg &elem, const StateArg &state) const
 
DotType dot (const FaceArg &face, const StateArg &state) const
 
DotType dot (const ElemQpArg &qp, const StateArg &state) const
 
DotType dot (const ElemSideQpArg &qp, const StateArg &state) const
 
DotType dot (const ElemPointArg &elem_point, const StateArg &state) const
 
DotType dot (const NodeArg &node, const StateArg &state) const
 
DotType dot (const ElemArg &elem, const StateArg &state) const
 
DotType dot (const FaceArg &face, const StateArg &state) const
 
DotType dot (const ElemQpArg &qp, const StateArg &state) const
 
DotType dot (const ElemSideQpArg &qp, const StateArg &state) const
 
DotType dot (const ElemPointArg &elem_point, const StateArg &state) const
 
DotType dot (const NodeArg &node, const StateArg &state) const
 
DotType dot (const ElemArg &elem, const StateArg &state) const
 
DotType dot (const FaceArg &face, const StateArg &state) const
 
DotType dot (const ElemQpArg &qp, const StateArg &state) const
 
DotType dot (const ElemSideQpArg &qp, const StateArg &state) const
 
DotType dot (const ElemPointArg &elem_point, const StateArg &state) const
 
DotType dot (const NodeArg &node, const StateArg &state) const
 
GradientType gradDot (const ElemArg &elem, const StateArg &state) const
 
GradientType gradDot (const FaceArg &face, const StateArg &state) const
 
GradientType gradDot (const ElemQpArg &qp, const StateArg &state) const
 
GradientType gradDot (const ElemSideQpArg &qp, const StateArg &state) const
 
GradientType gradDot (const ElemPointArg &elem_point, const StateArg &state) const
 
GradientType gradDot (const NodeArg &node, const StateArg &state) const
 
GradientType gradDot (const ElemArg &elem, const StateArg &state) const
 
GradientType gradDot (const FaceArg &face, const StateArg &state) const
 
GradientType gradDot (const ElemQpArg &qp, const StateArg &state) const
 
GradientType gradDot (const ElemSideQpArg &qp, const StateArg &state) const
 
GradientType gradDot (const ElemPointArg &elem_point, const StateArg &state) const
 
GradientType gradDot (const NodeArg &node, const StateArg &state) const
 
GradientType gradDot (const ElemArg &elem, const StateArg &state) const
 
GradientType gradDot (const FaceArg &face, const StateArg &state) const
 
GradientType gradDot (const ElemQpArg &qp, const StateArg &state) const
 
GradientType gradDot (const ElemSideQpArg &qp, const StateArg &state) const
 
GradientType gradDot (const ElemPointArg &elem_point, const StateArg &state) const
 
GradientType gradDot (const NodeArg &node, const StateArg &state) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 
Real operator[] (std::size_t index) const
 Get the value of the coefficient at the corresponding index. More...
 
const std::vector< std::size_t > & getCharacteristics () const
 Get a reference to the characteristics array. More...
 
const std::vector< Real > & getCoefficients () const
 Get a read-only reference to the vector of coefficients. More...
 
std::vector< Real > & getCoefficients ()
 Get a writeable reference to the vector of coefficients. More...
 
std::string getCoefficientsTable () const
 Get a formatted string of the coefficients. More...
 
std::size_t getSize () const
 Get the size, aka number of coefficients. More...
 
bool isCompatibleWith (const MutableCoefficientsInterface &other) const
 Checks to see if another instance is compatible. More...
 
bool isSizeEnforced () const
 Returns true if the size of the coefficient array is fixed and enforced. More...
 
void enforceSize (bool enforce)
 Toggle whether the size of the coefficient array can be changed. More...
 
void importCoefficients (const MutableCoefficientsInterface &other)
 Import the coefficients from another instance. More...
 
void resize (std::size_t size, Real fill=0.0, bool fill_out_to_size=true)
 Resize the array, using the value for fill if the new size is larger. More...
 
void setCharacteristics (const std::vector< std::size_t > &new_characteristics)
 Sets the characteristics array. More...
 
void setCoefficients (const std::vector< Real > &new_coefficients)
 Set the coefficients using a copy operation. More...
 
void setCoefficients (std::vector< Real > &&dropin_coefficients)
 Set the coefficients using a move operation (only works with temp objects) More...
 

Static Public Member Functions

static InputParameters validParams ()
 
static FunctionSeriescheckAndConvertFunction (const Function &function, const std::string &typeName, const std::string &objectName)
 Static function to cast a Function to SeriesFunction. More...
 

Public Attributes

const ConsoleStream _console
 

Protected Member Functions

virtual void coefficientsChanged () override
 Called when the coefficients have been changed. More...
 
void invalidateCache ()
 Called by derived classes to invalidate the cache, perhaps due to a state change. More...
 
virtual void addPostprocessorDependencyHelper (const PostprocessorName &) const
 
virtual void addUserObjectDependencyHelper (const UserObject &) const
 
T & declareRestartableData (const std::string &data_name, Args &&... args)
 
ManagedValue< T > declareManagedRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
const T & getRestartableData (const std::string &data_name) const
 
T & declareRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
T & declareRecoverableData (const std::string &data_name, Args &&... args)
 
T & declareRestartableDataWithObjectName (const std::string &data_name, const std::string &object_name, Args &&... args)
 
T & declareRestartableDataWithObjectNameWithContext (const std::string &data_name, const std::string &object_name, void *context, Args &&... args)
 
std::string restartableName (const std::string &data_name) const
 
bool isCoupledScalar (const std::string &var_name, unsigned int i=0) const
 
unsigned int coupledScalarComponents (const std::string &var_name) const
 
unsigned int coupledScalar (const std::string &var_name, unsigned int comp=0) const
 
libMesh::Order coupledScalarOrder (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarValue (const std::string &var_name, unsigned int comp=0) const
 
const ADVariableValueadCoupledScalarValue (const std::string &var_name, unsigned int comp=0) const
 
const GenericVariableValue< is_ad > & coupledGenericScalarValue (const std::string &var_name, unsigned int comp=0) const
 
const GenericVariableValue< false > & coupledGenericScalarValue (const std::string &var_name, const unsigned int comp) const
 
const GenericVariableValue< true > & coupledGenericScalarValue (const std::string &var_name, const unsigned int comp) const
 
const VariableValuecoupledVectorTagScalarValue (const std::string &var_name, TagID tag, unsigned int comp=0) const
 
const VariableValuecoupledMatrixTagScalarValue (const std::string &var_name, TagID tag, unsigned int comp=0) const
 
const VariableValuecoupledScalarValueOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarValueOlder (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDot (const std::string &var_name, unsigned int comp=0) const
 
const ADVariableValueadCoupledScalarDot (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotDot (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotDotOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotDu (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotDotDu (const std::string &var_name, unsigned int comp=0) const
 
const MooseVariableScalargetScalarVar (const std::string &var_name, unsigned int comp) const
 
virtual GradientType evaluateGradDot (const ElemArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const FaceArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemQpArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemSideQpArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemPointArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const NodeArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const FaceArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemQpArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemSideQpArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemPointArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const NodeArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const FaceArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemQpArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemSideQpArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemPointArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const NodeArg &, const StateArg &) const
 
virtual ValueType evaluate (const ElemArg &elem, const StateArg &state) const =0
 
virtual ValueType evaluate (const FaceArg &face, const StateArg &state) const =0
 
virtual ValueType evaluate (const ElemQpArg &qp, const StateArg &state) const =0
 
virtual ValueType evaluate (const ElemSideQpArg &side_qp, const StateArg &state) const =0
 
virtual ValueType evaluate (const ElemPointArg &elem_point, const StateArg &state) const =0
 
virtual ValueType evaluate (const NodeArg &node, const StateArg &state) const =0
 
virtual GradientType evaluateGradient (const ElemArg &, const StateArg &) const
 
virtual GradientType evaluateGradient (const FaceArg &, const StateArg &) const
 
virtual GradientType evaluateGradient (const ElemQpArg &, const StateArg &) const
 
virtual GradientType evaluateGradient (const ElemSideQpArg &, const StateArg &) const
 
virtual GradientType evaluateGradient (const ElemPointArg &, const StateArg &) const
 
virtual GradientType evaluateGradient (const NodeArg &, const StateArg &) const
 
virtual DotType evaluateDot (const ElemArg &, const StateArg &) const
 
virtual DotType evaluateDot (const FaceArg &, const StateArg &) const
 
virtual DotType evaluateDot (const ElemQpArg &, const StateArg &) const
 
virtual DotType evaluateDot (const ElemSideQpArg &, const StateArg &) const
 
virtual DotType evaluateDot (const ElemPointArg &, const StateArg &) const
 
virtual DotType evaluateDot (const NodeArg &, const StateArg &) const
 
const FunctiongetFunction (const std::string &name) const
 
const FunctiongetFunctionByName (const FunctionName &name) const
 
bool hasFunction (const std::string &param_name) const
 
bool hasFunctionByName (const FunctionName &name) const
 

Protected Attributes

const std::vector< std::size_t > _orders
 The vector holding the orders of each single series. More...
 
const std::vector< Real_physical_bounds
 The physical bounds of the function series. More...
 
std::unique_ptr< CompositeSeriesBasisInterface_series_type
 Stores a pointer to the functional series object. More...
 
const MooseEnum_series_type_name
 Stores the name of the current functional series type. More...
 
const MooseEnum_x
 Stores the name of the single function series to use in the x direction. More...
 
const MooseEnum_y
 Stores the name of the single function series to use in the y direction. More...
 
const MooseEnum_z
 Stores the name of the single function series to use in the z direction. More...
 
const MooseEnum_disc
 Stores the name of the single function series to use for a unit disc. More...
 
const MooseEnum_expansion_type
 The normalization type for expansion. More...
 
const MooseEnum_generation_type
 The normalization type for generation. More...
 
const bool & _enabled
 
MooseApp_app
 
const std::string _type
 
const std::string _name
 
const InputParameters_pars
 
Factory_factory
 
ActionFactory_action_factory
 
const ExecFlagEnum_execute_enum
 
const ExecFlagType_current_execute_flag
 
const InputParameters_ti_params
 
FEProblemBase_ti_feproblem
 
bool _is_implicit
 
Real_t
 
const Real_t_old
 
int_t_step
 
Real_dt
 
Real_dt_old
 
bool _is_transient
 
MooseApp_restartable_app
 
const std::string _restartable_system_name
 
const THREAD_ID _restartable_tid
 
const bool _restartable_read_only
 
FEProblemBase_mci_feproblem
 
FEProblemBase_sc_fe_problem
 
const THREAD_ID _sc_tid
 
const Real_real_zero
 
const VariableValue_scalar_zero
 
const Point & _point_zero
 
const Parallel::Communicator & _communicator
 
std::vector< std::size_t > & _characteristics
 An array of integer characteristics that can be used to check compatibility. More...
 
std::vector< Real > & _coefficients
 The coefficient array. More...
 
bool _enforce_size
 Boolean that locks or allows resizing of the coefficient array. More...
 
const bool _print_coefficients
 Boolean to flag if the coefficients should be printed when set. More...
 

Static Private Member Functions

static std::vector< std::size_t > convertOrders (const std::vector< unsigned int > &orders)
 Static function to convert an array of unsigned int to std::size_t. More...
 

Friends

std::ostream & operator<< (std::ostream &stream, const FunctionSeries &me)
 Returns a tabularized text stream of the currently stored coefficients. More...
 

Detailed Description

This class uses implementations of CompositeSeriesBasisInterface to generate a function based on convolved function series.

Its inheritance tree includes MutableCoefficientsInterface, which enables easy MultiApp transfers of coefficients.

Definition at line 20 of file FunctionSeries.h.

Constructor & Destructor Documentation

◆ FunctionSeries()

FunctionSeries::FunctionSeries ( const InputParameters parameters)

Definition at line 74 of file FunctionSeries.C.

76  _orders(convertOrders(getParam<std::vector<unsigned int>>("orders"))),
77  _physical_bounds(getParam<std::vector<Real>>("physical_bounds")),
78  _series_type_name(getParam<MooseEnum>("series_type")),
79  _x(getParam<MooseEnum>("x")),
80  _y(getParam<MooseEnum>("y")),
81  _z(getParam<MooseEnum>("z")),
82  _disc(getParam<MooseEnum>("disc")),
83  _expansion_type(getParam<MooseEnum>("expansion_type")),
84  _generation_type(getParam<MooseEnum>("generation_type"))
85 {
86  std::vector<MooseEnum> domains;
87  std::vector<MooseEnum> types;
88 
89  if (_series_type_name == "Cartesian")
90  {
91  /*
92  * For Cartesian series, at least one of 'x', 'y', and 'z' must be specified.
93  *
94  * The individual series are always stored in x, y, z order (independent of the order in which
95  * they appear in the input file). Hence, the 'orders' and 'physical_bounds' vectors must always
96  * be specified in x, y, z order.
97  */
98  if (isParamValid("x"))
99  {
100  domains.push_back(FunctionalBasisInterface::_domain_options = "x");
101  types.push_back(_x);
102  }
103  if (isParamValid("y"))
104  {
105  domains.push_back(FunctionalBasisInterface::_domain_options = "y");
106  types.push_back(_y);
107  }
108  if (isParamValid("z"))
109  {
110  domains.push_back(FunctionalBasisInterface::_domain_options = "z");
111  types.push_back(_z);
112  }
113  if (types.size() == 0)
114  mooseError("Must specify one of 'x', 'y', or 'z' for 'Cartesian' series!");
115  _series_type = std::make_unique<Cartesian>(
116  domains, _orders, types, name(), _expansion_type, _generation_type);
117  }
118  else if (_series_type_name == "CylindricalDuo")
119  {
120  /*
121  * CylindricalDuo represents a disc-axial expansion, where the disc is described by a single
122  * series, such as Zernike (as opposed to a series individually representing r and a second
123  * series independently representing theta. For CylindricalDuo series, the series are always
124  * stored in the axial, planar order, independent of which order the series appear in the input
125  * file. Therefore, the _orders and _physical_bounds vectors must always appear in axial, planar
126  * order. The first entry in _domains is interpreted as the axial direction, and the following
127  * two as the planar.
128  */
129  if (isParamValid("x"))
130  {
134  types.push_back(_x);
135  }
136  if (isParamValid("y"))
137  {
141  types.push_back(_y);
142  }
143  if (isParamValid("z"))
144  {
148  types.push_back(_z);
149  }
150 
151  if (types.size() == 0)
152  mooseError("Must specify one of 'x', 'y', or 'z' for 'CylindricalDuo' series!");
153 
154  if (types.size() > 1)
155  mooseError("Cannot specify more than one of 'x', 'y', or 'z' for 'CylindricalDuo' series!");
156 
157  types.push_back(_disc);
158  _series_type = std::make_unique<CylindricalDuo>(
159  domains, _orders, types, name(), _expansion_type, _generation_type);
160  }
161  else
162  mooseError("Unknown functional series type \"", _series_type_name, "\"");
163 
164  // Set the physical bounds of each of the single series if defined
165  if (isParamValid("physical_bounds"))
166  _series_type->setPhysicalBounds(_physical_bounds);
167 
168  // Resize the coefficient array as needed
169  enforceSize(false), resize(getNumberOfTerms(), 0.0), enforceSize(true);
171 }
std::unique_ptr< CompositeSeriesBasisInterface > _series_type
Stores a pointer to the functional series object.
const MooseEnum & _x
Stores the name of the single function series to use in the x direction.
const std::vector< std::size_t > _orders
The vector holding the orders of each single series.
const MooseEnum & _generation_type
The normalization type for generation.
static MooseEnum _domain_options
An enumeration of the domains available to each functional series.
void setCharacteristics(const std::vector< std::size_t > &new_characteristics)
Sets the characteristics array.
virtual const std::string & name() const
bool isParamValid(const std::string &name) const
const MooseEnum & _z
Stores the name of the single function series to use in the z direction.
const MooseEnum & _series_type_name
Stores the name of the current functional series type.
MutableCoefficientsFunctionInterface(const MooseObject *moose_object, const InputParameters &parameters)
const T & getParam(const std::string &name) const
std::size_t getNumberOfTerms() const
Returns the number of terms (coefficients) in the underlying function series.
const std::vector< Real > _physical_bounds
The physical bounds of the function series.
static std::vector< std::size_t > convertOrders(const std::vector< unsigned int > &orders)
Static function to convert an array of unsigned int to std::size_t.
const MooseEnum & _disc
Stores the name of the single function series to use for a unit disc.
const MooseEnum & _y
Stores the name of the single function series to use in the y direction.
void mooseError(Args &&... args) const
const InputParameters & parameters() const
void resize(std::size_t size, Real fill=0.0, bool fill_out_to_size=true)
Resize the array, using the value for fill if the new size is larger.
const MooseEnum & _expansion_type
The normalization type for expansion.
void enforceSize(bool enforce)
Toggle whether the size of the coefficient array can be changed.

Member Function Documentation

◆ checkAndConvertFunction()

FunctionSeries & FunctionSeries::checkAndConvertFunction ( const Function function,
const std::string &  typeName,
const std::string &  objectName 
)
static

Static function to cast a Function to SeriesFunction.

Definition at line 174 of file FunctionSeries.C.

Referenced by FunctionSeriesToAux::FunctionSeriesToAux(), FXFluxBC::FXFluxBC(), FXValueBC::FXValueBC(), and FXValuePenaltyBC::FXValuePenaltyBC().

177 {
178  const FunctionSeries * test = dynamic_cast<const FunctionSeries *>(&function);
179  if (!test)
180  ::mooseError("In ",
181  typeName,
182  "-type object \"",
183  objectName,
184  "\": the named Function \"",
185  function.name(),
186  "\" must be a FunctionSeries-type object.");
187 
188  return *const_cast<FunctionSeries *>(test);
189 }
virtual const std::string & name() const
This class uses implementations of CompositeSeriesBasisInterface to generate a function based on conv...
void mooseError(Args &&... args) const

◆ coefficientsChanged()

void MutableCoefficientsFunctionInterface::coefficientsChanged ( )
overrideprotectedvirtualinherited

Called when the coefficients have been changed.

Reimplemented from MutableCoefficientsInterface.

Definition at line 38 of file MutableCoefficientsFunctionInterface.C.

39 {
40  // The coefficients have changed, which invalidates the cache
42 }
void invalidateCache()
Called by derived classes to invalidate the cache, perhaps due to a state change. ...

◆ convertOrders()

std::vector< std::size_t > FunctionSeries::convertOrders ( const std::vector< unsigned int > &  orders)
staticprivate

Static function to convert an array of unsigned int to std::size_t.

The MOOSE parser has issues reading a list of integers in as std::size_t (unsigned long), so this workaround is required in order to set _orders in the constructor initializer list.

Definition at line 289 of file FunctionSeries.C.

290 {
291  return std::vector<std::size_t>(orders.begin(), orders.end());
292 }

◆ enforceSize()

void MutableCoefficientsInterface::enforceSize ( bool  enforce)
inherited

Toggle whether the size of the coefficient array can be changed.

Definition at line 111 of file MutableCoefficientsInterface.C.

Referenced by FunctionSeries(), and MutableCoefficientsFunctionInterface::MutableCoefficientsFunctionInterface().

112 {
113  _enforce_size = enforce;
114 }
bool _enforce_size
Boolean that locks or allows resizing of the coefficient array.

◆ evaluateValue()

Real FunctionSeries::evaluateValue ( Real  time,
const Point &  point 
)
overridevirtual

Used in derived classes, equivalent to Function::value()

Implements MemoizedFunctionInterface.

Definition at line 249 of file FunctionSeries.C.

250 {
251  // Check that the point is within the physical bounds of the series
252  if (!isInPhysicalBounds(point))
253  return 0.0;
254 
255  // Set the location at which to evaluate the series
256  setLocation(point);
257 
258  return expand();
259 }
void setLocation(const Point &point)
Set the current evaluation location.
Real expand()
Expand the function series at the current location and with the current coefficients.
bool isInPhysicalBounds(const Point &point) const
Returns true if the provided point is within the set physical boundaries.

◆ expand() [1/2]

Real FunctionSeries::expand ( )

Expand the function series at the current location and with the current coefficients.

Definition at line 262 of file FunctionSeries.C.

Referenced by evaluateValue().

263 {
264  return expand(_coefficients);
265 }
Real expand()
Expand the function series at the current location and with the current coefficients.
std::vector< Real > & _coefficients
The coefficient array.

◆ expand() [2/2]

Real FunctionSeries::expand ( const std::vector< Real > &  coefficients)

Expand the function using the provided coefficients at the current location.

Definition at line 268 of file FunctionSeries.C.

269 {
270  // Evaluate all of the terms in the series
271  const std::vector<Real> & terms = getExpansion();
272 
273  return std::inner_product(terms.begin(), terms.end(), coefficients.begin(), 0.0);
274 }
const std::vector< Real > & getExpansion()
Returns a vector of the expansion-evaluated functional series at the current location.

◆ getCharacteristics()

const std::vector< std::size_t > & MutableCoefficientsInterface::getCharacteristics ( ) const
inherited

Get a reference to the characteristics array.

Definition at line 51 of file MutableCoefficientsInterface.C.

52 {
53  return _characteristics;
54 }
std::vector< std::size_t > & _characteristics
An array of integer characteristics that can be used to check compatibility.

◆ getCoefficients() [1/2]

const std::vector< Real > & MutableCoefficientsInterface::getCoefficients ( ) const
inherited

Get a read-only reference to the vector of coefficients.

Definition at line 57 of file MutableCoefficientsInterface.C.

58 {
59  return _coefficients;
60 }
std::vector< Real > & _coefficients
The coefficient array.

◆ getCoefficients() [2/2]

std::vector< Real > & MutableCoefficientsInterface::getCoefficients ( )
inherited

Get a writeable reference to the vector of coefficients.

Definition at line 63 of file MutableCoefficientsInterface.C.

64 {
65  return _coefficients;
66 }
std::vector< Real > & _coefficients
The coefficient array.

◆ getCoefficientsTable()

std::string MutableCoefficientsInterface::getCoefficientsTable ( ) const
inherited

Get a formatted string of the coefficients.

Definition at line 69 of file MutableCoefficientsInterface.C.

70 {
71  std::stringbuf string;
72  std::ostream table(&string);
73 
74  table << *this;
75 
76  return string.str();
77 }

◆ getExpansion()

const std::vector< Real > & FunctionSeries::getExpansion ( )

Returns a vector of the expansion-evaluated functional series at the current location.

Definition at line 226 of file FunctionSeries.C.

Referenced by expand().

227 {
228  return _series_type->getAllExpansion();
229 }
std::unique_ptr< CompositeSeriesBasisInterface > _series_type
Stores a pointer to the functional series object.

◆ getGeneration()

const std::vector< Real > & FunctionSeries::getGeneration ( )

Returns a vector of the generation-evaluated functional series at the current location.

Definition at line 215 of file FunctionSeries.C.

216 {
217  return _series_type->getAllGeneration();
218 }
std::unique_ptr< CompositeSeriesBasisInterface > _series_type
Stores a pointer to the functional series object.

◆ getNumberOfTerms()

std::size_t FunctionSeries::getNumberOfTerms ( ) const

Returns the number of terms (coefficients) in the underlying function series.

Definition at line 198 of file FunctionSeries.C.

Referenced by FunctionSeries(), FXIntegralBaseUserObject< ElementIntegralVariableUserObject >::FXIntegralBaseUserObject(), and operator<<().

199 {
200  return _series_type->getNumberOfTerms();
201 }
std::unique_ptr< CompositeSeriesBasisInterface > _series_type
Stores a pointer to the functional series object.

◆ getOrders()

const std::vector< size_t > & FunctionSeries::getOrders ( ) const

Returns a vector of the functional orders in the underlying functional series.

Definition at line 204 of file FunctionSeries.C.

Referenced by FXIntegralBaseUserObject< ElementIntegralVariableUserObject >::FXIntegralBaseUserObject().

205 {
206  return _orders;
207 }
const std::vector< std::size_t > _orders
The vector holding the orders of each single series.

◆ getSize()

std::size_t MutableCoefficientsInterface::getSize ( ) const
inherited

Get the size, aka number of coefficients.

Definition at line 80 of file MutableCoefficientsInterface.C.

Referenced by MutableCoefficientsInterface::isCompatibleWith(), and operator<<().

81 {
82  return _coefficients.size();
83 }
std::vector< Real > & _coefficients
The coefficient array.

◆ getStandardizedFunctionVolume()

Real FunctionSeries::getStandardizedFunctionVolume ( ) const

Returns the volume of evaluation in the functional series standardized space.

Definition at line 192 of file FunctionSeries.C.

193 {
194  return _series_type->getStandardizedFunctionVolume();
195 }
std::unique_ptr< CompositeSeriesBasisInterface > _series_type
Stores a pointer to the functional series object.

◆ importCoefficients()

void MutableCoefficientsInterface::importCoefficients ( const MutableCoefficientsInterface other)
inherited

Import the coefficients from another instance.

Definition at line 117 of file MutableCoefficientsInterface.C.

Referenced by MultiAppFXTransfer::execute().

118 {
119  if (!isCompatibleWith(other))
120  mooseError("Cannot import coefficients from incompatible MutableCoefficientsInterface");
121 
123 
125  _console << *this;
126 
128 }
void mooseError(Args &&... args)
virtual void coefficientsChanged()
Called when the coefficients have been changed.
const bool _print_coefficients
Boolean to flag if the coefficients should be printed when set.
bool isCompatibleWith(const MutableCoefficientsInterface &other) const
Checks to see if another instance is compatible.
std::vector< Real > & _coefficients
The coefficient array.
const ConsoleStream & _console
MooseObject instance of this to provide access to _console

◆ invalidateCache()

void MemoizedFunctionInterface::invalidateCache ( )
protectedinherited

Called by derived classes to invalidate the cache, perhaps due to a state change.

Definition at line 89 of file MemoizedFunctionInterface.C.

Referenced by MutableCoefficientsFunctionInterface::coefficientsChanged(), MemoizedFunctionInterface::meshChanged(), MemoizedFunctionInterface::useCache(), and MemoizedFunctionInterface::value().

90 {
91  _cache.clear();
92 }
std::unordered_map< hashing::HashValue, Real > _cache
Cached evaluations for each point.

◆ isCompatibleWith()

bool MutableCoefficientsInterface::isCompatibleWith ( const MutableCoefficientsInterface other) const
inherited

Checks to see if another instance is compatible.

Definition at line 86 of file MutableCoefficientsInterface.C.

Referenced by MultiAppFXTransfer::execute(), and MutableCoefficientsInterface::importCoefficients().

87 {
88  // Check the coefficient sizes if requested
89  if ((_enforce_size && other._enforce_size) && getSize() != other.getSize())
90  return false;
91 
92  // Check the size of the characteristics array
93  if (_characteristics.size() != other._characteristics.size())
94  return false;
95 
96  // Check the values of the characteristics array
97  for (std::size_t i = 0; i < _characteristics.size(); ++i)
98  if (_characteristics[i] != other._characteristics[i])
99  return false;
100 
101  return true;
102 }
bool _enforce_size
Boolean that locks or allows resizing of the coefficient array.
std::vector< std::size_t > & _characteristics
An array of integer characteristics that can be used to check compatibility.
std::size_t getSize() const
Get the size, aka number of coefficients.

◆ isInPhysicalBounds()

bool FunctionSeries::isInPhysicalBounds ( const Point &  point) const

Returns true if the provided point is within the set physical boundaries.

Definition at line 237 of file FunctionSeries.C.

Referenced by evaluateValue().

238 {
239  return _series_type->isInPhysicalBounds(point);
240 }
std::unique_ptr< CompositeSeriesBasisInterface > _series_type
Stores a pointer to the functional series object.

◆ isSizeEnforced()

bool MutableCoefficientsInterface::isSizeEnforced ( ) const
inherited

Returns true if the size of the coefficient array is fixed and enforced.

Definition at line 105 of file MutableCoefficientsInterface.C.

106 {
107  return _enforce_size;
108 }
bool _enforce_size
Boolean that locks or allows resizing of the coefficient array.

◆ meshChanged()

void MemoizedFunctionInterface::meshChanged ( )
overridevirtualinherited

Reimplemented from Function.

Definition at line 39 of file MemoizedFunctionInterface.C.

40 {
41  // The mesh has changed, which invalidates the cache
43 }
void invalidateCache()
Called by derived classes to invalidate the cache, perhaps due to a state change. ...

◆ operator[]()

Real MutableCoefficientsInterface::operator[] ( std::size_t  index) const
inherited

Get the value of the coefficient at the corresponding index.

Definition at line 45 of file MutableCoefficientsInterface.C.

46 {
47  return _coefficients[index];
48 }
std::vector< Real > & _coefficients
The coefficient array.

◆ resize()

void MutableCoefficientsInterface::resize ( std::size_t  size,
Real  fill = 0.0,
bool  fill_out_to_size = true 
)
inherited

Resize the array, using the value for fill if the new size is larger.

Definition at line 131 of file MutableCoefficientsInterface.C.

Referenced by FunctionSeries().

132 {
133  if (size != _coefficients.size())
134  {
135  if (_enforce_size &&
136  (size > _coefficients.size() || (size < _coefficients.size() && !fill_out_to_size)))
137  mooseError("Cannot resize coefficient array with size enforcement enabled.");
138 
139  _coefficients.resize(size, fill);
140 
142  _console << *this;
143 
145  }
146 }
void mooseError(Args &&... args)
virtual void coefficientsChanged()
Called when the coefficients have been changed.
const bool _print_coefficients
Boolean to flag if the coefficients should be printed when set.
bool _enforce_size
Boolean that locks or allows resizing of the coefficient array.
std::vector< Real > & _coefficients
The coefficient array.
const ConsoleStream & _console
MooseObject instance of this to provide access to _console

◆ setCharacteristics()

void MutableCoefficientsInterface::setCharacteristics ( const std::vector< std::size_t > &  new_characteristics)
inherited

Sets the characteristics array.

Definition at line 149 of file MutableCoefficientsInterface.C.

Referenced by FunctionSeries().

151 {
152  _characteristics = new_characteristics;
153 }
std::vector< std::size_t > & _characteristics
An array of integer characteristics that can be used to check compatibility.

◆ setCoefficients() [1/2]

void MutableCoefficientsInterface::setCoefficients ( const std::vector< Real > &  new_coefficients)
inherited

Set the coefficients using a copy operation.

Definition at line 156 of file MutableCoefficientsInterface.C.

Referenced by MutableCoefficientsFunctionInterface::MutableCoefficientsFunctionInterface().

157 {
158  if (_enforce_size && new_coefficients.size() != _coefficients.size())
159  mooseError("Cannon assigned a coefficient array with differing size when size enforcement is "
160  "enabled.");
161 
162  _coefficients = new_coefficients;
163 
165  _console << *this;
166 
168 }
void mooseError(Args &&... args)
virtual void coefficientsChanged()
Called when the coefficients have been changed.
const bool _print_coefficients
Boolean to flag if the coefficients should be printed when set.
bool _enforce_size
Boolean that locks or allows resizing of the coefficient array.
std::vector< Real > & _coefficients
The coefficient array.
const ConsoleStream & _console
MooseObject instance of this to provide access to _console

◆ setCoefficients() [2/2]

void MutableCoefficientsInterface::setCoefficients ( std::vector< Real > &&  dropin_coefficients)
inherited

Set the coefficients using a move operation (only works with temp objects)

Definition at line 171 of file MutableCoefficientsInterface.C.

172 {
173  if (_enforce_size && dropin_coefficients.size() != _coefficients.size())
174  mooseError("Cannon assigned a coefficient array with differing size when size enforcement is "
175  "enabled.");
176 
177  _coefficients = dropin_coefficients;
178 
180  _console << *this;
181 
183 }
void mooseError(Args &&... args)
virtual void coefficientsChanged()
Called when the coefficients have been changed.
const bool _print_coefficients
Boolean to flag if the coefficients should be printed when set.
bool _enforce_size
Boolean that locks or allows resizing of the coefficient array.
std::vector< Real > & _coefficients
The coefficient array.
const ConsoleStream & _console
MooseObject instance of this to provide access to _console

◆ setLocation()

void FunctionSeries::setLocation ( const Point &  point)

Set the current evaluation location.

Definition at line 243 of file FunctionSeries.C.

Referenced by evaluateValue().

244 {
245  _series_type->setLocation(point);
246 }
std::unique_ptr< CompositeSeriesBasisInterface > _series_type
Stores a pointer to the functional series object.

◆ useCache()

void MemoizedFunctionInterface::useCache ( bool  use)
inherited

Enable/disable the cache.

Definition at line 80 of file MemoizedFunctionInterface.C.

Referenced by FXFluxBC::FXFluxBC(), FXValueBC::FXValueBC(), and FXValuePenaltyBC::FXValuePenaltyBC().

81 {
82  _enable_cache = use;
83 
84  if (!_enable_cache)
86 }
void invalidateCache()
Called by derived classes to invalidate the cache, perhaps due to a state change. ...
bool _enable_cache
Flag for whether to cache values.

◆ validParams()

InputParameters FunctionSeries::validParams ( )
static

Definition at line 20 of file FunctionSeries.C.

21 {
23 
24  params.addClassDescription("This function uses a convolution of functional series (functional "
25  "expansion or FX) to create a 1D, 2D, or 3D function");
26 
27  // The available composite series types.
28  // Cartesian: 1D, 2D, or 3D, depending on which of x, y, and z are present
29  // CylindricalDuo: planar disc expansion and axial expansion
30  MooseEnum series_types("Cartesian CylindricalDuo");
33 
35  "series_type", series_types, "The type of function series to construct.");
36 
37  /*
38  * This needs to use `unsigned int` instead of `std::size_t` because otherwise MOOSE errors at
39  * runtime
40  */
41  params.addRequiredParam<std::vector<unsigned int>>("orders",
42  "The order of each series. These must be "
43  "defined as \"x y z\" for Cartesian, and \"z "
44  "disc\" for CylindricalDuo.");
45 
46  params.addParam<std::vector<Real>>("physical_bounds",
47  "The physical bounds of the function series. These must be "
48  "defined as \"x_min x_max y_min y_max z_min z_max\" for "
49  "Cartesian, and \"axial_min axial_max disc_center1 "
50  "disc_center2 radius\" for CylindricalDuo");
51 
52  params.addParam<MooseEnum>("x", single_series_types_1D, "The series to use for the x-direction.");
53  params.addParam<MooseEnum>("y", single_series_types_1D, "The series to use for the y-direction.");
54  params.addParam<MooseEnum>("z", single_series_types_1D, "The series to use for the z-direction.");
55 
56  params.addParam<MooseEnum>("disc",
58  "The series to use for the disc. Its direction is determined by "
59  "orthogonality to the declared direction of the axis.");
60 
61  std::string normalization_types = "orthonormal sqrt_mu standard";
62  MooseEnum expansion_type(normalization_types, "standard");
63  MooseEnum generation_type(normalization_types, "orthonormal");
64  params.addParam<MooseEnum>("expansion_type",
66  "The normalization used for expansion of the basis functions");
67  params.addParam<MooseEnum>(
68  "generation_type",
70  "The normalization used for generation of the basis function coefficients");
71  return params;
72 }
MooseEnum single_series_types_2D
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
MooseEnum expansion_type
MooseEnum single_series_types_1D
void addClassDescription(const std::string &doc_string)
MooseEnum generation_type

◆ value() [1/10]

auto Function::value
inherited

◆ value() [2/10]

virtual Real Function::value
inherited

◆ value() [3/10]

ChainedReal Function::value
inherited

◆ value() [4/10]

auto Function::value
inherited

◆ value() [5/10]

auto Function::value
inherited

◆ value() [6/10]

ChainedReal Function::value
inherited

◆ value() [7/10]

virtual ADReal Function::value
inherited

◆ value() [8/10]

auto Function::value
inherited

◆ value() [9/10]

Real MemoizedFunctionInterface::value ( Real  time,
const Point &  point 
) const
finalvirtualinherited

Reimplemented from Function.

Definition at line 46 of file MemoizedFunctionInterface.C.

47 {
48  MemoizedFunctionInterface * ptr = const_cast<MemoizedFunctionInterface *>(this);
49 
50  if (_enable_cache)
51  {
52  // Start the cache over if we are at a new time step
53  if (_respect_time && time != _current_time)
54  {
55  _current_time = time;
56  ptr->invalidateCache();
57  }
58 
59  // Try to insert a new value into the cache
60  auto result = _cache.insert({hashing::hashCombine(time, point), 0.0});
61 
62  // Evaluate and apply if the insertion worked, i.e. the element didn't exist
63  if (result.second)
64  result.first->second = ptr->evaluateValue(time, point);
65 
66  // Return the cached value
67  return result.first->second;
68  }
69 
70  return ptr->evaluateValue(time, point);
71 }
void invalidateCache()
Called by derived classes to invalidate the cache, perhaps due to a state change. ...
bool _enable_cache
Flag for whether to cache values.
Real _current_time
Stores the time evaluation of the cache.
void hashCombine(HashValue &)
Final iteration of the variadic template with no additional arguments.
Definition: Hashing.h:28
bool _respect_time
Flag for whether changes in time invalidate the cache.
std::unordered_map< hashing::HashValue, Real > _cache
Cached evaluations for each point.
Implementation of Function that memoizes (caches) former evaluations in an unordered map using a hash...
virtual Real evaluateValue(Real time, const Point &point)=0
Used in derived classes, equivalent to Function::value()

◆ value() [10/10]

ADReal MemoizedFunctionInterface::value ( const ADReal time,
const ADPoint point 
) const
finalvirtualinherited

Reimplemented from Function.

Definition at line 74 of file MemoizedFunctionInterface.C.

75 {
76  mooseError("Not implemented");
77 }
void mooseError(Args &&... args) const

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  stream,
const FunctionSeries me 
)
friend

Returns a tabularized text stream of the currently stored coefficients.

Definition at line 277 of file FunctionSeries.C.

278 {
279  stream << "\n\n"
280  << "FunctionSeries: " << me.name() << "\n"
281  << " Terms: " << me.getNumberOfTerms() << "\n";
282  me._series_type->formatCoefficients(stream, me._coefficients);
283  stream << "\n\n" << std::flush;
284 
285  return stream;
286 }
std::unique_ptr< CompositeSeriesBasisInterface > _series_type
Stores a pointer to the functional series object.
virtual const std::string & name() const
std::vector< Real > & _coefficients
The coefficient array.
std::size_t getNumberOfTerms() const
Returns the number of terms (coefficients) in the underlying function series.

Member Data Documentation

◆ _characteristics

std::vector<std::size_t>& MutableCoefficientsInterface::_characteristics
protectedinherited

◆ _coefficients

std::vector<Real>& MutableCoefficientsInterface::_coefficients
protectedinherited

◆ _disc

const MooseEnum& FunctionSeries::_disc
protected

Stores the name of the single function series to use for a unit disc.

Definition at line 111 of file FunctionSeries.h.

Referenced by FunctionSeries().

◆ _enforce_size

bool MutableCoefficientsInterface::_enforce_size
protectedinherited

◆ _expansion_type

const MooseEnum& FunctionSeries::_expansion_type
protected

The normalization type for expansion.

Definition at line 113 of file FunctionSeries.h.

Referenced by FunctionSeries().

◆ _generation_type

const MooseEnum& FunctionSeries::_generation_type
protected

The normalization type for generation.

Definition at line 115 of file FunctionSeries.h.

Referenced by FunctionSeries().

◆ _orders

const std::vector<std::size_t> FunctionSeries::_orders
protected

The vector holding the orders of each single series.

Definition at line 89 of file FunctionSeries.h.

Referenced by FunctionSeries(), and getOrders().

◆ _physical_bounds

const std::vector<Real> FunctionSeries::_physical_bounds
protected

The physical bounds of the function series.

Definition at line 92 of file FunctionSeries.h.

Referenced by FunctionSeries().

◆ _print_coefficients

const bool MutableCoefficientsInterface::_print_coefficients
protectedinherited

Boolean to flag if the coefficients should be printed when set.

Definition at line 117 of file MutableCoefficientsInterface.h.

Referenced by MutableCoefficientsInterface::importCoefficients(), MutableCoefficientsInterface::resize(), and MutableCoefficientsInterface::setCoefficients().

◆ _series_type

std::unique_ptr<CompositeSeriesBasisInterface> FunctionSeries::_series_type
protected

Stores a pointer to the functional series object.

Definition at line 95 of file FunctionSeries.h.

Referenced by FunctionSeries(), getExpansion(), getGeneration(), getNumberOfTerms(), getStandardizedFunctionVolume(), isInPhysicalBounds(), operator<<(), and setLocation().

◆ _series_type_name

const MooseEnum& FunctionSeries::_series_type_name
protected

Stores the name of the current functional series type.

Definition at line 98 of file FunctionSeries.h.

Referenced by FunctionSeries().

◆ _x

const MooseEnum& FunctionSeries::_x
protected

Stores the name of the single function series to use in the x direction.

Definition at line 105 of file FunctionSeries.h.

Referenced by FunctionSeries().

◆ _y

const MooseEnum& FunctionSeries::_y
protected

Stores the name of the single function series to use in the y direction.

Definition at line 107 of file FunctionSeries.h.

Referenced by FunctionSeries().

◆ _z

const MooseEnum& FunctionSeries::_z
protected

Stores the name of the single function series to use in the z direction.

Definition at line 109 of file FunctionSeries.h.

Referenced by FunctionSeries().


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