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

This class is the basis for constructing a composite—or convolved—functional series by combining multiple other series together. More...

#include <CompositeSeriesBasisInterface.h>

Inheritance diagram for CompositeSeriesBasisInterface:
[legend]

Public Member Functions

 CompositeSeriesBasisInterface (const std::string &who_is_using_me)
 
 CompositeSeriesBasisInterface (const std::vector< std::size_t > &orders, std::vector< MooseEnum > series_types, const std::string &who_is_using_me)
 
virtual ~CompositeSeriesBasisInterface ()
 
 CompositeSeriesBasisInterface (const CompositeSeriesBasisInterface &)=delete
 
 CompositeSeriesBasisInterface (CompositeSeriesBasisInterface &&)=delete
 
void operator= (const CompositeSeriesBasisInterface &)=delete
 
CompositeSeriesBasisInterfaceoperator= (CompositeSeriesBasisInterface &&)=delete
 
virtual const std::vector< Real > & getStandardizedFunctionLimits () const final
 Returns a vector of the lower and upper bounds of the standard functional space. More...
 
virtual Real getStandardizedFunctionVolume () const final
 Returns the volume within the standardized function local_limits. More...
 
virtual bool isCacheInvalid () const final
 Whether the cached values correspond to the current point. More...
 
virtual bool isInPhysicalBounds (const Point &point) const final
 Determines if the point provided is in within the physical bounds. More...
 
virtual void setLocation (const Point &p) final
 Set the location that will be used by the series to compute values. More...
 
virtual void setOrder (const std::vector< std::size_t > &orders) final
 Set the order of the series. More...
 
std::vector< RealcombineStandardizedFunctionLimits () const
 Get the function limits by looping over each of the single series. More...
 
void setNumberOfTerms ()
 Initialize the number of terms in the composite series by looping over the single series. More...
 
virtual void formatCoefficients (std::ostream &stream, const std::vector< Real > &coefficients) const
 Appends a tabulated form of the coefficients to the stream. More...
 
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...
 
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 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 evaluateGeneration () final
 Evaluate the generation form of the functional basis. More...
 
virtual void evaluateExpansion () final
 Evaluate the expansion form of the functional basis. More...
 
void evaluateSeries (const std::vector< std::vector< Real >> &single_series_basis_evaluations)
 Evaluates the values of _basis_evaluation for either evaluateGeneration() or evaluateExpansion() More...
 
virtual void clearBasisEvaluation (const unsigned int &number_of_terms)
 Set all entries of the basis evaluation to zero. 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

std::vector< MooseEnum_series_types
 The series types in this composite series. More...
 
std::vector< std::unique_ptr< SingleSeriesBasisInterface > > _series
 A pointer to the single series type (one for each entry in _domains) More...
 
const std::string & _who_is_using_me
 The name of the MooseObject that is using this class. More...
 
unsigned int _number_of_terms
 The number of terms in the series. More...
 

Private Member Functions

virtual void clearBasisEvaluation (const unsigned int &number_of_terms)
 Set all entries of the basis evaluation to zero. More...
 

Private Attributes

Point _previous_point
 The previous point at which the series was evaluated. More...
 
bool _is_cache_invalid
 indicates if the evaluated values correspond to the current location More...
 

Detailed Description

This class is the basis for constructing a composite—or convolved—functional series by combining multiple other series together.

Nonseparability is currently assumed.

Definition at line 24 of file CompositeSeriesBasisInterface.h.

Constructor & Destructor Documentation

◆ CompositeSeriesBasisInterface() [1/4]

CompositeSeriesBasisInterface::CompositeSeriesBasisInterface ( const std::string &  who_is_using_me)

Definition at line 19 of file CompositeSeriesBasisInterface.C.

20  : FunctionalBasisInterface(1), _who_is_using_me(who_is_using_me)
21 {
22  _series.push_back(std::make_unique<Legendre>());
23 }
std::vector< std::unique_ptr< SingleSeriesBasisInterface > > _series
A pointer to the single series type (one for each entry in _domains)
const std::string & _who_is_using_me
The name of the MooseObject that is using this class.

◆ CompositeSeriesBasisInterface() [2/4]

CompositeSeriesBasisInterface::CompositeSeriesBasisInterface ( const std::vector< std::size_t > &  orders,
std::vector< MooseEnum series_types,
const std::string &  who_is_using_me 
)

Definition at line 30 of file CompositeSeriesBasisInterface.C.

34  : FunctionalBasisInterface(), _series_types(series_types), _who_is_using_me(who_is_using_me)
35 {
36  if (orders.size() != _series_types.size())
38  " calling CSBI::CSBI(...): Incorrect number of 'orders' specified for "
39  "'FunctionSeries'! Check that 'orders' is the correct length and no invalid "
40  "enumerations are specified for the series.");
41 }
std::vector< MooseEnum > _series_types
The series types in this composite series.
void mooseError(Args &&... args)
const std::string & _who_is_using_me
The name of the MooseObject that is using this class.

◆ ~CompositeSeriesBasisInterface()

CompositeSeriesBasisInterface::~CompositeSeriesBasisInterface ( )
virtual

Definition at line 301 of file CompositeSeriesBasisInterface.C.

301 {}

◆ CompositeSeriesBasisInterface() [3/4]

CompositeSeriesBasisInterface::CompositeSeriesBasisInterface ( const CompositeSeriesBasisInterface )
delete

◆ CompositeSeriesBasisInterface() [4/4]

CompositeSeriesBasisInterface::CompositeSeriesBasisInterface ( CompositeSeriesBasisInterface &&  )
delete

Member Function Documentation

◆ clearBasisEvaluation() [1/2]

void FunctionalBasisInterface::clearBasisEvaluation
private

Set all entries of the basis evaluation to zero.

Definition at line 145 of file FunctionalBasisInterface.C.

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.

◆ clearBasisEvaluation() [2/2]

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

Set all entries of the basis evaluation to zero.

Definition at line 145 of file FunctionalBasisInterface.C.

Referenced by FunctionalBasisInterface::getAllExpansion(), FunctionalBasisInterface::getAllGeneration(), 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.

◆ combineStandardizedFunctionLimits()

std::vector< Real > CompositeSeriesBasisInterface::combineStandardizedFunctionLimits ( ) const

Get the function limits by looping over each of the single series.

Definition at line 135 of file CompositeSeriesBasisInterface.C.

Referenced by getStandardizedFunctionLimits().

136 {
137  std::vector<Real> function_limits;
138 
139  for (auto & series : _series)
140  {
141  std::vector<Real> local_limits = series->getStandardizedFunctionLimits();
142  for (auto & limit : local_limits)
143  function_limits.push_back(limit);
144  }
145 
146  return function_limits;
147 }
std::vector< std::unique_ptr< SingleSeriesBasisInterface > > _series
A pointer to the single series type (one for each entry in _domains)

◆ evaluateExpansion()

void CompositeSeriesBasisInterface::evaluateExpansion ( )
finalprotectedvirtual

Evaluate the expansion form of the functional basis.

Implements FunctionalBasisInterface.

Definition at line 101 of file CompositeSeriesBasisInterface.C.

102 {
103  /*
104  * Evaluate the expansion versions of each of the single series, and collect the results before
105  * passing them to evaluateSeries, where they will be multiplied together correctly and stored in
106  * the composite series basis evaluation.
107  */
108  std::vector<std::vector<Real>> single_series_basis_evaluation;
109  for (auto & series : _series)
110  single_series_basis_evaluation.push_back(series->getAllExpansion());
111 
112  evaluateSeries(single_series_basis_evaluation);
113 }
void evaluateSeries(const std::vector< std::vector< Real >> &single_series_basis_evaluations)
Evaluates the values of _basis_evaluation for either evaluateGeneration() or evaluateExpansion() ...
std::vector< std::unique_ptr< SingleSeriesBasisInterface > > _series
A pointer to the single series type (one for each entry in _domains)

◆ evaluateGeneration()

void CompositeSeriesBasisInterface::evaluateGeneration ( )
finalprotectedvirtual

Evaluate the generation form of the functional basis.

Implements FunctionalBasisInterface.

Definition at line 44 of file CompositeSeriesBasisInterface.C.

45 {
46  /*
47  * Evaluate the generation versions of each of the single series, and collect the results before
48  * passing them to evaluateSeries, where they will be multiplied together correctly and stored in
49  * the composite series basis evaluation.
50  */
51  std::vector<std::vector<Real>> single_series_basis_evaluation;
52  for (auto & series : _series)
53  single_series_basis_evaluation.push_back(series->getAllGeneration());
54 
55  evaluateSeries(single_series_basis_evaluation);
56 }
void evaluateSeries(const std::vector< std::vector< Real >> &single_series_basis_evaluations)
Evaluates the values of _basis_evaluation for either evaluateGeneration() or evaluateExpansion() ...
std::vector< std::unique_ptr< SingleSeriesBasisInterface > > _series
A pointer to the single series type (one for each entry in _domains)

◆ evaluateSeries()

void CompositeSeriesBasisInterface::evaluateSeries ( const std::vector< std::vector< Real >> &  single_series_basis_evaluations)
protected

Evaluates the values of _basis_evaluation for either evaluateGeneration() or evaluateExpansion()

Definition at line 59 of file CompositeSeriesBasisInterface.C.

Referenced by evaluateExpansion(), and evaluateGeneration().

61 {
62  /*
63  * Appropriate number of loops based on 1-D, 2-D, or 3-D to multiply the basis evaluations of the
64  * single series together to form the basis evaluation of the entire composite series.
65  */
66  Real f1, f2, f3;
67  std::size_t term = 0;
68 
69  if (single_series_basis_evaluations.size() == 1)
70  for (std::size_t i = 0; i < _series[0]->getNumberOfTerms(); ++i, ++term)
71  save(term, single_series_basis_evaluations[0][i]);
72 
73  if (single_series_basis_evaluations.size() == 2)
74  for (std::size_t i = 0; i < _series[0]->getNumberOfTerms(); ++i)
75  {
76  f1 = single_series_basis_evaluations[0][i];
77  for (std::size_t j = 0; j < _series[1]->getNumberOfTerms(); ++j, ++term)
78  {
79  f2 = single_series_basis_evaluations[1][j];
80  save(term, f1 * f2);
81  }
82  }
83 
84  if (single_series_basis_evaluations.size() == 3)
85  for (std::size_t i = 0; i < _series[0]->getNumberOfTerms(); ++i)
86  {
87  f1 = single_series_basis_evaluations[0][i];
88  for (std::size_t j = 0; j < _series[1]->getNumberOfTerms(); ++j)
89  {
90  f2 = single_series_basis_evaluations[1][j];
91  for (std::size_t k = 0; k < _series[2]->getNumberOfTerms(); ++k, ++term)
92  {
93  f3 = single_series_basis_evaluations[2][k];
94  save(term, f1 * f2 * f3);
95  }
96  }
97  }
98 }
void save(std::size_t index, Real value)
Helper function to store a value in #_series.
std::vector< std::unique_ptr< SingleSeriesBasisInterface > > _series
A pointer to the single series type (one for each entry in _domains)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
static const std::string k
Definition: NS.h:124

◆ formatCoefficients()

void CompositeSeriesBasisInterface::formatCoefficients ( std::ostream &  stream,
const std::vector< Real > &  coefficients 
) const
virtual

Appends a tabulated form of the coefficients to the stream.

Definition at line 150 of file CompositeSeriesBasisInterface.C.

152 {
153  // clang-format off
154  std::ostringstream formatted, domains, orders;
155  std::size_t term = 0;
156 
157  stream << "---------------- Coefficients ----------------\n"
158  << " == Subindices ==\n";
159 
160  if (_series_types.size() == 1)
161  {
162  orders << " Orders: " << std::setw(3) << _series[0]->getOrder(0) << "\n";
163  domains << " == Index == " << std::setw(3) << _series[0]->_domains[0]
164  << " === Value ===\n"
165  << "----------------------------------------------\n";
166 
167  for (std::size_t i = 0; i < _series[0]->getNumberOfTerms(); ++i, ++term)
168  formatted << " " << std::setw(4) << term
169  << " " << std::setw(3) << i
170  << " " << std::setw(12) << coefficients[term] << "\n";
171  }
172  else if (_series_types.size() == 2)
173  {
174  orders << " Orders: " << std::setw(3) << _series[0]->getOrder(0)
175  << " " << std::setw(3) << _series[1]->getOrder(0) << "\n";
176  domains << " == Index == " << std::setw(3) << _series[0]->_domains[0]
177  << " " << std::setw(3) << _series[1]->_domains[0]
178  << " === Value ===\n"
179  << "----------------------------------------------\n";
180 
181  for (std::size_t i = 0; i < _series[0]->getNumberOfTerms(); ++i)
182  {
183  for (std::size_t j = 0; j < _series[1]->getNumberOfTerms(); ++j, ++term)
184  formatted << " " << std::setw(4) << term
185  << " " << std::setw(3) << i
186  << " " << std::setw(3) << j
187  << " " << std::setw(12) << coefficients[term] << "\n";
188  }
189  }
190  else if (_series_types.size() == 3)
191  {
192  orders << " Orders: " << std::setw(3) << _series[0]->getOrder(0)
193  << " " << std::setw(3) << _series[1]->getOrder(0)
194  << " " << std::setw(3) << _series[2]->getOrder(0) << "\n";
195  domains << " == Index == " << std::setw(3) << _series[0]->_domains[0]
196  << " " << std::setw(3) << _series[1]->_domains[0]
197  << " " << std::setw(3) << _series[2]->_domains[0]
198  << " === Value ===\n"
199  << "----------------------------------------------\n";
200 
201  for (std::size_t i = 0; i < _series[0]->getNumberOfTerms(); ++i)
202  {
203  for (std::size_t j = 0; j < _series[1]->getNumberOfTerms(); ++j)
204  {
205  for (std::size_t k = 0; k < _series[2]->getNumberOfTerms(); ++k, ++term)
206  formatted << " " << std::setw(4) << term
207  << " " << std::setw(3) << i
208  << " " << std::setw(3) << j
209  << " " << std::setw(3) << k
210  << " " << std::setw(12) << coefficients[term] << "\n";
211  }
212  }
213  }
214  // clang-format on
215 
216  stream << orders.str() << domains.str() << formatted.str() << std::flush;
217 }
std::vector< MooseEnum > _series_types
The series types in this composite series.
std::vector< std::unique_ptr< SingleSeriesBasisInterface > > _series
A pointer to the single series type (one for each entry in _domains)
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
static const std::string k
Definition: NS.h:124

◆ getAllExpansion()

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

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

Definition at line 73 of file FunctionalBasisInterface.C.

Referenced by FunctionalBasisInterface::getExpansion(), and FunctionalBasisInterface::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 ( )
inherited

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

Definition at line 57 of file FunctionalBasisInterface.C.

Referenced by FunctionalBasisInterface::getGeneration(), and FunctionalBasisInterface::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 ( )
inherited

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 ( )
inherited

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 ( )
inherited

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 ( )
inherited

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
inherited

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()

const std::vector< Real > & CompositeSeriesBasisInterface::getStandardizedFunctionLimits ( ) const
finalvirtual

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

Implements FunctionalBasisInterface.

Definition at line 116 of file CompositeSeriesBasisInterface.C.

117 {
118  static const std::vector<Real> function_limits = combineStandardizedFunctionLimits();
119 
120  return function_limits;
121 }
std::vector< Real > combineStandardizedFunctionLimits() const
Get the function limits by looping over each of the single series.

◆ getStandardizedFunctionVolume()

Real CompositeSeriesBasisInterface::getStandardizedFunctionVolume ( ) const
finalvirtual

Returns the volume within the standardized function local_limits.

Implements FunctionalBasisInterface.

Definition at line 124 of file CompositeSeriesBasisInterface.C.

125 {
126  Real function_volume = 1.0;
127 
128  for (auto & series : _series)
129  function_volume *= series->getStandardizedFunctionVolume();
130 
131  return function_volume;
132 }
std::vector< std::unique_ptr< SingleSeriesBasisInterface > > _series
A pointer to the single series type (one for each entry in _domains)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ isCacheInvalid()

bool CompositeSeriesBasisInterface::isCacheInvalid ( ) const
finalvirtual

Whether the cached values correspond to the current point.

Implements FunctionalBasisInterface.

Definition at line 220 of file CompositeSeriesBasisInterface.C.

221 {
222  /*
223  * If any one of the single series have an invalid cache, then we need to re-evaluate the entire
224  * composite series because the terms are multiplied.
225  */
226  for (auto & series : _series)
227  if (series->isCacheInvalid())
228  return true;
229 
230  return false;
231 }
std::vector< std::unique_ptr< SingleSeriesBasisInterface > > _series
A pointer to the single series type (one for each entry in _domains)

◆ isExpansion()

bool FunctionalBasisInterface::isExpansion ( ) const
inherited

Returns true if the current evaluation is expansion.

Definition at line 51 of file FunctionalBasisInterface.C.

Referenced by FunctionalBasisInterface::getAllGeneration().

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

◆ isGeneration()

bool FunctionalBasisInterface::isGeneration ( ) const
inherited

Returns true if the current evaluation is generation.

Definition at line 45 of file FunctionalBasisInterface.C.

Referenced by FunctionalBasisInterface::getAllExpansion().

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

◆ isInPhysicalBounds()

bool CompositeSeriesBasisInterface::isInPhysicalBounds ( const Point &  point) const
finalvirtual

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

Implements FunctionalBasisInterface.

Definition at line 234 of file CompositeSeriesBasisInterface.C.

235 {
236  /*
237  * A point is in the physical bounds of the composite series if it is in the physical bounds of
238  * each of the single series
239  */
240  for (auto & series : _series)
241  if (!series->isInPhysicalBounds(point))
242  return false;
243 
244  return true;
245 }
std::vector< std::unique_ptr< SingleSeriesBasisInterface > > _series
A pointer to the single series type (one for each entry in _domains)

◆ load()

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

◆ operator=() [1/2]

void CompositeSeriesBasisInterface::operator= ( const CompositeSeriesBasisInterface )
delete

◆ operator=() [2/2]

CompositeSeriesBasisInterface& CompositeSeriesBasisInterface::operator= ( CompositeSeriesBasisInterface &&  )
delete

◆ operator[]()

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

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 
)
protectedinherited

Helper function to store a value in _series.

Definition at line 139 of file FunctionalBasisInterface.C.

Referenced by Legendre::evaluateOrthonormal(), Zernike::evaluateOrthonormal(), 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()

void CompositeSeriesBasisInterface::setLocation ( const Point &  point)
finalvirtual

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

Implements FunctionalBasisInterface.

Definition at line 287 of file CompositeSeriesBasisInterface.C.

Referenced by TEST().

288 {
289  // Return if this point is the same as the last at which the composite series was evaluated
290  if (point.absolute_fuzzy_equals(_previous_point))
291  return;
292 
293  // Set the location of each of the single series
294  for (auto & series : _series)
295  series->setLocation(point);
296 
297  // Store the previous point
298  _previous_point = point;
299 }
std::vector< std::unique_ptr< SingleSeriesBasisInterface > > _series
A pointer to the single series type (one for each entry in _domains)
Point _previous_point
The previous point at which the series was evaluated.

◆ setNumberOfTerms()

void CompositeSeriesBasisInterface::setNumberOfTerms ( )

Initialize the number of terms in the composite series by looping over the single series.

Definition at line 248 of file CompositeSeriesBasisInterface.C.

Referenced by Cartesian::Cartesian(), CylindricalDuo::CylindricalDuo(), and setOrder().

249 {
250  unsigned int number_of_terms = 1;
251 
252  // Accumulate the number of terms for each series
253  for (auto & series : _series)
254  number_of_terms *= series->getNumberOfTerms();
255 
256  _number_of_terms = number_of_terms;
257 
258  /*
259  * The length of the _basis_evaluation depends on the number of terms, so we need to clear the
260  * entries because the number of terms in the composite series may have changed.
261  */
263 }
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.
std::vector< std::unique_ptr< SingleSeriesBasisInterface > > _series
A pointer to the single series type (one for each entry in _domains)

◆ setOrder()

void CompositeSeriesBasisInterface::setOrder ( const std::vector< std::size_t > &  orders)
finalvirtual

Set the order of the series.

Implements FunctionalBasisInterface.

Definition at line 266 of file CompositeSeriesBasisInterface.C.

267 {
268  // One order must be specified for each single series
269  if (orders.size() != _series.size())
271  " calling CSBI::setOrder(): Mismatch between the orders provided and the number of "
272  "series in the functional basis!");
273 
274  // Update the orders of each of the single series
275  for (std::size_t i = 0; i < _series.size(); ++i)
276  _series[i]->setOrder({orders[i]});
277 
278  /*
279  * After changing the order of each single series, we need to recompute the number of terms by
280  * looping over those single series. This also clears the basis evaluation of the composite
281  * series.
282  */
284 }
void mooseError(Args &&... args)
virtual void setOrder(const std::vector< std::size_t > &orders) final
Set the order of the series.
void setNumberOfTerms()
Initialize the number of terms in the composite series by looping over the single series...
std::vector< std::unique_ptr< SingleSeriesBasisInterface > > _series
A pointer to the single series type (one for each entry in _domains)
const std::string & _who_is_using_me
The name of the MooseObject that is using this class.

◆ setPhysicalBounds()

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

Sets the bounds of the series.

Implemented in SingleSeriesBasisInterface, Cartesian, and CylindricalDuo.

Member Data Documentation

◆ _domain_options

MooseEnum FunctionalBasisInterface::_domain_options
staticinherited

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
private

indicates if the evaluated values correspond to the current location

Definition at line 146 of file FunctionalBasisInterface.h.

◆ _number_of_terms

unsigned int FunctionalBasisInterface::_number_of_terms
protectedinherited

◆ _previous_point

Point CompositeSeriesBasisInterface::_previous_point
private

The previous point at which the series was evaluated.

Definition at line 86 of file CompositeSeriesBasisInterface.h.

Referenced by setLocation().

◆ _series

std::vector<std::unique_ptr<SingleSeriesBasisInterface> > CompositeSeriesBasisInterface::_series
protected

◆ _series_types

std::vector<MooseEnum> CompositeSeriesBasisInterface::_series_types
protected

◆ _who_is_using_me

const std::string& CompositeSeriesBasisInterface::_who_is_using_me
protected

The name of the MooseObject that is using this class.

Definition at line 82 of file CompositeSeriesBasisInterface.h.

Referenced by CompositeSeriesBasisInterface(), and setOrder().


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