Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_RecurrenceBasis.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Stokhos Package
4 //
5 // Copyright 2009 NTESS and the Stokhos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef STOKHOS_RECURRENCEBASIS_HPP
11 #define STOKHOS_RECURRENCEBASIS_HPP
12 
14 
15 namespace Stokhos {
16 
18  enum GrowthPolicy {
21  };
22 
52  template <typename ordinal_type, typename value_type>
54  public OneDOrthogPolyBasis<ordinal_type, value_type> {
55  public:
56 
58  virtual ~RecurrenceBasis();
59 
61 
62 
64  virtual ordinal_type order() const;
65 
67  virtual ordinal_type size() const;
68 
70 
74  virtual const Teuchos::Array<value_type>& norm_squared() const;
75 
77  virtual const value_type& norm_squared(ordinal_type i) const;
78 
80 
92 
94 
104  virtual
107 
109 
119 
121 
125  virtual void evaluateBases(const value_type& point,
126  Teuchos::Array<value_type>& basis_pts) const;
127 
132  virtual value_type evaluate(const value_type& point,
133  ordinal_type order) const;
134 
136  virtual void print(std::ostream& os) const;
137 
139  virtual const std::string& getName() const;
140 
158  virtual void
159  getQuadPoints(ordinal_type quad_order,
162  Teuchos::Array< Teuchos::Array<value_type> >& values) const;
163 
169 
172 
174  virtual ordinal_type pointGrowth(ordinal_type n) const;
175 
178 
180 
190  return sparse_grid_growth_rule; }
191 
194  sparse_grid_growth_rule = ptr; }
195 
197 
203 
205  virtual void evaluateBasesAndDerivatives(const value_type& point,
207  Teuchos::Array<value_type>& derivs) const;
208 
210  virtual void setQuadZeroTol(value_type tol) {
211  quad_zero_tol = tol; }
212 
213  protected:
214 
216 
224  RecurrenceBasis(const std::string& name, ordinal_type p, bool normalize,
226 
229 
231 
240  virtual bool
245  Teuchos::Array<value_type>& gamma) const = 0;
246 
248 
252  virtual void setup();
253 
260 
261  private:
262 
263  // Prohibit copying
265 
266  // Prohibit Assignment
268 
269  protected:
270 
272  std::string name;
273 
276 
278  bool normalize;
279 
282 
285 
288 
291 
294 
297 
300 
303 
304  }; // class RecurrenceBasis
305 
306 } // Namespace Stokhos
307 
308 // Include template definitions
310 
311 #endif
Teuchos::Array< value_type > delta
Recurrence coefficients.
virtual void evaluateBases(const value_type &point, Teuchos::Array< value_type > &basis_pts) const
Evaluate each basis polynomial at given point point.
virtual Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > computeSparseTripleProductTensor(ordinal_type order) const
Compute triple product tensor.
value_type quad_zero_tol
Tolerance for quadrature points near zero.
virtual void getRecurrenceCoefficients(Teuchos::Array< value_type > &alpha, Teuchos::Array< value_type > &beta, Teuchos::Array< value_type > &delta, Teuchos::Array< value_type > &gamma) const
Return recurrence coefficients defined by above formula.
virtual const std::string & getName() const
Return string name of basis.
Teuchos::Array< value_type > norms
Norms.
Implementation of OneDOrthogPolyBasis based on the general three-term recurrence relationship: for ...
std::string name
Name of basis.
virtual value_type evaluate(const value_type &point, ordinal_type order) const
Evaluate basis polynomial given by order order at given point point.
virtual ~RecurrenceBasis()
Destructor.
virtual ordinal_type pointGrowth(ordinal_type n) const
Evaluate point growth rule for Smolyak-type bases.
virtual void getQuadPoints(ordinal_type quad_order, Teuchos::Array< value_type > &points, Teuchos::Array< value_type > &weights, Teuchos::Array< Teuchos::Array< value_type > > &values) const
Compute quadrature points, weights, and values of basis polynomials at given set of points points...
Teuchos::Array< value_type > beta
Recurrence coefficients.
GrowthPolicy
Enumerated type for determining Smolyak growth policies.
virtual void setQuadZeroTol(value_type tol)
Set tolerance for zero in quad point generation.
virtual Teuchos::RCP< Stokhos::Dense3Tensor< ordinal_type, value_type > > computeTripleProductTensor() const
Compute triple product tensor.
Teuchos::Array< value_type > alpha
Recurrence coefficients.
void normalizeRecurrenceCoefficients(Teuchos::Array< value_type > &alpha, Teuchos::Array< value_type > &beta, Teuchos::Array< value_type > &delta, Teuchos::Array< value_type > &gamma) const
Normalize coefficients.
virtual void evaluateBasesAndDerivatives(const value_type &point, Teuchos::Array< value_type > &vals, Teuchos::Array< value_type > &derivs) const
Evaluate basis polynomials and their derivatives at given point point.
OneDOrthogPolyBasis< ordinal_type, value_type >::LevelToOrderFnPtr LevelToOrderFnPtr
Function pointer needed for level_to_order mappings.
virtual ordinal_type quadDegreeOfExactness(ordinal_type n) const
virtual Teuchos::RCP< Teuchos::SerialDenseMatrix< ordinal_type, value_type > > computeDerivDoubleProductTensor() const
Compute derivative double product tensor.
virtual ordinal_type order() const
Return order of basis (largest monomial degree ).
virtual void print(std::ostream &os) const
Print basis to stream os.
LevelToOrderFnPtr sparse_grid_growth_rule
Sparse grid growth rule (as determined by Pecos)
virtual ordinal_type coefficientGrowth(ordinal_type n) const
Evaluate coefficient growth rule for Smolyak-type bases.
virtual void setup()
Setup basis after computing recurrence coefficients.
virtual bool computeRecurrenceCoefficients(ordinal_type n, Teuchos::Array< value_type > &alpha, Teuchos::Array< value_type > &beta, Teuchos::Array< value_type > &delta, Teuchos::Array< value_type > &gamma) const =0
Compute recurrence coefficients.
Abstract base class for 1-D orthogonal polynomials.
RecurrenceBasis & operator=(const RecurrenceBasis &b)
virtual ordinal_type size() const
Return total size of basis (given by order() + 1).
ordinal_type p
Order of basis.
Teuchos::Array< value_type > gamma
Recurrence coefficients.
virtual void setSparseGridGrowthRule(LevelToOrderFnPtr ptr)
Set sparse grid rule.
virtual LevelToOrderFnPtr getSparseGridGrowthRule() const
Get sparse grid level_to_order mapping function.
virtual const Teuchos::Array< value_type > & norm_squared() const
Return array storing norm-squared of each basis polynomial.
RecurrenceBasis(const std::string &name, ordinal_type p, bool normalize, GrowthPolicy growth=SLOW_GROWTH)
Constructor to be called by derived classes.
GrowthPolicy growth
Smolyak growth policy.
int n