Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
Stokhos_GSReducedPCEBasisBase.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_GS_REDUCED_PCE_BASIS_BASE_HPP
43 #define STOKHOS_GS_REDUCED_PCE_BASIS_BASE_HPP
44 
45 #include "Teuchos_RCP.hpp"
46 #include "Teuchos_Array.hpp"
47 #include "Teuchos_BLAS.hpp"
51 
54 #include "Stokhos_Quadrature.hpp"
56 
57 namespace Stokhos {
58 
68  template <typename ordinal_type, typename value_type>
70  public ReducedPCEBasis<ordinal_type,value_type> {
71  public:
72 
74 
86 
88  virtual ~GSReducedPCEBasisBase();
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
122 
124  virtual
127 
129  virtual value_type evaluateZero(ordinal_type i) const;
130 
132 
136  virtual void evaluateBases(
138  Teuchos::Array<value_type>& basis_vals) const;
139 
141  virtual void print(std::ostream& os) const;
142 
144 
146 
147 
149  virtual void
151  value_type *out,
152  ordinal_type ncol = 1,
153  bool transpose = false) const;
154 
156  virtual void
158  value_type *out,
159  ordinal_type ncol = 1,
160  bool transpose = false) const;
161 
164  getReducedQuadrature() const;
165 
167 
168  protected:
169 
170  void setup(
171  ordinal_type p,
174 
176 
179  virtual ordinal_type
181  ordinal_type max_p,
182  value_type threshold,
185  const Teuchos::Array<value_type>& weights,
187  Teuchos::Array<ordinal_type>& num_terms_,
190 
191  private:
192 
193  // Prohibit copying
195 
196  // Prohibit Assignment
198 
199  protected:
200 
204 
206  std::string name;
207 
210 
213 
216 
219 
222 
225 
228 
231 
234 
237 
240 
243 
245  bool verbose;
246 
249 
252 
254 
255  }; // class GSReducedPCEBasisBase
256 
257 } // Namespace Stokhos
258 
259 // Include template definitions
261 
262 #endif
Teuchos_ParameterList.hpp
Stokhos::GSReducedPCEBasisBase::params
Teuchos::ParameterList params
Algorithm parameters.
Definition: Stokhos_GSReducedPCEBasisBase.hpp:209
Teuchos_RCP.hpp
Stokhos::GSReducedPCEBasisBase::sz
ordinal_type sz
Total size of basis.
Definition: Stokhos_GSReducedPCEBasisBase.hpp:224
Stokhos::GSReducedPCEBasisBase::buildReducedBasis
virtual ordinal_type buildReducedBasis(ordinal_type max_p, value_type threshold, const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &A, const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &F, const Teuchos::Array< value_type > &weights, 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 > &Q_)=0
Build the reduced basis, parameterized by total order max_p.
Stokhos::GSReducedPCEBasisBase::pce_basis
Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > pce_basis
Original pce basis.
Definition: Stokhos_GSReducedPCEBasisBase.hpp:212
Stokhos::GSReducedPCEBasisBase::evaluateBases
virtual void evaluateBases(const Teuchos::ArrayView< const value_type > &point, Teuchos::Array< value_type > &basis_vals) const
Evaluate basis polynomials at given point point.
Definition: Stokhos_GSReducedPCEBasisBaseImp.hpp:216
Stokhos::GSReducedPCEBasisBase::num_terms
Teuchos::Array< ordinal_type > num_terms
Number of terms up to each order.
Definition: Stokhos_GSReducedPCEBasisBase.hpp:230
Stokhos::GSReducedPCEBasisBase::rank_threshold
value_type rank_threshold
Rank threshold.
Definition: Stokhos_GSReducedPCEBasisBase.hpp:248
Stokhos::GSReducedPCEBasisBase::name
std::string name
Name of basis.
Definition: Stokhos_GSReducedPCEBasisBase.hpp:206
Stokhos::GSReducedPCEBasisBase::~GSReducedPCEBasisBase
virtual ~GSReducedPCEBasisBase()
Destructor.
Definition: Stokhos_GSReducedPCEBasisBaseImp.hpp:143
Stokhos_OrthogPolyApprox.hpp
Stokhos::GSReducedPCEBasisBase::Qp
SDM Qp
Coefficients of transformed basis in original basis.
Definition: Stokhos_GSReducedPCEBasisBase.hpp:239
Stokhos::GSReducedPCEBasisBase::verbose
bool verbose
Whether to print a bunch of stuff out.
Definition: Stokhos_GSReducedPCEBasisBase.hpp:245
TotalOrderBasisUnitTest::value_type
double value_type
Definition: Stokhos_LexicographicTreeBasisUnitTest.cpp:70
Stokhos::GSReducedPCEBasisBase::SDM
Teuchos::SerialDenseMatrix< ordinal_type, value_type > SDM
Definition: Stokhos_GSReducedPCEBasisBase.hpp:203
Stokhos::GSReducedPCEBasisBase::CPBUtils
Stokhos::CompletePolynomialBasisUtils< ordinal_type, value_type > CPBUtils
Definition: Stokhos_GSReducedPCEBasisBase.hpp:201
Teuchos::BLAS< ordinal_type, value_type >
Stokhos::Quadrature
Abstract base class for quadrature methods.
Definition: Stokhos_Quadrature.hpp:54
Stokhos::GSReducedPCEBasisBase::size
virtual ordinal_type size() const
Return total size of basis.
Definition: Stokhos_GSReducedPCEBasisBaseImp.hpp:166
Teuchos_Array.hpp
Teuchos::ArrayView
Stokhos::MultiIndex< ordinal_type >
Teuchos::RCP
Stokhos::GSReducedPCEBasisBase::reduced_quad
Teuchos::RCP< const Stokhos::Quadrature< ordinal_type, value_type > > reduced_quad
Reduced quadrature object.
Definition: Stokhos_GSReducedPCEBasisBase.hpp:242
Teuchos::Array
Stokhos::GSReducedPCEBasisBase::setup
void setup(ordinal_type p, const Teuchos::Array< Stokhos::OrthogPolyApprox< ordinal_type, value_type > > &pce, const Teuchos::RCP< const Stokhos::Quadrature< ordinal_type, value_type > > &quad)
Definition: Stokhos_GSReducedPCEBasisBaseImp.hpp:66
TotalOrderBasisUnitTest::ordinal_type
int ordinal_type
Definition: Stokhos_LexicographicTreeBasisUnitTest.cpp:69
Stokhos::GSReducedPCEBasisBase::p
ordinal_type p
Total order of basis.
Definition: Stokhos_GSReducedPCEBasisBase.hpp:218
Stokhos::GSReducedPCEBasisBase::Q
SDM Q
Values of transformed basis at quadrature points.
Definition: Stokhos_GSReducedPCEBasisBase.hpp:236
Stokhos_GSReducedPCEBasisBaseImp.hpp
Stokhos::GSReducedPCEBasisBase::computeTripleProductTensor
virtual Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > computeTripleProductTensor() const
Compute triple product tensor.
Definition: Stokhos_GSReducedPCEBasisBaseImp.hpp:190
Stokhos::GSReducedPCEBasisBase::norms
Teuchos::Array< value_type > norms
Norms.
Definition: Stokhos_GSReducedPCEBasisBase.hpp:233
Stokhos::GSReducedPCEBasisBase::order
ordinal_type order() const
Return order of basis.
Definition: Stokhos_GSReducedPCEBasisBaseImp.hpp:150
Stokhos
Top-level namespace for Stokhos classes and functions.
Definition: Stokhos_AbstractPreconditionerFactory.hpp:48
Stokhos::GSReducedPCEBasisBase::evaluateZero
virtual value_type evaluateZero(ordinal_type i) const
Evaluate basis polynomial i at zero.
Definition: Stokhos_GSReducedPCEBasisBaseImp.hpp:208
Stokhos::GSReducedPCEBasisBase
Generate a basis from a given set of PCE expansions that is orthogonal with respect to the product me...
Definition: Stokhos_GSReducedPCEBasisBase.hpp:69
Teuchos_SerialDenseMatrix.hpp
Stokhos::GSReducedPCEBasisBase::orthogonalization_method
std::string orthogonalization_method
Orthogonalization method.
Definition: Stokhos_GSReducedPCEBasisBase.hpp:251
Stokhos_Quadrature.hpp
Stokhos::GSReducedPCEBasisBase::transformToOriginalBasis
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.
Definition: Stokhos_GSReducedPCEBasisBaseImp.hpp:239
Stokhos::GSReducedPCEBasisBase::print
virtual void print(std::ostream &os) const
Print basis to stream os.
Definition: Stokhos_GSReducedPCEBasisBaseImp.hpp:225
Stokhos::GSReducedPCEBasisBase::computeLinearTripleProductTensor
virtual Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > computeLinearTripleProductTensor() const
Compute linear triple product tensor where k = 0,1,..,d.
Definition: Stokhos_GSReducedPCEBasisBaseImp.hpp:199
Stokhos::GSReducedPCEBasisBase::transformFromOriginalBasis
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.
Definition: Stokhos_GSReducedPCEBasisBaseImp.hpp:261
Stokhos::OrthogPolyApprox< ordinal_type, value_type >
A
Teuchos::SerialDenseVector< ordinal_type, value_type >
Teuchos_BLAS.hpp
Stokhos::GSReducedPCEBasisBase::terms
Teuchos::Array< Stokhos::MultiIndex< ordinal_type > > terms
2-D array of basis terms
Definition: Stokhos_GSReducedPCEBasisBase.hpp:227
Stokhos::GSReducedPCEBasisBase::SDV
Teuchos::SerialDenseVector< ordinal_type, value_type > SDV
Definition: Stokhos_GSReducedPCEBasisBase.hpp:202
Stokhos::GSReducedPCEBasisBase::d
ordinal_type d
Total dimension of basis.
Definition: Stokhos_GSReducedPCEBasisBase.hpp:221
Stokhos_ProductBasisUtils.hpp
Stokhos::GSReducedPCEBasisBase::GSReducedPCEBasisBase
GSReducedPCEBasisBase(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.
Definition: Stokhos_GSReducedPCEBasisBaseImp.hpp:46
Teuchos::SerialDenseMatrix< ordinal_type, value_type >
Teuchos::ParameterList
Stokhos::GSReducedPCEBasisBase::getReducedQuadrature
virtual Teuchos::RCP< const Stokhos::Quadrature< ordinal_type, value_type > > getReducedQuadrature() const
Get reduced quadrature object.
Definition: Stokhos_GSReducedPCEBasisBaseImp.hpp:283
Stokhos::GSReducedPCEBasisBase::pce_sz
ordinal_type pce_sz
Size of original pce basis.
Definition: Stokhos_GSReducedPCEBasisBase.hpp:215
Stokhos::GSReducedPCEBasisBase::operator=
GSReducedPCEBasisBase & operator=(const GSReducedPCEBasisBase &b)
Stokhos::GSReducedPCEBasisBase::norm_squared
virtual const Teuchos::Array< value_type > & norm_squared() const
Return array storing norm-squared of each basis polynomial.
Definition: Stokhos_GSReducedPCEBasisBaseImp.hpp:174
Stokhos::CompletePolynomialBasisUtils
Utilities for indexing a multi-variate complete polynomial basis.
Definition: Stokhos_ProductBasisUtils.hpp:1506
Teuchos_SerialDenseVector.hpp
Stokhos::ReducedPCEBasis
Abstract base class for reduced basis strategies built from polynomial chaos expansions in some other...
Definition: Stokhos_ReducedPCEBasis.hpp:57
Stokhos_ReducedPCEBasis.hpp
Stokhos::GSReducedPCEBasisBase::dimension
ordinal_type dimension() const
Return dimension of basis.
Definition: Stokhos_GSReducedPCEBasisBaseImp.hpp:158
Stokhos::GSReducedPCEBasisBase::blas
Teuchos::BLAS< ordinal_type, value_type > blas
Definition: Stokhos_GSReducedPCEBasisBase.hpp:253