www.mooseframework.org
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Cartesian Class Referencefinal

This class constructs a functional expansion using a separate series for each Cartesian dimension. More...

#include <Cartesian.h>

Inheritance diagram for Cartesian:
[legend]

Public Member Functions

 Cartesian (const std::string &who_is_using_me)
 
 Cartesian (const std::vector< MooseEnum > &domain, const std::vector< std::size_t > &order, const std::vector< MooseEnum > &series_types, const std::string &who_is_using_me, MooseEnum expansion_type, MooseEnum generation_type)
 
virtual void setPhysicalBounds (const std::vector< Real > &bounds) final
 Sets the bounds of the series. More...
 
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< Real > combineStandardizedFunctionLimits () 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...
 

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...
 

Detailed Description

This class constructs a functional expansion using a separate series for each Cartesian dimension.

1D, 2D, and 3D domains are supported.

Definition at line 19 of file Cartesian.h.

Constructor & Destructor Documentation

◆ Cartesian() [1/2]

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

Definition at line 13 of file Cartesian.C.

14  : CompositeSeriesBasisInterface(who_is_using_me)
15 {
16 }
CompositeSeriesBasisInterface(const std::string &who_is_using_me)

◆ Cartesian() [2/2]

Cartesian::Cartesian ( const std::vector< MooseEnum > &  domain,
const std::vector< std::size_t > &  order,
const std::vector< MooseEnum > &  series_types,
const std::string &  who_is_using_me,
MooseEnum  expansion_type,
MooseEnum  generation_type 
)

Definition at line 18 of file Cartesian.C.

24  : CompositeSeriesBasisInterface(orders, series_types, who_is_using_me)
25 {
26  // Initialize the pointers to each of the single series
27  for (std::size_t i = 0; i < _series_types.size(); ++i)
28  if (_series_types[i] == "Legendre")
29  {
30  std::vector<MooseEnum> local_domain = {domains[i]};
31  std::vector<std::size_t> local_order = {orders[i]};
32  _series.push_back(libmesh_make_unique<Legendre>(
33  local_domain, local_order, expansion_type, generation_type));
34  }
35  else
36  mooseError("Cartesian: No other linear series implemented except Legendre!");
37 
38  /*
39  * Set the _number_of_terms for the composite series by looping over each of the single series.
40  * This also initializes _basis_evaluation with zero values and the appropriate length.
41  */
43 }
std::vector< MooseEnum > _series_types
The series types in this composite series.
CompositeSeriesBasisInterface(const std::string &who_is_using_me)
void setNumberOfTerms()
Initialize the number of terms in the composite series by looping over the single series...
MooseEnum expansion_type
std::vector< std::unique_ptr< SingleSeriesBasisInterface > > _series
A pointer to the single series type (one for each entry in _domains)
MooseEnum generation_type

Member Function Documentation

◆ clearBasisEvaluation()

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

Set all entries of the basis evaluation to zero.

Definition at line 144 of file FunctionalBasisInterface.C.

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

◆ combineStandardizedFunctionLimits()

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

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

Definition at line 133 of file CompositeSeriesBasisInterface.C.

Referenced by CompositeSeriesBasisInterface::getStandardizedFunctionLimits().

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

◆ evaluateExpansion()

void CompositeSeriesBasisInterface::evaluateExpansion ( )
finalprotectedvirtualinherited

Evaluate the expansion form of the functional basis.

Implements FunctionalBasisInterface.

Definition at line 99 of file CompositeSeriesBasisInterface.C.

100 {
101  /*
102  * Evaluate the expansion versions of each of the single series, and collect the results before
103  * passing them to evaluateSeries, where they will be multiplied together correctly and stored in
104  * the composite series basis evaluation.
105  */
106  std::vector<std::vector<Real>> single_series_basis_evaluation;
107  for (auto & series : _series)
108  single_series_basis_evaluation.push_back(series->getAllExpansion());
109 
110  evaluateSeries(single_series_basis_evaluation);
111 }
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 ( )
finalprotectedvirtualinherited

Evaluate the generation form of the functional basis.

Implements FunctionalBasisInterface.

Definition at line 42 of file CompositeSeriesBasisInterface.C.

43 {
44  /*
45  * Evaluate the generation versions of each of the single series, and collect the results before
46  * passing them to evaluateSeries, where they will be multiplied together correctly and stored in
47  * the composite series basis evaluation.
48  */
49  std::vector<std::vector<Real>> single_series_basis_evaluation;
50  for (auto & series : _series)
51  single_series_basis_evaluation.push_back(series->getAllGeneration());
52 
53  evaluateSeries(single_series_basis_evaluation);
54 }
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)
protectedinherited

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

Definition at line 57 of file CompositeSeriesBasisInterface.C.

Referenced by CompositeSeriesBasisInterface::evaluateExpansion(), and CompositeSeriesBasisInterface::evaluateGeneration().

59 {
60  /*
61  * Appropriate number of loops based on 1-D, 2-D, or 3-D to multiply the basis evaluations of the
62  * single series together to form the basis evaluation of the entire composite series.
63  */
64  Real f1, f2, f3;
65  std::size_t term = 0;
66 
67  if (single_series_basis_evaluations.size() == 1)
68  for (std::size_t i = 0; i < _series[0]->getNumberOfTerms(); ++i, ++term)
69  save(term, single_series_basis_evaluations[0][i]);
70 
71  if (single_series_basis_evaluations.size() == 2)
72  for (std::size_t i = 0; i < _series[0]->getNumberOfTerms(); ++i)
73  {
74  f1 = single_series_basis_evaluations[0][i];
75  for (std::size_t j = 0; j < _series[1]->getNumberOfTerms(); ++j, ++term)
76  {
77  f2 = single_series_basis_evaluations[1][j];
78  save(term, f1 * f2);
79  }
80  }
81 
82  if (single_series_basis_evaluations.size() == 3)
83  for (std::size_t i = 0; i < _series[0]->getNumberOfTerms(); ++i)
84  {
85  f1 = single_series_basis_evaluations[0][i];
86  for (std::size_t j = 0; j < _series[1]->getNumberOfTerms(); ++j)
87  {
88  f2 = single_series_basis_evaluations[1][j];
89  for (std::size_t k = 0; k < _series[2]->getNumberOfTerms(); ++k, ++term)
90  {
91  f3 = single_series_basis_evaluations[2][k];
92  save(term, f1 * f2 * f3);
93  }
94  }
95  }
96 }
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)

◆ formatCoefficients()

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

Appends a tabulated form of the coefficients to the stream.

Definition at line 148 of file CompositeSeriesBasisInterface.C.

150 {
151  // clang-format off
152  std::ostringstream formatted, domains, orders;
153  std::size_t term = 0;
154 
155  stream << "---------------- Coefficients ----------------\n"
156  << " == Subindices ==\n";
157 
158  if (_series_types.size() == 1)
159  {
160  orders << " Orders: " << std::setw(3) << _series[0]->getOrder(0) << "\n";
161  domains << " == Index == " << std::setw(3) << _series[0]->_domains[0]
162  << " === Value ===\n"
163  << "----------------------------------------------\n";
164 
165  for (std::size_t i = 0; i < _series[0]->getNumberOfTerms(); ++i, ++term)
166  formatted << " " << std::setw(4) << term
167  << " " << std::setw(3) << i
168  << " " << std::setw(12) << coefficients[term] << "\n";
169  }
170  else if (_series_types.size() == 2)
171  {
172  orders << " Orders: " << std::setw(3) << _series[0]->getOrder(0)
173  << " " << std::setw(3) << _series[1]->getOrder(0) << "\n";
174  domains << " == Index == " << std::setw(3) << _series[0]->_domains[0]
175  << " " << std::setw(3) << _series[1]->_domains[0]
176  << " === Value ===\n"
177  << "----------------------------------------------\n";
178 
179  for (std::size_t i = 0; i < _series[0]->getNumberOfTerms(); ++i)
180  {
181  for (std::size_t j = 0; j < _series[1]->getNumberOfTerms(); ++j, ++term)
182  formatted << " " << std::setw(4) << term
183  << " " << std::setw(3) << i
184  << " " << std::setw(3) << j
185  << " " << std::setw(12) << coefficients[term] << "\n";
186  }
187  }
188  else if (_series_types.size() == 3)
189  {
190  orders << " Orders: " << std::setw(3) << _series[0]->getOrder(0)
191  << " " << std::setw(3) << _series[1]->getOrder(0)
192  << " " << std::setw(3) << _series[2]->getOrder(0) << "\n";
193  domains << " == Index == " << std::setw(3) << _series[0]->_domains[0]
194  << " " << std::setw(3) << _series[1]->_domains[0]
195  << " " << std::setw(3) << _series[2]->_domains[0]
196  << " === Value ===\n"
197  << "----------------------------------------------\n";
198 
199  for (std::size_t i = 0; i < _series[0]->getNumberOfTerms(); ++i)
200  {
201  for (std::size_t j = 0; j < _series[1]->getNumberOfTerms(); ++j)
202  {
203  for (std::size_t k = 0; k < _series[2]->getNumberOfTerms(); ++k, ++term)
204  formatted << " " << std::setw(4) << term
205  << " " << std::setw(3) << i
206  << " " << std::setw(3) << j
207  << " " << std::setw(3) << k
208  << " " << std::setw(12) << coefficients[term] << "\n";
209  }
210  }
211  }
212  // clang-format on
213 
214  stream << orders.str() << domains.str() << formatted.str();
215 }
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)

◆ getAllExpansion()

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

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

Definition at line 72 of file FunctionalBasisInterface.C.

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

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

Definition at line 56 of file FunctionalBasisInterface.C.

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

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

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

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

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
inherited

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

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

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

Implements FunctionalBasisInterface.

Definition at line 114 of file CompositeSeriesBasisInterface.C.

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

◆ getStandardizedFunctionVolume()

Real CompositeSeriesBasisInterface::getStandardizedFunctionVolume ( ) const
finalvirtualinherited

Returns the volume within the standardized function local_limits.

Implements FunctionalBasisInterface.

Definition at line 122 of file CompositeSeriesBasisInterface.C.

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

◆ isCacheInvalid()

bool CompositeSeriesBasisInterface::isCacheInvalid ( ) const
finalvirtualinherited

Whether the cached values correspond to the current point.

Implements FunctionalBasisInterface.

Definition at line 218 of file CompositeSeriesBasisInterface.C.

219 {
220  /*
221  * If any one of the single series have an invalid cache, then we need to re-evaluate the entire
222  * composite series because the terms are multiplied.
223  */
224  for (auto & series : _series)
225  if (series->isCacheInvalid())
226  return true;
227 
228  return false;
229 }
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 50 of file FunctionalBasisInterface.C.

Referenced by FunctionalBasisInterface::getAllGeneration().

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

Referenced by FunctionalBasisInterface::getAllExpansion().

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

◆ isInPhysicalBounds()

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

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

Implements FunctionalBasisInterface.

Definition at line 232 of file CompositeSeriesBasisInterface.C.

233 {
234  /*
235  * A point is in the physical bounds of the composite series if it is in the physical bounds of
236  * each of the single series
237  */
238  for (auto & series : _series)
239  if (!series->isInPhysicalBounds(point))
240  return false;
241 
242  return true;
243 }
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[]()

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

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

◆ setLocation()

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

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

Implements FunctionalBasisInterface.

Definition at line 285 of file CompositeSeriesBasisInterface.C.

Referenced by TEST().

286 {
287  // Return if this point is the same as the last at which the composite series was evaluated
288  if (point.absolute_fuzzy_equals(_previous_point))
289  return;
290 
291  // Set the location of each of the single series
292  for (auto & series : _series)
293  series->setLocation(point);
294 
295  // Store the previous point
296  _previous_point = point;
297 }
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 ( )
inherited

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

Definition at line 246 of file CompositeSeriesBasisInterface.C.

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

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

Set the order of the series.

Implements FunctionalBasisInterface.

Definition at line 264 of file CompositeSeriesBasisInterface.C.

265 {
266  // One order must be specified for each single series
267  if (orders.size() != _series.size())
268  mooseError(_who_is_using_me,
269  " calling CSBI::setOrder(): Mismatch between the orders provided and the number of "
270  "series in the functional basis!");
271 
272  // Update the orders of each of the single series
273  for (std::size_t i = 0; i < _series.size(); ++i)
274  _series[i]->setOrder({orders[i]});
275 
276  /*
277  * After changing the order of each single series, we need to recompute the number of terms by
278  * looping over those single series. This also clears the basis evaluation of the composite
279  * series.
280  */
282 }
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()

void Cartesian::setPhysicalBounds ( const std::vector< Real > &  bounds)
finalvirtual

Sets the bounds of the series.

Implements FunctionalBasisInterface.

Definition at line 46 of file Cartesian.C.

47 {
48  // Each single series is assumed to be a function of a single variable so that it has two bounds
49  if (bounds.size() != _series_types.size() * 2)
50  mooseError("Cartesian: Mismatch between the physical bounds provided and the number of series "
51  "in the functional basis!");
52 
53  // Update the _physical_bounds of each of the single series
54  unsigned int j = 0;
55  for (std::size_t i = 0; i < _series_types.size(); ++i, j += 2)
56  _series[i]->setPhysicalBounds({bounds[j], bounds[j + 1]});
57 }
std::vector< MooseEnum > _series_types
The series types in this composite series.
virtual void setPhysicalBounds(const std::vector< Real > &bounds) final
Sets the bounds of the series.
Definition: Cartesian.C:46
std::vector< std::unique_ptr< SingleSeriesBasisInterface > > _series
A pointer to the single series type (one for each entry in _domains)

Member Data Documentation

◆ _domain_options

MooseEnum FunctionalBasisInterface::_domain_options
staticinherited

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

◆ _number_of_terms

unsigned int FunctionalBasisInterface::_number_of_terms
protectedinherited

◆ _series

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

◆ _series_types

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

◆ _who_is_using_me

const std::string& CompositeSeriesBasisInterface::_who_is_using_me
protectedinherited

The name of the MooseObject that is using this class.

Definition at line 81 of file CompositeSeriesBasisInterface.h.

Referenced by CompositeSeriesBasisInterface::CompositeSeriesBasisInterface(), and CompositeSeriesBasisInterface::setOrder().


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