Stokhos Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
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
45#include "Teuchos_ParameterList.hpp"
46#include "Teuchos_PromotionTraits.hpp"
47#include "Kokkos_Core.hpp"
48
51
52namespace Stokhos {
53
54 namespace KL {
55
57
106 template <typename value_type,
107 typename execution_space = Kokkos::DefaultExecutionSpace>
109 public:
110
114 typedef Kokkos::View<one_d_eigen_func_type**,execution_space> eigen_func_array_type;
115 typedef Kokkos::View<value_type*,execution_space> eigen_value_array_type;
116
119
121 ExponentialRandomField(Teuchos::ParameterList& solverParams);
122
124 KOKKOS_INLINE_FUNCTION
126
128 KOKKOS_INLINE_FUNCTION
129 int spatialDimension() const { return dim; }
130
132 KOKKOS_INLINE_FUNCTION
133 int stochasticDimension() const { return num_KL; }
134
136 template <typename point_type, typename rv_type>
137 KOKKOS_INLINE_FUNCTION
138 typename Teuchos::PromotionTraits<typename rv_type::value_type,
139 value_type>::promote
140 evaluate(const point_type& point,
141 const rv_type& random_variables) const;
142
144 template <typename point_type>
145 KOKKOS_INLINE_FUNCTION
146 value_type evaluate_mean(const point_type& point) const { return mean; }
147
149 template <typename point_type>
150 KOKKOS_INLINE_FUNCTION
151 typename Teuchos::PromotionTraits<typename point_type::value_type,
152 value_type>::promote
153 evaluate_standard_deviation(const point_type& point) const;
154
156 template <typename point_type>
157 KOKKOS_INLINE_FUNCTION
158 typename Teuchos::PromotionTraits<typename point_type::value_type, value_type>::promote
159 evaluate_eigenfunction(const point_type& point, int i) const;
160
162 value_type
163 KOKKOS_INLINE_FUNCTION
164 eigenvalue(int i) const { return product_eigen_values(i); }
165
167 void print(std::ostream& os) const;
168
169 protected:
170
173
175 int dim;
176
178 value_type mean;
179
181 value_type std_dev;
182
185
188
189 }; // class ExponentialRandomField
190
191 } // namespace KL
192
193} // namespace Stokhos
194
195// Include template definitions
197
198#endif // STOKHOS_KL_EXPONENTIAL_RANDOM_FIELD_HPP
Kokkos::DefaultExecutionSpace execution_space
One-dimensional eigenfunction for exponential covariance function.
Class representing a KL expansion of an exponential random field.
KOKKOS_INLINE_FUNCTION ~ExponentialRandomField()
Destructor.
KOKKOS_INLINE_FUNCTION Teuchos::PromotionTraits< typenamepoint_type::value_type, value_type >::promote evaluate_eigenfunction(const point_type &point, int i) const
Evaluate given eigenfunction at a point.
KOKKOS_INLINE_FUNCTION int stochasticDimension() const
Return stochastic dimension of the field.
eigen_value_array_type product_eigen_values
Product eigenvalues.
KOKKOS_INLINE_FUNCTION Teuchos::PromotionTraits< typenamerv_type::value_type, value_type >::promote evaluate(const point_type &point, const rv_type &random_variables) const
Evaluate random field at a point.
Kokkos::View< one_d_eigen_func_type **, execution_space > eigen_func_array_type
value_type std_dev
Standard deviation of random field.
void print(std::ostream &os) const
Print KL expansion.
Kokkos::View< value_type *, execution_space > eigen_value_array_type
OneDEigenPair< one_d_eigen_func_type > one_d_eigen_pair_type
eigen_func_array_type product_eigen_funcs
Product eigenfunctions.
KOKKOS_INLINE_FUNCTION int spatialDimension() const
Return spatial dimension of the field.
KOKKOS_INLINE_FUNCTION Teuchos::PromotionTraits< typenamepoint_type::value_type, value_type >::promote evaluate_standard_deviation(const point_type &point) const
Evaluate standard deviation of 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.
ProductEigenPair< one_d_eigen_func_type, execution_space > product_eigen_pair_type
ExponentialOneDEigenFunction< value_type > one_d_eigen_func_type
value_type KOKKOS_INLINE_FUNCTION eigenvalue(int i) const
Return eigenvalue.
Top-level namespace for Stokhos classes and functions.
Container for one-dimensional eigenfunction and eigenvalue.
Container for multi-dimensional product of 1-D eigenfunctions/values.