Go to the documentation of this file.
25 params.addClassDescription(
"This function uses a convolution of functional series (functional "
26 "expansion or FX) to create a 1D, 2D, or 3D function");
31 MooseEnum series_types(
"Cartesian CylindricalDuo");
35 params.addRequiredParam<MooseEnum>(
36 "series_type", series_types,
"The type of function series to construct.");
42 params.addRequiredParam<std::vector<unsigned int>>(
"orders",
43 "The order of each series. These must be "
44 "defined as \"x y z\" for Cartesian, and \"z "
45 "disc\" for CylindricalDuo.");
47 params.addParam<std::vector<Real>>(
"physical_bounds",
48 "The physical bounds of the function series. These must be "
49 "defined as \"x_min x_max y_min y_max z_min z_max\" for "
50 "Cartesian, and \"axial_min axial_max disc_center1 "
51 "disc_center2 radius\" for CylindricalDuo");
57 params.addParam<MooseEnum>(
"disc",
59 "The series to use for the disc. Its direction is determined by "
60 "orthogonality to the declared direction of the axis.");
62 std::string normalization_types =
"orthonormal sqrt_mu standard";
65 params.addParam<MooseEnum>(
"expansion_type",
67 "The normalization used for expansion of the basis functions");
68 params.addParam<MooseEnum>(
71 "The normalization used for generation of the basis function coefficients");
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"))
87 std::vector<MooseEnum> domains;
88 std::vector<MooseEnum> types;
99 if (isParamValid(
"x"))
104 if (isParamValid(
"y"))
109 if (isParamValid(
"z"))
114 if (types.size() == 0)
115 mooseError(
"Must specify one of 'x', 'y', or 'z' for 'Cartesian' series!");
130 if (isParamValid(
"x"))
137 if (isParamValid(
"y"))
144 if (isParamValid(
"z"))
152 if (types.size() == 0)
153 mooseError(
"Must specify one of 'x', 'y', or 'z' for 'CylindricalDuo' series!");
155 if (types.size() > 1)
156 mooseError(
"Cannot specify more than one of 'x', 'y', or 'z' for 'CylindricalDuo' series!");
158 types.push_back(
_disc);
166 if (isParamValid(
"physical_bounds"))
176 const std::string & typeName,
177 const std::string & objectName)
179 const FunctionSeries * test = dynamic_cast<const FunctionSeries *>(&
function);
185 "\": the named Function \"",
187 "\" must be a FunctionSeries-type object.");
189 return *const_cast<FunctionSeries *>(test);
204 const std::vector<size_t> &
215 const std::vector<Real> &
226 const std::vector<Real> &
274 return std::inner_product(terms.begin(), terms.end(), coefficients.begin(), 0.0);
281 <<
"FunctionSeries: " << me.name() <<
"\n"
289 std::vector<std::size_t>
292 return std::vector<std::size_t>(orders.begin(), orders.end());
const MooseEnum & _disc
Stores the name of the single function series to use for a unit disc.
void setCharacteristics(const std::vector< std::size_t > &new_characteristics)
Sets the characteristics array.
static MooseEnum _domain_options
An enumeration of the domains available to each functional series.
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.
Real expand()
Expand the function series at the current location and with the current coefficients.
virtual Real evaluateValue(Real t, const Point &p) override
Used in derived classes, equivalent to Function::value()
MooseEnum single_series_types_1D
Interface for a type of functions using coefficients that may be changed before or after a solve.
std::size_t getNumberOfTerms() const
Returns the number of terms (coefficients) in the underlying function series.
const std::vector< std::size_t > _orders
The vector holding the orders of each single series.
std::unique_ptr< CompositeSeriesBasisInterface > _series_type
Stores a pointer to the functional series object.
std::vector< Real > & _coefficients
The coefficient array.
bool isInPhysicalBounds(const Point &point) const
Returns true if the provided point is within the set physical boundaries.
This class uses implementations of CompositeSeriesBasisInterface to generate a function based on conv...
FunctionSeries(const InputParameters ¶meters)
MooseEnum single_series_types_2D
const MooseEnum & _z
Stores the name of the single function series to use in the z direction.
registerMooseObject("FunctionalExpansionToolsApp", FunctionSeries)
MooseEnum generation_type
const MooseEnum & _expansion_type
The normalization type for expansion.
const std::vector< Real > & getExpansion()
Returns a vector of the expansion-evaluated functional series at the current location.
const std::vector< Real > & getGeneration()
Returns a vector of the generation-evaluated functional series at the current location.
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.
InputParameters validParams< FunctionSeries >()
void enforceSize(bool enforce)
Toggle whether the size of the coefficient array can be changed.
InputParameters validParams< MutableCoefficientsFunctionInterface >()
const std::vector< std::size_t > & getOrders() const
Returns a vector of the functional orders in the underlying functional series.
const std::vector< Real > _physical_bounds
The physical bounds of the function series.
const MooseEnum & _x
Stores the name of the single function series to use in the x direction.
Real getStandardizedFunctionVolume() const
Returns the volume of evaluation in the functional series standardized space.
const MooseEnum & _generation_type
The normalization type for generation.
std::ostream & operator<<(std::ostream &stream, const FunctionSeries &me)
static FunctionSeries & checkAndConvertFunction(const Function &function, const std::string &typeName, const std::string &objectName)
Static function to cast a Function to SeriesFunction.
const MooseEnum & _y
Stores the name of the single function series to use in the y direction.
void setLocation(const Point &point)
Set the current evaluation location.
const MooseEnum & _series_type_name
Stores the name of the current functional series type.