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 
21 {
22 public:
24 
26 
30  static FunctionSeries & checkAndConvertFunction(const Function & function,
31  const std::string & typeName,
32  const std::string & objectName);
33 
34  // Override from MemoizedFunctionInterface
35  virtual Real evaluateValue(Real t, const Point & p) override;
36 
40  Real expand();
41 
45  Real expand(const std::vector<Real> & coefficients);
46 
50  std::size_t getNumberOfTerms() const;
51 
56 
60  const std::vector<std::size_t> & getOrders() const;
61 
65  const std::vector<Real> & getGeneration();
66 
70  const std::vector<Real> & getExpansion();
71 
75  bool isInPhysicalBounds(const Point & point) const;
76 
80  void setLocation(const Point & point);
81 
85  friend std::ostream & operator<<(std::ostream & stream, const FunctionSeries & me);
86 
87 protected:
89  const std::vector<std::size_t> _orders;
90 
92  const std::vector<Real> _physical_bounds;
93 
95  std::unique_ptr<CompositeSeriesBasisInterface> _series_type;
96 
99 
100  /*
101  * Enumerations of the possible series types for the different spatial expansions. Not all of
102  * these will be provided for any one series.
103  */
105  const MooseEnum & _x;
107  const MooseEnum & _y;
109  const MooseEnum & _z;
111  const MooseEnum & _disc;
116 
117 private:
123  static std::vector<std::size_t> convertOrders(const std::vector<unsigned int> & orders);
124 };
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...
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 &parameters)
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.
friend std::ostream & operator<<(std::ostream &stream, const FunctionSeries &me)
Returns a tabularized text stream of the currently stored coefficients.
virtual Real evaluateValue(Real t, const Point &p) override
Used in derived classes, equivalent to Function::value()
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.
This class uses implementations of CompositeSeriesBasisInterface to generate a function based on conv...
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::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.
const InputParameters & parameters() const
const std::vector< std::size_t > & getOrders() const
Returns a vector of the functional orders in the underlying functional series.
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.
Real getStandardizedFunctionVolume() const
Returns the volume of evaluation in the functional series standardized space.