17 #ifndef KOKKOS_EXAMPLE_FENLFUNCTORS_HPP
18 #define KOKKOS_EXAMPLE_FENLFUNCTORS_HPP
29 #include <Kokkos_Pair.hpp>
30 #include <Kokkos_UnorderedMap.hpp>
31 #include <KokkosSparse_StaticCrsGraph.hpp>
33 #include <Kokkos_Timer.hpp>
50 Dim3(
const size_t x_,
const size_t y_ = 1,
const size_t z_ = 1) :
51 x(x_),
y(y_),
z(z_) {}
59 const size_t threads_per_block_x_ = 0,
60 const size_t threads_per_block_y_ = 0,
61 const size_t threads_per_block_z_ = 1) :
62 block_dim(threads_per_block_x_,threads_per_block_y_,threads_per_block_z_),
68 template<
typename ValueType ,
class Space >
70 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE // Don't remove this until Kokkos has removed the deprecated code path probably around September 2018
71 typedef KokkosSparse::StaticCrsGraph< unsigned , Space , void , unsigned >
StaticCrsGraphType ;
73 typedef KokkosSparse::StaticCrsGraph< unsigned , Space , void , void , unsigned >
StaticCrsGraphType ;
84 ,
values(
"crs_matrix_values" , arg_graph.entries.extent(0) )
90 template <
typename ViewType,
typename Enabled =
void>
91 struct LocalViewTraits {
100 KOKKOS_INLINE_FUNCTION
102 const unsigned local_rank)
106 #if defined( KOKKOS_ENABLE_CUDA )
108 template <
typename ViewType>
109 struct LocalViewTraits<
111 typename std::enable_if< std::is_same<typename ViewType::execution_space,
112 Kokkos::Cuda>::value &&
113 Kokkos::is_view_mp_vector<ViewType>::value
120 KOKKOS_INLINE_FUNCTION
122 const unsigned local_rank)
124 return Kokkos::partition<1>(v, local_rank);
131 template <
typename ScalarType>
132 struct CreateDeviceConfigs {
141 template <
typename StorageType>
142 struct CreateDeviceConfigs< Sacado::MP::Vector<StorageType> > {
146 static const unsigned VectorSize = StorageType::static_size;
147 #if defined( KOKKOS_ENABLE_CUDA )
148 enum { is_cuda = std::is_same< execution_space, Kokkos::Cuda >::value };
150 enum { is_cuda =
false };
163 template<
class ElemNodeIdView ,
class CrsGraphType ,
unsigned ElemNode >
164 class NodeNodeGraph {
170 typedef Kokkos::UnorderedMap< key_type, void , execution_space >
SetType ;
171 typedef typename CrsGraphType::row_map_type::non_const_type
RowMapType ;
175 typedef Kokkos::View< unsigned*[ElemNode][ElemNode] , execution_space >
210 const unsigned arg_node_count,
226 Kokkos::Timer wall_clock ;
232 size_t set_capacity = (((28ull *
node_count) / 2ull)*4ull)/3ull;
250 results.fill_node_set = wall_clock.seconds();
264 unsigned graph_entry_count = 0 ;
270 graph.entries =
typename CrsGraphType::entries_type(
"graph_entries" , graph_entry_count );
276 results.scan_node_count = wall_clock.seconds();
283 results.fill_graph_entries = wall_clock.seconds();
300 results.sort_graph_entries = wall_clock.seconds();
310 results.fill_element_graph = wall_clock.seconds();
316 KOKKOS_INLINE_FUNCTION
320 for (
unsigned row_local_node = 0 ; row_local_node <
elem_node_id.extent(1) ; ++row_local_node ) {
322 const unsigned row_node =
elem_node_id( ielem , row_local_node );
324 for (
unsigned col_local_node = row_local_node ; col_local_node <
elem_node_id.extent(1) ; ++col_local_node ) {
326 const unsigned col_node =
elem_node_id( ielem , col_local_node );
332 const key_type key = (row_node < col_node) ? make_pair( row_node, col_node ) : make_pair( col_node, row_node ) ;
334 const typename SetType::insert_result result =
node_node_set.insert( key );
336 if ( result.success() ) {
345 KOKKOS_INLINE_FUNCTION
350 const unsigned row_node = key.first ;
351 const unsigned col_node = key.second ;
355 graph.entries( offset ) = col_node ;
358 if ( col_node <
row_count.extent(0) && col_node != row_node ) {
360 graph.entries( offset ) = row_node ;
365 KOKKOS_INLINE_FUNCTION
368 typedef typename CrsGraphType::size_type size_type;
369 const size_type row_beg =
graph.row_map( irow );
370 const size_type row_end =
graph.row_map( irow + 1 );
371 for ( size_type i = row_beg + 1 ; i < row_end ; ++i ) {
372 const typename CrsGraphType::data_type col =
graph.entries(i);
374 for ( ; row_beg < j && col <
graph.entries(j-1) ; --
j ) {
377 graph.entries(j) = col ;
381 KOKKOS_INLINE_FUNCTION
384 typedef typename CrsGraphType::data_type entry_type;
385 for (
unsigned row_local_node = 0 ; row_local_node <
elem_node_id.extent(1) ; ++row_local_node ) {
387 const unsigned row_node =
elem_node_id( ielem , row_local_node );
389 for (
unsigned col_local_node = 0 ; col_local_node <
elem_node_id.extent(1) ; ++col_local_node ) {
391 const unsigned col_node =
elem_node_id( ielem , col_local_node );
393 entry_type entry = 0 ;
395 if ( row_node + 1 <
graph.row_map.extent(0) ) {
397 const entry_type entry_end =
static_cast<entry_type
> (
graph.row_map( row_node + 1 ));
399 entry =
graph.row_map( row_node );
401 for ( ; entry < entry_end &&
graph.entries(entry) !=
static_cast<entry_type
> (col_node) ; ++entry );
403 if ( entry == entry_end ) entry = ~0u ;
406 elem_graph( ielem , row_local_node , col_local_node ) = entry ;
411 KOKKOS_INLINE_FUNCTION
433 KOKKOS_INLINE_FUNCTION
449 KOKKOS_INLINE_FUNCTION
452 KOKKOS_INLINE_FUNCTION
453 void join(
unsigned &
update ,
const unsigned & input )
const { update += input ; }
469 struct ElementComputationConstantCoefficient {
474 KOKKOS_INLINE_FUNCTION
475 double operator()(
double pt[],
unsigned ensemble_rank)
const
486 template <
typename Scalar,
typename MeshScalar,
typename Device >
487 class ExponentialKLCoefficient {
491 template <
typename T1,
typename T2 = MeshScalar,
typename T3 = Device>
498 typedef typename RandomVariableView::size_type
size_type;
515 const MeshScalar mean ,
516 const MeshScalar variance ,
517 const MeshScalar correlation_length ,
526 solverParams.
set(
"Number of KL Terms",
int(num_rv));
527 solverParams.
set(
"Mean", mean);
528 solverParams.
set(
"Standard Deviation",
std::sqrt(variance));
531 correlation_lengths(ndim, correlation_length);
532 solverParams.
set(
"Domain Upper Bounds", domain_upper);
533 solverParams.
set(
"Domain Lower Bounds", domain_lower);
534 solverParams.
set(
"Correlation Lengths", correlation_lengths);
547 KOKKOS_INLINE_FUNCTION
550 KOKKOS_INLINE_FUNCTION
553 KOKKOS_INLINE_FUNCTION
566 template<
class FiniteElementMeshType ,
class SparseMatrixType
567 ,
class CoeffFunctionType = ElementComputationConstantCoefficient
569 class ElementComputation ;
573 typename ScalarType ,
class CoeffFunctionType >
577 , CoeffFunctionType >
592 typedef Kokkos::View< scalar_type* , Kokkos::LayoutLeft, execution_space >
vector_type ;
601 static const bool use_team = local_vector_view_traits::use_team;
603 static const unsigned SpatialDim = element_data_type::spatial_dimension ;
604 static const unsigned TensorDim = SpatialDim * SpatialDim ;
605 static const unsigned ElemNodeCount = element_data_type::element_node_count ;
606 static const unsigned FunctionCount = element_data_type::function_count ;
607 static const unsigned IntegrationCount = element_data_type::integration_count ;
613 typedef Kokkos::View< scalar_type*[FunctionCount][FunctionCount] , execution_space >
elem_matrices_type ;
643 , elem_node_ids( rhs.elem_node_ids )
644 , node_coords( rhs.node_coords )
645 , elem_graph( rhs.elem_graph )
646 , elem_jacobians( rhs.elem_jacobians )
647 , elem_residuals( rhs.elem_residuals )
648 , solution( rhs.solution )
649 , residual( rhs.residual )
650 , jacobian( rhs.jacobian )
651 , coeff_function( rhs.coeff_function )
652 , dev_config( rhs.dev_config )
658 const CoeffFunctionType & arg_coeff_function ,
665 , elem_node_ids( arg_mesh.elem_node() )
666 , node_coords( arg_mesh.node_coord() )
667 , elem_graph( arg_elem_graph )
670 , solution( arg_solution )
671 , residual( arg_residual )
672 , jacobian( arg_jacobian )
673 , coeff_function( arg_coeff_function )
674 , dev_config( arg_dev_config )
681 const size_t nelem = elem_node_ids.extent(0);
683 const size_t team_size = dev_config.block_dim.x * dev_config.block_dim.y;
684 const size_t league_size =
685 (nelem + dev_config.block_dim.y-1) / dev_config.block_dim.y;
686 Kokkos::TeamPolicy< execution_space > config( league_size, team_size );
687 parallel_for( config , *
this );
690 parallel_for( nelem , *
this );
696 static const unsigned FLOPS_transform_gradients =
697 FunctionCount * TensorDim * 2 +
701 KOKKOS_INLINE_FUNCTION
703 const double grad[][ FunctionCount ] ,
709 double dpsidz[] )
const
711 enum { j11 = 0 , j12 = 1 , j13 = 2 ,
712 j21 = 3 , j22 = 4 , j23 = 5 ,
713 j31 = 6 , j32 = 7 , j33 = 8 };
717 double J[ TensorDim ] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
719 for(
unsigned i = 0; i < FunctionCount ; ++i ) {
720 const double x1 = x[i] ;
721 const double x2 = y[i] ;
722 const double x3 = z[i] ;
724 const double g1 = grad[0][i] ;
725 const double g2 = grad[1][i] ;
726 const double g3 = grad[2][i] ;
743 double invJ[ TensorDim ] = {
744 static_cast<double>( J[j22] * J[j33] - J[j23] * J[j32] ) ,
745 static_cast<double>( J[j13] * J[j32] - J[j12] * J[j33] ) ,
746 static_cast<double>( J[j12] * J[j23] - J[j13] * J[j22] ) ,
748 static_cast<double>( J[j23] * J[j31] - J[j21] * J[j33] ) ,
749 static_cast<double>( J[j11] * J[j33] - J[j13] * J[j31] ) ,
750 static_cast<double>( J[j13] * J[j21] - J[j11] * J[j23] ) ,
752 static_cast<double>( J[j21] * J[j32] - J[j22] * J[j31] ) ,
753 static_cast<double>( J[j12] * J[j31] - J[j11] * J[j32] ) ,
754 static_cast<double>( J[j11] * J[j22] - J[j12] * J[j21] ) };
756 const double detJ = J[j11] * invJ[j11] +
760 const double detJinv = 1.0 / detJ ;
762 for (
unsigned i = 0 ; i < TensorDim ; ++i ) { invJ[i] *= detJinv ; }
766 for(
unsigned i = 0; i < FunctionCount ; ++i ) {
767 const double g0 = grad[0][i];
768 const double g1 = grad[1][i];
769 const double g2 = grad[2][i];
771 dpsidx[i] = g0 * invJ[j11] + g1 * invJ[j12] + g2 * invJ[j13];
772 dpsidy[i] = g0 * invJ[j21] + g1 * invJ[j22] + g2 * invJ[j23];
773 dpsidz[i] = g0 * invJ[j31] + g1 * invJ[j32] + g2 * invJ[j33];
779 KOKKOS_INLINE_FUNCTION
782 const double dpsidx[] ,
783 const double dpsidy[] ,
784 const double dpsidz[] ,
787 const double integ_weight ,
788 const double bases_vals[] ,
797 for (
unsigned m = 0 ; m < FunctionCount ; m++ ) {
798 value_at_pt += dof_values[m] * bases_vals[m] ;
799 gradx_at_pt += dof_values[m] * dpsidx[m] ;
800 grady_at_pt += dof_values[m] * dpsidy[m] ;
801 gradz_at_pt += dof_values[m] * dpsidz[m] ;
805 const local_scalar_type res_val = value_at_pt * value_at_pt * detJ * integ_weight ;
811 for (
unsigned m = 0; m < FunctionCount; ++m) {
813 const double bases_val_m = bases_vals[m];
814 const double dpsidx_m = dpsidx[m] ;
815 const double dpsidy_m = dpsidy[m] ;
816 const double dpsidz_m = dpsidz[m] ;
818 elem_res[m] += k_detJ_weight * ( dpsidx_m * gradx_at_pt +
819 dpsidy_m * grady_at_pt +
820 dpsidz_m * gradz_at_pt ) +
821 res_val * bases_val_m ;
823 for(
unsigned n = 0;
n < FunctionCount;
n++) {
825 mat[
n] += k_detJ_weight * ( dpsidx_m * dpsidx[
n] +
826 dpsidy_m * dpsidy[
n] +
827 dpsidz_m * dpsidz[
n] ) +
828 mat_val * bases_val_m * bases_vals[
n];
833 KOKKOS_INLINE_FUNCTION
834 void operator()(
const typename TeamPolicy< execution_space >::member_type & dev )
const
837 const unsigned num_ensemble_threads = dev_config.block_dim.x ;
838 const unsigned num_element_threads = dev_config.block_dim.y ;
839 const unsigned element_rank = dev.team_rank() / num_ensemble_threads ;
840 const unsigned ensemble_rank = dev.team_rank() % num_ensemble_threads ;
842 const unsigned ielem =
843 dev.league_rank() * num_element_threads + element_rank;
845 if (ielem >= elem_node_ids.extent(0))
848 (*this)( ielem, ensemble_rank );
852 KOKKOS_INLINE_FUNCTION
854 const unsigned ensemble_rank = 0 )
const
857 local_vector_view_traits::create_local_view(solution,
860 local_vector_view_traits::create_local_view(residual,
863 local_matrix_view_traits::create_local_view(jacobian.values,
868 double x[ FunctionCount ] ;
869 double y[ FunctionCount ] ;
870 double z[ FunctionCount ] ;
872 unsigned node_index[ ElemNodeCount ];
874 for (
unsigned i = 0 ; i < ElemNodeCount ; ++i ) {
875 const unsigned ni = elem_node_ids( ielem , i );
879 x[i] = node_coords( ni , 0 );
880 y[i] = node_coords( ni , 1 );
881 z[i] = node_coords( ni , 2 );
883 val[i] = local_solution( ni );
890 for(
unsigned i = 0; i < FunctionCount ; i++ ) {
892 for(
unsigned j = 0;
j < FunctionCount ;
j++){
898 for (
unsigned i = 0 ; i < IntegrationCount ; ++i ) {
899 double dpsidx[ FunctionCount ] ;
900 double dpsidy[ FunctionCount ] ;
901 double dpsidz[ FunctionCount ] ;
906 double pt[] = {0.0, 0.0, 0.0};
910 if ( ! coeff_function.is_constant ) {
911 for (
unsigned j = 0 ;
j < FunctionCount ; ++
j ) {
912 pt[0] += x[
j] * elem_data.values[i][
j] ;
913 pt[1] += y[
j] * elem_data.values[i][
j] ;
914 pt[2] += z[
j] * elem_data.values[i][
j] ;
919 coeff_k = coeff_function(pt, ensemble_rank);
923 transform_gradients( elem_data.gradients[i] , x , y , z ,
924 dpsidx , dpsidy , dpsidz );
926 contributeResidualJacobian( val , dpsidx , dpsidy , dpsidz ,
928 elem_data.weights[i] ,
929 elem_data.values[i] ,
930 elem_vec , elem_mat );
933 for(
unsigned i = 0 ; i < FunctionCount ; i++ ) {
934 const unsigned row = node_index[i] ;
935 if ( row < residual.extent(0) ) {
936 atomic_add( & local_residual( row ) , elem_vec[i] );
938 for(
unsigned j = 0 ;
j < FunctionCount ;
j++ ) {
939 const unsigned entry = elem_graph( ielem , i ,
j );
940 if ( entry != ~0u ) {
941 atomic_add( & local_jacobian_values( entry ) , elem_mat[i][
j] );
951 template<
class FixtureType ,
class SparseMatrixType >
952 class DirichletComputation ;
955 typename ScalarType >
956 class DirichletComputation<
972 typedef Kokkos::View< scalar_type* , execution_space >
vector_type ;
980 static const bool use_team = local_vector_view_traits::use_team;
995 const unsigned bc_plane ;
996 const unsigned node_count ;
1005 const unsigned arg_bc_plane ,
1009 : node_coords( arg_mesh.node_coord() )
1010 , solution( arg_solution )
1011 , jacobian( arg_jacobian )
1012 , residual( arg_residual )
1013 , bc_lower_value( arg_bc_lower_value )
1014 , bc_upper_value( arg_bc_upper_value )
1017 , bc_plane( arg_bc_plane )
1018 , node_count( arg_mesh.node_count_owned() )
1020 , dev_config( arg_dev_config )
1022 parallel_for( node_count , *
this );
1029 const size_t team_size = dev_config.block_dim.x * dev_config.block_dim.y;
1030 const size_t league_size =
1031 (node_count + dev_config.block_dim.y-1) / dev_config.block_dim.y;
1032 Kokkos::TeamPolicy< execution_space > config( league_size, team_size );
1033 parallel_for( config , *
this );
1036 parallel_for( node_count , *
this );
1041 KOKKOS_INLINE_FUNCTION
1042 void operator()(
const typename TeamPolicy< execution_space >::member_type & dev )
const
1045 const unsigned num_ensemble_threads = dev_config.block_dim.x ;
1046 const unsigned num_node_threads = dev_config.block_dim.y ;
1047 const unsigned node_rank = dev.team_rank() / num_ensemble_threads ;
1048 const unsigned ensemble_rank = dev.team_rank() % num_ensemble_threads ;
1050 const unsigned inode = dev.league_rank() * num_node_threads + node_rank;
1052 if (inode >= node_count)
1055 (*this)( inode, ensemble_rank );
1059 KOKKOS_INLINE_FUNCTION
1061 const unsigned ensemble_rank = 0)
const
1064 local_vector_view_traits::create_local_view(residual,
1067 local_matrix_view_traits::create_local_view(jacobian.values,
1075 const unsigned iBeg = jacobian.graph.row_map[inode];
1076 const unsigned iEnd = jacobian.graph.row_map[inode+1];
1079 const bool bc_lower = c <= bc_lower_limit ;
1080 const bool bc_upper = bc_upper_limit <= c ;
1083 solution(inode) = bc_lower ? bc_lower_value : (
1084 bc_upper ? bc_upper_value : 0 );
1087 if ( bc_lower || bc_upper ) {
1089 local_residual(inode) = 0 ;
1094 for(
unsigned i = iBeg ; i < iEnd ; ++i ) {
1095 local_jacobian_values(i) = int(inode) == int(jacobian.graph.entries(i)) ? 1 : 0 ;
1103 for(
unsigned i = iBeg ; i < iEnd ; ++i ) {
1104 const unsigned cnode = jacobian.graph.entries(i) ;
1107 if ( ( cc <= bc_lower_limit ) || ( bc_upper_limit <= cc ) ) {
1108 local_jacobian_values(i) = 0 ;
1116 template<
typename FixtureType ,
typename VectorType >
1127 static const unsigned SpatialDim = element_data_type::spatial_dimension ;
1128 static const unsigned TensorDim = SpatialDim * SpatialDim ;
1129 static const unsigned ElemNodeCount = element_data_type::element_node_count ;
1130 static const unsigned IntegrationCount = element_data_type::integration_count ;
1141 , fixture( rhs.fixture )
1142 , solution( rhs.solution )
1148 , fixture( arg_fixture )
1149 , solution( arg_solution )
1158 Kokkos::parallel_reduce( solution.extent(0) , *this , response );
1164 KOKKOS_INLINE_FUNCTION
1166 const double grad[][ ElemNodeCount ] ,
1169 const double z[] )
const
1171 enum { j11 = 0 , j12 = 1 , j13 = 2 ,
1172 j21 = 3 , j22 = 4 , j23 = 5 ,
1173 j31 = 6 , j32 = 7 , j33 = 8 };
1177 double J[ TensorDim ] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
1179 for(
unsigned i = 0; i < ElemNodeCount ; ++i ) {
1180 const double x1 = x[i] ;
1181 const double x2 = y[i] ;
1182 const double x3 = z[i] ;
1184 const double g1 = grad[0][i] ;
1185 const double g2 = grad[1][i] ;
1186 const double g3 = grad[2][i] ;
1203 double invJ[ TensorDim ] = {
1204 static_cast<double>( J[j22] * J[j33] - J[j23] * J[j32] ) ,
1205 static_cast<double>( J[j13] * J[j32] - J[j12] * J[j33] ) ,
1206 static_cast<double>( J[j12] * J[j23] - J[j13] * J[j22] ) ,
1208 static_cast<double>( J[j23] * J[j31] - J[j21] * J[j33] ) ,
1209 static_cast<double>( J[j11] * J[j33] - J[j13] * J[j31] ) ,
1210 static_cast<double>( J[j13] * J[j21] - J[j11] * J[j23] ) ,
1212 static_cast<double>( J[j21] * J[j32] - J[j22] * J[j31] ) ,
1213 static_cast<double>( J[j12] * J[j31] - J[j11] * J[j32] ) ,
1214 static_cast<double>( J[j11] * J[j22] - J[j12] * J[j21] ) };
1216 const double detJ = J[j11] * invJ[j11] +
1217 J[j21] * invJ[j12] +
1218 J[j31] * invJ[j13] ;
1223 KOKKOS_INLINE_FUNCTION
1227 const double integ_weight ,
1228 const double bases_vals[] )
const
1233 for (
unsigned m = 0 ; m < ElemNodeCount ; m++ ) {
1234 value_at_pt += dof_values[m] * bases_vals[m] ;
1238 value_at_pt * value_at_pt * detJ * integ_weight ;
1240 return elem_response;
1274 KOKKOS_INLINE_FUNCTION
1278 response += (u * u) / fixture.node_count_global();
1281 KOKKOS_INLINE_FUNCTION
1285 KOKKOS_INLINE_FUNCTION
1288 { response += input ; }
1299 #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)
KokkosSparse::StaticCrsGraph< unsigned, Space, void, void, unsigned > StaticCrsGraphType
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::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