www.mooseframework.org
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
FunctionalBasisInterface Class Referenceabstract

This class provides the basis for any custom functional basis, and is the parent class of both SingleSeriesBasisInterface and CompositeSeriesBasisInterface. More...

#include <FunctionalBasisInterface.h>

Inheritance diagram for FunctionalBasisInterface:
[legend]

Public Member Functions

 FunctionalBasisInterface ()
 
 FunctionalBasisInterface (const unsigned int number_of_terms)
 
Real operator[] (std::size_t index) const
 Returns the current evaluation at the given index. More...
 
const std::vector< Real > & getAllGeneration ()
 Returns an array reference containing the value of each generation term. More...
 
const std::vector< Real > & getAllExpansion ()
 Returns an array reference containing the value of each expansion term. More...
 
std::size_t getNumberOfTerms () const
 Returns the number of terms in the series. More...
 
Real getGeneration ()
 Gets the last term of the generation functional basis. More...
 
Real getGenerationSeriesSum ()
 Gets the sum of all terms in the generation functional basis. More...
 
Real getExpansion ()
 Gets the #_order-th term of the expansion functional basis. More...
 
Real getExpansionSeriesSum ()
 Evaluates the sum of all terms in the expansion functional basis up to #_order. More...
 
virtual const std::vector< Real > & getStandardizedFunctionLimits () const =0
 Returns a vector of the lower and upper bounds of the standard functional space. More...
 
virtual Real getStandardizedFunctionVolume () const =0
 Returns the volume within the standardized function local_limits. More...
 
bool isGeneration () const
 Returns true if the current evaluation is generation. More...
 
bool isExpansion () const
 Returns true if the current evaluation is expansion. More...
 
virtual bool isCacheInvalid () const =0
 Whether the cached values correspond to the current point. More...
 
virtual bool isInPhysicalBounds (const Point &point) const =0
 Determines if the point provided is in within the physical bounds. More...
 
virtual void setLocation (const Point &point)=0
 Set the location that will be used by the series to compute values. More...
 
virtual void setOrder (const std::vector< std::size_t > &orders)=0
 Set the order of the series. More...
 
virtual void setPhysicalBounds (const std::vector< Real > &bounds)=0
 Sets the bounds of the series. More...
 

Static Public Attributes

static MooseEnum _domain_options
 An enumeration of the domains available to each functional series. More...
 

Protected Member Functions

virtual void clearBasisEvaluation (const unsigned int &number_of_terms)
 Set all entries of the basis evaluation to zero. More...
 
virtual void evaluateGeneration ()=0
 Evaluate the generation form of the functional basis. More...
 
virtual void evaluateExpansion ()=0
 Evaluate the expansion form of the functional basis. More...
 
Real load (std::size_t index) const
 Helper function to load a value from #_series. More...
 
void save (std::size_t index, Real value)
 Helper function to store a value in #_series. More...
 

Protected Attributes

unsigned int _number_of_terms
 The number of terms in the series. More...
 
bool _is_cache_invalid
 indicates if the evaluated values correspond to the current location More...
 

Private Attributes

std::vector< Real_basis_evaluation
 Stores the values of the basis evaluation. More...
 
bool _is_generation
 Indicates whether the current evaluation is expansion or generation. More...
 

Detailed Description

This class provides the basis for any custom functional basis, and is the parent class of both SingleSeriesBasisInterface and CompositeSeriesBasisInterface.

Definition at line 22 of file FunctionalBasisInterface.h.

Constructor & Destructor Documentation

◆ FunctionalBasisInterface() [1/2]

FunctionalBasisInterface::FunctionalBasisInterface ( )

Definition at line 20 of file FunctionalBasisInterface.C.

21  : _is_cache_invalid(true), _is_generation(false)
22 {
23 }
bool _is_generation
Indicates whether the current evaluation is expansion or generation.
bool _is_cache_invalid
indicates if the evaluated values correspond to the current location

◆ FunctionalBasisInterface() [2/2]

FunctionalBasisInterface::FunctionalBasisInterface ( const unsigned int  number_of_terms)

Definition at line 29 of file FunctionalBasisInterface.C.

30  : _number_of_terms(number_of_terms),
31  _is_cache_invalid(true),
33  _is_generation(false)
34 {
35  _basis_evaluation.shrink_to_fit();
36 }
std::vector< Real > _basis_evaluation
Stores the values of the basis evaluation.
bool _is_generation
Indicates whether the current evaluation is expansion or generation.
unsigned int _number_of_terms
The number of terms in the series.
bool _is_cache_invalid
indicates if the evaluated values correspond to the current location

Member Function Documentation

◆ clearBasisEvaluation()

void FunctionalBasisInterface::clearBasisEvaluation ( const unsigned int number_of_terms)
protectedvirtual

Set all entries of the basis evaluation to zero.

Definition at line 145 of file FunctionalBasisInterface.C.

Referenced by getAllExpansion(), getAllGeneration(), CompositeSeriesBasisInterface::setNumberOfTerms(), and SingleSeriesBasisInterface::setOrder().

146 {
147  _basis_evaluation.assign(number_of_terms, 0.0);
148  _basis_evaluation.shrink_to_fit();
149 }
std::vector< Real > _basis_evaluation
Stores the values of the basis evaluation.

◆ evaluateExpansion()

virtual void FunctionalBasisInterface::evaluateExpansion ( )
protectedpure virtual

Evaluate the expansion form of the functional basis.

Implemented in CompositeSeriesBasisInterface, and SingleSeriesBasisInterface.

Referenced by getAllExpansion().

◆ evaluateGeneration()

virtual void FunctionalBasisInterface::evaluateGeneration ( )
protectedpure virtual

Evaluate the generation form of the functional basis.

Implemented in CompositeSeriesBasisInterface, and SingleSeriesBasisInterface.

Referenced by getAllGeneration().

◆ getAllExpansion()

const std::vector< Real > & FunctionalBasisInterface::getAllExpansion ( )

Returns an array reference containing the value of each expansion term.

Definition at line 73 of file FunctionalBasisInterface.C.

Referenced by getExpansion(), and getExpansionSeriesSum().

74 {
75  if (isGeneration() || isCacheInvalid())
76  {
78 
80 
81  _is_generation = false;
82  _is_cache_invalid = false;
83  }
84 
85  return _basis_evaluation;
86 }
std::vector< Real > _basis_evaluation
Stores the values of the basis evaluation.
virtual void evaluateExpansion()=0
Evaluate the expansion form of the functional basis.
bool _is_generation
Indicates whether the current evaluation is expansion or generation.
unsigned int _number_of_terms
The number of terms in the series.
virtual void clearBasisEvaluation(const unsigned int &number_of_terms)
Set all entries of the basis evaluation to zero.
virtual bool isCacheInvalid() const =0
Whether the cached values correspond to the current point.
bool isGeneration() const
Returns true if the current evaluation is generation.
bool _is_cache_invalid
indicates if the evaluated values correspond to the current location

◆ getAllGeneration()

const std::vector< Real > & FunctionalBasisInterface::getAllGeneration ( )

Returns an array reference containing the value of each generation term.

Definition at line 57 of file FunctionalBasisInterface.C.

Referenced by getGeneration(), and getGenerationSeriesSum().

58 {
59  if (isExpansion() || isCacheInvalid())
60  {
62 
64 
65  _is_generation = true;
66  _is_cache_invalid = false;
67  }
68 
69  return _basis_evaluation;
70 }
std::vector< Real > _basis_evaluation
Stores the values of the basis evaluation.
bool _is_generation
Indicates whether the current evaluation is expansion or generation.
unsigned int _number_of_terms
The number of terms in the series.
virtual void clearBasisEvaluation(const unsigned int &number_of_terms)
Set all entries of the basis evaluation to zero.
virtual bool isCacheInvalid() const =0
Whether the cached values correspond to the current point.
bool isExpansion() const
Returns true if the current evaluation is expansion.
virtual void evaluateGeneration()=0
Evaluate the generation form of the functional basis.
bool _is_cache_invalid
indicates if the evaluated values correspond to the current location

◆ getExpansion()

Real FunctionalBasisInterface::getExpansion ( )

Gets the #_order-th term of the expansion functional basis.

Definition at line 114 of file FunctionalBasisInterface.C.

115 {
116  // Use getAllExpansion() which will lazily evaluate the series as needed
117  return getAllExpansion().back();
118 }
const std::vector< Real > & getAllExpansion()
Returns an array reference containing the value of each expansion term.

◆ getExpansionSeriesSum()

Real FunctionalBasisInterface::getExpansionSeriesSum ( )

Evaluates the sum of all terms in the expansion functional basis up to #_order.

Definition at line 121 of file FunctionalBasisInterface.C.

Referenced by TEST().

122 {
123  Real sum = 0.0;
124 
125  // Use getAllExpansion() which will lazily evaluate the series as needed
126  for (auto term : getAllExpansion())
127  sum += term;
128 
129  return sum;
130 }
const std::vector< Real > & getAllExpansion()
Returns an array reference containing the value of each expansion term.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ getGeneration()

Real FunctionalBasisInterface::getGeneration ( )

Gets the last term of the generation functional basis.

Definition at line 95 of file FunctionalBasisInterface.C.

96 {
97  // Use getAllGeneration() which will lazily evaluate the series as needed
98  return getAllGeneration().back();
99 }
const std::vector< Real > & getAllGeneration()
Returns an array reference containing the value of each generation term.

◆ getGenerationSeriesSum()

Real FunctionalBasisInterface::getGenerationSeriesSum ( )

Gets the sum of all terms in the generation functional basis.

Definition at line 102 of file FunctionalBasisInterface.C.

Referenced by TEST().

103 {
104  Real sum = 0.0;
105 
106  // Use getAllGeneration() which will lazily evaluate the series as needed
107  for (auto term : getAllGeneration())
108  sum += term;
109 
110  return sum;
111 }
const std::vector< Real > & getAllGeneration()
Returns an array reference containing the value of each generation term.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ getNumberOfTerms()

std::size_t FunctionalBasisInterface::getNumberOfTerms ( ) const

Returns the number of terms in the series.

Definition at line 89 of file FunctionalBasisInterface.C.

Referenced by Legendre::evaluateSqrtMu(), and TEST().

90 {
91  return _number_of_terms;
92 }
unsigned int _number_of_terms
The number of terms in the series.

◆ getStandardizedFunctionLimits()

virtual const std::vector<Real>& FunctionalBasisInterface::getStandardizedFunctionLimits ( ) const
pure virtual

Returns a vector of the lower and upper bounds of the standard functional space.

Implemented in CompositeSeriesBasisInterface, Zernike, and Legendre.

◆ getStandardizedFunctionVolume()

virtual Real FunctionalBasisInterface::getStandardizedFunctionVolume ( ) const
pure virtual

Returns the volume within the standardized function local_limits.

Implemented in CompositeSeriesBasisInterface, Zernike, and Legendre.

◆ isCacheInvalid()

virtual bool FunctionalBasisInterface::isCacheInvalid ( ) const
pure virtual

Whether the cached values correspond to the current point.

Implemented in CompositeSeriesBasisInterface, and SingleSeriesBasisInterface.

Referenced by getAllExpansion(), and getAllGeneration().

◆ isExpansion()

bool FunctionalBasisInterface::isExpansion ( ) const

Returns true if the current evaluation is expansion.

Definition at line 51 of file FunctionalBasisInterface.C.

Referenced by getAllGeneration().

52 {
53  return !_is_generation;
54 }
bool _is_generation
Indicates whether the current evaluation is expansion or generation.

◆ isGeneration()

bool FunctionalBasisInterface::isGeneration ( ) const

Returns true if the current evaluation is generation.

Definition at line 45 of file FunctionalBasisInterface.C.

Referenced by getAllExpansion().

46 {
47  return _is_generation;
48 }
bool _is_generation
Indicates whether the current evaluation is expansion or generation.

◆ isInPhysicalBounds()

virtual bool FunctionalBasisInterface::isInPhysicalBounds ( const Point &  point) const
pure virtual

Determines if the point provided is in within the physical bounds.

Implemented in CompositeSeriesBasisInterface, Zernike, and Legendre.

◆ load()

Real FunctionalBasisInterface::load ( std::size_t  index) const
protected

Helper function to load a value from #_series.

Definition at line 133 of file FunctionalBasisInterface.C.

Referenced by Legendre::evaluateOrthonormal(), Zernike::evaluateOrthonormal(), Legendre::evaluateSqrtMu(), Zernike::evaluateSqrtMu(), Legendre::evaluateStandard(), Zernike::evaluateStandard(), and Zernike::fillOutNegativeRankAndApplyAzimuthalComponent().

134 {
135  return _basis_evaluation[index];
136 }
std::vector< Real > _basis_evaluation
Stores the values of the basis evaluation.

◆ operator[]()

Real FunctionalBasisInterface::operator[] ( std::size_t  index) const

Returns the current evaluation at the given index.

Definition at line 39 of file FunctionalBasisInterface.C.

40 {
41  return (index > _basis_evaluation.size() ? 0.0 : _basis_evaluation[index]);
42 }
std::vector< Real > _basis_evaluation
Stores the values of the basis evaluation.

◆ save()

void FunctionalBasisInterface::save ( std::size_t  index,
Real  value 
)
protected

Helper function to store a value in #_series.

Definition at line 139 of file FunctionalBasisInterface.C.

Referenced by Legendre::evaluateOrthonormal(), Zernike::evaluateOrthonormal(), CompositeSeriesBasisInterface::evaluateSeries(), Legendre::evaluateSqrtMu(), Zernike::evaluateSqrtMu(), Legendre::evaluateStandard(), Zernike::evaluateStandard(), and Zernike::fillOutNegativeRankAndApplyAzimuthalComponent().

140 {
141  _basis_evaluation[index] = value;
142 }
std::vector< Real > _basis_evaluation
Stores the values of the basis evaluation.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)

◆ setLocation()

virtual void FunctionalBasisInterface::setLocation ( const Point &  point)
pure virtual

Set the location that will be used by the series to compute values.

Implemented in CompositeSeriesBasisInterface, and SingleSeriesBasisInterface.

◆ setOrder()

virtual void FunctionalBasisInterface::setOrder ( const std::vector< std::size_t > &  orders)
pure virtual

Set the order of the series.

Implemented in CompositeSeriesBasisInterface, and SingleSeriesBasisInterface.

◆ setPhysicalBounds()

virtual void FunctionalBasisInterface::setPhysicalBounds ( const std::vector< Real > &  bounds)
pure virtual

Sets the bounds of the series.

Implemented in SingleSeriesBasisInterface, Cartesian, and CylindricalDuo.

Member Data Documentation

◆ _basis_evaluation

std::vector<Real> FunctionalBasisInterface::_basis_evaluation
private

Stores the values of the basis evaluation.

Definition at line 150 of file FunctionalBasisInterface.h.

Referenced by clearBasisEvaluation(), FunctionalBasisInterface(), getAllExpansion(), getAllGeneration(), load(), operator[](), and save().

◆ _domain_options

MooseEnum FunctionalBasisInterface::_domain_options
static

An enumeration of the domains available to each functional series.

Definition at line 114 of file FunctionalBasisInterface.h.

Referenced by FunctionSeries::FunctionSeries(), SingleSeriesBasisInterface::SingleSeriesBasisInterface(), and TEST().

◆ _is_cache_invalid

bool FunctionalBasisInterface::_is_cache_invalid
protected

◆ _is_generation

bool FunctionalBasisInterface::_is_generation
private

Indicates whether the current evaluation is expansion or generation.

Definition at line 153 of file FunctionalBasisInterface.h.

Referenced by getAllExpansion(), getAllGeneration(), isExpansion(), and isGeneration().

◆ _number_of_terms

unsigned int FunctionalBasisInterface::_number_of_terms
protected

The documentation for this class was generated from the following files: