Interface for a type of functions using coefficients that may be changed before or after a solve. More...
#include <MutableCoefficientsFunctionInterface.h>
Public Member Functions | |
MutableCoefficientsFunctionInterface (const MooseObject *moose_object, const InputParameters ¶meters) | |
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... | |
Protected Member Functions | |
virtual void | coefficientsChanged () override |
Called when the coefficients have been changed. More... | |
virtual Real | evaluateValue (Real time, const Point &point)=0 |
Used in derived classes, equivalent to Function::value() More... | |
void | invalidateCache () |
Called by derived classes to invalidate the cache, perhaps due to a state change. More... | |
Protected Attributes | |
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... | |
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... | |
Interface for a type of functions using coefficients that may be changed before or after a solve.
Definition at line 25 of file MutableCoefficientsFunctionInterface.h.
MutableCoefficientsFunctionInterface::MutableCoefficientsFunctionInterface | ( | const MooseObject * | moose_object, |
const InputParameters & | parameters | ||
) |
Definition at line 28 of file MutableCoefficientsFunctionInterface.C.
|
overrideprotectedvirtual |
Called when the coefficients have been changed.
Reimplemented from MutableCoefficientsInterface.
Definition at line 39 of file MutableCoefficientsFunctionInterface.C.
|
inherited |
Toggle whether the size of the coefficient array can be changed.
Definition at line 111 of file MutableCoefficientsInterface.C.
Referenced by FunctionSeries::FunctionSeries(), and MutableCoefficientsFunctionInterface().
|
protectedpure virtualinherited |
Used in derived classes, equivalent to Function::value()
Implemented in FunctionSeries.
Referenced by MemoizedFunctionInterface::value().
|
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.
|
inherited |
Get the size, aka number of coefficients.
Definition at line 80 of file MutableCoefficientsInterface.C.
Referenced by MutableCoefficientsInterface::isCompatibleWith(), and operator<<().
|
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 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().
|
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::FunctionSeries().
|
inherited |
Sets the characteristics array.
Definition at line 149 of file MutableCoefficientsInterface.C.
Referenced by FunctionSeries::FunctionSeries().
|
inherited |
Set the coefficients using a copy operation.
Definition at line 156 of file MutableCoefficientsInterface.C.
Referenced by MutableCoefficientsFunctionInterface().
|
inherited |
Set the coefficients using a move operation (only works with temp objects)
Definition at line 171 of file MutableCoefficientsInterface.C.
|
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.
|
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 FunctionSeries::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().
|
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().
|
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().