Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_TensorProductBasis.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_TENSOR_PRODUCT_BASIS_HPP
43 #define STOKHOS_TENSOR_PRODUCT_BASIS_HPP
44 
45 #include "Teuchos_RCP.hpp"
46 
47 #include "Stokhos_ProductBasis.hpp"
50 
51 namespace Stokhos {
52 
66  template <typename ordinal_type, typename value_type,
67  typename coeff_compare_type =
68  TotalOrderLess<MultiIndex<ordinal_type> > >
70  public ProductBasis<ordinal_type,value_type> {
71  public:
72 
74 
81  value_type> > >& bases,
82  const value_type& sparse_tol = 1.0e-12,
84  const coeff_compare_type& coeff_compare = coeff_compare_type());
85 
87  virtual ~TensorProductBasis();
88 
90 
91 
93  ordinal_type order() const;
94 
96  ordinal_type dimension() const;
97 
99  virtual ordinal_type size() const;
100 
102 
106  virtual const Teuchos::Array<value_type>& norm_squared() const;
107 
109  virtual const value_type& norm_squared(ordinal_type i) const;
110 
112 
118  virtual
121 
123  virtual
126 
128  virtual value_type evaluateZero(ordinal_type i) const;
129 
131 
135  virtual void evaluateBases(
137  Teuchos::Array<value_type>& basis_vals) const;
138 
140  virtual void print(std::ostream& os) const;
141 
143  virtual const std::string& getName() const;
144 
146 
148 
149 
151 
156  virtual const MultiIndex<ordinal_type>& term(ordinal_type i) const;
157 
159 
163  virtual ordinal_type index(const MultiIndex<ordinal_type>& term) const;
164 
166 
170  value_type> > >
171  getCoordinateBases() const;
172 
174  virtual MultiIndex<ordinal_type> getMaxOrders() const;
175 
177 
178  private:
179 
180  // Prohibit copying
182 
183  // Prohibit Assignment
185 
186  protected:
187 
189  typedef std::map<coeff_type,ordinal_type,coeff_compare_type> coeff_set_type;
191 
193  std::string name;
194 
197 
200 
203 
206 
209 
212 
215 
218 
221 
224 
225  }; // class TensorProductBasis
226 
227 } // Namespace Stokhos
228 
229 // Include template definitions
231 
232 #endif
virtual Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > computeLinearTripleProductTensor() const
Compute linear triple product tensor where k = 0,1,..,d.
ordinal_type order() const
Return order of basis.
coeff_type max_orders
Maximum orders for each dimension.
virtual value_type evaluateZero(ordinal_type i) const
Evaluate basis polynomial i at zero.
value_type sparse_tol
Tolerance for computing sparse Cijk.
Teuchos::Array< Teuchos::RCP< const OneDOrthogPolyBasis< ordinal_type, value_type > > > getCoordinateBases() const
Return coordinate bases.
Teuchos::Array< Teuchos::Array< value_type > > basis_eval_tmp
Temporary array used in basis evaluation.
virtual const MultiIndex< ordinal_type > & term(ordinal_type i) const
Get orders of each coordinate polynomial given an index i.
virtual Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > computeTripleProductTensor() const
Compute triple product tensor.
virtual const std::string & getName() const
Return string name of basis.
ordinal_type sz
Total size of basis.
TensorProductBasis & operator=(const TensorProductBasis &b)
Teuchos::Array< value_type > norms
Norms.
std::map< coeff_type, ordinal_type, coeff_compare_type > coeff_set_type
virtual const Teuchos::Array< value_type > & norm_squared() const
Return array storing norm-squared of each basis polynomial.
Abstract base class for multivariate orthogonal polynomials generated from tensor products of univari...
virtual void evaluateBases(const Teuchos::ArrayView< const value_type > &point, Teuchos::Array< value_type > &basis_vals) const
Evaluate basis polynomials at given point point.
Multivariate orthogonal polynomial basis generated from a tensor product of univariate polynomials...
ordinal_type dimension() const
Return dimension of basis.
Teuchos::Array< Teuchos::RCP< const OneDOrthogPolyBasis< ordinal_type, value_type > > > bases
Array of bases.
Abstract base class for 1-D orthogonal polynomials.
ordinal_type d
Total dimension of basis.
virtual ordinal_type size() const
Return total size of basis.
MultiIndex< ordinal_type > coeff_type
ordinal_type p
Total order of basis.
TensorProductBasis(const Teuchos::Array< Teuchos::RCP< const OneDOrthogPolyBasis< ordinal_type, value_type > > > &bases, const value_type &sparse_tol=1.0e-12, const MultiIndex< ordinal_type > &index=MultiIndex< ordinal_type >(), const coeff_compare_type &coeff_compare=coeff_compare_type())
Constructor.
virtual void print(std::ostream &os) const
Print basis to stream os.
virtual ordinal_type index(const MultiIndex< ordinal_type > &term) const
Get index of the multivariate polynomial given orders of each coordinate.
Teuchos::Array< coeff_type > coeff_map_type
virtual MultiIndex< ordinal_type > getMaxOrders() const
Return maximum order allowable for each coordinate basis.