Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_OneDOrthogPolyBasis.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_ONEDORTHOGPOLYBASIS_HPP
11 #define STOKHOS_ONEDORTHOGPOLYBASIS_HPP
12 
13 #include <ostream>
14 #include <string>
15 #include "Stokhos_Dense3Tensor.hpp"
17 #include "Teuchos_Array.hpp"
19 
20 #include "Stokhos_ConfigDefs.h"
21 #ifdef HAVE_STOKHOS_DAKOTA
22 #include "sandia_rules.hpp"
23 #endif
24 
26 namespace Stokhos {
27 
29 
48  template <typename ordinal_type, typename value_type>
50  public:
51 
54 
56  virtual ~OneDOrthogPolyBasis() {};
57 
59  virtual ordinal_type order() const = 0;
60 
62  virtual ordinal_type size() const = 0;
63 
65 
69  virtual const Teuchos::Array<value_type>& norm_squared() const = 0;
70 
72  virtual const value_type& norm_squared(ordinal_type i) const = 0;
73 
75 
82  virtual
84  computeTripleProductTensor() const = 0;
85 
87 
94  virtual
97 
99 
105  virtual
108 
110 
114  virtual void evaluateBases(const value_type& point,
115  Teuchos::Array<value_type>& basis_pts) const = 0;
116 
121  virtual value_type evaluate(const value_type& point,
122  ordinal_type order) const = 0;
123 
125  virtual void print(std::ostream& os) const {};
126 
128  virtual const std::string& getName() const = 0;
129 
141  virtual void
142  getQuadPoints(ordinal_type quad_order,
145  Teuchos::Array< Teuchos::Array<value_type> >& values) const = 0;
146 
151  virtual ordinal_type quadDegreeOfExactness(ordinal_type n) const = 0;
152 
164 
166  virtual ordinal_type coefficientGrowth(ordinal_type n) const = 0;
167 
169  virtual ordinal_type pointGrowth(ordinal_type n) const = 0;
170 
172  typedef int ( *LevelToOrderFnPtr ) ( int level, int growth );
173 
175 
184  virtual LevelToOrderFnPtr getSparseGridGrowthRule() const = 0;
185 
187  virtual void setSparseGridGrowthRule(LevelToOrderFnPtr ptr) = 0;
188 
189  private:
190 
191  // Prohibit copying
193 
194  // Prohibit Assignment
196 
197 
198  }; // class OrthogPolyBasis
199 
201  template <typename ordinal_type, typename value_type>
202  std::ostream&
203  operator << (std::ostream& os,
205  b.print(os);
206  return os;
207  }
208 
209 } // Namespace Stokhos
210 
211 #endif
OneDOrthogPolyBasis & operator=(const OneDOrthogPolyBasis &b)
virtual ordinal_type coefficientGrowth(ordinal_type n) const =0
Evaluate coefficient growth rule for Smolyak-type bases.
virtual void evaluateBases(const value_type &point, Teuchos::Array< value_type > &basis_pts) const =0
Evaluate each basis polynomial at given point point.
virtual ordinal_type pointGrowth(ordinal_type n) const =0
Evaluate point growth rule for Smolyak-type bases.
virtual const Teuchos::Array< value_type > & norm_squared() const =0
Return array storing norm-squared of each basis polynomial.
virtual value_type evaluate(const value_type &point, ordinal_type order) const =0
Evaluate basis polynomial given by order order at given point point.
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 =0
Compute quadrature points, weights, and values of basis polynomials at given set of points points...
virtual void print(std::ostream &os) const
Print basis to stream os.
virtual ordinal_type quadDegreeOfExactness(ordinal_type n) const =0
int(* LevelToOrderFnPtr)(int level, int growth)
Function pointer needed for level_to_order mappings.
std::ostream & operator<<(std::ostream &os, const ProductContainer< coeff_type > &vec)
virtual ordinal_type size() const =0
Return total size of basis (given by order() + 1).
virtual void setSparseGridGrowthRule(LevelToOrderFnPtr ptr)=0
Set sparse grid rule.
Abstract base class for 1-D orthogonal polynomials.
virtual Teuchos::RCP< Stokhos::Dense3Tensor< ordinal_type, value_type > > computeTripleProductTensor() const =0
Compute triple product tensor.
virtual Teuchos::RCP< Teuchos::SerialDenseMatrix< ordinal_type, value_type > > computeDerivDoubleProductTensor() const =0
Compute derivative double product tensor.
virtual Teuchos::RCP< OneDOrthogPolyBasis< ordinal_type, value_type > > cloneWithOrder(ordinal_type p) const =0
Clone this object with the option of building a higher order basis.
virtual const std::string & getName() const =0
Return string name of basis.
virtual ordinal_type order() const =0
Return order of basis (largest monomial degree ).
virtual LevelToOrderFnPtr getSparseGridGrowthRule() const =0
Get sparse grid level_to_order mapping function.
virtual Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > computeSparseTripleProductTensor(ordinal_type order) const =0
Compute triple product tensor.