Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_SparseGridQuadrature.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_SPARSEGRIDQUADRATURE
11 #define STOKHOS_SPARSEGRIDQUADRATURE
12 
13 #include "Stokhos_ConfigDefs.h"
14 #ifdef HAVE_STOKHOS_DAKOTA
15 
16 #include "Stokhos_Quadrature.hpp"
17 #include "Stokhos_ProductBasis.hpp"
18 #include "Teuchos_RCP.hpp"
19 #include "pecos_global_defs.hpp"
20 
21 namespace Stokhos {
22 
32  template <typename ordinal_type, typename value_type>
33  class SparseGridQuadrature : public Quadrature<ordinal_type,value_type> {
34  public:
35 
37 
43  SparseGridQuadrature(
44  const Teuchos::RCP<const ProductBasis<ordinal_type,value_type> >& product_basis,
45  ordinal_type sparse_grid_level = 0,
46  value_type duplicate_tol = 1.0e-12,
47  ordinal_type growth_rate = Pecos::SLOW_RESTRICTED_GROWTH);
48 
50  virtual ~SparseGridQuadrature() {}
51 
53  virtual ordinal_type size() const { return quad_weights.size(); }
54 
56 
61  getQuadPoints() const;
62 
64 
67  virtual const Teuchos::Array<value_type>&
68  getQuadWeights() const;
69 
71 
76  getBasisAtQuadPoints() const;
77 
79  virtual std::ostream& print(std::ostream& os) const;
80 
81  private:
82 
83  // Prohibit copying
84  SparseGridQuadrature(const SparseGridQuadrature&);
85 
86  // Prohibit Assignment
87  SparseGridQuadrature& operator=(const SparseGridQuadrature& b);
88 
89  static void getMyPoints( int order, int dim, double x[] );
90 
91  static void getMyWeights( int order, int dim, double w[] );
92 
93  protected:
94 
97 
100 
102  Teuchos::Array<value_type> quad_weights;
103 
106 
108  static SparseGridQuadrature *sgq;
109 
110  }; // class SparseGridQuadrature
111 
112 } // namespace Stokhos
113 
114 // Include template definitions
116 
117 #endif // HAVE_STOKHOS_DAKOTA
118 
119 #endif // STOKHOS_SPARSEGRIDQUADRATURE