17 #ifndef KOKKOS_EXAMPLE_FENLFUNCTORS_HPP
18 #define KOKKOS_EXAMPLE_FENLFUNCTORS_HPP
29 #include <Kokkos_Core.hpp>
30 #include <Kokkos_Pair.hpp>
31 #include <Kokkos_UnorderedMap.hpp>
32 #include <Kokkos_StaticCrsGraph.hpp>
34 #include <Kokkos_Timer.hpp>
48 template<
typename ValueType ,
class Space >
50 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE // Don't remove this until Kokkos has removed the deprecated code path probably around September 2018
51 typedef Kokkos::StaticCrsGraph< unsigned , Space , void , unsigned >
StaticCrsGraphType ;
64 ,
coeff(
"crs_matrix_coeff" , arg_graph.entries.extent(0) )
68 template<
class ElemNodeIdView ,
class CrsGraphType ,
unsigned ElemNode >
75 typedef Kokkos::UnorderedMap< key_type, void , execution_space >
SetType ;
76 typedef typename CrsGraphType::row_map_type::non_const_type
RowMapType ;
80 typedef Kokkos::View< unsigned*[ElemNode][ElemNode] , execution_space >
84 struct TagScanNodeCount {};
85 struct TagFillGraphEntries {};
86 struct TagSortGraphEntries {};
87 struct TagFillElementGraph {};
121 const unsigned arg_node_count,
137 Kokkos::Timer wall_clock ;
143 size_t set_capacity = (28ull *
node_count) / 2;
144 unsigned failed_insert_count = 0 ;
155 Kokkos::parallel_reduce( Kokkos::RangePolicy<execution_space,TagFillNodeSet>(0,
elem_node_id.extent(0))
157 , failed_insert_count );
159 }
while ( failed_insert_count );
163 results.fill_node_set = wall_clock.seconds();
177 unsigned graph_entry_count = 0 ;
179 Kokkos::deep_copy( graph_entry_count ,
row_total );
183 graph.entries =
typename CrsGraphType::entries_type(
"graph_entries" , graph_entry_count );
189 results.scan_node_count = wall_clock.seconds();
196 results.fill_graph_entries = wall_clock.seconds();
213 results.sort_graph_entries = wall_clock.seconds();
223 results.fill_element_graph = wall_clock.seconds();
229 KOKKOS_INLINE_FUNCTION
233 for (
unsigned row_local_node = 0 ; row_local_node <
elem_node_id.extent(1) ; ++row_local_node ) {
235 const unsigned row_node =
elem_node_id( ielem , row_local_node );
237 for (
unsigned col_local_node = row_local_node ; col_local_node <
elem_node_id.extent(1) ; ++col_local_node ) {
239 const unsigned col_node =
elem_node_id( ielem , col_local_node );
245 const key_type key = (row_node < col_node) ? make_pair( row_node, col_node ) : make_pair( col_node, row_node ) ;
247 const typename SetType::insert_result result =
node_node_set.insert( key );
250 if ( result.success() ) {
256 if ( col_node <
row_count.extent(0) && col_node != row_node ) { atomic_inc( &
row_count( col_node ) ); }
258 else if ( result.failed() ) {
266 KOKKOS_INLINE_FUNCTION
269 typedef typename std::remove_reference< decltype( row_count(0) ) >::type atomic_incr_type;
275 const unsigned row_node = key.first ;
276 const unsigned col_node = key.second ;
279 const unsigned offset =
graph.row_map( row_node ) + atomic_fetch_add( &
row_count( row_node ) , atomic_incr_type(1) );
280 graph.entries( offset ) = col_node ;
283 if ( col_node <
row_count.extent(0) && col_node != row_node ) {
284 const unsigned offset =
graph.row_map( col_node ) + atomic_fetch_add( &
row_count( col_node ) , atomic_incr_type(1) );
285 graph.entries( offset ) = row_node ;
290 KOKKOS_INLINE_FUNCTION
293 const unsigned row_beg =
graph.row_map( irow );
294 const unsigned row_end =
graph.row_map( irow + 1 );
295 for (
unsigned i = row_beg + 1 ;
i < row_end ; ++
i ) {
296 const unsigned col =
graph.entries(
i);
298 for ( ; row_beg < j && col <
graph.entries(j-1) ; --j ) {
301 graph.entries(j) = col ;
305 KOKKOS_INLINE_FUNCTION
308 for (
unsigned row_local_node = 0 ; row_local_node <
elem_node_id.extent(1) ; ++row_local_node ) {
310 const unsigned row_node =
elem_node_id( ielem , row_local_node );
312 for (
unsigned col_local_node = 0 ; col_local_node <
elem_node_id.extent(1) ; ++col_local_node ) {
314 const unsigned col_node =
elem_node_id( ielem , col_local_node );
316 unsigned entry = ~0u ;
318 if ( row_node + 1 <
graph.row_map.extent(0) ) {
320 const unsigned entry_end =
graph.row_map( row_node + 1 );
322 entry =
graph.row_map( row_node );
324 for ( ; entry < entry_end &&
graph.entries(entry) != col_node ; ++entry );
326 if ( entry == entry_end ) entry = ~0u ;
329 elem_graph( ielem , row_local_node , col_local_node ) = entry ;
334 KOKKOS_INLINE_FUNCTION
358 KOKKOS_INLINE_FUNCTION
359 void operator()(
const unsigned irow ,
unsigned & update ,
const bool final )
const
362 if (
final ) {
row_map( irow ) = update ; }
375 KOKKOS_INLINE_FUNCTION
378 KOKKOS_INLINE_FUNCTION
381 ,
const unsigned & input )
const { update += input ; }
384 KOKKOS_INLINE_FUNCTION
385 void init(
unsigned & update )
const { update = 0 ; }
387 KOKKOS_INLINE_FUNCTION
389 ,
const unsigned & input )
const { update += input ; }
406 class CoordinateMap ,
typename ScalarType >
407 class ElementComputationBase
421 typedef Kokkos::View< scalar_type* , Kokkos::LayoutLeft, execution_space >
vector_type ;
435 typedef Kokkos::View< scalar_type*[FunctionCount][FunctionCount] , execution_space >
elem_matrices_type ;
486 KOKKOS_INLINE_FUNCTION
494 double dpsidz[] )
const
496 enum { j11 = 0 , j12 = 1 , j13 = 2 ,
497 j21 = 3 , j22 = 4 , j23 = 5 ,
498 j31 = 6 , j32 = 7 , j33 = 8 };
502 double J[
TensorDim ] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
505 const double x1 = x[
i] ;
506 const double x2 = y[
i] ;
507 const double x3 = z[
i] ;
509 const double g1 = grad[0][
i] ;
510 const double g2 = grad[1][
i] ;
511 const double g3 = grad[2][
i] ;
529 static_cast<double>( J[j22] * J[j33] - J[j23] * J[j32] ) ,
530 static_cast<double>( J[j13] * J[j32] - J[j12] * J[j33] ) ,
531 static_cast<double>( J[j12] * J[j23] - J[j13] * J[j22] ) ,
533 static_cast<double>( J[j23] * J[j31] - J[j21] * J[j33] ) ,
534 static_cast<double>( J[j11] * J[j33] - J[j13] * J[j31] ) ,
535 static_cast<double>( J[j13] * J[j21] - J[j11] * J[j23] ) ,
537 static_cast<double>( J[j21] * J[j32] - J[j22] * J[j31] ) ,
538 static_cast<double>( J[j12] * J[j31] - J[j11] * J[j32] ) ,
539 static_cast<double>( J[j11] * J[j22] - J[j12] * J[j21] ) };
541 const double detJ = J[j11] * invJ[j11] +
545 const double detJinv = 1.0 / detJ ;
547 for (
unsigned i = 0 ;
i <
TensorDim ; ++
i ) { invJ[
i] *= detJinv ; }
552 const double g0 = grad[0][
i];
553 const double g1 = grad[1][
i];
554 const double g2 = grad[2][
i];
556 dpsidx[
i] = g0 * invJ[j11] + g1 * invJ[j12] + g2 * invJ[j13];
557 dpsidy[
i] = g0 * invJ[j21] + g1 * invJ[j22] + g2 * invJ[j23];
558 dpsidz[
i] = g0 * invJ[j31] + g1 * invJ[j32] + g2 * invJ[j33];
573 template<
class FiniteElementMeshType ,
574 class SparseMatrixType ,
577 class ElementComputation ;
580 class CoordinateMap ,
typename ScalarType >
581 class ElementComputation
583 CrsMatrix< ScalarType , ExecutionSpace > ,
595 static const unsigned FunctionCount = base_type::FunctionCount;
597 static const unsigned ElemNodeCount = base_type::ElemNodeCount;
599 typedef Kokkos::View<scalar_type[FunctionCount],Kokkos::LayoutRight,execution_space,Kokkos::MemoryUnmanaged>
elem_vec_type;
600 typedef Kokkos::View<scalar_type[FunctionCount][FunctionCount],Kokkos::LayoutRight,execution_space,Kokkos::MemoryUnmanaged>
elem_mat_type;
610 base_type(arg_mesh, arg_solution, arg_elem_graph,
611 arg_jacobian, arg_residual) {}
618 parallel_for( nelem , *
this );
621 KOKKOS_INLINE_FUNCTION
624 unsigned node_index[],
625 double x[],
double y[],
double z[],
647 KOKKOS_INLINE_FUNCTION
649 const unsigned node_index[],
654 const unsigned row = node_index[
i] ;
655 if ( row < this->
residual.extent(0) ) {
656 atomic_add( & this->
residual( row ) , res(
i) );
659 const unsigned entry = this->
elem_graph( ielem ,
i , j );
660 if ( entry != ~0u ) {
668 KOKKOS_INLINE_FUNCTION
677 double coeff_k = 3.456;
678 double coeff_src = 1.234;
679 double advection[] = { 1.1, 1.2, 1.3 };
690 dpsidx , dpsidy , dpsidz );
691 const double detJ_weight = detJ * integ_weight;
692 const double detJ_weight_coeff_k = detJ_weight * coeff_k;
699 value_at_pt += dof_values(m) * bases_vals[m] ;
700 gradx_at_pt += dof_values(m) * dpsidx[m] ;
701 grady_at_pt += dof_values(m) * dpsidy[m] ;
702 gradz_at_pt += dof_values(m) * dpsidz[m] ;
706 coeff_src * value_at_pt * value_at_pt ;
708 2.0 * coeff_src * value_at_pt ;
715 advection_x*gradx_at_pt +
716 advection_y*grady_at_pt +
717 advection_z*gradz_at_pt ;
720 const double bases_val_m = bases_vals[m] * detJ_weight ;
721 const double dpsidx_m = dpsidx[m] ;
722 const double dpsidy_m = dpsidy[m] ;
723 const double dpsidz_m = dpsidz[m] ;
726 detJ_weight_coeff_k * ( dpsidx_m * gradx_at_pt +
727 dpsidy_m * grady_at_pt +
728 dpsidz_m * gradz_at_pt ) +
729 bases_val_m * ( advection_term + source_term ) ;
732 const double dpsidx_n = dpsidx[
n] ;
733 const double dpsidy_n = dpsidy[
n] ;
734 const double dpsidz_n = dpsidz[
n] ;
736 detJ_weight_coeff_k * ( dpsidx_m * dpsidx_n +
737 dpsidy_m * dpsidy_n +
738 dpsidz_m * dpsidz_n ) +
739 bases_val_m * ( advection_x * dpsidx_n +
740 advection_y * dpsidy_n +
741 advection_z * dpsidz_n +
742 source_deriv * bases_vals[
n] ) ;
748 KOKKOS_INLINE_FUNCTION
762 gatherSolution(ielem, val, node_index, x, y, z, elem_res, elem_mat);
765 computeElementResidualJacobian( val, x, y, z, elem_res , elem_mat );
768 scatterResidual( ielem, node_index, elem_res, elem_mat );
773 class CoordinateMap ,
typename ScalarType >
774 class ElementComputation
776 CrsMatrix< ScalarType , ExecutionSpace > ,
787 static const unsigned FunctionCount = base_type::FunctionCount;
789 static const unsigned ElemNodeCount = base_type::ElemNodeCount;
794 typedef Kokkos::View<fad_scalar_type*,Kokkos::LayoutRight,execution_space,Kokkos::MemoryUnmanaged>
elem_vec_type;
804 base_type(arg_mesh, arg_solution, arg_elem_graph,
805 arg_jacobian, arg_residual) {}
812 parallel_for( nelem , *
this );
815 KOKKOS_INLINE_FUNCTION
818 unsigned node_index[],
819 double x[],
double y[],
double z[],
837 KOKKOS_INLINE_FUNCTION
839 const unsigned node_index[],
843 const unsigned row = node_index[
i] ;
844 if ( row < this->
residual.extent(0) ) {
848 const unsigned entry = this->
elem_graph( ielem ,
i , j );
849 if ( entry != ~0u ) {
851 res(
i).fastAccessDx(j) );
858 KOKKOS_INLINE_FUNCTION
865 double coeff_k = 3.456;
866 double coeff_src = 1.234;
867 double advection[] = { 1.1, 1.2, 1.3 };
878 dpsidx , dpsidy , dpsidz );
879 const double detJ_weight = detJ * integ_weight;
880 const double detJ_weight_coeff_k = detJ_weight * coeff_k;
887 value_at_pt += dof_values(m) * bases_vals[m] ;
888 gradx_at_pt += dof_values(m) * dpsidx[m] ;
889 grady_at_pt += dof_values(m) * dpsidy[m] ;
890 gradz_at_pt += dof_values(m) * dpsidz[m] ;
894 coeff_src * value_at_pt * value_at_pt ;
897 advection[0]*gradx_at_pt +
898 advection[1]*grady_at_pt +
899 advection[2]*gradz_at_pt;
902 const double bases_val_m = bases_vals[m] * detJ_weight ;
903 const double dpsidx_m = dpsidx[m] ;
904 const double dpsidy_m = dpsidy[m] ;
905 const double dpsidz_m = dpsidz[m] ;
908 detJ_weight_coeff_k * ( dpsidx_m * gradx_at_pt +
909 dpsidy_m * grady_at_pt +
910 dpsidz_m * gradz_at_pt ) +
911 bases_val_m * ( advection_term + source_term ) ;
916 KOKKOS_INLINE_FUNCTION
929 gatherSolution( ielem, val, node_index, x, y, z, elem_res );
932 computeElementResidual( val, x, y, z, elem_res );
935 scatterResidual( ielem, node_index, elem_res );
940 class CoordinateMap ,
typename ScalarType >
941 class ElementComputation
943 CrsMatrix< ScalarType , ExecutionSpace > ,
945 public ElementComputation< Kokkos::Example::BoxElemFixture< ExecutionSpace , Order , CoordinateMap > ,
946 CrsMatrix< ScalarType , ExecutionSpace > ,
950 typedef ElementComputation< Kokkos::Example::BoxElemFixture< ExecutionSpace , Order , CoordinateMap > ,
951 CrsMatrix< ScalarType , ExecutionSpace > ,
957 static const unsigned FunctionCount = base_type::FunctionCount;
959 static const unsigned ElemNodeCount = base_type::ElemNodeCount;
963 typedef Kokkos::View<scalar_type[FunctionCount],Kokkos::LayoutRight,execution_space,Kokkos::MemoryUnmanaged>
scalar_elem_vec_type;
974 base_type(arg_mesh, arg_solution, arg_elem_graph,
975 arg_jacobian, arg_residual) {}
982 parallel_for( nelem , *
this );
985 KOKKOS_INLINE_FUNCTION
988 unsigned node_index[],
989 double x[],
double y[],
double z[],
1006 KOKKOS_INLINE_FUNCTION
1013 double coeff_k = 3.456;
1014 double coeff_src = 1.234;
1015 double advection[] = { 1.1, 1.2, 1.3 };
1026 dpsidx , dpsidy , dpsidz );
1027 const double detJ_weight = detJ * integ_weight;
1028 const double detJ_weight_coeff_k = detJ_weight * coeff_k;
1035 value_at_pt.val() += dof_values(m) * bases_vals[m] ;
1036 value_at_pt.fastAccessDx(m) = bases_vals[m] ;
1038 gradx_at_pt.val() += dof_values(m) * dpsidx[m] ;
1039 gradx_at_pt.fastAccessDx(m) = dpsidx[m] ;
1041 grady_at_pt.val() += dof_values(m) * dpsidy[m] ;
1042 grady_at_pt.fastAccessDx(m) = dpsidy[m] ;
1044 gradz_at_pt.val() += dof_values(m) * dpsidz[m] ;
1045 gradz_at_pt.fastAccessDx(m) = dpsidz[m] ;
1049 coeff_src * value_at_pt * value_at_pt ;
1052 advection[0]*gradx_at_pt +
1053 advection[1]*grady_at_pt +
1054 advection[2]*gradz_at_pt;
1057 const double bases_val_m = bases_vals[m] * detJ_weight ;
1058 const double dpsidx_m = dpsidx[m] ;
1059 const double dpsidy_m = dpsidy[m] ;
1060 const double dpsidz_m = dpsidz[m] ;
1063 detJ_weight_coeff_k * ( dpsidx_m * gradx_at_pt +
1064 dpsidy_m * grady_at_pt +
1065 dpsidz_m * gradz_at_pt ) +
1066 bases_val_m * ( advection_term + source_term ) ;
1071 KOKKOS_INLINE_FUNCTION
1084 gatherSolution( ielem, val, node_index, x, y, z, elem_res );
1087 computeElementResidual( val, x, y, z, elem_res );
1090 this->scatterResidual( ielem, node_index, elem_res );
1095 class CoordinateMap ,
typename ScalarType >
1096 class ElementComputation
1098 CrsMatrix< ScalarType , ExecutionSpace > ,
1100 public ElementComputation< Kokkos::Example::BoxElemFixture< ExecutionSpace , Order , CoordinateMap > ,
1101 CrsMatrix< ScalarType , ExecutionSpace > ,
1105 typedef ElementComputation< Kokkos::Example::BoxElemFixture< ExecutionSpace , Order , CoordinateMap > ,
1106 CrsMatrix< ScalarType , ExecutionSpace > ,
1112 static const unsigned FunctionCount = base_type::FunctionCount;
1114 static const unsigned ElemNodeCount = base_type::ElemNodeCount;
1129 base_type(arg_mesh, arg_solution, arg_elem_graph,
1130 arg_jacobian, arg_residual) {}
1137 parallel_for( nelem , *
this );
1140 KOKKOS_INLINE_FUNCTION
1149 double coeff_k = 3.456;
1150 double coeff_src = 1.234;
1151 double advection[] = { 1.1, 1.2, 1.3 };
1167 dpsidx , dpsidy , dpsidz );
1168 const double detJ_weight = detJ * integ_weight;
1169 const double detJ_weight_coeff_k = detJ_weight * coeff_k;
1171 value_at_pt.val() = 0.0 ;
1172 gradx_at_pt.val() = 0.0 ;
1173 grady_at_pt.val() = 0.0 ;
1174 gradz_at_pt.val() = 0.0 ;
1176 value_at_pt.val() += dof_values(m) * bases_vals[m] ;
1177 gradx_at_pt.val() += dof_values(m) * dpsidx[m] ;
1178 grady_at_pt.val() += dof_values(m) * dpsidy[m] ;
1179 gradz_at_pt.val() += dof_values(m) * dpsidz[m] ;
1183 coeff_src * value_at_pt * value_at_pt ;
1186 advection[0]*gradx_at_pt +
1187 advection[1]*grady_at_pt +
1188 advection[2]*gradz_at_pt;
1191 const double bases_val_m = bases_vals[m] * detJ_weight ;
1193 detJ_weight_coeff_k * ( dpsidx[m] * gradx_at_pt +
1194 dpsidy[m] * grady_at_pt +
1195 dpsidz[m] * gradz_at_pt ) +
1196 bases_val_m * ( advection_term + source_term ) ;
1198 elem_res(m) += res.val();
1201 elem_mat(m,
n) += res.fastAccessDx(0) * bases_vals[
n] +
1202 res.fastAccessDx(1) * dpsidx[
n] +
1203 res.fastAccessDx(2) * dpsidy[
n] +
1204 res.fastAccessDx(3) * dpsidz[
n];
1210 KOKKOS_INLINE_FUNCTION
1224 this->gatherSolution( ielem, val, node_index, x, y, z, elem_res, elem_mat );
1227 computeElementResidualJacobian( val, x, y, z, elem_res, elem_mat );
1230 this->scatterResidual( ielem, node_index, elem_res, elem_mat );
double weights[integration_count]
ElementComputation(const typename base_type::mesh_type &arg_mesh, const typename base_type::vector_type &arg_solution, const typename base_type::elem_graph_type &arg_elem_graph, const typename base_type::sparse_matrix_type &arg_jacobian, const typename base_type::vector_type &arg_residual)
static const unsigned TensorDim
base_type::scalar_type scalar_type
base_type::execution_space execution_space
const elem_vectors_type elem_residuals
KOKKOS_INLINE_FUNCTION void computeElementResidualJacobian(const elem_vec_type &dof_values, const double x[], const double y[], const double z[], const elem_vec_type &elem_res, const elem_mat_type &elem_mat) const
KOKKOS_INLINE_FUNCTION void fill_graph_entries(const unsigned iset) const
static const unsigned SpatialDim
Kokkos::View< scalar_type *[FunctionCount], execution_space > elem_vectors_type
static const unsigned element_node_count
CrsMatrix< ScalarType, ExecutionSpace > sparse_matrix_type
const elem_matrices_type elem_jacobians
KOKKOS_INLINE_FUNCTION void computeElementResidualJacobian(const elem_vec_type &dof_values, const double x[], const double y[], const double z[], const elem_vec_type &elem_res, const elem_mat_type &elem_mat) const
static const unsigned function_count
KOKKOS_INLINE_FUNCTION void join(unsigned &update, const unsigned &input) const
ElementComputation< Kokkos::Example::BoxElemFixture< ExecutionSpace, Order, CoordinateMap >, CrsMatrix< ScalarType, ExecutionSpace >, Analytic > base_type
Kokkos::View< const double *[SpaceDim], Device > node_coord_type
KOKKOS_INLINE_FUNCTION void operator()(const unsigned ielem) const
double gradients[integration_count][spatial_dimension][function_count]
Kokkos::View< const unsigned *[ElemNode], Device > elem_node_type
ElementComputationBase< ExecutionSpace, Order, CoordinateMap, ScalarType > base_type
ExecutionSpace execution_space
Kokkos::View< scalar_type[FunctionCount], Kokkos::LayoutRight, execution_space, Kokkos::MemoryUnmanaged > scalar_elem_vec_type
Kokkos::View< scalar_type *, Kokkos::LayoutLeft, execution_space > vector_type
base_type::execution_space execution_space
const vector_type residual
Sacado::Fad::SFad< scalar_type, 4 > fad_scalar_type
KOKKOS_INLINE_FUNCTION void computeElementResidual(const scalar_elem_vec_type dof_values, const double x[], const double y[], const double z[], const fad_elem_vec_type &elem_res) const
static const unsigned IntegrationCount
const elem_node_type elem_node_ids
const unsigned node_count
base_type::elem_vec_type fad_elem_vec_type
NodeNodeGraph< elem_node_type, sparse_graph_type, ElemNodeCount >::ElemGraphType elem_graph_type
const vector_type solution
base_type::execution_space execution_space
ElemNodeIdView::execution_space execution_space
KOKKOS_INLINE_FUNCTION void operator()(const unsigned irow, unsigned &update, const bool final) const
ElementComputationBase< ExecutionSpace, Order, CoordinateMap, ScalarType > base_type
Kokkos::View< scalar_type[FunctionCount], Kokkos::LayoutRight, execution_space, Kokkos::MemoryUnmanaged > elem_vec_type
KOKKOS_INLINE_FUNCTION void init(unsigned &update) const
double sort_graph_entries
double fill_graph_entries
ElementComputationBase(const ElementComputationBase &rhs)
KOKKOS_INLINE_FUNCTION void fill_elem_graph_map(const unsigned ielem) const
Kokkos::Example::HexElement_Data< mesh_type::ElemNode > element_data_type
CrsGraphType::row_map_type::non_const_type RowMapType
const element_data_type elem_data
ElementComputationBase(const mesh_type &arg_mesh, const vector_type &arg_solution, const elem_graph_type &arg_elem_graph, const sparse_matrix_type &arg_jacobian, const vector_type &arg_residual)
ElementComputation(const ElementComputation &rhs)
KOKKOS_INLINE_FUNCTION void operator()(const TagFillNodeSet &, unsigned ielem, unsigned &count) const
CrsMatrix(const StaticCrsGraphType &arg_graph)
Kokkos::StaticCrsGraph< unsigned, Space, void, void, unsigned > StaticCrsGraphType
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
double values[integration_count][function_count]
mesh_type::elem_node_type elem_node_type
Do not initialize the derivative array.
KOKKOS_INLINE_FUNCTION void operator()(const unsigned ielem) const
Kokkos::View< fad_scalar_type *, Kokkos::LayoutRight, execution_space, Kokkos::MemoryUnmanaged > elem_vec_type
KOKKOS_INLINE_FUNCTION void operator()(const unsigned iwork) const
KOKKOS_INLINE_FUNCTION void operator()(const unsigned ielem) const
static const unsigned ElemNodeCount
const ElemNodeIdView elem_node_id
static const unsigned integration_count
mesh_type::node_coord_type node_coord_type
const elem_graph_type elem_graph
ElementComputation(const ElementComputation &rhs)
base_type::elem_vec_type elem_vec_type
Kokkos::Example::BoxElemFixture< ExecutionSpace, Order, CoordinateMap > mesh_type
Kokkos::View< scalar_type[FunctionCount][FunctionCount], Kokkos::LayoutRight, execution_space, Kokkos::MemoryUnmanaged > elem_mat_type
NodeNodeGraph(const ElemNodeIdView &arg_elem_node_id, const unsigned arg_node_count, Times &results)
const sparse_matrix_type jacobian
const node_coord_type node_coords
base_type::execution_space execution_space
Sacado::Fad::SFad< scalar_type, FunctionCount > fad_scalar_type
KOKKOS_INLINE_FUNCTION void init(const TagFillNodeSet &, unsigned &update) const
KOKKOS_INLINE_FUNCTION void scatterResidual(const unsigned ielem, const unsigned node_index[], const elem_vec_type &res) const
KOKKOS_INLINE_FUNCTION void gatherSolution(const unsigned ielem, const scalar_elem_vec_type &val, unsigned node_index[], double x[], double y[], double z[], const fad_elem_vec_type &res) const
View< ValueType *, Space > coeff_type
sparse_matrix_type::StaticCrsGraphType sparse_graph_type
Kokkos::View< unsigned, execution_space > UnsignedValue
ElementComputation(const typename base_type::mesh_type &arg_mesh, const typename base_type::vector_type &arg_solution, const typename base_type::elem_graph_type &arg_elem_graph, const typename base_type::sparse_matrix_type &arg_jacobian, const typename base_type::vector_type &arg_residual)
ElementComputation< Kokkos::Example::BoxElemFixture< ExecutionSpace, Order, CoordinateMap >, CrsMatrix< ScalarType, ExecutionSpace >, FadElement > base_type
ElementComputation(const typename base_type::mesh_type &arg_mesh, const typename base_type::vector_type &arg_solution, const typename base_type::elem_graph_type &arg_elem_graph, const typename base_type::sparse_matrix_type &arg_jacobian, const typename base_type::vector_type &arg_residual)
ElementComputation(const ElementComputation &rhs)
base_type::fad_scalar_type fad_scalar_type
ElementComputation(const ElementComputation &rhs)
ElementComputation(const typename base_type::mesh_type &arg_mesh, const typename base_type::vector_type &arg_solution, const typename base_type::elem_graph_type &arg_elem_graph, const typename base_type::sparse_matrix_type &arg_jacobian, const typename base_type::vector_type &arg_residual)
KOKKOS_INLINE_FUNCTION void scatterResidual(const unsigned ielem, const unsigned node_index[], const elem_vec_type &res, const elem_mat_type &mat) const
KOKKOS_INLINE_FUNCTION void join(const TagFillNodeSet &, unsigned &update, const unsigned &input) const
KOKKOS_INLINE_FUNCTION void operator()(const unsigned ielem) const
base_type::scalar_type scalar_type
KOKKOS_INLINE_FUNCTION void sort_graph_entries(const unsigned irow) const
base_type::scalar_type scalar_type
double fill_element_graph
Kokkos::View< scalar_type *[FunctionCount][FunctionCount], execution_space > elem_matrices_type
KOKKOS_INLINE_FUNCTION void gatherSolution(const unsigned ielem, const elem_vec_type &val, unsigned node_index[], double x[], double y[], double z[], const elem_vec_type &res) const
base_type::elem_mat_type elem_mat_type
Kokkos::View< unsigned *[ElemNode][ElemNode], execution_space > ElemGraphType
static const unsigned FunctionCount
Generate a distributed unstructured finite element mesh from a partitioned NX*NY*NZ box of elements...
KOKKOS_INLINE_FUNCTION void computeElementResidual(const elem_vec_type &dof_values, const double x[], const double y[], const double z[], const elem_vec_type &elem_res) const
base_type::scalar_type scalar_type
Kokkos::UnorderedMap< key_type, void, execution_space > SetType
pair< unsigned, unsigned > key_type
KOKKOS_INLINE_FUNCTION void gatherSolution(const unsigned ielem, const elem_vec_type &val, unsigned node_index[], double x[], double y[], double z[], const elem_vec_type &res, const elem_mat_type &mat) const
static const unsigned spatial_dimension