Stokhos Package Browser (Single Doxygen Collection)
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
src
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
49
#include "
Stokhos_KL_OneDExponentialEigenPair.hpp
"
50
#include "
Stokhos_KL_ProductEigenPair.hpp
"
51
52
namespace
Stokhos
{
53
54
namespace
KL
{
55
57
106
template
<
typename
value_type
,
107
typename
execution_space
= Kokkos::DefaultExecutionSpace>
108
class
ExponentialRandomField
{
109
public
:
110
111
typedef
ExponentialOneDEigenFunction<value_type>
one_d_eigen_func_type
;
112
typedef
OneDEigenPair<one_d_eigen_func_type>
one_d_eigen_pair_type
;
113
typedef
ProductEigenPair<one_d_eigen_func_type,execution_space>
product_eigen_pair_type
;
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
118
ExponentialRandomField
() :
num_KL
(0),
mean
(0),
std_dev
(0) {}
119
121
ExponentialRandomField
(Teuchos::ParameterList& solverParams);
122
124
KOKKOS_INLINE_FUNCTION
125
~ExponentialRandomField
() {}
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
po
int
_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
po
int
_type>
145
KOKKOS_INLINE_FUNCTION
146
value_type
evaluate_mean
(
const
point_type& point)
const
{
return
mean
; }
147
149
template
<
typename
po
int
_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
po
int
_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
172
int
num_KL
;
173
175
int
dim
;
176
178
value_type
mean
;
179
181
value_type
std_dev
;
182
184
eigen_func_array_type
product_eigen_funcs
;
185
187
eigen_value_array_type
product_eigen_values
;
188
189
};
// class ExponentialRandomField
190
191
}
// namespace KL
192
193
}
// namespace Stokhos
194
195
// Include template definitions
196
#include "
Stokhos_KL_ExponentialRandomFieldImp.hpp
"
197
198
#endif
// STOKHOS_KL_EXPONENTIAL_RANDOM_FIELD_HPP
Stokhos_KL_ExponentialRandomFieldImp.hpp
Stokhos_KL_OneDExponentialEigenPair.hpp
Stokhos_KL_ProductEigenPair.hpp
execution_space
Kokkos::DefaultHostExecutionSpace execution_space
Definition
Stokhos_SacadoUQPCEUnitTest.cpp:52
Stokhos::KL::ExponentialOneDEigenFunction
One-dimensional eigenfunction for exponential covariance function.
Definition
Stokhos_KL_OneDExponentialEigenPair.hpp:73
Stokhos::KL::ExponentialRandomField< value_type, execution_space >::mean
value_type mean
Definition
Stokhos_KL_ExponentialRandomField.hpp:178
Stokhos::KL::ExponentialRandomField::~ExponentialRandomField
KOKKOS_INLINE_FUNCTION ~ExponentialRandomField()
Destructor.
Definition
Stokhos_KL_ExponentialRandomField.hpp:125
Stokhos::KL::ExponentialRandomField::evaluate_eigenfunction
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.
Definition
Stokhos_KL_ExponentialRandomFieldImp.hpp:203
Stokhos::KL::ExponentialRandomField::stochasticDimension
KOKKOS_INLINE_FUNCTION int stochasticDimension() const
Return stochastic dimension of the field.
Definition
Stokhos_KL_ExponentialRandomField.hpp:133
Stokhos::KL::ExponentialRandomField::ExponentialRandomField
ExponentialRandomField(Teuchos::ParameterList &solverParams)
Constructor.
Definition
Stokhos_KL_ExponentialRandomFieldImp.hpp:50
Stokhos::KL::ExponentialRandomField::product_eigen_values
eigen_value_array_type product_eigen_values
Product eigenvalues.
Definition
Stokhos_KL_ExponentialRandomField.hpp:187
Stokhos::KL::ExponentialRandomField::evaluate
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.
Definition
Stokhos_KL_ExponentialRandomFieldImp.hpp:167
Stokhos::KL::ExponentialRandomField::eigen_func_array_type
Kokkos::View< one_d_eigen_func_type **, execution_space > eigen_func_array_type
Definition
Stokhos_KL_ExponentialRandomField.hpp:114
Stokhos::KL::ExponentialRandomField< value_type, execution_space >::std_dev
value_type std_dev
Definition
Stokhos_KL_ExponentialRandomField.hpp:181
Stokhos::KL::ExponentialRandomField< value_type, execution_space >::dim
int dim
Definition
Stokhos_KL_ExponentialRandomField.hpp:175
Stokhos::KL::ExponentialRandomField::print
void print(std::ostream &os) const
Print KL expansion.
Definition
Stokhos_KL_ExponentialRandomFieldImp.hpp:215
Stokhos::KL::ExponentialRandomField::eigen_value_array_type
Kokkos::View< value_type *, execution_space > eigen_value_array_type
Definition
Stokhos_KL_ExponentialRandomField.hpp:115
Stokhos::KL::ExponentialRandomField::one_d_eigen_pair_type
OneDEigenPair< one_d_eigen_func_type > one_d_eigen_pair_type
Definition
Stokhos_KL_ExponentialRandomField.hpp:112
Stokhos::KL::ExponentialRandomField< value_type, execution_space >::num_KL
int num_KL
Definition
Stokhos_KL_ExponentialRandomField.hpp:172
Stokhos::KL::ExponentialRandomField< value_type, execution_space >::product_eigen_funcs
eigen_func_array_type product_eigen_funcs
Definition
Stokhos_KL_ExponentialRandomField.hpp:184
Stokhos::KL::ExponentialRandomField::spatialDimension
KOKKOS_INLINE_FUNCTION int spatialDimension() const
Return spatial dimension of the field.
Definition
Stokhos_KL_ExponentialRandomField.hpp:129
Stokhos::KL::ExponentialRandomField::evaluate_standard_deviation
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.
Definition
Stokhos_KL_ExponentialRandomFieldImp.hpp:185
Stokhos::KL::ExponentialRandomField::evaluate_mean
KOKKOS_INLINE_FUNCTION value_type evaluate_mean(const point_type &point) const
Evaluate mean of random field at a point.
Definition
Stokhos_KL_ExponentialRandomField.hpp:146
Stokhos::KL::ExponentialRandomField::product_eigen_pair_type
ProductEigenPair< one_d_eigen_func_type, execution_space > product_eigen_pair_type
Definition
Stokhos_KL_ExponentialRandomField.hpp:113
Stokhos::KL::ExponentialRandomField::one_d_eigen_func_type
ExponentialOneDEigenFunction< value_type > one_d_eigen_func_type
Definition
Stokhos_KL_ExponentialRandomField.hpp:111
Stokhos::KL::ExponentialRandomField::eigenvalue
value_type KOKKOS_INLINE_FUNCTION eigenvalue(int i) const
Return eigenvalue.
Definition
Stokhos_KL_ExponentialRandomField.hpp:164
Stokhos::KL::ExponentialRandomField::ExponentialRandomField
ExponentialRandomField()
Default constructor.
Definition
Stokhos_KL_ExponentialRandomField.hpp:118
Stokhos::value_type
Stokhos::KL
Namespace for analytic KL expansions.
Definition
Stokhos_KL_ExponentialRandomField.hpp:54
Stokhos
Top-level namespace for Stokhos classes and functions.
Definition
Stokhos_AbstractPreconditionerFactory.hpp:48
Stokhos::KL::OneDEigenPair
Container for one-dimensional eigenfunction and eigenvalue.
Definition
Stokhos_KL_OneDExponentialEigenPair.hpp:57
Stokhos::KL::ProductEigenPair
Container for multi-dimensional product of 1-D eigenfunctions/values.
Definition
Stokhos_KL_ProductEigenPair.hpp:53
Generated by
1.17.0