www.mooseframework.org
Cartesian.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "Cartesian.h"
11 #include "Legendre.h"
12 
13 #include "libmesh/auto_ptr.h"
14 
15 Cartesian::Cartesian(const std::string & who_is_using_me)
16  : CompositeSeriesBasisInterface(who_is_using_me)
17 {
18 }
19 
20 Cartesian::Cartesian(const std::vector<MooseEnum> & domains,
21  const std::vector<std::size_t> & orders,
22  const std::vector<MooseEnum> & series_types,
23  const std::string & who_is_using_me,
24  MooseEnum expansion_type,
25  MooseEnum generation_type)
26  : CompositeSeriesBasisInterface(orders, series_types, who_is_using_me)
27 {
28  // Initialize the pointers to each of the single series
29  for (std::size_t i = 0; i < _series_types.size(); ++i)
30  if (_series_types[i] == "Legendre")
31  {
32  std::vector<MooseEnum> local_domain = {domains[i]};
33  std::vector<std::size_t> local_order = {orders[i]};
34  _series.push_back(libmesh_make_unique<Legendre>(
35  local_domain, local_order, expansion_type, generation_type));
36  }
37  else
38  mooseError("Cartesian: No other linear series implemented except Legendre!");
39 
40  /*
41  * Set the _number_of_terms for the composite series by looping over each of the single series.
42  * This also initializes _basis_evaluation with zero values and the appropriate length.
43  */
45 }
46 
47 void
48 Cartesian::setPhysicalBounds(const std::vector<Real> & bounds)
49 {
50  // Each single series is assumed to be a function of a single variable so that it has two bounds
51  if (bounds.size() != _series_types.size() * 2)
52  mooseError("Cartesian: Mismatch between the physical bounds provided and the number of series "
53  "in the functional basis!");
54 
55  // Update the _physical_bounds of each of the single series
56  unsigned int j = 0;
57  for (std::size_t i = 0; i < _series_types.size(); ++i, j += 2)
58  _series[i]->setPhysicalBounds({bounds[j], bounds[j + 1]});
59 }
Cartesian.h
Cartesian::Cartesian
Cartesian(const std::string &who_is_using_me)
Definition: Cartesian.C:15
CompositeSeriesBasisInterface::_series_types
std::vector< MooseEnum > _series_types
The series types in this composite series.
Definition: CompositeSeriesBasisInterface.h:76
expansion_type
MooseEnum expansion_type
Legendre.h
CompositeSeriesBasisInterface
This class is the basis for constructing a composite—or convolved—functional series by combining mult...
Definition: CompositeSeriesBasisInterface.h:24
generation_type
MooseEnum generation_type
CompositeSeriesBasisInterface::setNumberOfTerms
void setNumberOfTerms()
Initialize the number of terms in the composite series by looping over the single series.
Definition: CompositeSeriesBasisInterface.C:248
CompositeSeriesBasisInterface::_series
std::vector< std::unique_ptr< SingleSeriesBasisInterface > > _series
A pointer to the single series type (one for each entry in _domains)
Definition: CompositeSeriesBasisInterface.h:79
Cartesian::setPhysicalBounds
virtual void setPhysicalBounds(const std::vector< Real > &bounds) final
Sets the bounds of the series.
Definition: Cartesian.C:48