This class uses implementations of CompositeSeriesBasisInterface to generate a function based on convolved function series. More...
#include <FunctionSeries.h>
Public Member Functions | |
FunctionSeries (const InputParameters ¶meters) | |
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 |
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 FunctionSeries & | checkAndConvertFunction (const Function &function, const std::string &typeName, const std::string &objectName) |
Static function to cast a Function to SeriesFunction. More... | |
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... | |
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... | |
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... | |
Private Attributes | |
std::unordered_map< hashing::HashValue, Real > | _cache |
Cached evaluations for each point. More... | |
Real | _current_time |
Stores the time evaluation of the cache. More... | |
bool | _enable_cache |
Flag for whether to cache values. More... | |
bool | _respect_time |
Flag for whether changes in time invalidate the cache. More... | |
const ConsoleStream & | _console |
MooseObject instance of this to provide access to _console More... | |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const FunctionSeries &me) |
Returns a tabularized text stream of the currently stored coefficients. More... | |
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 25 of file FunctionSeries.h.
FunctionSeries::FunctionSeries | ( | const InputParameters & | parameters | ) |
Definition at line 75 of file FunctionSeries.C.
|
static |
Static function to cast a Function to SeriesFunction.
Definition at line 175 of file FunctionSeries.C.
Referenced by FunctionSeriesToAux::FunctionSeriesToAux(), FXFluxBC::FXFluxBC(), FXValueBC::FXValueBC(), and FXValuePenaltyBC::FXValuePenaltyBC().
|
overrideprotectedvirtualinherited |
Called when the coefficients have been changed.
Reimplemented from MutableCoefficientsInterface.
Definition at line 39 of file MutableCoefficientsFunctionInterface.C.
|
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 290 of file FunctionSeries.C.
|
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().
|
overridevirtual |
Used in derived classes, equivalent to Function::value()
Implements MemoizedFunctionInterface.
Definition at line 250 of file FunctionSeries.C.
Real FunctionSeries::expand | ( | ) |
Expand the function series at the current location and with the current coefficients.
Definition at line 263 of file FunctionSeries.C.
Referenced by evaluateValue().
Real FunctionSeries::expand | ( | const std::vector< Real > & | coefficients | ) |
Expand the function using the provided coefficients at the current location.
Definition at line 269 of file FunctionSeries.C.
|
inherited |
Get a reference to the characteristics array.
Definition at line 51 of file MutableCoefficientsInterface.C.
|
inherited |
Get a writeable reference to the vector of coefficients.
Definition at line 63 of file MutableCoefficientsInterface.C.
|
inherited |
Get a read-only reference to the vector of coefficients.
Definition at line 57 of file MutableCoefficientsInterface.C.
|
inherited |
Get a formatted string of the coefficients.
Definition at line 69 of file MutableCoefficientsInterface.C.
const std::vector< Real > & FunctionSeries::getExpansion | ( | ) |
Returns a vector of the expansion-evaluated functional series at the current location.
Definition at line 227 of file FunctionSeries.C.
Referenced by expand().
const std::vector< Real > & FunctionSeries::getGeneration | ( | ) |
Returns a vector of the generation-evaluated functional series at the current location.
Definition at line 216 of file FunctionSeries.C.
std::size_t FunctionSeries::getNumberOfTerms | ( | ) | const |
Returns the number of terms (coefficients) in the underlying function series.
Definition at line 199 of file FunctionSeries.C.
Referenced by FunctionSeries(), FXIntegralBaseUserObject< ElementIntegralVariableUserObject >::FXIntegralBaseUserObject(), and operator<<().
const std::vector< size_t > & FunctionSeries::getOrders | ( | ) | const |
Returns a vector of the functional orders in the underlying functional series.
Definition at line 205 of file FunctionSeries.C.
Referenced by FXIntegralBaseUserObject< ElementIntegralVariableUserObject >::FXIntegralBaseUserObject().
|
inherited |
Get the size, aka number of coefficients.
Definition at line 80 of file MutableCoefficientsInterface.C.
Referenced by MutableCoefficientsInterface::isCompatibleWith(), and operator<<().
Real FunctionSeries::getStandardizedFunctionVolume | ( | ) | const |
Returns the volume of evaluation in the functional series standardized space.
Definition at line 193 of file FunctionSeries.C.
|
inherited |
Import the coefficients from another instance.
Definition at line 117 of file MutableCoefficientsInterface.C.
Referenced by MultiAppFXTransfer::execute().
|
protectedinherited |
Called by derived classes to invalidate the cache, perhaps due to a state change.
Definition at line 84 of file MemoizedFunctionInterface.C.
Referenced by MutableCoefficientsFunctionInterface::coefficientsChanged(), MemoizedFunctionInterface::meshChanged(), MemoizedFunctionInterface::useCache(), and MemoizedFunctionInterface::value().
|
inherited |
Checks to see if another instance is compatible.
Definition at line 86 of file MutableCoefficientsInterface.C.
Referenced by MultiAppFXTransfer::execute(), and MutableCoefficientsInterface::importCoefficients().
bool FunctionSeries::isInPhysicalBounds | ( | const Point & | point | ) | const |
Returns true if the provided point is within the set physical boundaries.
Definition at line 238 of file FunctionSeries.C.
Referenced by evaluateValue().
|
inherited |
Returns true if the size of the coefficient array is fixed and enforced.
Definition at line 105 of file MutableCoefficientsInterface.C.
|
overridevirtualinherited |
Definition at line 40 of file MemoizedFunctionInterface.C.
|
inherited |
Get the value of the coefficient at the corresponding index.
Definition at line 45 of file MutableCoefficientsInterface.C.
|
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().
|
inherited |
Sets the characteristics array.
Definition at line 149 of file MutableCoefficientsInterface.C.
Referenced by FunctionSeries().
|
inherited |
Set the coefficients using a copy operation.
Definition at line 156 of file MutableCoefficientsInterface.C.
Referenced by MutableCoefficientsFunctionInterface::MutableCoefficientsFunctionInterface().
|
inherited |
Set the coefficients using a move operation (only works with temp objects)
Definition at line 171 of file MutableCoefficientsInterface.C.
void FunctionSeries::setLocation | ( | const Point & | point | ) |
Set the current evaluation location.
Definition at line 244 of file FunctionSeries.C.
Referenced by evaluateValue().
|
inherited |
Enable/disable the cache.
Definition at line 75 of file MemoizedFunctionInterface.C.
Referenced by FXFluxBC::FXFluxBC(), FXValueBC::FXValueBC(), and FXValuePenaltyBC::FXValuePenaltyBC().
|
finalvirtualinherited |
Definition at line 47 of file MemoizedFunctionInterface.C.
|
friend |
Returns a tabularized text stream of the currently stored coefficients.
Definition at line 278 of file FunctionSeries.C.
|
mutableprivateinherited |
Cached evaluations for each point.
Definition at line 59 of file MemoizedFunctionInterface.h.
Referenced by MemoizedFunctionInterface::invalidateCache(), and MemoizedFunctionInterface::value().
|
protectedinherited |
An array of integer characteristics that can be used to check compatibility.
Definition at line 107 of file MutableCoefficientsInterface.h.
Referenced by FXIntegralBaseUserObject< ElementIntegralVariableUserObject >::FXIntegralBaseUserObject(), MutableCoefficientsInterface::getCharacteristics(), MutableCoefficientsInterface::isCompatibleWith(), and MutableCoefficientsInterface::setCharacteristics().
|
protectedinherited |
The coefficient array.
Definition at line 113 of file MutableCoefficientsInterface.h.
Referenced by expand(), FXIntegralBaseUserObject< ElementIntegralVariableUserObject >::FXIntegralBaseUserObject(), MutableCoefficientsInterface::getCoefficients(), MutableCoefficientsInterface::getSize(), MutableCoefficientsInterface::importCoefficients(), operator<<(), MutableCoefficientsInterface::operator[](), MutableCoefficientsInterface::resize(), and MutableCoefficientsInterface::setCoefficients().
|
privateinherited |
MooseObject instance of this
to provide access to _console
Definition at line 123 of file MutableCoefficientsInterface.h.
Referenced by MutableCoefficientsInterface::importCoefficients(), MutableCoefficientsInterface::resize(), and MutableCoefficientsInterface::setCoefficients().
|
mutableprivateinherited |
Stores the time evaluation of the cache.
Definition at line 62 of file MemoizedFunctionInterface.h.
Referenced by MemoizedFunctionInterface::value().
|
protected |
Stores the name of the single function series to use for a unit disc.
Definition at line 114 of file FunctionSeries.h.
Referenced by FunctionSeries().
|
privateinherited |
Flag for whether to cache values.
Definition at line 65 of file MemoizedFunctionInterface.h.
Referenced by MemoizedFunctionInterface::useCache(), and MemoizedFunctionInterface::value().
|
protectedinherited |
Boolean that locks or allows resizing of the coefficient array.
Definition at line 116 of file MutableCoefficientsInterface.h.
Referenced by MutableCoefficientsInterface::enforceSize(), MutableCoefficientsInterface::isCompatibleWith(), MutableCoefficientsInterface::isSizeEnforced(), MutableCoefficientsInterface::resize(), and MutableCoefficientsInterface::setCoefficients().
|
protected |
The normalization type for expansion.
Definition at line 116 of file FunctionSeries.h.
Referenced by FunctionSeries().
|
protected |
The normalization type for generation.
Definition at line 118 of file FunctionSeries.h.
Referenced by FunctionSeries().
|
protected |
The vector holding the orders of each single series.
Definition at line 92 of file FunctionSeries.h.
Referenced by FunctionSeries(), and getOrders().
|
protected |
The physical bounds of the function series.
Definition at line 95 of file FunctionSeries.h.
Referenced by FunctionSeries().
|
protectedinherited |
Boolean to flag if the coefficients should be printed when set.
Definition at line 119 of file MutableCoefficientsInterface.h.
Referenced by MutableCoefficientsInterface::importCoefficients(), MutableCoefficientsInterface::resize(), and MutableCoefficientsInterface::setCoefficients().
|
privateinherited |
Flag for whether changes in time invalidate the cache.
Definition at line 68 of file MemoizedFunctionInterface.h.
Referenced by MemoizedFunctionInterface::value().
|
protected |
Stores a pointer to the functional series object.
Definition at line 98 of file FunctionSeries.h.
Referenced by FunctionSeries(), getExpansion(), getGeneration(), getNumberOfTerms(), getStandardizedFunctionVolume(), isInPhysicalBounds(), operator<<(), and setLocation().
|
protected |
Stores the name of the current functional series type.
Definition at line 101 of file FunctionSeries.h.
Referenced by FunctionSeries().
|
protected |
Stores the name of the single function series to use in the x direction.
Definition at line 108 of file FunctionSeries.h.
Referenced by FunctionSeries().
|
protected |
Stores the name of the single function series to use in the y direction.
Definition at line 110 of file FunctionSeries.h.
Referenced by FunctionSeries().
|
protected |
Stores the name of the single function series to use in the z direction.
Definition at line 112 of file FunctionSeries.h.
Referenced by FunctionSeries().