Stokhos Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
Stokhos_MonomialProjGramSchmidtPCEBasis2.hpp
Go to the documentation of this file.
1// @HEADER
2// ***********************************************************************
3//
4// Stokhos Package
5// Copyright (2009) Sandia Corporation
6//
7// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8// license for use of this work by or on behalf of the U.S. Government.
9//
10// Redistribution and use in source and binary forms, with or without
11// modification, are permitted provided that the following conditions are
12// met:
13//
14// 1. Redistributions of source code must retain the above copyright
15// notice, this list of conditions and the following disclaimer.
16//
17// 2. Redistributions in binary form must reproduce the above copyright
18// notice, this list of conditions and the following disclaimer in the
19// documentation and/or other materials provided with the distribution.
20//
21// 3. Neither the name of the Corporation nor the names of the
22// contributors may be used to endorse or promote products derived from
23// this software without specific prior written permission.
24//
25// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36//
37// Questions? Contact Eric T. Phipps (etphipp@sandia.gov).
38//
39// ***********************************************************************
40// @HEADER
41
42#ifndef STOKHOS_MONOMIAL_PROJ_GRAM_SCHMIDT_PCE_BASIS2_HPP
43#define STOKHOS_MONOMIAL_PROJ_GRAM_SCHMIDT_PCE_BASIS2_HPP
44
45#include "Teuchos_RCP.hpp"
46#include "Teuchos_Array.hpp"
47#include "Teuchos_BLAS.hpp"
48#include "Teuchos_SerialDenseMatrix.hpp"
49#include "Teuchos_SerialDenseVector.hpp"
50#include "Teuchos_ParameterList.hpp"
51
56
57namespace Stokhos {
58
68 template <typename ordinal_type, typename value_type>
70 public ReducedPCEBasis<ordinal_type,value_type> {
71 public:
72
74
82 ordinal_type p,
83 const Teuchos::Array< Stokhos::OrthogPolyApprox<ordinal_type, value_type> >& pce,
84 const Teuchos::RCP<const Stokhos::Quadrature<ordinal_type, value_type> >& quad,
85 const Teuchos::ParameterList& params = Teuchos::ParameterList());
86
89
91
92
94 ordinal_type order() const;
95
97 ordinal_type dimension() const;
98
100 virtual ordinal_type size() const;
101
103
107 virtual const Teuchos::Array<value_type>& norm_squared() const;
108
110 virtual const value_type& norm_squared(ordinal_type i) const;
111
113
119 virtual
120 Teuchos::RCP< Stokhos::Sparse3Tensor<ordinal_type, value_type> >
122
124 virtual
125 Teuchos::RCP< Stokhos::Sparse3Tensor<ordinal_type, value_type> >
127
129 virtual value_type evaluateZero(ordinal_type i) const;
130
132
136 virtual void evaluateBases(
137 const Teuchos::ArrayView<const value_type>& point,
138 Teuchos::Array<value_type>& basis_vals) const;
139
141 virtual const std::string& getName() const;
142
144 virtual void print(std::ostream& os) const;
145
147
149
150
152 virtual void
153 transformToOriginalBasis(const value_type *in,
154 value_type *out,
155 ordinal_type ncol = 1,
156 bool transpose = false) const;
157
159 virtual void
160 transformFromOriginalBasis(const value_type *in,
161 value_type *out,
162 ordinal_type ncol = 1,
163 bool transpose = false) const;
164
166 virtual Teuchos::RCP<const Stokhos::Quadrature<ordinal_type, value_type> >
167 getReducedQuadrature() const;
168
170
171 protected:
172
174
177 ordinal_type
178 buildQ(
179 ordinal_type max_p,
180 value_type threshold,
181 const Teuchos::Array< Stokhos::OrthogPolyApprox<ordinal_type, value_type> >& pce,
182 const Teuchos::RCP<const Stokhos::Quadrature<ordinal_type, value_type> >& quad,
183 Teuchos::Array< Stokhos::MultiIndex<ordinal_type> >& terms_,
184 Teuchos::Array<ordinal_type>& num_terms_,
185 Teuchos::SerialDenseMatrix<ordinal_type,value_type>& Qp_,
186 Teuchos::SerialDenseMatrix<ordinal_type,value_type>& A_,
187 Teuchos::SerialDenseMatrix<ordinal_type,value_type>& F_);
188
189 private:
190
191 // Prohibit copying
193
194 // Prohibit Assignment
196
197 protected:
198
200 typedef Teuchos::SerialDenseVector<ordinal_type,value_type> SDV;
201 typedef Teuchos::SerialDenseMatrix<ordinal_type,value_type> SDM;
202
204 std::string name;
205
207 Teuchos::ParameterList params;
208
210 Teuchos::RCP<const Stokhos::OrthogPolyBasis<ordinal_type,value_type> > pce_basis;
211
213 ordinal_type pce_sz;
214
216 ordinal_type p;
217
219 ordinal_type d;
220
222 ordinal_type sz;
223
225 Teuchos::Array< Stokhos::MultiIndex<ordinal_type> > terms;
226
228 Teuchos::Array<ordinal_type> num_terms;
229
231 Teuchos::Array<value_type> norms;
232
235
238
240 Teuchos::RCP<const Stokhos::Quadrature<ordinal_type, value_type> > reduced_quad;
241
244
246 value_type rank_threshold;
247
250
251 Teuchos::BLAS<ordinal_type,value_type> blas;
252
253 }; // class MonomialProjGramSchmidtPCEBasis2
254
255} // Namespace Stokhos
256
257// Include template definitions
259
260#endif
Utilities for indexing a multi-variate complete polynomial basis.
Generate a basis from a given set of PCE expansions that is orthogonal with respect to the product me...
SDM Q
Values of transformed basis at quadrature points.
Stokhos::CompletePolynomialBasisUtils< ordinal_type, value_type > CPBUtils
Teuchos::Array< Stokhos::MultiIndex< ordinal_type > > terms
2-D array of basis terms
virtual void transformFromOriginalBasis(const value_type *in, value_type *out, ordinal_type ncol=1, bool transpose=false) const
Transform coefficients from original basis to this basis.
MonomialProjGramSchmidtPCEBasis2(const MonomialProjGramSchmidtPCEBasis2 &)
virtual const std::string & getName() const
Return string name of basis.
virtual void transformToOriginalBasis(const value_type *in, value_type *out, ordinal_type ncol=1, bool transpose=false) const
Transform coefficients to original basis from this basis.
virtual ordinal_type size() const
Return total size of basis.
virtual Teuchos::RCP< const Stokhos::Quadrature< ordinal_type, value_type > > getReducedQuadrature() const
Get reduced quadrature object.
Teuchos::Array< ordinal_type > num_terms
Number of terms up to each order.
ordinal_type buildQ(ordinal_type max_p, value_type threshold, const Teuchos::Array< Stokhos::OrthogPolyApprox< ordinal_type, value_type > > &pce, const Teuchos::RCP< const Stokhos::Quadrature< ordinal_type, value_type > > &quad, Teuchos::Array< Stokhos::MultiIndex< ordinal_type > > &terms_, Teuchos::Array< ordinal_type > &num_terms_, Teuchos::SerialDenseMatrix< ordinal_type, value_type > &Qp_, Teuchos::SerialDenseMatrix< ordinal_type, value_type > &A_, Teuchos::SerialDenseMatrix< ordinal_type, value_type > &F_)
Build the reduced basis, parameterized by total order max_p.
Teuchos::SerialDenseMatrix< ordinal_type, value_type > SDM
MonomialProjGramSchmidtPCEBasis2 & operator=(const MonomialProjGramSchmidtPCEBasis2 &b)
Teuchos::SerialDenseVector< ordinal_type, value_type > SDV
virtual void print(std::ostream &os) const
Print basis to stream os.
Teuchos::RCP< const Stokhos::Quadrature< ordinal_type, value_type > > reduced_quad
Reduced quadrature object.
virtual Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > computeTripleProductTensor() const
Compute triple product tensor.
virtual const Teuchos::Array< value_type > & norm_squared() const
Return array storing norm-squared of each basis polynomial.
Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > pce_basis
Original pce basis.
virtual value_type evaluateZero(ordinal_type i) const
Evaluate basis polynomial i at zero.
MonomialProjGramSchmidtPCEBasis2(ordinal_type p, const Teuchos::Array< Stokhos::OrthogPolyApprox< ordinal_type, value_type > > &pce, const Teuchos::RCP< const Stokhos::Quadrature< ordinal_type, value_type > > &quad, const Teuchos::ParameterList &params=Teuchos::ParameterList())
Constructor.
virtual Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > computeLinearTripleProductTensor() const
Compute linear triple product tensor where k = 0,1,..,d.
virtual void evaluateBases(const Teuchos::ArrayView< const value_type > &point, Teuchos::Array< value_type > &basis_vals) const
Evaluate basis polynomials at given point point.
SDM Qp
Coefficients of transformed basis in original basis.
A multidimensional index.
Class to store coefficients of a projection onto an orthogonal polynomial basis.
Abstract base class for quadrature methods.
Abstract base class for reduced basis strategies built from polynomial chaos expansions in some other...
Top-level namespace for Stokhos classes and functions.