www.mooseframework.org
SingleSeriesBasisInterface.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 
13 #include <functional>
14 
20 {
21 public:
23  SingleSeriesBasisInterface(const std::vector<MooseEnum> & domains,
24  const std::vector<std::size_t> & orders,
25  const unsigned int number_of_terms);
27 
28  // Disable move and copy operations
31  void operator=(const SingleSeriesBasisInterface &) = delete;
33 
34  // Overrides from FunctionalBasisInterface
35  virtual bool isCacheInvalid() const final;
36  virtual void setLocation(const Point & point) final;
37  virtual void setOrder(const std::vector<std::size_t> & orders) final;
38  virtual void setPhysicalBounds(const std::vector<Real> & bounds) final;
39 
43  virtual std::size_t
44  calculatedNumberOfTermsBasedOnOrder(const std::vector<std::size_t> & order) const = 0;
45 
51  virtual std::vector<Real> getStandardizedLocation(const std::vector<Real> & location) const = 0;
52 
56  std::size_t getOrder(std::size_t domain) const;
57 
60  const std::vector<MooseEnum> _domains;
61 
62 protected:
63  // Overrides from FunctionalBasisInterface
64  virtual void evaluateGeneration() override;
65  virtual void evaluateExpansion() override;
66 
70  virtual void checkPhysicalBounds(const std::vector<Real> & bounds) const = 0;
71 
76  std::vector<Real> extractLocationFromPoint(const Point & point) const;
77 
79  std::vector<std::size_t> _orders;
80 
82  std::vector<Real> _physical_bounds;
83 
85  std::vector<Real> _standardized_location;
86 
88  std::function<void()> _evaluateExpansionWrapper;
89 
91  std::function<void()> _evaluateGenerationWrapper;
92 
93 private:
96 
99  std::vector<Real> _location;
100 
101  // Hide from subclasses to prevent BAD things from happening
104 };
bool _are_physical_bounds_specified
Flag for if the physical bounds are specified for this series.
virtual void checkPhysicalBounds(const std::vector< Real > &bounds) const =0
Checks the physical bounds according to the actual implementation.
std::vector< Real > _standardized_location
The standardized location of evaluation.
const std::vector< MooseEnum > _domains
An ordered list of the x, y, and/or z domains needed by the functional basis to convert a point to a ...
std::function< void()> _evaluateExpansionWrapper
The expansion evaluation wrapper.
virtual void evaluateExpansion() override
Evaluate the expansion form of the functional basis.
std::function< void()> _evaluateGenerationWrapper
The generation evaluation wrapper.
virtual void evaluateGeneration() override
Evaluate the generation form of the functional basis.
virtual void clearBasisEvaluation(const unsigned int &number_of_terms)
Set all entries of the basis evaluation to zero.
virtual bool isCacheInvalid() const final
Whether the cached values correspond to the current point.
std::vector< Real > _location
The domain locations of the current evaluation.
std::vector< Real > _physical_bounds
The physical bounds of the series.
virtual void setOrder(const std::vector< std::size_t > &orders) final
Set the order of the series.
virtual void setPhysicalBounds(const std::vector< Real > &bounds) final
Sets the bounds of the series.
virtual void setLocation(const Point &point) final
Set the location that will be used by the series to compute values.
std::size_t getOrder(std::size_t domain) const
Returns the order of the particular domain index.
std::vector< Real > extractLocationFromPoint(const Point &point) const
Convert a spatial point to a location that the series will use to determine the value at which to eva...
std::vector< std::size_t > _orders
The order of the series.
virtual std::size_t calculatedNumberOfTermsBasedOnOrder(const std::vector< std::size_t > &order) const =0
Returns the number of terms in the single series given a value for the order.
virtual std::vector< Real > getStandardizedLocation(const std::vector< Real > &location) const =0
Standardize the location according to the requirements of the underlying basis, which may actually co...
This class is a simple wrapper around FunctionalBasisInterface, and intended for use by any single fu...
This class provides the basis for any custom functional basis, and is the parent class of both Single...
void operator=(const SingleSeriesBasisInterface &)=delete
bool _is_cache_invalid
indicates if the evaluated values correspond to the current location