https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Cartesian.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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 <memory>
14
15Cartesian::Cartesian(const std::string & who_is_using_me)
16 : CompositeSeriesBasisInterface(who_is_using_me)
17{
18}
19
20Cartesian::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,
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(
35 std::make_unique<Legendre>(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
47void
48Cartesian::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}
void mooseError(Args &&... args)
MooseEnum expansion_type
MooseEnum generation_type
Cartesian(const std::string &who_is_using_me)
Definition Cartesian.C:15
virtual void setPhysicalBounds(const std::vector< Real > &bounds) final
Sets the bounds of the series.
Definition Cartesian.C:48
This class is the basis for constructing a composite—or convolved—functional series by combining mult...
std::vector< std::unique_ptr< SingleSeriesBasisInterface > > _series
A pointer to the single series type (one for each entry in _domains)
std::vector< MooseEnum > _series_types
The series types in this composite series.
void setNumberOfTerms()
Initialize the number of terms in the composite series by looping over the single series.