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.");
203 const std::vector<size_t> &
214 const std::vector<Real> &
225 const 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;
288 std::vector<std::size_t>
291 return std::vector<std::size_t>(orders.begin(), orders.end());
std::unique_ptr< CompositeSeriesBasisInterface > _series_type
Stores a pointer to the functional series object.
Interface for a type of functions using coefficients that may be changed before or after a solve...
MooseEnum single_series_types_2D
void setLocation(const Point &point)
Set the current evaluation location.
const MooseEnum & _x
Stores the name of the single function series to use in the x direction.
const std::vector< Real > & getExpansion()
Returns a vector of the expansion-evaluated functional series at the current location.
const std::vector< std::size_t > _orders
The vector holding the orders of each single series.
FunctionSeries(const InputParameters ¶meters)
const MooseEnum & _generation_type
The normalization type for generation.
const std::vector< Real > & getGeneration()
Returns a vector of the generation-evaluated functional series at the current location.
std::ostream & operator<<(std::ostream &stream, const FunctionSeries &me)
static MooseEnum _domain_options
An enumeration of the domains available to each functional series.
virtual Real evaluateValue(Real t, const Point &p) override
Used in derived classes, equivalent to Function::value()
void setCharacteristics(const std::vector< std::size_t > &new_characteristics)
Sets the characteristics array.
virtual const std::string & name() const
bool isParamValid(const std::string &name) const
const MooseEnum & _z
Stores the name of the single function series to use in the z direction.
const MooseEnum & _series_type_name
Stores the name of the current functional series type.
MooseEnum single_series_types_1D
This class uses implementations of CompositeSeriesBasisInterface to generate a function based on conv...
static InputParameters validParams()
Real expand()
Expand the function series at the current location and with the current coefficients.
static InputParameters validParams()
static FunctionSeries & checkAndConvertFunction(const Function &function, const std::string &typeName, const std::string &objectName)
Static function to cast a Function to SeriesFunction.
std::vector< Real > & _coefficients
The coefficient array.
std::size_t getNumberOfTerms() const
Returns the number of terms (coefficients) in the underlying function series.
const std::vector< Real > _physical_bounds
The physical bounds of the function series.
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 & _disc
Stores the name of the single function series to use for a unit disc.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const MooseEnum & _y
Stores the name of the single function series to use in the y direction.
void mooseError(Args &&... args) const
const std::vector< std::size_t > & getOrders() const
Returns a vector of the functional orders in the underlying 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.
const MooseEnum & _expansion_type
The normalization type for expansion.
bool isInPhysicalBounds(const Point &point) const
Returns true if the provided point is within the set physical boundaries.
void ErrorVector unsigned int
Real getStandardizedFunctionVolume() const
Returns the volume of evaluation in the functional series standardized space.
registerMooseObject("FunctionalExpansionToolsApp", FunctionSeries)
MooseEnum generation_type
void enforceSize(bool enforce)
Toggle whether the size of the coefficient array can be changed.