Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_PseudoSpectralOperator.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_PSEUDO_SPECTRAL_OPERATOR_HPP
43 #define STOKHOS_PSEUDO_SPECTRAL_OPERATOR_HPP
44 
45 #include <map>
46 #include "Teuchos_Array.hpp"
47 
49 
50 namespace Stokhos {
51 
53  template <typename ordinal_type, typename value_type>
57  };
58 
62  template <typename ordinal_t,
63  typename value_t,
64  typename point_compare_type =
67  public:
68 
69  typedef ordinal_t ordinal_type;
70  typedef value_t value_type;
72  typedef std::map<point_type, std::pair<value_type,ordinal_type>,
73  point_compare_type> point_set_type;
75 
78  typedef typename point_set_type::iterator set_iterator;
79  typedef typename point_set_type::const_iterator const_set_iterator;
80 
83 
86 
88  virtual ordinal_type point_size() const = 0;
89 
91  virtual ordinal_type coeff_size() const = 0;
92 
94  virtual iterator begin() = 0;
95 
97  virtual iterator end() = 0;
98 
100  virtual const_iterator begin() const = 0;
101 
103  virtual const_iterator end() const = 0;
104 
106  virtual set_iterator set_begin() = 0;
107 
109  virtual set_iterator set_end() = 0;
110 
112  virtual const_set_iterator set_begin() const = 0;
113 
115  virtual const_set_iterator set_end() const = 0;
116 
118  virtual ordinal_type index(const point_type& point) const = 0;
119 
121  virtual const point_type& point(ordinal_type n) const = 0;
122 
124 
131  virtual void transformQP2PCE(
132  const value_type& alpha,
135  const value_type& beta,
136  bool trans = false) const = 0;
137 
139 
146  virtual void transformPCE2QP(
147  const value_type& alpha,
150  const value_type& beta,
151  bool trans = false) const = 0;
152 
153  };
154 
155 }
156 
157 #endif
A functor for comparing floating-point numbers to some tolerance.
std::map< point_type, std::pair< value_type, ordinal_type >, point_compare_type > point_set_type
virtual set_iterator set_end()=0
Iterator to end of point set.
TensorProductElement< ordinal_type, value_type > point_type
Container storing a term in a generalized tensor product.
virtual iterator end()=0
Iterator to end of point set.
An operator interface for building pseudo-spectral approximations.
virtual ordinal_type index(const point_type &point) const =0
Get point index for given point.
virtual void transformQP2PCE(const value_type &alpha, const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &input, Teuchos::SerialDenseMatrix< ordinal_type, value_type > &result, const value_type &beta, bool trans=false) const =0
Transform values at quadrature points to PCE coefficients.
virtual void transformPCE2QP(const value_type &alpha, const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &input, Teuchos::SerialDenseMatrix< ordinal_type, value_type > &result, const value_type &beta, bool trans=false) const =0
Transform PCE coefficients to quadrature values.
virtual ordinal_type point_size() const =0
Number of points.
Struct defining default point compare type.
virtual ordinal_type coeff_size() const =0
Number of coefficients.
std::vector< T >::const_iterator const_iterator
A comparison functor implementing a strict weak ordering based lexographic ordering.
virtual set_iterator set_begin()=0
Iterator to begining of point set.
point_map_type::const_iterator const_iterator
LexographicLess< TensorProductElement< ordinal_type, value_type >, FloatingPointLess< value_type > > type
std::vector< T >::iterator iterator
virtual iterator begin()=0
Iterator to begining of point set.
point_set_type::const_iterator const_set_iterator
virtual const point_type & point(ordinal_type n) const =0
Get point for given index.