17 #ifndef KOKKOS_EXAMPLE_FENLFUNCTORS_HPP
18 #define KOKKOS_EXAMPLE_FENLFUNCTORS_HPP
29 #include <Kokkos_Pair.hpp>
30 #include <Kokkos_UnorderedMap.hpp>
32 #include <Kokkos_Timer.hpp>
49 Dim3(
const size_t x_,
const size_t y_ = 1,
const size_t z_ = 1) :
50 x(x_),
y(y_),
z(z_) {}
58 const size_t threads_per_block_x_ = 0,
59 const size_t threads_per_block_y_ = 0,
60 const size_t threads_per_block_z_ = 1) :
61 block_dim(threads_per_block_x_,threads_per_block_y_,threads_per_block_z_),
67 template<
typename ValueType ,
class Space >
69 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE // Don't remove this until Kokkos has removed the deprecated code path probably around September 2018
70 typedef Kokkos::StaticCrsGraph< unsigned , Space , void , unsigned >
StaticCrsGraphType ;
83 ,
values(
"crs_matrix_values" , arg_graph.entries.extent(0) )
89 template <
typename ViewType,
typename Enabled =
void>
90 struct LocalViewTraits {
99 KOKKOS_INLINE_FUNCTION
101 const unsigned local_rank)
105 #if defined( KOKKOS_ENABLE_CUDA )
107 template <
typename ViewType>
108 struct LocalViewTraits<
110 typename std::enable_if< std::is_same<typename ViewType::execution_space,
111 Kokkos::Cuda>::value &&
112 Kokkos::is_view_mp_vector<ViewType>::value
119 KOKKOS_INLINE_FUNCTION
121 const unsigned local_rank)
123 return Kokkos::partition<1>(v, local_rank);
130 template <
typename ScalarType>
131 struct CreateDeviceConfigs {
140 template <
typename StorageType>
141 struct CreateDeviceConfigs< Sacado::MP::Vector<StorageType> > {
145 static const unsigned VectorSize = StorageType::static_size;
146 #if defined( KOKKOS_ENABLE_CUDA )
147 enum { is_cuda = std::is_same< execution_space, Kokkos::Cuda >::value };
149 enum { is_cuda =
false };
162 template<
class ElemNodeIdView ,
class CrsGraphType ,
unsigned ElemNode >
163 class NodeNodeGraph {
169 typedef Kokkos::UnorderedMap< key_type, void , execution_space >
SetType ;
170 typedef typename CrsGraphType::row_map_type::non_const_type
RowMapType ;
174 typedef Kokkos::View< unsigned*[ElemNode][ElemNode] , execution_space >
209 const unsigned arg_node_count,
225 Kokkos::Timer wall_clock ;
231 size_t set_capacity = (((28ull *
node_count) / 2ull)*4ull)/3ull;
249 results.fill_node_set = wall_clock.seconds();
263 unsigned graph_entry_count = 0 ;
269 graph.entries =
typename CrsGraphType::entries_type(
"graph_entries" , graph_entry_count );
275 results.scan_node_count = wall_clock.seconds();
282 results.fill_graph_entries = wall_clock.seconds();
299 results.sort_graph_entries = wall_clock.seconds();
309 results.fill_element_graph = wall_clock.seconds();
315 KOKKOS_INLINE_FUNCTION
319 for (
unsigned row_local_node = 0 ; row_local_node <
elem_node_id.extent(1) ; ++row_local_node ) {
321 const unsigned row_node =
elem_node_id( ielem , row_local_node );
323 for (
unsigned col_local_node = row_local_node ; col_local_node <
elem_node_id.extent(1) ; ++col_local_node ) {
325 const unsigned col_node =
elem_node_id( ielem , col_local_node );
331 const key_type key = (row_node < col_node) ? make_pair( row_node, col_node ) : make_pair( col_node, row_node ) ;
333 const typename SetType::insert_result result =
node_node_set.insert( key );
335 if ( result.success() ) {
344 KOKKOS_INLINE_FUNCTION
349 const unsigned row_node = key.first ;
350 const unsigned col_node = key.second ;
354 graph.entries( offset ) = col_node ;
357 if ( col_node <
row_count.extent(0) && col_node != row_node ) {
359 graph.entries( offset ) = row_node ;
364 KOKKOS_INLINE_FUNCTION
367 typedef typename CrsGraphType::size_type size_type;
368 const size_type row_beg =
graph.row_map( irow );
369 const size_type row_end =
graph.row_map( irow + 1 );
370 for ( size_type i = row_beg + 1 ; i < row_end ; ++i ) {
371 const typename CrsGraphType::data_type col =
graph.entries(i);
373 for ( ; row_beg < j && col <
graph.entries(j-1) ; --
j ) {
376 graph.entries(j) = col ;
380 KOKKOS_INLINE_FUNCTION
383 typedef typename CrsGraphType::data_type entry_type;
384 for (
unsigned row_local_node = 0 ; row_local_node <
elem_node_id.extent(1) ; ++row_local_node ) {
386 const unsigned row_node =
elem_node_id( ielem , row_local_node );
388 for (
unsigned col_local_node = 0 ; col_local_node <
elem_node_id.extent(1) ; ++col_local_node ) {
390 const unsigned col_node =
elem_node_id( ielem , col_local_node );
392 entry_type entry = 0 ;
394 if ( row_node + 1 <
graph.row_map.extent(0) ) {
396 const entry_type entry_end =
static_cast<entry_type
> (
graph.row_map( row_node + 1 ));
398 entry =
graph.row_map( row_node );
400 for ( ; entry < entry_end &&
graph.entries(entry) !=
static_cast<entry_type
> (col_node) ; ++entry );
402 if ( entry == entry_end ) entry = ~0u ;
405 elem_graph( ielem , row_local_node , col_local_node ) = entry ;
410 KOKKOS_INLINE_FUNCTION
432 KOKKOS_INLINE_FUNCTION
448 KOKKOS_INLINE_FUNCTION
451 KOKKOS_INLINE_FUNCTION
452 void join(
unsigned &
update ,
const unsigned & input )
const { update += input ; }
468 struct ElementComputationConstantCoefficient {
473 KOKKOS_INLINE_FUNCTION
474 double operator()(
double pt[],
unsigned ensemble_rank)
const
485 template <
typename Scalar,
typename MeshScalar,
typename Device >
486 class ExponentialKLCoefficient {
490 template <
typename T1,
typename T2 = MeshScalar,
typename T3 = Device>
497 typedef typename RandomVariableView::size_type
size_type;
514 const MeshScalar mean ,
515 const MeshScalar variance ,
516 const MeshScalar correlation_length ,
525 solverParams.
set(
"Number of KL Terms",
int(num_rv));
526 solverParams.
set(
"Mean", mean);
527 solverParams.
set(
"Standard Deviation",
std::sqrt(variance));
530 correlation_lengths(ndim, correlation_length);
531 solverParams.
set(
"Domain Upper Bounds", domain_upper);
532 solverParams.
set(
"Domain Lower Bounds", domain_lower);
533 solverParams.
set(
"Correlation Lengths", correlation_lengths);
546 KOKKOS_INLINE_FUNCTION
549 KOKKOS_INLINE_FUNCTION
552 KOKKOS_INLINE_FUNCTION
565 template<
class FiniteElementMeshType ,
class SparseMatrixType
566 ,
class CoeffFunctionType = ElementComputationConstantCoefficient
568 class ElementComputation ;
572 typename ScalarType ,
class CoeffFunctionType >
576 , CoeffFunctionType >
591 typedef Kokkos::View< scalar_type* , Kokkos::LayoutLeft, execution_space >
vector_type ;
600 static const bool use_team = local_vector_view_traits::use_team;
602 static const unsigned SpatialDim = element_data_type::spatial_dimension ;
603 static const unsigned TensorDim = SpatialDim * SpatialDim ;
604 static const unsigned ElemNodeCount = element_data_type::element_node_count ;
605 static const unsigned FunctionCount = element_data_type::function_count ;
606 static const unsigned IntegrationCount = element_data_type::integration_count ;
612 typedef Kokkos::View< scalar_type*[FunctionCount][FunctionCount] , execution_space >
elem_matrices_type ;
642 , elem_node_ids( rhs.elem_node_ids )
643 , node_coords( rhs.node_coords )
644 , elem_graph( rhs.elem_graph )
645 , elem_jacobians( rhs.elem_jacobians )
646 , elem_residuals( rhs.elem_residuals )
647 , solution( rhs.solution )
648 , residual( rhs.residual )
649 , jacobian( rhs.jacobian )
650 , coeff_function( rhs.coeff_function )
651 , dev_config( rhs.dev_config )
657 const CoeffFunctionType & arg_coeff_function ,
664 , elem_node_ids( arg_mesh.elem_node() )
665 , node_coords( arg_mesh.node_coord() )
666 , elem_graph( arg_elem_graph )
669 , solution( arg_solution )
670 , residual( arg_residual )
671 , jacobian( arg_jacobian )
672 , coeff_function( arg_coeff_function )
673 , dev_config( arg_dev_config )
680 const size_t nelem = elem_node_ids.extent(0);
682 const size_t team_size = dev_config.block_dim.x * dev_config.block_dim.y;
683 const size_t league_size =
684 (nelem + dev_config.block_dim.y-1) / dev_config.block_dim.y;
685 Kokkos::TeamPolicy< execution_space > config( league_size, team_size );
686 parallel_for( config , *
this );
689 parallel_for( nelem , *
this );
695 static const unsigned FLOPS_transform_gradients =
696 FunctionCount * TensorDim * 2 +
700 KOKKOS_INLINE_FUNCTION
702 const double grad[][ FunctionCount ] ,
708 double dpsidz[] )
const
710 enum { j11 = 0 , j12 = 1 , j13 = 2 ,
711 j21 = 3 , j22 = 4 , j23 = 5 ,
712 j31 = 6 , j32 = 7 , j33 = 8 };
716 double J[ TensorDim ] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
718 for(
unsigned i = 0; i < FunctionCount ; ++i ) {
719 const double x1 = x[i] ;
720 const double x2 = y[i] ;
721 const double x3 = z[i] ;
723 const double g1 = grad[0][i] ;
724 const double g2 = grad[1][i] ;
725 const double g3 = grad[2][i] ;
742 double invJ[ TensorDim ] = {
743 static_cast<double>( J[j22] * J[j33] - J[j23] * J[j32] ) ,
744 static_cast<double>( J[j13] * J[j32] - J[j12] * J[j33] ) ,
745 static_cast<double>( J[j12] * J[j23] - J[j13] * J[j22] ) ,
747 static_cast<double>( J[j23] * J[j31] - J[j21] * J[j33] ) ,
748 static_cast<double>( J[j11] * J[j33] - J[j13] * J[j31] ) ,
749 static_cast<double>( J[j13] * J[j21] - J[j11] * J[j23] ) ,
751 static_cast<double>( J[j21] * J[j32] - J[j22] * J[j31] ) ,
752 static_cast<double>( J[j12] * J[j31] - J[j11] * J[j32] ) ,
753 static_cast<double>( J[j11] * J[j22] - J[j12] * J[j21] ) };
755 const double detJ = J[j11] * invJ[j11] +
759 const double detJinv = 1.0 / detJ ;
761 for (
unsigned i = 0 ; i < TensorDim ; ++i ) { invJ[i] *= detJinv ; }
765 for(
unsigned i = 0; i < FunctionCount ; ++i ) {
766 const double g0 = grad[0][i];
767 const double g1 = grad[1][i];
768 const double g2 = grad[2][i];
770 dpsidx[i] = g0 * invJ[j11] + g1 * invJ[j12] + g2 * invJ[j13];
771 dpsidy[i] = g0 * invJ[j21] + g1 * invJ[j22] + g2 * invJ[j23];
772 dpsidz[i] = g0 * invJ[j31] + g1 * invJ[j32] + g2 * invJ[j33];
778 KOKKOS_INLINE_FUNCTION
781 const double dpsidx[] ,
782 const double dpsidy[] ,
783 const double dpsidz[] ,
786 const double integ_weight ,
787 const double bases_vals[] ,
796 for (
unsigned m = 0 ; m < FunctionCount ; m++ ) {
797 value_at_pt += dof_values[m] * bases_vals[m] ;
798 gradx_at_pt += dof_values[m] * dpsidx[m] ;
799 grady_at_pt += dof_values[m] * dpsidy[m] ;
800 gradz_at_pt += dof_values[m] * dpsidz[m] ;
804 const local_scalar_type res_val = value_at_pt * value_at_pt * detJ * integ_weight ;
810 for (
unsigned m = 0; m < FunctionCount; ++m) {
812 const double bases_val_m = bases_vals[m];
813 const double dpsidx_m = dpsidx[m] ;
814 const double dpsidy_m = dpsidy[m] ;
815 const double dpsidz_m = dpsidz[m] ;
817 elem_res[m] += k_detJ_weight * ( dpsidx_m * gradx_at_pt +
818 dpsidy_m * grady_at_pt +
819 dpsidz_m * gradz_at_pt ) +
820 res_val * bases_val_m ;
822 for(
unsigned n = 0;
n < FunctionCount;
n++) {
824 mat[
n] += k_detJ_weight * ( dpsidx_m * dpsidx[
n] +
825 dpsidy_m * dpsidy[
n] +
826 dpsidz_m * dpsidz[
n] ) +
827 mat_val * bases_val_m * bases_vals[
n];
832 KOKKOS_INLINE_FUNCTION
833 void operator()(
const typename TeamPolicy< execution_space >::member_type & dev )
const
836 const unsigned num_ensemble_threads = dev_config.block_dim.x ;
837 const unsigned num_element_threads = dev_config.block_dim.y ;
838 const unsigned element_rank = dev.team_rank() / num_ensemble_threads ;
839 const unsigned ensemble_rank = dev.team_rank() % num_ensemble_threads ;
841 const unsigned ielem =
842 dev.league_rank() * num_element_threads + element_rank;
844 if (ielem >= elem_node_ids.extent(0))
847 (*this)( ielem, ensemble_rank );
851 KOKKOS_INLINE_FUNCTION
853 const unsigned ensemble_rank = 0 )
const
856 local_vector_view_traits::create_local_view(solution,
859 local_vector_view_traits::create_local_view(residual,
862 local_matrix_view_traits::create_local_view(jacobian.values,
867 double x[ FunctionCount ] ;
868 double y[ FunctionCount ] ;
869 double z[ FunctionCount ] ;
871 unsigned node_index[ ElemNodeCount ];
873 for (
unsigned i = 0 ; i < ElemNodeCount ; ++i ) {
874 const unsigned ni = elem_node_ids( ielem , i );
878 x[i] = node_coords( ni , 0 );
879 y[i] = node_coords( ni , 1 );
880 z[i] = node_coords( ni , 2 );
882 val[i] = local_solution( ni );
889 for(
unsigned i = 0; i < FunctionCount ; i++ ) {
891 for(
unsigned j = 0;
j < FunctionCount ;
j++){
897 for (
unsigned i = 0 ; i < IntegrationCount ; ++i ) {
898 double dpsidx[ FunctionCount ] ;
899 double dpsidy[ FunctionCount ] ;
900 double dpsidz[ FunctionCount ] ;
905 double pt[] = {0.0, 0.0, 0.0};
909 if ( ! coeff_function.is_constant ) {
910 for (
unsigned j = 0 ;
j < FunctionCount ; ++
j ) {
911 pt[0] += x[
j] * elem_data.values[i][
j] ;
912 pt[1] += y[
j] * elem_data.values[i][
j] ;
913 pt[2] += z[
j] * elem_data.values[i][
j] ;
918 coeff_k = coeff_function(pt, ensemble_rank);
922 transform_gradients( elem_data.gradients[i] , x , y , z ,
923 dpsidx , dpsidy , dpsidz );
925 contributeResidualJacobian( val , dpsidx , dpsidy , dpsidz ,
927 elem_data.weights[i] ,
928 elem_data.values[i] ,
929 elem_vec , elem_mat );
932 for(
unsigned i = 0 ; i < FunctionCount ; i++ ) {
933 const unsigned row = node_index[i] ;
934 if ( row < residual.extent(0) ) {
935 atomic_add( & local_residual( row ) , elem_vec[i] );
937 for(
unsigned j = 0 ;
j < FunctionCount ;
j++ ) {
938 const unsigned entry = elem_graph( ielem , i ,
j );
939 if ( entry != ~0u ) {
940 atomic_add( & local_jacobian_values( entry ) , elem_mat[i][
j] );
950 template<
class FixtureType ,
class SparseMatrixType >
951 class DirichletComputation ;
954 typename ScalarType >
955 class DirichletComputation<
971 typedef Kokkos::View< scalar_type* , execution_space >
vector_type ;
979 static const bool use_team = local_vector_view_traits::use_team;
994 const unsigned bc_plane ;
995 const unsigned node_count ;
1004 const unsigned arg_bc_plane ,
1008 : node_coords( arg_mesh.node_coord() )
1009 , solution( arg_solution )
1010 , jacobian( arg_jacobian )
1011 , residual( arg_residual )
1012 , bc_lower_value( arg_bc_lower_value )
1013 , bc_upper_value( arg_bc_upper_value )
1016 , bc_plane( arg_bc_plane )
1017 , node_count( arg_mesh.node_count_owned() )
1019 , dev_config( arg_dev_config )
1021 parallel_for( node_count , *
this );
1028 const size_t team_size = dev_config.block_dim.x * dev_config.block_dim.y;
1029 const size_t league_size =
1030 (node_count + dev_config.block_dim.y-1) / dev_config.block_dim.y;
1031 Kokkos::TeamPolicy< execution_space > config( league_size, team_size );
1032 parallel_for( config , *
this );
1035 parallel_for( node_count , *
this );
1040 KOKKOS_INLINE_FUNCTION
1041 void operator()(
const typename TeamPolicy< execution_space >::member_type & dev )
const
1044 const unsigned num_ensemble_threads = dev_config.block_dim.x ;
1045 const unsigned num_node_threads = dev_config.block_dim.y ;
1046 const unsigned node_rank = dev.team_rank() / num_ensemble_threads ;
1047 const unsigned ensemble_rank = dev.team_rank() % num_ensemble_threads ;
1049 const unsigned inode = dev.league_rank() * num_node_threads + node_rank;
1051 if (inode >= node_count)
1054 (*this)( inode, ensemble_rank );
1058 KOKKOS_INLINE_FUNCTION
1060 const unsigned ensemble_rank = 0)
const
1063 local_vector_view_traits::create_local_view(residual,
1066 local_matrix_view_traits::create_local_view(jacobian.values,
1074 const unsigned iBeg = jacobian.graph.row_map[inode];
1075 const unsigned iEnd = jacobian.graph.row_map[inode+1];
1078 const bool bc_lower = c <= bc_lower_limit ;
1079 const bool bc_upper = bc_upper_limit <= c ;
1082 solution(inode) = bc_lower ? bc_lower_value : (
1083 bc_upper ? bc_upper_value : 0 );
1086 if ( bc_lower || bc_upper ) {
1088 local_residual(inode) = 0 ;
1093 for(
unsigned i = iBeg ; i < iEnd ; ++i ) {
1094 local_jacobian_values(i) = int(inode) == int(jacobian.graph.entries(i)) ? 1 : 0 ;
1102 for(
unsigned i = iBeg ; i < iEnd ; ++i ) {
1103 const unsigned cnode = jacobian.graph.entries(i) ;
1106 if ( ( cc <= bc_lower_limit ) || ( bc_upper_limit <= cc ) ) {
1107 local_jacobian_values(i) = 0 ;
1115 template<
typename FixtureType ,
typename VectorType >
1126 static const unsigned SpatialDim = element_data_type::spatial_dimension ;
1127 static const unsigned TensorDim = SpatialDim * SpatialDim ;
1128 static const unsigned ElemNodeCount = element_data_type::element_node_count ;
1129 static const unsigned IntegrationCount = element_data_type::integration_count ;
1140 , fixture( rhs.fixture )
1141 , solution( rhs.solution )
1147 , fixture( arg_fixture )
1148 , solution( arg_solution )
1157 Kokkos::parallel_reduce( solution.extent(0) , *this , response );
1163 KOKKOS_INLINE_FUNCTION
1165 const double grad[][ ElemNodeCount ] ,
1168 const double z[] )
const
1170 enum { j11 = 0 , j12 = 1 , j13 = 2 ,
1171 j21 = 3 , j22 = 4 , j23 = 5 ,
1172 j31 = 6 , j32 = 7 , j33 = 8 };
1176 double J[ TensorDim ] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
1178 for(
unsigned i = 0; i < ElemNodeCount ; ++i ) {
1179 const double x1 = x[i] ;
1180 const double x2 = y[i] ;
1181 const double x3 = z[i] ;
1183 const double g1 = grad[0][i] ;
1184 const double g2 = grad[1][i] ;
1185 const double g3 = grad[2][i] ;
1202 double invJ[ TensorDim ] = {
1203 static_cast<double>( J[j22] * J[j33] - J[j23] * J[j32] ) ,
1204 static_cast<double>( J[j13] * J[j32] - J[j12] * J[j33] ) ,
1205 static_cast<double>( J[j12] * J[j23] - J[j13] * J[j22] ) ,
1207 static_cast<double>( J[j23] * J[j31] - J[j21] * J[j33] ) ,
1208 static_cast<double>( J[j11] * J[j33] - J[j13] * J[j31] ) ,
1209 static_cast<double>( J[j13] * J[j21] - J[j11] * J[j23] ) ,
1211 static_cast<double>( J[j21] * J[j32] - J[j22] * J[j31] ) ,
1212 static_cast<double>( J[j12] * J[j31] - J[j11] * J[j32] ) ,
1213 static_cast<double>( J[j11] * J[j22] - J[j12] * J[j21] ) };
1215 const double detJ = J[j11] * invJ[j11] +
1216 J[j21] * invJ[j12] +
1217 J[j31] * invJ[j13] ;
1222 KOKKOS_INLINE_FUNCTION
1226 const double integ_weight ,
1227 const double bases_vals[] )
const
1232 for (
unsigned m = 0 ; m < ElemNodeCount ; m++ ) {
1233 value_at_pt += dof_values[m] * bases_vals[m] ;
1237 value_at_pt * value_at_pt * detJ * integ_weight ;
1239 return elem_response;
1273 KOKKOS_INLINE_FUNCTION
1277 response += (u * u) / fixture.node_count_global();
1280 KOKKOS_INLINE_FUNCTION
1284 KOKKOS_INLINE_FUNCTION
1287 { response += input ; }
1298 #if defined( __CUDACC__ )
static KOKKOS_INLINE_FUNCTION local_view_type create_local_view(const view_type &v, const unsigned local_rank)
KOKKOS_INLINE_FUNCTION PCE< Storage > sqrt(const PCE< Storage > &a)
LocalViewTraits< vector_type > local_vector_view_traits
KOKKOS_INLINE_FUNCTION double compute_detJ(const double grad[][ElemNodeCount], const double x[], const double y[], const double z[]) const
KOKKOS_INLINE_FUNCTION void operator()(const unsigned i, value_type &response) const
ExponentialKLCoefficient(const ExponentialKLCoefficient &rhs)
const elem_matrices_type elem_jacobians
Kokkos::View< scalar_type *, execution_space > vector_type
KOKKOS_INLINE_FUNCTION void setRandomVariables(const RandomVariableView &rv)
LocalViewTraits< matrix_values_type > local_matrix_view_traits
const element_data_type elem_data
LocalViewTraits< RandomVariableView > local_rv_view_traits
const fixture_type fixture
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.
const elem_graph_type elem_graph
KOKKOS_INLINE_FUNCTION void fill_graph_entries(const unsigned iset) const
static const bool use_team
const element_data_type elem_data
view_type::value_type local_value_type
KOKKOS_INLINE_FUNCTION void join(unsigned &update, const unsigned &input) const
static void eval(Kokkos::Example::FENL::DeviceConfig &dev_config_elem, Kokkos::Example::FENL::DeviceConfig &dev_config_bc)
KOKKOS_INLINE_FUNCTION value_type contributeResponse(const value_type dof_values[], const double detJ, const double integ_weight, const double bases_vals[]) const
Kokkos::View< scalar_type *, Kokkos::LayoutLeft, execution_space > vector_type
Kokkos::View< const double *[SpaceDim], Device > node_coord_type
Kokkos::DefaultExecutionSpace execution_space
Kokkos::View< const unsigned *[ElemNode], Device > elem_node_type
const Kokkos::Example::FENL::DeviceConfig dev_config
KOKKOS_INLINE_FUNCTION RandomVariableView getRandomVariables() const
static void eval(Kokkos::Example::FENL::DeviceConfig &dev_config_elem, Kokkos::Example::FENL::DeviceConfig &dev_config_bc)
ElementComputation(const ElementComputation &rhs)
vector_type::execution_space execution_space
KOKKOS_INLINE_FUNCTION void atomic_add(volatile Sacado::UQ::PCE< Storage > *const dest, const Sacado::UQ::PCE< Storage > &src)
local_elem_vectors_traits::local_view_type local_elem_vectors_type
LocalViewTraits< elem_matrices_type > local_elem_matrices_traits
const sparse_matrix_type jacobian
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
Kokkos::View< Scalar *, Kokkos::LayoutLeft, Device > RandomVariableView
LocalViewTraits< vector_type > local_vector_view_traits
Kokkos::Example::HexElement_Data< mesh_type::ElemNode > element_data_type
LocalViewTraits< matrix_values_type > local_matrix_view_traits
const vector_type solution
const unsigned node_count
local_elem_matrices_traits::local_view_type local_elem_matrices_type
KOKKOS_INLINE_FUNCTION local_scalar_type operator()(const MeshScalar point[], const size_type ensemble_rank) const
mesh_type::node_coord_type node_coord_type
KOKKOS_INLINE_FUNCTION void operator()(const unsigned ielem, const unsigned ensemble_rank=0) const
const vector_type solution
const MeshScalar m_variance
local_rv_view_traits::local_view_type local_rv_view_type
mesh_type::node_coord_type node_coord_type
ElemNodeIdView::execution_space execution_space
node_coord_type::value_type scalar_coord_type
ResponseComputation(const fixture_type &arg_fixture, const vector_type &arg_solution)
KOKKOS_INLINE_FUNCTION void operator()(const unsigned irow, unsigned &update, const bool final) const
mesh_type::elem_node_type elem_node_type
ElementComputationConstantCoefficient(const ElementComputationConstantCoefficient &rhs)
RandomVariableView::size_type size_type
KOKKOS_INLINE_FUNCTION void init(unsigned &update) const
Kokkos::Example::BoxElemFixture< ExecutionSpace, Order, CoordinateMap > mesh_type
ExecutionSpace execution_space
double sort_graph_entries
size_t num_threads_per_block
double fill_graph_entries
sparse_matrix_type::StaticCrsGraphType sparse_graph_type
NodeNodeGraph< elem_node_type, sparse_graph_type, ElemNodeCount >::ElemGraphType elem_graph_type
KOKKOS_INLINE_FUNCTION void fill_elem_graph_map(const unsigned ielem) const
Dim3(const size_t x_, const size_t y_=1, const size_t z_=1)
const CoeffFunctionType coeff_function
CrsGraphType::row_map_type::non_const_type RowMapType
Kokkos::Example::FENL::CrsMatrix< ScalarType, ExecutionSpace > sparse_matrix_type
KOKKOS_INLINE_FUNCTION void operator()(const typename TeamPolicy< execution_space >::member_type &dev) const
sparse_matrix_type::values_type matrix_values_type
const MeshScalar m_corr_len
KOKKOS_INLINE_FUNCTION void init(value_type &response) const
KOKKOS_INLINE_FUNCTION void operator()(const typename TeamPolicy< execution_space >::member_type &dev) const
CrsMatrix(const StaticCrsGraphType &arg_graph)
Kokkos::StaticCrsGraph< unsigned, Space, void, void, unsigned > StaticCrsGraphType
Kokkos::Example::FENL::CrsMatrix< ScalarType, ExecutionSpace > sparse_matrix_type
vector_type::value_type value_type
void deep_copy(const Stokhos::CrsMatrix< ValueType, DstDevice, Layout > &dst, const Stokhos::CrsMatrix< ValueType, SrcDevice, Layout > &src)
KOKKOS_INLINE_FUNCTION void operator()(const unsigned inode, const unsigned ensemble_rank=0) const
KOKKOS_INLINE_FUNCTION void operator()(const unsigned iwork) const
local_vector_view_traits::local_value_type local_scalar_type
KOKKOS_INLINE_FUNCTION void contributeResidualJacobian(const local_scalar_type dof_values[], const double dpsidx[], const double dpsidy[], const double dpsidz[], const double detJ, const local_scalar_type coeff_k, const double integ_weight, const double bases_vals[], local_scalar_type elem_res[], local_scalar_type elem_mat[][FunctionCount]) const
KOKKOS_INLINE_FUNCTION double operator()(double pt[], unsigned ensemble_rank) const
const ElemNodeIdView elem_node_id
Kokkos::Example::BoxElemFixture< ExecutionSpace, Order, CoordinateMap > mesh_type
sparse_matrix_type::StaticCrsGraphType sparse_graph_type
const view_type & local_view_type
const elem_vectors_type elem_residuals
NodeNodeGraph(const ElemNodeIdView &arg_elem_node_id, const unsigned arg_node_count, Times &results)
LocalViewTraits< elem_vectors_type > local_elem_vectors_traits
KOKKOS_INLINE_FUNCTION void join(value_type &response, const value_type &input) const
ElementComputation(const mesh_type &arg_mesh, const CoeffFunctionType &arg_coeff_function, const vector_type &arg_solution, const elem_graph_type &arg_elem_graph, const sparse_matrix_type &arg_jacobian, const vector_type &arg_residual, const Kokkos::Example::FENL::DeviceConfig arg_dev_config)
KOKKOS_INLINE_FUNCTION double transform_gradients(const double grad[][FunctionCount], const double x[], const double y[], const double z[], double dpsidx[], double dpsidy[], double dpsidz[]) const
Kokkos::View< unsigned, execution_space > UnsignedValue
DeviceConfig(const size_t num_blocks_=0, const size_t threads_per_block_x_=0, const size_t threads_per_block_y_=0, const size_t threads_per_block_z_=1)
ExponentialKLCoefficient< T1, T2, T3 > type
Kokkos::View< scalar_type *[FunctionCount][FunctionCount], execution_space > elem_matrices_type
ResponseComputation(const ResponseComputation &rhs)
Kokkos::Example::HexElement_Data< fixture_type::ElemNode > element_data_type
local_rv_view_traits::local_value_type local_scalar_type
DirichletComputation(const mesh_type &arg_mesh, const vector_type &arg_solution, const sparse_matrix_type &arg_jacobian, const vector_type &arg_residual, const unsigned arg_bc_plane, const bc_scalar_type arg_bc_lower_value, const bc_scalar_type arg_bc_upper_value, const Kokkos::Example::FENL::DeviceConfig arg_dev_config)
ExecutionSpace execution_space
KOKKOS_INLINE_FUNCTION PCE< Storage > sin(const PCE< Storage > &a)
View< ValueType *, Space > values_type
const node_coord_type node_coords
StorageType::execution_space execution_space
local_matrix_view_traits::local_view_type local_matrix_type
KOKKOS_INLINE_FUNCTION void sort_graph_entries(const unsigned irow) const
double fill_element_graph
const unsigned VectorSize
KOKKOS_INLINE_FUNCTION void fill_set(const unsigned ielem) const
ElementComputationConstantCoefficient(const double val)
Kokkos::View< unsigned *[ElemNode][ElemNode], execution_space > ElemGraphType
Generate a distributed unstructured finite element mesh from a partitioned NX*NY*NZ box of elements...
Stokhos::KL::ExponentialRandomField< MeshScalar, Device > rf_type
sparse_matrix_type::values_type matrix_values_type
ExponentialKLCoefficient(const MeshScalar mean, const MeshScalar variance, const MeshScalar correlation_length, const size_type num_rv)
Kokkos::View< scalar_type *[FunctionCount], execution_space > elem_vectors_type
local_vector_view_traits::local_view_type local_vector_type
void update(const ValueType &alpha, VectorType &x, const ValueType &beta, const VectorType &y)
const vector_type residual
const elem_node_type elem_node_ids
Kokkos::UnorderedMap< key_type, void, execution_space > SetType
pair< unsigned, unsigned > key_type
local_vector_view_traits::local_view_type local_vector_type
local_matrix_view_traits::local_view_type local_matrix_type