www.mooseframework.org
CompositeSeriesBasisInterface.h
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 #pragma once
11 
12 #include <iomanip>
13 
15 
16 #include "libmesh/point.h"
17 
19 
25 {
26 public:
27  CompositeSeriesBasisInterface(const std::string & who_is_using_me);
28  CompositeSeriesBasisInterface(const std::vector<std::size_t> & orders,
29  std::vector<MooseEnum> series_types,
30  const std::string & who_is_using_me);
32 
33  // Disable move and copy operations
36  void operator=(const CompositeSeriesBasisInterface &) = delete;
38 
39  // Overrides from FunctionalBasisInterface
40  virtual const std::vector<Real> & getStandardizedFunctionLimits() const final;
41  virtual Real getStandardizedFunctionVolume() const final;
42  virtual bool isCacheInvalid() const final;
43  virtual bool isInPhysicalBounds(const Point & point) const final;
44  virtual void setLocation(const Point & p) final;
45  // This definition must be with CSBI because it has to loop over each of the single series.
46  virtual void setOrder(const std::vector<std::size_t> & orders) final;
47 
51  std::vector<Real> combineStandardizedFunctionLimits() const;
52 
56  void setNumberOfTerms();
57 
61  virtual void formatCoefficients(std::ostream & stream,
62  const std::vector<Real> & coefficients) const;
63 
64 protected:
65  // Overrides from FunctionalBasisInterface
66  virtual void evaluateGeneration() final;
67  virtual void evaluateExpansion() final;
68 
73  void evaluateSeries(const std::vector<std::vector<Real>> & single_series_basis_evaluations);
74 
76  std::vector<MooseEnum> _series_types;
77 
79  std::vector<std::unique_ptr<SingleSeriesBasisInterface>> _series;
80 
82  const std::string & _who_is_using_me;
83 
84 private:
87 
88  // Hide from subclasses (everything can be done by CSBI) to prevent BAD things from happening
91 };
std::vector< MooseEnum > _series_types
The series types in this composite series.
virtual bool isInPhysicalBounds(const Point &point) const final
Determines if the point provided is in within the physical bounds.
CompositeSeriesBasisInterface(const std::string &who_is_using_me)
virtual void evaluateGeneration() final
Evaluate the generation form of the functional basis.
This class is the basis for constructing a composite—or convolved—functional series by combining mu...
virtual const std::vector< Real > & getStandardizedFunctionLimits() const final
Returns a vector of the lower and upper bounds of the standard functional space.
virtual void clearBasisEvaluation(const unsigned int &number_of_terms)
Set all entries of the basis evaluation to zero.
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...
virtual void setLocation(const Point &p) final
Set the location that will be used by the series to compute values.
void operator=(const CompositeSeriesBasisInterface &)=delete
void evaluateSeries(const std::vector< std::vector< Real >> &single_series_basis_evaluations)
Evaluates the values of _basis_evaluation for either evaluateGeneration() or evaluateExpansion() ...
virtual void formatCoefficients(std::ostream &stream, const std::vector< Real > &coefficients) const
Appends a tabulated form of the coefficients to the stream.
std::vector< std::unique_ptr< SingleSeriesBasisInterface > > _series
A pointer to the single series type (one for each entry in _domains)
virtual bool isCacheInvalid() const final
Whether the cached values correspond to the current point.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void evaluateExpansion() final
Evaluate the expansion form of the functional basis.
const std::string & _who_is_using_me
The name of the MooseObject that is using this class.
std::vector< Real > combineStandardizedFunctionLimits() const
Get the function limits by looping over each of the single series.
This class is a simple wrapper around FunctionalBasisInterface, and intended for use by any single fu...
Point _previous_point
The previous point at which the series was evaluated.
virtual Real getStandardizedFunctionVolume() const final
Returns the volume within the standardized function local_limits.
This class provides the basis for any custom functional basis, and is the parent class of both Single...
bool _is_cache_invalid
indicates if the evaluated values correspond to the current location