https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
FunctionSeries Class Reference

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< Real > FunctorType
 
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()
 
Real expand ()
 Expand the function series at the current location and with the current coefficients.
 
Real expand (const std::vector< Real > &coefficients)
 Expand the function using the provided coefficients at the current location.
 
std::size_t getNumberOfTerms () const
 Returns the number of terms (coefficients) in the underlying function series.
 
Real getStandardizedFunctionVolume () const
 Returns the volume of evaluation in the functional series standardized space.
 
const std::vector< std::size_t > & getOrders () const
 Returns a vector of the functional orders in the underlying functional series.
 
const std::vector< Real > & getGeneration ()
 Returns a vector of the generation-evaluated functional series at the current location.
 
const std::vector< Real > & getExpansion ()
 Returns a vector of the expansion-evaluated functional series at the current location.
 
bool isInPhysicalBounds (const Point &point) const
 Returns true if the provided point is within the set physical boundaries.
 
void setLocation (const Point &point)
 Set the current evaluation location.
 
virtual void meshChanged () override
 
void useCache (bool use)
 Enable/disable the cache.
 
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
 
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
 
bool isKokkosObject () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
const std::string & name () const
 
std::string typeAndName () const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
MooseObjectName uniqueName () const
 
const InputParametersparameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () const
 
const TgetParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const TqueryParam (const std::string &name) const
 
const TgetRenamedParam (const std::string &old_name, const std::string &new_name) const
 
T getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &name) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (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
 
std::string messagePrefix (const bool hit_prefix=true) const
 
std::string errorPrefix (const std::string &) const
 
void mooseError (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecatedNoTrace (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
void callMooseError (std::string msg, const bool with_prefix, const hit::Node *node=nullptr, const bool show_trace=true) 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 TgetUserObject (const std::string &param_name, bool is_dependency=true) const
 
const TgetUserObjectByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const UserObjectBasegetUserObjectBase (const std::string &param_name, bool is_dependency=true) const
 
const UserObjectBasegetUserObjectBaseByName (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
 
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.
 
const std::vector< std::size_t > & getCharacteristics () const
 Get a reference to the characteristics array.
 
const std::vector< Real > & getCoefficients () const
 Get a read-only reference to the vector of coefficients.
 
std::vector< Real > & getCoefficients ()
 Get a writeable reference to the vector of coefficients.
 
std::string getCoefficientsTable () const
 Get a formatted string of the coefficients.
 
std::size_t getSize () const
 Get the size, aka number of coefficients.
 
bool isCompatibleWith (const MutableCoefficientsInterface &other) const
 Checks to see if another instance is compatible.
 
bool isSizeEnforced () const
 Returns true if the size of the coefficient array is fixed and enforced.
 
void enforceSize (bool enforce)
 Toggle whether the size of the coefficient array can be changed.
 
void importCoefficients (const MutableCoefficientsInterface &other)
 Import the coefficients from another instance.
 
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.
 
void setCharacteristics (const std::vector< std::size_t > &new_characteristics)
 Sets the characteristics array.
 
void setCoefficients (const std::vector< Real > &new_coefficients)
 Set the coefficients using a copy operation.
 
void setCoefficients (std::vector< Real > &&dropin_coefficients)
 Set the coefficients using a move operation (only works with temp objects)
 

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.
 
static void callMooseError (MooseApp *const app, const InputParameters &params, std::string msg, const bool with_prefix, const hit::Node *node, const bool show_trace=true)
 

Public Attributes

 usingCombinedWarningSolutionWarnings
 
const ConsoleStream _console
 

Static Public Attributes

static const std::string type_param
 
static const std::string name_param
 
static const std::string unique_name_param
 
static const std::string app_param
 
static const std::string moose_base_param
 
static const std::string kokkos_object_param
 

Protected Member Functions

virtual void coefficientsChanged () override
 Called when the coefficients have been changed.
 
void invalidateCache ()
 Called by derived classes to invalidate the cache, perhaps due to a state change.
 
void flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const
 
InvalidSolutionID registerInvalidSolutionInternal (const std::string &message, const bool warning) const
 
virtual void addPostprocessorDependencyHelper (const PostprocessorName &) const
 
virtual void addUserObjectDependencyHelper (const UserObjectBase &) const
 
TdeclareRestartableData (const std::string &data_name, Args &&... args)
 
ManagedValue< TdeclareManagedRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
const TgetRestartableData (const std::string &data_name) const
 
TdeclareRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
TdeclareRecoverableData (const std::string &data_name, Args &&... args)
 
TdeclareRestartableDataWithObjectName (const std::string &data_name, const std::string &object_name, Args &&... args)
 
TdeclareRestartableDataWithObjectNameWithContext (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
 
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
 
Moose::Kokkos::Function getKokkosFunction (const std::string &name) const
 
const TgetKokkosFunction (const std::string &name) const
 
Moose::Kokkos::Function getKokkosFunctionByName (const FunctionName &name) const
 
const TgetKokkosFunctionByName (const FunctionName &name) const
 
bool hasKokkosFunction (const std::string &param_name) const
 
bool hasKokkosFunctionByName (const FunctionName &name) const
 

Protected Attributes

const std::vector< std::size_t > _orders
 The vector holding the orders of each single series.
 
const std::vector< Real > _physical_bounds
 The physical bounds of the function series.
 
std::unique_ptr< CompositeSeriesBasisInterface_series_type
 Stores a pointer to the functional series object.
 
const MooseEnum_series_type_name
 Stores the name of the current functional series type.
 
const MooseEnum_x
 Stores the name of the single function series to use in the x direction.
 
const MooseEnum_y
 Stores the name of the single function series to use in the y direction.
 
const MooseEnum_z
 Stores the name of the single function series to use in the z direction.
 
const MooseEnum_disc
 Stores the name of the single function series to use for a unit disc.
 
const MooseEnum_expansion_type
 The normalization type for expansion.
 
const MooseEnum_generation_type
 The normalization type for generation.
 
const bool & _enabled
 
MooseApp_app
 
Factory_factory
 
ActionFactory_action_factory
 
const std::string & _type
 
const std::string & _name
 
const InputParameters_pars
 
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.
 
std::vector< Real > & _coefficients
 The coefficient array.
 
bool _enforce_size
 Boolean that locks or allows resizing of the coefficient array.
 
const bool _print_coefficients
 Boolean to flag if the coefficients should be printed when set.
 

Private Types

typedef Moose::ElemArg ElemArg
 
typedef Moose::ElemQpArg ElemQpArg
 
typedef Moose::ElemSideQpArg ElemSideQpArg
 
typedef Moose::FaceArg FaceArg
 
typedef Moose::ElemPointArg ElemPointArg
 
typedef Moose::NodeArg NodeArg
 

Private Member Functions

ValueType evaluateHelper (const R &r, const Moose::StateArg &state) const
 
ValueType evaluate (const ElemArg &elem, const Moose::StateArg &state) const override final
 
ValueType evaluate (const FaceArg &face, const Moose::StateArg &state) const override final
 
ValueType evaluate (const ElemQpArg &qp, const Moose::StateArg &state) const override final
 
ValueType evaluate (const ElemSideQpArg &elem_side_qp, const Moose::StateArg &state) const override final
 
ValueType evaluate (const ElemPointArg &elem_point, const Moose::StateArg &state) const override final
 
ValueType evaluate (const NodeArg &node, const Moose::StateArg &state) const override final
 
GradientType evaluateGradientHelper (const R &r, const Moose::StateArg &state) const
 
GradientType evaluateGradient (const ElemArg &elem, const Moose::StateArg &state) const override final
 
GradientType evaluateGradient (const FaceArg &face, const Moose::StateArg &state) const override final
 
GradientType evaluateGradient (const ElemQpArg &qp, const Moose::StateArg &state) const override final
 
GradientType evaluateGradient (const ElemSideQpArg &elem_side_qp, const Moose::StateArg &state) const override final
 
GradientType evaluateGradient (const ElemPointArg &elem_point, const Moose::StateArg &state) const override final
 
GradientType evaluateGradient (const NodeArg &node, const Moose::StateArg &state) const override final
 
DotType evaluateDotHelper (const R &r, const Moose::StateArg &state) const
 
DotType evaluateDot (const ElemArg &elem, const Moose::StateArg &state) const override final
 
DotType evaluateDot (const FaceArg &face, const Moose::StateArg &state) const override final
 
DotType evaluateDot (const ElemQpArg &qp, const Moose::StateArg &state) const override final
 
DotType evaluateDot (const ElemSideQpArg &elem_side_qp, const Moose::StateArg &state) const override final
 
DotType evaluateDot (const ElemPointArg &elem_point, const Moose::StateArg &state) const override final
 
DotType evaluateDot (const NodeArg &node, const Moose::StateArg &state) const override final
 
const PostprocessorName & getPostprocessorNameInternal (const std::string &param_name, const unsigned int index, const bool allow_default_value=true) const
 
bool isDefaultPostprocessorValueByName (const PostprocessorName &name) const
 
PostprocessorValue getDefaultPostprocessorValueByName (const PostprocessorName &name) const
 
void checkParam (const std::string &param_name, const unsigned int index=std::numeric_limits< unsigned int >::max()) const
 
bool postprocessorsAdded () const
 
const UserObjectBasegetUserObjectFromFEProblem (const UserObjectName &object_name, const THREAD_ID tid=0) const
 
const TcastUserObject (const UserObjectBase &uo_base, const std::string &param_name="") const
 
void mooseObjectError (const std::string &param_name, std::stringstream &oss) const
 
const std::string & userObjectType (const UserObjectBase &uo) const
 
const std::string & userObjectName (const UserObjectBase &uo) const
 
RestartableDataValueregisterRestartableDataOnApp (std::unique_ptr< RestartableDataValue > data, THREAD_ID tid) const
 
void registerRestartableNameWithFilterOnApp (const std::string &name, Moose::RESTARTABLE_FILTER filter)
 
RestartableData< T > & declareRestartableDataHelper (const std::string &data_name, void *context, Args &&... args) const
 
const VariableValuegetDefaultValue (const std::string &var_name) const
 
const ADVariableValuegetADDefaultValue (const std::string &var_name) const
 
void checkVar (const std::string &var_name) const
 
void validateExecutionerType (const std::string &name, const std::string &fn_name) const
 
void clearCacheData ()
 
ValueType queryQpCache (unsigned int qp, const libMesh::QBase &qrule, std::vector< std::pair< bool, Real > > &qp_cache_data, const SpaceArg &space, const StateArg &state) const
 
ValueType queryFVArgCache (std::map< SpaceArg, ValueType > &cache_data, const SpaceArg &space) const
 
const PostprocessorValuegetPostprocessorValueInternal (const std::string &param_name, unsigned int index, std::size_t t_index) const
 
const PostprocessorValuegetPostprocessorValueInternal (const std::string &param_name, unsigned int index, std::size_t t_index) const
 
const PostprocessorValuegetPostprocessorValueByNameInternal (const PostprocessorName &name, std::size_t t_index) const
 
const PostprocessorValuegetPostprocessorValueByNameInternal (const PostprocessorName &name, std::size_t t_index) const
 
const Moose::FunctionBasegetKokkosFunctionByNameHelper (const FunctionName &name) const
 

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.
 
static const hit::Node * getHitNode (const InputParameters &params)
 
static std::string messagePrefix (const InputParameters &params, const bool hit_prefix)
 

Private Attributes

std::unordered_map< hashing::HashValue, Real > _cache
 Cached evaluations for each point.
 
Real _current_time
 Stores the time evaluation of the cache.
 
bool _enable_cache
 Flag for whether to cache values.
 
bool _respect_time
 Flag for whether changes in time invalidate the cache.
 
const ParallelParamObject_parent
 
const MooseBase_si_moose_base
 
const FEProblemBase_si_problem
 
ExecFlagEnum _empty_execute_enum
 
const std::string _ti_name
 
const MooseObject_ppi_moose_object
 
const InputParameters_ppi_params
 
const FEProblemBase_ppi_feproblem
 
std::map< PostprocessorName, std::unique_ptr< PostprocessorValue > > _default_values
 
const MooseObject_uoi_moose_object
 
const FEProblemBase_uoi_feproblem
 
const THREAD_ID _uoi_tid
 
const RestartableDataMapName _metaname
 
std::string _restartable_name
 
const InputParameters_sc_parameters
 
const std::string & _sc_name
 
const bool _sc_is_implicit
 
std::unordered_map< std::string, std::vector< MooseVariableScalar * > > _coupled_scalar_vars
 
std::unordered_map< std::string, std::unique_ptr< VariableValue > > _default_value
 
std::unordered_map< std::string, std::unique_ptr< ADVariableValue > > _dual_default_value
 
std::vector< MooseVariableScalar * > _coupled_moose_scalar_vars
 
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _sc_coupled_vars
 
std::set< TagID_sc_coupleable_vector_tags
 
std::set< TagID_sc_coupleable_matrix_tags
 
std::set< ExecFlagType_clearance_schedule
 
bool _always_evaluate
 
dof_id_type _current_qp_map_key
 
std::vector< std::pair< bool, ValueType > > * _current_qp_map_value
 
std::unordered_map< dof_id_type, std::vector< std::pair< bool, ValueType > > > _qp_to_value
 
dof_id_type _current_side_qp_map_key
 
std::vector< std::vector< std::pair< bool, ValueType > > > * _current_side_qp_map_value
 
std::unordered_map< dof_id_type, std::vector< std::vector< std::pair< bool, ValueType > > > > _side_qp_to_value
 
std::map< ElemArg, ValueType_elem_arg_to_value
 
std::map< FaceArg, ValueType_face_arg_to_value
 
std::map< NodeArg, ValueType_node_arg_to_value
 
MooseFunctorName _functor_name
 
const MooseObject_fni_object
 
const InputParameters_fni_params
 
FEProblemBase_fni_feproblem
 
const THREAD_ID _fni_tid
 

Friends

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

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}
const std::vector< std::size_t > _orders
The vector holding the orders of each single series.
std::size_t getNumberOfTerms() const
Returns the number of terms (coefficients) in the underlying function series.
const MooseEnum & _disc
Stores the name of the single function series to use for a unit disc.
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 & _z
Stores the name of the single function series to use in the z direction.
const MooseEnum & _y
Stores the name of the single function series to use in the y direction.
const MooseEnum & _generation_type
The normalization type for generation.
const MooseEnum & _expansion_type
The normalization type for expansion.
const MooseEnum & _x
Stores the name of the single function series to use in the x direction.
const std::vector< Real > _physical_bounds
The physical bounds of the function series.
const MooseEnum & _series_type_name
Stores the name of the current functional series type.
std::unique_ptr< CompositeSeriesBasisInterface > _series_type
Stores a pointer to the functional series object.
static MooseEnum _domain_options
An enumeration of the domains available to each functional series.
const InputParameters & parameters() const
const std::string & name() const
void mooseError(Args &&... args) const
const T & getParam(const std::string &name) const
bool isParamValid(const std::string &name) const
Interface for a type of functions using coefficients that may be changed before or after a solve.
void setCharacteristics(const std::vector< std::size_t > &new_characteristics)
Sets the characteristics array.
void enforceSize(bool enforce)
Toggle whether the size of the coefficient array can be changed.
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.

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.

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}
This class uses implementations of CompositeSeriesBasisInterface to generate a function based on conv...

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

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

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

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

◆ 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.
bool isInPhysicalBounds(const Point &point) const
Returns true if the provided point is within the set physical boundaries.
Real expand()
Expand the function series at the current location and with the current coefficients.

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

263{
264 return expand(_coefficients);
265}
std::vector< Real > & _coefficients
The coefficient array.

Referenced by evaluateValue(), and expand().

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

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}

◆ getCoefficients() [2/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}

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

227{
228 return _series_type->getAllExpansion();
229}

Referenced by expand().

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

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

199{
200 return _series_type->getNumberOfTerms();
201}

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

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

205{
206 return _orders;
207}

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

◆ getSize()

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

Get the size, aka number of coefficients.

Definition at line 80 of file MutableCoefficientsInterface.C.

81{
82 return _coefficients.size();
83}

Referenced by MutableCoefficientsInterface::isCompatibleWith().

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

◆ importCoefficients()

void MutableCoefficientsInterface::importCoefficients ( const MutableCoefficientsInterface other)
inherited

Import the coefficients from another instance.

Definition at line 117 of file MutableCoefficientsInterface.C.

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.
const ConsoleStream & _console
MooseObject instance of this to provide access to _console
bool isCompatibleWith(const MutableCoefficientsInterface &other) const
Checks to see if another instance is compatible.

Referenced by MultiAppFXTransfer::execute().

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

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

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

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

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}
std::size_t getSize() const
Get the size, aka number of coefficients.

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

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

238{
239 return _series_type->isInPhysicalBounds(point);
240}

Referenced by evaluateValue().

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

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

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

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

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}

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

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

151{
152 _characteristics = new_characteristics;
153}

Referenced by FunctionSeries().

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

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}

Referenced by MutableCoefficientsFunctionInterface::MutableCoefficientsFunctionInterface().

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

◆ setLocation()

void FunctionSeries::setLocation ( const Point &  point)

Set the current evaluation location.

Definition at line 243 of file FunctionSeries.C.

244{
245 _series_type->setLocation(point);
246}

Referenced by evaluateValue().

◆ useCache()

void MemoizedFunctionInterface::useCache ( bool  use)
inherited

Enable/disable the cache.

Definition at line 80 of file MemoizedFunctionInterface.C.

81{
82 _enable_cache = use;
83
84 if (!_enable_cache)
86}
bool _enable_cache
Flag for whether to cache values.

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

◆ 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 expansion_type
MooseEnum single_series_types_2D
MooseEnum generation_type
MooseEnum single_series_types_1D
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)

◆ value() [1/10]

virtual ADReal Function::value ( const ADReal t,
const ADPoint p 
) const
virtualinherited

Reimplemented from Function.

◆ value() [2/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}

◆ value() [3/10]

ChainedReal Function::value ( const ChainedReal t) const
inherited

◆ value() [4/10]

ChainedReal Function::value ( const ChainedReal t) const
inherited

◆ value() [5/10]

auto Function::value ( const U &  t) const
inherited

◆ value() [6/10]

auto Function::value ( const U &  t) const
inherited

◆ value() [7/10]

auto Function::value ( const U &  t,
const U &  x,
const U &  y = 0,
const U &  z = 0 
) const
inherited

◆ value() [8/10]

auto Function::value ( const U &  t,
const U &  x,
const U &  y = 0,
const U &  z = 0 
) const
inherited

◆ value() [9/10]

virtual Real Function::value ( Real  t,
const Point &  p 
) const
virtualinherited

Reimplemented from Function.

◆ value() [10/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}
Implementation of Function that memoizes (caches) former evaluations in an unordered map using a hash...
bool _respect_time
Flag for whether changes in time invalidate the cache.
virtual Real evaluateValue(Real time, const Point &point)=0
Used in derived classes, equivalent to Function::value()
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

Friends And Related Symbol 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 276 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}

Member Data Documentation

◆ _cache

std::unordered_map<hashing::HashValue, Real> MemoizedFunctionInterface::_cache
mutableprivateinherited

Cached evaluations for each point.

Definition at line 58 of file MemoizedFunctionInterface.h.

Referenced by MemoizedFunctionInterface::invalidateCache(), and MemoizedFunctionInterface::value().

◆ _characteristics

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

◆ _coefficients

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

◆ _current_time

Real MemoizedFunctionInterface::_current_time
mutableprivateinherited

Stores the time evaluation of the cache.

Definition at line 61 of file MemoizedFunctionInterface.h.

Referenced by MemoizedFunctionInterface::value().

◆ _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().

◆ _enable_cache

bool MemoizedFunctionInterface::_enable_cache
privateinherited

Flag for whether to cache values.

Definition at line 64 of file MemoizedFunctionInterface.h.

Referenced by MemoizedFunctionInterface::useCache(), and MemoizedFunctionInterface::value().

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

◆ _respect_time

bool MemoizedFunctionInterface::_respect_time
privateinherited

Flag for whether changes in time invalidate the cache.

Definition at line 67 of file MemoizedFunctionInterface.h.

Referenced by MemoizedFunctionInterface::value().

◆ _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(), 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: