www.mooseframework.org
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | 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 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
 
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 FunctionSeriescheckAndConvertFunction (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...
 

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 25 of file FunctionSeries.h.

Constructor & Destructor Documentation

◆ FunctionSeries()

FunctionSeries::FunctionSeries ( const InputParameters &  parameters)

Definition at line 75 of file FunctionSeries.C.

76  : MutableCoefficientsFunctionInterface(this, parameters),
77  _orders(convertOrders(getParam<std::vector<unsigned int>>("orders"))),
78  _physical_bounds(getParam<std::vector<Real>>("physical_bounds")),
79  _series_type_name(getParam<MooseEnum>("series_type")),
80  _x(getParam<MooseEnum>("x")),
81  _y(getParam<MooseEnum>("y")),
82  _z(getParam<MooseEnum>("z")),
83  _disc(getParam<MooseEnum>("disc")),
84  _expansion_type(getParam<MooseEnum>("expansion_type")),
85  _generation_type(getParam<MooseEnum>("generation_type"))
86 {
87  std::vector<MooseEnum> domains;
88  std::vector<MooseEnum> types;
89 
90  if (_series_type_name == "Cartesian")
91  {
92  /*
93  * For Cartesian series, at least one of 'x', 'y', and 'z' must be specified.
94  *
95  * The individual series are always stored in x, y, z order (independent of the order in which
96  * they appear in the input file). Hence, the 'orders' and 'physical_bounds' vectors must always
97  * be specified in x, y, z order.
98  */
99  if (isParamValid("x"))
100  {
101  domains.push_back(FunctionalBasisInterface::_domain_options = "x");
102  types.push_back(_x);
103  }
104  if (isParamValid("y"))
105  {
106  domains.push_back(FunctionalBasisInterface::_domain_options = "y");
107  types.push_back(_y);
108  }
109  if (isParamValid("z"))
110  {
111  domains.push_back(FunctionalBasisInterface::_domain_options = "z");
112  types.push_back(_z);
113  }
114  if (types.size() == 0)
115  mooseError("Must specify one of 'x', 'y', or 'z' for 'Cartesian' series!");
116  _series_type = libmesh_make_unique<Cartesian>(
117  domains, _orders, types, name(), _expansion_type, _generation_type);
118  }
119  else if (_series_type_name == "CylindricalDuo")
120  {
121  /*
122  * CylindricalDuo represents a disc-axial expansion, where the disc is described by a single
123  * series, such as Zernike (as opposed to a series individually representing r and a second
124  * series independently representing theta. For CylindricalDuo series, the series are always
125  * stored in the axial, planar order, independent of which order the series appear in the input
126  * file. Therefore, the _orders and _physical_bounds vectors must always appear in axial, planar
127  * order. The first entry in _domains is interpreted as the axial direction, and the following
128  * two as the planar.
129  */
130  if (isParamValid("x"))
131  {
135  types.push_back(_x);
136  }
137  if (isParamValid("y"))
138  {
142  types.push_back(_y);
143  }
144  if (isParamValid("z"))
145  {
149  types.push_back(_z);
150  }
151 
152  if (types.size() == 0)
153  mooseError("Must specify one of 'x', 'y', or 'z' for 'CylindricalDuo' series!");
154 
155  if (types.size() > 1)
156  mooseError("Cannot specify more than one of 'x', 'y', or 'z' for 'CylindricalDuo' series!");
157 
158  types.push_back(_disc);
159  _series_type = libmesh_make_unique<CylindricalDuo>(
160  domains, _orders, types, name(), _expansion_type, _generation_type);
161  }
162  else
163  mooseError("Unknown functional series type \"", _series_type_name, "\"");
164 
165  // Set the physical bounds of each of the single series if defined
166  if (isParamValid("physical_bounds"))
167  _series_type->setPhysicalBounds(_physical_bounds);
168 
169  // Resize the coefficient array as needed
170  enforceSize(false), resize(getNumberOfTerms(), 0.0), enforceSize(true);
172 }

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 175 of file FunctionSeries.C.

178 {
179  const FunctionSeries * test = dynamic_cast<const FunctionSeries *>(&function);
180  if (!test)
181  ::mooseError("In ",
182  typeName,
183  "-type object \"",
184  objectName,
185  "\": the named Function \"",
186  function.name(),
187  "\" must be a FunctionSeries-type object.");
188 
189  return *const_cast<FunctionSeries *>(test);
190 }

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 39 of file MutableCoefficientsFunctionInterface.C.

40 {
41  // The coefficients have changed, which invalidates the cache
43 }

◆ 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 290 of file FunctionSeries.C.

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

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

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 250 of file FunctionSeries.C.

251 {
252  // Check that the point is within the physical bounds of the series
253  if (!isInPhysicalBounds(point))
254  return 0.0;
255 
256  // Set the location at which to evaluate the series
257  setLocation(point);
258 
259  return expand();
260 }

◆ expand() [1/2]

Real FunctionSeries::expand ( )

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

Definition at line 263 of file FunctionSeries.C.

264 {
265  return expand(_coefficients);
266 }

Referenced by evaluateValue().

◆ 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 269 of file FunctionSeries.C.

270 {
271  // Evaluate all of the terms in the series
272  const std::vector<Real> & terms = getExpansion();
273 
274  return std::inner_product(terms.begin(), terms.end(), coefficients.begin(), 0.0);
275 }

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

◆ 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 227 of file FunctionSeries.C.

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

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 216 of file FunctionSeries.C.

217 {
218  return _series_type->getAllGeneration();
219 }

◆ getNumberOfTerms()

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.

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

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

◆ getOrders()

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.

206 {
207  return _orders;
208 }

Referenced by FXIntegralBaseUserObject< ElementIntegralVariableUserObject >::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(), and operator<<().

◆ getStandardizedFunctionVolume()

Real FunctionSeries::getStandardizedFunctionVolume ( ) const

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

Definition at line 193 of file FunctionSeries.C.

194 {
195  return _series_type->getStandardizedFunctionVolume();
196 }

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

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 84 of file MemoizedFunctionInterface.C.

85 {
86  _cache.clear();
87 }

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 }

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 238 of file FunctionSeries.C.

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

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

Definition at line 40 of file MemoizedFunctionInterface.C.

41 {
42  // The mesh has changed, which invalidates the cache
44 }

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

◆ 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 244 of file FunctionSeries.C.

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

Referenced by evaluateValue().

◆ useCache()

void MemoizedFunctionInterface::useCache ( bool  use)
inherited

Enable/disable the cache.

Definition at line 75 of file MemoizedFunctionInterface.C.

76 {
77  _enable_cache = use;
78 
79  if (!_enable_cache)
81 }

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

◆ value()

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

Definition at line 47 of file MemoizedFunctionInterface.C.

48 {
49  MemoizedFunctionInterface * ptr = const_cast<MemoizedFunctionInterface *>(this);
50 
51  if (_enable_cache)
52  {
53  // Start the cache over if we are at a new time step
54  if (_respect_time && time != _current_time)
55  {
56  _current_time = time;
57  ptr->invalidateCache();
58  }
59 
60  // Try to insert a new value into the cache
61  auto result = _cache.insert({hashing::hashCombine(time, point), 0.0});
62 
63  // Evaluate and apply if the insertion worked, i.e. the element didn't exist
64  if (result.second)
65  result.first->second = ptr->evaluateValue(time, point);
66 
67  // Return the cached value
68  return result.first->second;
69  }
70 
71  return ptr->evaluateValue(time, point);
72 }

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 278 of file FunctionSeries.C.

279 {
280  stream << "\n\n"
281  << "FunctionSeries: " << me.name() << "\n"
282  << " Terms: " << me.getNumberOfTerms() << "\n";
283  me._series_type->formatCoefficients(stream, me._coefficients);
284  stream << "\n\n";
285 
286  return stream;
287 }

Member Data Documentation

◆ _cache

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

Cached evaluations for each point.

Definition at line 59 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

◆ _console

const ConsoleStream& MutableCoefficientsInterface::_console
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().

◆ _current_time

Real MemoizedFunctionInterface::_current_time
mutableprivateinherited

Stores the time evaluation of the cache.

Definition at line 62 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 114 of file FunctionSeries.h.

Referenced by FunctionSeries().

◆ _enable_cache

bool MemoizedFunctionInterface::_enable_cache
privateinherited

Flag for whether to cache values.

Definition at line 65 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 116 of file FunctionSeries.h.

Referenced by FunctionSeries().

◆ _generation_type

const MooseEnum& FunctionSeries::_generation_type
protected

The normalization type for generation.

Definition at line 118 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 92 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 95 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 119 of file MutableCoefficientsInterface.h.

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

◆ _respect_time

bool MemoizedFunctionInterface::_respect_time
privateinherited

Flag for whether changes in time invalidate the cache.

Definition at line 68 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 98 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 101 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 108 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 110 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 112 of file FunctionSeries.h.

Referenced by FunctionSeries().


The documentation for this class was generated from the following files:
MutableCoefficientsInterface::_print_coefficients
const bool _print_coefficients
Boolean to flag if the coefficients should be printed when set.
Definition: MutableCoefficientsInterface.h:119
FunctionSeries::_disc
const MooseEnum & _disc
Stores the name of the single function series to use for a unit disc.
Definition: FunctionSeries.h:114
MutableCoefficientsInterface::setCharacteristics
void setCharacteristics(const std::vector< std::size_t > &new_characteristics)
Sets the characteristics array.
Definition: MutableCoefficientsInterface.C:149
FunctionalBasisInterface::_domain_options
static MooseEnum _domain_options
An enumeration of the domains available to each functional series.
Definition: FunctionalBasisInterface.h:115
MemoizedFunctionInterface::_respect_time
bool _respect_time
Flag for whether changes in time invalidate the cache.
Definition: MemoizedFunctionInterface.h:68
MutableCoefficientsInterface::resize
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.
Definition: MutableCoefficientsInterface.C:131
MemoizedFunctionInterface
Implementation of Function that memoizes (caches) former evaluations in an unordered map using a hash...
Definition: MemoizedFunctionInterface.h:28
FunctionSeries::expand
Real expand()
Expand the function series at the current location and with the current coefficients.
Definition: FunctionSeries.C:263
hashing::hashCombine
void hashCombine(HashValue &)
Final iteration of the variadic template with no additional arguments.
Definition: Hashing.h:28
FunctionSeries::getNumberOfTerms
std::size_t getNumberOfTerms() const
Returns the number of terms (coefficients) in the underlying function series.
Definition: FunctionSeries.C:199
FunctionSeries::_orders
const std::vector< std::size_t > _orders
The vector holding the orders of each single series.
Definition: FunctionSeries.h:92
MutableCoefficientsFunctionInterface::MutableCoefficientsFunctionInterface
MutableCoefficientsFunctionInterface(const MooseObject *moose_object, const InputParameters &parameters)
Definition: MutableCoefficientsFunctionInterface.C:28
FunctionSeries::_series_type
std::unique_ptr< CompositeSeriesBasisInterface > _series_type
Stores a pointer to the functional series object.
Definition: FunctionSeries.h:98
MutableCoefficientsInterface::_console
const ConsoleStream & _console
MooseObject instance of this to provide access to _console
Definition: MutableCoefficientsInterface.h:123
MemoizedFunctionInterface::_enable_cache
bool _enable_cache
Flag for whether to cache values.
Definition: MemoizedFunctionInterface.h:65
MutableCoefficientsInterface::_coefficients
std::vector< Real > & _coefficients
The coefficient array.
Definition: MutableCoefficientsInterface.h:113
FunctionSeries::isInPhysicalBounds
bool isInPhysicalBounds(const Point &point) const
Returns true if the provided point is within the set physical boundaries.
Definition: FunctionSeries.C:238
FunctionSeries
This class uses implementations of CompositeSeriesBasisInterface to generate a function based on conv...
Definition: FunctionSeries.h:25
MutableCoefficientsInterface::_characteristics
std::vector< std::size_t > & _characteristics
An array of integer characteristics that can be used to check compatibility.
Definition: MutableCoefficientsInterface.h:107
FunctionSeries::_z
const MooseEnum & _z
Stores the name of the single function series to use in the z direction.
Definition: FunctionSeries.h:112
MutableCoefficientsInterface::getSize
std::size_t getSize() const
Get the size, aka number of coefficients.
Definition: MutableCoefficientsInterface.C:80
FunctionSeries::_expansion_type
const MooseEnum & _expansion_type
The normalization type for expansion.
Definition: FunctionSeries.h:116
FunctionSeries::getExpansion
const std::vector< Real > & getExpansion()
Returns a vector of the expansion-evaluated functional series at the current location.
Definition: FunctionSeries.C:227
MemoizedFunctionInterface::invalidateCache
void invalidateCache()
Called by derived classes to invalidate the cache, perhaps due to a state change.
Definition: MemoizedFunctionInterface.C:84
FunctionSeries::convertOrders
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.
Definition: FunctionSeries.C:290
name
const std::string name
Definition: Setup.h:21
MutableCoefficientsInterface::enforceSize
void enforceSize(bool enforce)
Toggle whether the size of the coefficient array can be changed.
Definition: MutableCoefficientsInterface.C:111
FunctionSeries::_physical_bounds
const std::vector< Real > _physical_bounds
The physical bounds of the function series.
Definition: FunctionSeries.h:95
MutableCoefficientsInterface::coefficientsChanged
virtual void coefficientsChanged()
Called when the coefficients have been changed.
Definition: MutableCoefficientsInterface.h:107
FunctionSeries::_x
const MooseEnum & _x
Stores the name of the single function series to use in the x direction.
Definition: FunctionSeries.h:108
MemoizedFunctionInterface::_current_time
Real _current_time
Stores the time evaluation of the cache.
Definition: MemoizedFunctionInterface.h:62
MemoizedFunctionInterface::evaluateValue
virtual Real evaluateValue(Real time, const Point &point)=0
Used in derived classes, equivalent to Function::value()
MutableCoefficientsInterface::isCompatibleWith
bool isCompatibleWith(const MutableCoefficientsInterface &other) const
Checks to see if another instance is compatible.
Definition: MutableCoefficientsInterface.C:86
FunctionSeries::_generation_type
const MooseEnum & _generation_type
The normalization type for generation.
Definition: FunctionSeries.h:118
FunctionSeries::_y
const MooseEnum & _y
Stores the name of the single function series to use in the y direction.
Definition: FunctionSeries.h:110
MutableCoefficientsInterface::_enforce_size
bool _enforce_size
Boolean that locks or allows resizing of the coefficient array.
Definition: MutableCoefficientsInterface.h:116
FunctionSeries::setLocation
void setLocation(const Point &point)
Set the current evaluation location.
Definition: FunctionSeries.C:244
FunctionSeries::_series_type_name
const MooseEnum & _series_type_name
Stores the name of the current functional series type.
Definition: FunctionSeries.h:101
MemoizedFunctionInterface::_cache
std::unordered_map< hashing::HashValue, Real > _cache
Cached evaluations for each point.
Definition: MemoizedFunctionInterface.h:59