https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
24public:
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
51 Real getGeneration();
52
57
61 Real getExpansion();
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
116protected:
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
148private:
150 std::vector<Real> _basis_evaluation;
151
154};
This class provides the basis for any custom functional basis, and is the parent class of both Single...
virtual void setLocation(const Point &point)=0
Set the location that will be used by the series to compute values.
const std::vector< Real > & getAllGeneration()
Returns an array reference containing the value of each generation term.
Real getGeneration()
Gets the last term of the generation functional basis.
bool _is_cache_invalid
indicates if the evaluated values correspond to the current location
virtual void evaluateGeneration()=0
Evaluate the generation form of the functional basis.
Real getGenerationSeriesSum()
Gets the sum of all terms in the generation functional basis.
const std::vector< Real > & getAllExpansion()
Returns an array reference containing the value of each expansion term.
virtual void evaluateExpansion()=0
Evaluate the expansion form of the functional basis.
bool _is_generation
Indicates whether the current evaluation is expansion or generation.
virtual void setPhysicalBounds(const std::vector< Real > &bounds)=0
Sets the bounds of the series.
unsigned int _number_of_terms
The number of terms in the series.
Real getExpansion()
Gets the #_order-th term of the expansion functional basis.
Real getExpansionSeriesSum()
Evaluates the sum of all terms in the expansion functional basis up to #_order.
static MooseEnum _domain_options
An enumeration of the domains available to each functional series.
bool isExpansion() const
Returns true if the current evaluation is expansion.
std::size_t getNumberOfTerms() const
Returns the number of terms in the series.
bool isGeneration() const
Returns true if the current evaluation is generation.
virtual void setOrder(const std::vector< std::size_t > &orders)=0
Set the order of the series.
virtual const std::vector< Real > & getStandardizedFunctionLimits() const =0
Returns a vector of the lower and upper bounds of the standard functional space.
virtual bool isInPhysicalBounds(const Point &point) const =0
Determines if the point provided is in within the physical bounds.
Real load(std::size_t index) const
Helper function to load a value from #_series.
virtual void clearBasisEvaluation(const unsigned int &number_of_terms)
Set all entries of the basis evaluation to zero.
virtual bool isCacheInvalid() const =0
Whether the cached values correspond to the current point.
virtual Real getStandardizedFunctionVolume() const =0
Returns the volume within the standardized function local_limits.
std::vector< Real > _basis_evaluation
Stores the values of the basis evaluation.
Real operator[](std::size_t index) const
Returns the current evaluation at the given index.
void save(std::size_t index, Real value)
Helper function to store a value in #_series.