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 24 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 144 of file FunctionalBasisInterface.C.

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

145 {
146  _basis_evaluation.assign(number_of_terms, 0.0);
147  _basis_evaluation.shrink_to_fit();
148 }
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 72 of file FunctionalBasisInterface.C.

Referenced by getExpansion(), and getExpansionSeriesSum().

73 {
74  if (isGeneration() || isCacheInvalid())
75  {
77 
79 
80  _is_generation = false;
81  _is_cache_invalid = false;
82  }
83 
84  return _basis_evaluation;
85 }
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 56 of file FunctionalBasisInterface.C.

Referenced by getGeneration(), and getGenerationSeriesSum().

57 {
58  if (isExpansion() || isCacheInvalid())
59  {
61 
63 
64  _is_generation = true;
65  _is_cache_invalid = false;
66  }
67 
68  return _basis_evaluation;
69 }
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 113 of file FunctionalBasisInterface.C.

114 {
115  // Use getAllExpansion() which will lazily evaluate the series as needed
116  return getAllExpansion().back();
117 }
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 120 of file FunctionalBasisInterface.C.

Referenced by TEST().

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

◆ getGeneration()

Real FunctionalBasisInterface::getGeneration ( )

Gets the last term of the generation functional basis.

Definition at line 94 of file FunctionalBasisInterface.C.

95 {
96  // Use getAllGeneration() which will lazily evaluate the series as needed
97  return getAllGeneration().back();
98 }
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 101 of file FunctionalBasisInterface.C.

Referenced by TEST().

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

◆ getNumberOfTerms()

std::size_t FunctionalBasisInterface::getNumberOfTerms ( ) const

Returns the number of terms in the series.

Definition at line 88 of file FunctionalBasisInterface.C.

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

89 {
90  return _number_of_terms;
91 }
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 50 of file FunctionalBasisInterface.C.

Referenced by getAllGeneration().

51 {
52  return !_is_generation;
53 }
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 44 of file FunctionalBasisInterface.C.

Referenced by getAllExpansion().

45 {
46  return _is_generation;
47 }
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 132 of file FunctionalBasisInterface.C.

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

133 {
134  return _basis_evaluation[index];
135 }
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 38 of file FunctionalBasisInterface.C.

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

◆ save()

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

◆ 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 152 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 116 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 155 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: