Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_ForUQTKOrthogPolyExpansion.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_FORUQTKORTHOGPOLYEXPANSION_HPP
43 #define STOKHOS_FORUQTKORTHOGPOLYEXPANSION_HPP
44 
45 #include "Stokhos_ConfigDefs.h"
46 #ifdef HAVE_STOKHOS_FORUQTK
47 
49 
50 namespace Stokhos {
51 
57  template <typename ordinal_type, typename value_type>
58  class ForUQTKOrthogPolyExpansion :
59  public OrthogPolyExpansionBase<ordinal_type, value_type,
60  Stokhos::StandardStorage<ordinal_type, value_type> > {
61  public:
62 
64 
65  enum EXPANSION_METHOD {
66  TAYLOR,
67  INTEGRATION
68  };
69 
71  ForUQTKOrthogPolyExpansion(
72  const Teuchos::RCP<const OrthogPolyBasis<ordinal_type,value_type> >& basis,
74  EXPANSION_METHOD method = TAYLOR,
75  value_type rtol = 1.0e-12);
76 
78  virtual ~ForUQTKOrthogPolyExpansion() {}
79 
80  // Operations
81  void timesEqual(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
82  const value_type& x);
83  void divideEqual(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
84  const value_type& x);
85 
86  void timesEqual(
87  OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
88  const OrthogPolyApprox<ordinal_type, value_type, node_type>& x);
89  void divideEqual(
90  OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
91  const OrthogPolyApprox<ordinal_type, value_type, node_type>& x);
92 
93 
94  void times(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
95  const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
96  const OrthogPolyApprox<ordinal_type, value_type, node_type>& b);
97  void times(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
98  const value_type& a,
99  const OrthogPolyApprox<ordinal_type, value_type, node_type>& b);
100  void times(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
101  const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
102  const value_type& b);
103  void divide(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
104  const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
105  const OrthogPolyApprox<ordinal_type, value_type, node_type>& b);
106  void divide(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
107  const value_type& a,
108  const OrthogPolyApprox<ordinal_type, value_type, node_type>& b);
109  void divide(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
110  const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
111  const value_type& b);
112 
113  void exp(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
114  const OrthogPolyApprox<ordinal_type, value_type, node_type>& a);
115  void log(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
116  const OrthogPolyApprox<ordinal_type, value_type, node_type>& a);
117  void log10(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
118  const OrthogPolyApprox<ordinal_type, value_type, node_type>& a);
119  void sqrt(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
120  const OrthogPolyApprox<ordinal_type, value_type, node_type>& a);
121  void cbrt(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
122  const OrthogPolyApprox<ordinal_type, value_type, node_type>& a);
123  void pow(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
124  const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
125  const OrthogPolyApprox<ordinal_type, value_type, node_type>& b);
126  void pow(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
127  const value_type& a,
128  const OrthogPolyApprox<ordinal_type, value_type, node_type>& b);
129  void pow(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
130  const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
131  const value_type& b);
132  void cos(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
133  const OrthogPolyApprox<ordinal_type, value_type, node_type>& a);
134  void sin(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
135  const OrthogPolyApprox<ordinal_type, value_type, node_type>& a);
136  void tan(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
137  const OrthogPolyApprox<ordinal_type, value_type, node_type>& a);
138  void cosh(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
139  const OrthogPolyApprox<ordinal_type, value_type, node_type>& a);
140  void sinh(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
141  const OrthogPolyApprox<ordinal_type, value_type, node_type>& a);
142  void tanh(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
143  const OrthogPolyApprox<ordinal_type, value_type, node_type>& a);
144  void acos(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
145  const OrthogPolyApprox<ordinal_type, value_type, node_type>& a);
146  void asin(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
147  const OrthogPolyApprox<ordinal_type, value_type, node_type>& a);
148  void atan(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
149  const OrthogPolyApprox<ordinal_type, value_type, node_type>& a);
150  void atan2(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
151  const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
152  const OrthogPolyApprox<ordinal_type, value_type, node_type>& b);
153  void atan2(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
154  const value_type& a,
155  const OrthogPolyApprox<ordinal_type, value_type, node_type>& b);
156  void atan2(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
157  const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
158  const value_type& b);
159  void acosh(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
160  const OrthogPolyApprox<ordinal_type, value_type, node_type>& a);
161  void asinh(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
162  const OrthogPolyApprox<ordinal_type, value_type, node_type>& a);
163  void atanh(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
164  const OrthogPolyApprox<ordinal_type, value_type, node_type>& a);
165 
166  private:
167 
168  // Prohibit copying
169  ForUQTKOrthogPolyExpansion(const ForUQTKOrthogPolyExpansion&);
170 
171  // Prohibit Assignment
172  ForUQTKOrthogPolyExpansion& operator=(const ForUQTKOrthogPolyExpansion& b);
173 
174  protected:
175 
177  int order;
178 
180  int dim;
181 
183  ordinal_type sz;
184 
186  double rtol;
187 
189  EXPANSION_METHOD method;
190 
191  }; // class ForUQTKOrthogPolyExpansion
192 
193 } // namespace Stokhos
194 
196 
197 #endif // HAVE_STOKHOS_FORUQTK
198 
199 #endif // STOKHOS_FORUQTKORTHOGPOLYEXPANSION_HPP
KOKKOS_INLINE_FUNCTION PCE< Storage > sqrt(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > tan(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > sinh(const PCE< Storage > &a)
atanh(expr.val())
Data structure storing a sparse 3-tensor C(i,j,k) in a a compressed format.
KOKKOS_INLINE_FUNCTION PCE< Storage > pow(const PCE< Storage > &a, const PCE< Storage > &b)
KOKKOS_INLINE_FUNCTION PCE< Storage > tanh(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > cbrt(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > acos(const PCE< Storage > &a)
atan2(expr1.val(), expr2.val())
Kokkos::Serial node_type
asinh(expr.val())
KOKKOS_INLINE_FUNCTION PCE< Storage > cosh(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > atan(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > exp(const PCE< Storage > &a)
acosh(expr.val())
KOKKOS_INLINE_FUNCTION PCE< Storage > sin(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > log(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > log10(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > asin(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > cos(const PCE< Storage > &a)