https://mooseframework.inl.gov
FunctionalBasisInterface.h
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 #pragma once
11 
12 #include "MooseEnum.h"
13 #include "MooseError.h"
14 #include "MooseTypes.h"
15 
16 // Shortened typename
17 
23 {
24 public:
26  FunctionalBasisInterface(const unsigned int number_of_terms);
27 
31  Real operator[](std::size_t index) const;
32 
36  const std::vector<Real> & getAllGeneration();
37 
41  const std::vector<Real> & getAllExpansion();
42 
46  std::size_t getNumberOfTerms() const;
47 
52 
57 
62 
67 
71  virtual const std::vector<Real> & getStandardizedFunctionLimits() const = 0;
72 
76  virtual Real getStandardizedFunctionVolume() const = 0;
77 
81  bool isGeneration() const;
82 
86  bool isExpansion() const;
87 
91  virtual bool isCacheInvalid() const = 0;
92 
96  virtual bool isInPhysicalBounds(const Point & point) const = 0;
97 
101  virtual void setLocation(const Point & point) = 0;
102 
106  virtual void setOrder(const std::vector<std::size_t> & orders) = 0;
107 
111  virtual void setPhysicalBounds(const std::vector<Real> & bounds) = 0;
112 
115 
116 protected:
120  virtual void clearBasisEvaluation(const unsigned int & number_of_terms);
121 
125  virtual void evaluateGeneration() = 0;
126 
130  virtual void evaluateExpansion() = 0;
131 
135  Real load(std::size_t index) const;
136 
140  void save(std::size_t index, Real value);
141 
143  unsigned int _number_of_terms;
144 
147 
148 private:
150  std::vector<Real> _basis_evaluation;
151 
154 };
std::vector< Real > _basis_evaluation
Stores the values of the basis evaluation.
virtual void evaluateExpansion()=0
Evaluate the expansion form of the functional basis.
Real getExpansion()
Gets the #_order-th term of the expansion functional basis.
Real operator[](std::size_t index) const
Returns the current evaluation at the given index.
bool _is_generation
Indicates whether the current evaluation is expansion or generation.
Real getGeneration()
Gets the last term of the generation functional basis.
const std::vector< Real > & getAllExpansion()
Returns an array reference containing the value of each expansion term.
unsigned int _number_of_terms
The number of terms in the series.
virtual const std::vector< Real > & getStandardizedFunctionLimits() const =0
Returns a vector of the lower and upper bounds of the standard functional space.
static MooseEnum _domain_options
An enumeration of the domains available to each functional series.
virtual Real getStandardizedFunctionVolume() const =0
Returns the volume within the standardized function local_limits.
virtual void clearBasisEvaluation(const unsigned int &number_of_terms)
Set all entries of the basis evaluation to zero.
void save(std::size_t index, Real value)
Helper function to store a value in #_series.
virtual void setPhysicalBounds(const std::vector< Real > &bounds)=0
Sets the bounds of the series.
Real getGenerationSeriesSum()
Gets the sum of all terms in the generation functional basis.
virtual bool isInPhysicalBounds(const Point &point) const =0
Determines if the point provided is in within the physical bounds.
const std::vector< Real > & getAllGeneration()
Returns an array reference containing the value of each generation term.
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.
Real getExpansionSeriesSum()
Evaluates the sum of all terms in the expansion functional basis up to #_order.
Real load(std::size_t index) const
Helper function to load a value from #_series.
virtual void setOrder(const std::vector< std::size_t > &orders)=0
Set the order of the series.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void evaluateGeneration()=0
Evaluate the generation form of the functional basis.
virtual void setLocation(const Point &point)=0
Set the location that will be used by the series to compute values.
std::size_t getNumberOfTerms() const
Returns the number of terms in the series.
bool isGeneration() const
Returns true if the current evaluation is generation.
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