Stokhos Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
Stokhos_PecosOneDOrthogPolyBasis.hpp
Go to the documentation of this file.
1// $Id$
2// $Source$
3// @HEADER
4// ***********************************************************************
5//
6// Stokhos Package
7// Copyright (2009) Sandia Corporation
8//
9// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
10// license for use of this work by or on behalf of the U.S. Government.
11//
12// Redistribution and use in source and binary forms, with or without
13// modification, are permitted provided that the following conditions are
14// met:
15//
16// 1. Redistributions of source code must retain the above copyright
17// notice, this list of conditions and the following disclaimer.
18//
19// 2. Redistributions in binary form must reproduce the above copyright
20// notice, this list of conditions and the following disclaimer in the
21// documentation and/or other materials provided with the distribution.
22//
23// 3. Neither the name of the Corporation nor the names of the
24// contributors may be used to endorse or promote products derived from
25// this software without specific prior written permission.
26//
27// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
28// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
31// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
32// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
33// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
35// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
36// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
37// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38//
39// Questions? Contact Eric T. Phipps (etphipp@sandia.gov).
40//
41// ***********************************************************************
42// @HEADER
43
44#ifndef STOKHOS_PECOS_ONED_ORTHOG_POLY_BASIS_HPP
45#define STOKHOS_PECOS_ONED_ORTHOG_POLY_BASIS_HPP
46
47#include "Stokhos_ConfigDefs.h"
48#ifdef HAVE_STOKHOS_DAKOTA
49
51#include "TriKota_ConfigDefs.hpp"
52#include "OrthogonalPolynomial.hpp"
53
54namespace Stokhos {
55
59 template <typename ordinal_type, typename value_type>
60 class PecosOneDOrthogPolyBasis :
61 public OneDOrthogPolyBasis<ordinal_type, value_type> {
62 public:
63
65
69 PecosOneDOrthogPolyBasis(
70 const Teuchos::RCP<Pecos::OrthogonalPolynomial>& pecosPoly,
71 const std::string& name, ordinal_type p);
72
74 virtual ~PecosOneDOrthogPolyBasis();
75
77
78
80 virtual ordinal_type order() const;
81
83 virtual ordinal_type size() const;
84
86
90 virtual const Teuchos::Array<value_type>& norm_squared() const;
91
93 virtual const value_type& norm_squared(ordinal_type i) const;
94
96
106 virtual Teuchos::RCP< Stokhos::Dense3Tensor<ordinal_type, value_type> >
107 computeTripleProductTensor() const;
108
109 virtual
110 Teuchos::RCP< Stokhos::Sparse3Tensor<ordinal_type, value_type> >
111 computeSparseTripleProductTensor(ordinal_type order) const;
112
114
123 virtual Teuchos::RCP< Teuchos::SerialDenseMatrix<ordinal_type, value_type> > computeDerivDoubleProductTensor() const;
124
126
130 virtual void evaluateBases(const value_type& point,
131 Teuchos::Array<value_type>& basis_pts) const;
132
137 virtual value_type evaluate(const value_type& point,
138 ordinal_type order) const;
139
141 virtual void print(std::ostream& os) const;
142
144 virtual const std::string& getName() const;
145
163 virtual void
164 getQuadPoints(ordinal_type quad_order,
165 Teuchos::Array<value_type>& points,
166 Teuchos::Array<value_type>& weights,
167 Teuchos::Array< Teuchos::Array<value_type> >& values) const;
168
173 virtual ordinal_type quadDegreeOfExactness(ordinal_type n) const;
174
176 virtual ordinal_type coefficientGrowth(ordinal_type n) const;
177
179 virtual ordinal_type pointGrowth(ordinal_type n) const;
180
182 typedef typename OneDOrthogPolyBasis<ordinal_type,value_type>::LevelToOrderFnPtr LevelToOrderFnPtr;
183
185
194 virtual LevelToOrderFnPtr getSparseGridGrowthRule() const {
195 return sparse_grid_growth_rule; }
196
198 virtual void setSparseGridGrowthRule(LevelToOrderFnPtr ptr) {
199 sparse_grid_growth_rule = ptr; }
200
211 virtual Teuchos::RCP<OneDOrthogPolyBasis<ordinal_type,value_type> > cloneWithOrder(ordinal_type p) const;
212
214
216 virtual void evaluateBasesAndDerivatives(const value_type& point,
217 Teuchos::Array<value_type>& vals,
218 Teuchos::Array<value_type>& derivs) const;
219
220 protected:
221
223 PecosOneDOrthogPolyBasis(ordinal_type p,
224 const PecosOneDOrthogPolyBasis& basis);
225
226 private:
227
228 // Prohibit copying
229 PecosOneDOrthogPolyBasis(const PecosOneDOrthogPolyBasis&);
230
231 // Prohibit Assignment
232 PecosOneDOrthogPolyBasis& operator=(const PecosOneDOrthogPolyBasis& b);
233
234 protected:
235
237 Teuchos::RCP<Pecos::OrthogonalPolynomial> pecosPoly;
238
240 std::string name;
241
243 ordinal_type p;
244
246 LevelToOrderFnPtr sparse_grid_growth_rule;
247
249 Teuchos::Array<value_type> norms;
250
251 }; // class PecosOneDOrthogPolyBasis
252
253} // Namespace Stokhos
254
255// Include template definitions
257
258#endif // HAVE_STOKHOS_DAKOTA
259
260#endif // STOKHOS_PECOS_ONED_ORTHOG_POLY_BASIS_HPP
Top-level namespace for Stokhos classes and functions.