Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_KL_ExponentialRandomField.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_KL_EXPONENTIAL_RANDOM_FIELD_HPP
43 #define STOKHOS_KL_EXPONENTIAL_RANDOM_FIELD_HPP
44 
47 #include "Kokkos_Core.hpp"
48 #include "Kokkos_View.hpp"
49 
52 
53 namespace Stokhos {
54 
55  namespace KL {
56 
58 
107  template <typename value_type,
108  typename execution_space = Kokkos::DefaultExecutionSpace>
110  public:
111 
115  typedef Kokkos::View<one_d_eigen_func_type**,execution_space> eigen_func_array_type;
116  typedef Kokkos::View<value_type*,execution_space> eigen_value_array_type;
117 
120 
123 
125  KOKKOS_INLINE_FUNCTION
127 
129  KOKKOS_INLINE_FUNCTION
130  int spatialDimension() const { return dim; }
131 
133  KOKKOS_INLINE_FUNCTION
134  int stochasticDimension() const { return num_KL; }
135 
137  template <typename point_type, typename rv_type>
138  KOKKOS_INLINE_FUNCTION
140  value_type>::promote
141  evaluate(const point_type& point,
142  const rv_type& random_variables) const;
143 
145  template <typename point_type>
146  KOKKOS_INLINE_FUNCTION
147  value_type evaluate_mean(const point_type& point) const { return mean; }
148 
150  template <typename point_type>
151  KOKKOS_INLINE_FUNCTION
153  value_type>::promote
154  evaluate_standard_deviation(const point_type& point) const;
155 
157  template <typename point_type>
158  KOKKOS_INLINE_FUNCTION
160  evaluate_eigenfunction(const point_type& point, int i) const;
161 
163  value_type
164  KOKKOS_INLINE_FUNCTION
165  eigenvalue(int i) const { return product_eigen_values(i); }
166 
168  void print(std::ostream& os) const;
169 
170  protected:
171 
173  int num_KL;
174 
176  int dim;
177 
180 
183 
186 
189 
190  }; // class ExponentialRandomField
191 
192  } // namespace KL
193 
194 } // namespace Stokhos
195 
196 // Include template definitions
198 
199 #endif // STOKHOS_KL_EXPONENTIAL_RANDOM_FIELD_HPP
Container for multi-dimensional product of 1-D eigenfunctions/values.
Kokkos::DefaultExecutionSpace execution_space
eigen_func_array_type product_eigen_funcs
Product eigenfunctions.
ExponentialOneDEigenFunction< value_type > one_d_eigen_func_type
KOKKOS_INLINE_FUNCTION Teuchos::PromotionTraits< typename rv_type::value_type, value_type >::promote evaluate(const point_type &point, const rv_type &random_variables) const
Evaluate random field at a point.
KOKKOS_INLINE_FUNCTION value_type evaluate_mean(const point_type &point) const
Evaluate mean of random field at a point.
Kokkos::View< one_d_eigen_func_type **, execution_space > eigen_func_array_type
eigen_value_array_type product_eigen_values
Product eigenvalues.
Kokkos::View< value_type *, execution_space > eigen_value_array_type
void print(std::ostream &os) const
Print KL expansion.
Container for one-dimensional eigenfunction and eigenvalue.
KOKKOS_INLINE_FUNCTION Teuchos::PromotionTraits< typename point_type::value_type, value_type >::promote evaluate_eigenfunction(const point_type &point, int i) const
Evaluate given eigenfunction at a point.
KOKKOS_INLINE_FUNCTION Teuchos::PromotionTraits< typename point_type::value_type, value_type >::promote evaluate_standard_deviation(const point_type &point) const
Evaluate standard deviation of random field at a point.
value_type std_dev
Standard deviation of random field.
KOKKOS_INLINE_FUNCTION int stochasticDimension() const
Return stochastic dimension of the field.
Class representing a KL expansion of an exponential random field.
ProductEigenPair< one_d_eigen_func_type, execution_space > product_eigen_pair_type
KOKKOS_INLINE_FUNCTION ~ExponentialRandomField()
Destructor.
One-dimensional eigenfunction for exponential covariance function.
KOKKOS_INLINE_FUNCTION int spatialDimension() const
Return spatial dimension of the field.
OneDEigenPair< one_d_eigen_func_type > one_d_eigen_pair_type
value_type KOKKOS_INLINE_FUNCTION eigenvalue(int i) const
Return eigenvalue.