24 params.
addClassDescription(
"This function uses a convolution of functional series (functional "
25 "expansion or FX) to create a 1D, 2D, or 3D function");
30 MooseEnum series_types(
"Cartesian CylindricalDuo");
35 "series_type", series_types,
"The type of function series to construct.");
42 "The order of each series. These must be "
43 "defined as \"x y z\" for Cartesian, and \"z "
44 "disc\" for CylindricalDuo.");
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");
58 "The series to use for the disc. Its direction is determined by "
59 "orthogonality to the declared direction of the axis.");
61 std::string normalization_types =
"orthonormal sqrt_mu standard";
66 "The normalization used for expansion of the basis functions");
70 "The normalization used for generation of the basis function coefficients");
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")),
83 _expansion_type(getParam<
MooseEnum>(
"expansion_type")),
84 _generation_type(getParam<
MooseEnum>(
"generation_type"))
86 std::vector<MooseEnum> domains;
87 std::vector<MooseEnum> types;
113 if (types.size() == 0)
114 mooseError(
"Must specify one of 'x', 'y', or 'z' for 'Cartesian' series!");
151 if (types.size() == 0)
152 mooseError(
"Must specify one of 'x', 'y', or 'z' for 'CylindricalDuo' series!");
154 if (types.size() > 1)
155 mooseError(
"Cannot specify more than one of 'x', 'y', or 'z' for 'CylindricalDuo' series!");
157 types.push_back(
_disc);
175 const std::string & typeName,
176 const std::string & objectName)
184 "\": the named Function \"",
186 "\" must be a FunctionSeries-type object.");
203const std::vector<size_t> &
214const std::vector<Real> &
225const std::vector<Real> &
273 return std::inner_product(terms.begin(), terms.end(), coefficients.begin(), 0.0);
280 <<
"FunctionSeries: " << me.
name() <<
"\n"
283 stream <<
"\n\n" << std::flush;
288std::vector<std::size_t>
291 return std::vector<std::size_t>(orders.begin(), orders.end());
registerMooseObject("FunctionalExpansionToolsApp", FunctionSeries)
std::ostream & operator<<(std::ostream &stream, const FunctionSeries &me)
MooseEnum single_series_types_2D
MooseEnum generation_type
MooseEnum single_series_types_1D
void ErrorVector unsigned int
This class uses implementations of CompositeSeriesBasisInterface to generate a function based on conv...
const std::vector< std::size_t > _orders
The vector holding the orders of each single series.
static InputParameters validParams()
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.
void setLocation(const Point &point)
Set the current evaluation location.
const MooseEnum & _y
Stores the name of the single function series to use in the y direction.
virtual Real evaluateValue(Real t, const Point &p) override
Used in derived classes, equivalent to Function::value()
bool isInPhysicalBounds(const Point &point) const
Returns true if the provided point is within the set physical boundaries.
const std::vector< Real > & getExpansion()
Returns a vector of the expansion-evaluated functional series at the current location.
const std::vector< std::size_t > & getOrders() const
Returns a vector of the functional orders in the underlying functional series.
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.
static FunctionSeries & checkAndConvertFunction(const Function &function, const std::string &typeName, const std::string &objectName)
Static function to cast a Function to SeriesFunction.
const std::vector< Real > & getGeneration()
Returns a vector of the generation-evaluated functional series at the current location.
Real expand()
Expand the function series at the current location and with the current coefficients.
const std::vector< Real > _physical_bounds
The physical bounds of the function series.
Real getStandardizedFunctionVolume() const
Returns the volume of evaluation in the functional series standardized space.
const MooseEnum & _series_type_name
Stores the name of the current functional series type.
FunctionSeries(const InputParameters ¶meters)
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 std::string & name() const
void mooseError(Args &&... args) 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.
static InputParameters validParams()
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.
std::vector< Real > & _coefficients
The coefficient array.
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.