www.mooseframework.org
FunctionSeries.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
14 
15 class FunctionSeries;
16 
17 template <>
18 InputParameters validParams<FunctionSeries>();
19 
26 {
27 public:
28  FunctionSeries(const InputParameters & parameters);
29 
33  static FunctionSeries & checkAndConvertFunction(const Function & function,
34  const std::string & typeName,
35  const std::string & objectName);
36 
37  // Override from MemoizedFunctionInterface
38  virtual Real evaluateValue(Real t, const Point & p) override;
39 
43  Real expand();
44 
48  Real expand(const std::vector<Real> & coefficients);
49 
53  std::size_t getNumberOfTerms() const;
54 
58  Real getStandardizedFunctionVolume() const;
59 
63  const std::vector<std::size_t> & getOrders() const;
64 
68  const std::vector<Real> & getGeneration();
69 
73  const std::vector<Real> & getExpansion();
74 
78  bool isInPhysicalBounds(const Point & point) const;
79 
83  void setLocation(const Point & point);
84 
88  friend std::ostream & operator<<(std::ostream & stream, const FunctionSeries & me);
89 
90 protected:
92  const std::vector<std::size_t> _orders;
93 
95  const std::vector<Real> _physical_bounds;
96 
98  std::unique_ptr<CompositeSeriesBasisInterface> _series_type;
99 
101  const MooseEnum & _series_type_name;
102 
103  /*
104  * Enumerations of the possible series types for the different spatial expansions. Not all of
105  * these will be provided for any one series.
106  */
108  const MooseEnum & _x;
110  const MooseEnum & _y;
112  const MooseEnum & _z;
114  const MooseEnum & _disc;
116  const MooseEnum & _expansion_type;
118  const MooseEnum & _generation_type;
119 
120 private:
126  static std::vector<std::size_t> convertOrders(const std::vector<unsigned int> & orders);
127 };
FunctionSeries::_disc
const MooseEnum & _disc
Stores the name of the single function series to use for a unit disc.
Definition: FunctionSeries.h:114
FunctionSeries::expand
Real expand()
Expand the function series at the current location and with the current coefficients.
Definition: FunctionSeries.C:263
FunctionSeries::evaluateValue
virtual Real evaluateValue(Real t, const Point &p) override
Used in derived classes, equivalent to Function::value()
Definition: FunctionSeries.C:250
MutableCoefficientsFunctionInterface
Interface for a type of functions using coefficients that may be changed before or after a solve.
Definition: MutableCoefficientsFunctionInterface.h:25
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
FunctionSeries::_series_type
std::unique_ptr< CompositeSeriesBasisInterface > _series_type
Stores a pointer to the functional series object.
Definition: FunctionSeries.h:98
CompositeSeriesBasisInterface.h
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
FunctionSeries::FunctionSeries
FunctionSeries(const InputParameters &parameters)
Definition: FunctionSeries.C:75
FunctionSeries::_z
const MooseEnum & _z
Stores the name of the single function series to use in the z direction.
Definition: FunctionSeries.h:112
validParams< FunctionSeries >
InputParameters validParams< FunctionSeries >()
Definition: FunctionSeries.C:21
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
FunctionSeries::getGeneration
const std::vector< Real > & getGeneration()
Returns a vector of the generation-evaluated functional series at the current location.
Definition: FunctionSeries.C:216
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
FunctionSeries::getOrders
const std::vector< std::size_t > & getOrders() const
Returns a vector of the functional orders in the underlying functional series.
Definition: FunctionSeries.C:205
FunctionSeries::_physical_bounds
const std::vector< Real > _physical_bounds
The physical bounds of the function series.
Definition: FunctionSeries.h:95
MutableCoefficientsFunctionInterface.h
FunctionSeries::operator<<
friend std::ostream & operator<<(std::ostream &stream, const FunctionSeries &me)
Returns a tabularized text stream of the currently stored coefficients.
Definition: FunctionSeries.C:278
FunctionSeries::_x
const MooseEnum & _x
Stores the name of the single function series to use in the x direction.
Definition: FunctionSeries.h:108
FunctionSeries::getStandardizedFunctionVolume
Real getStandardizedFunctionVolume() const
Returns the volume of evaluation in the functional series standardized space.
Definition: FunctionSeries.C:193
FunctionSeries::_generation_type
const MooseEnum & _generation_type
The normalization type for generation.
Definition: FunctionSeries.h:118
FunctionSeries::checkAndConvertFunction
static FunctionSeries & checkAndConvertFunction(const Function &function, const std::string &typeName, const std::string &objectName)
Static function to cast a Function to SeriesFunction.
Definition: FunctionSeries.C:175
FunctionSeries::_y
const MooseEnum & _y
Stores the name of the single function series to use in the y direction.
Definition: FunctionSeries.h:110
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