44 #ifndef KOKKOS_EXAMPLE_FENLFUNCTORS_HPP
45 #define KOKKOS_EXAMPLE_FENLFUNCTORS_HPP
56 #include <Kokkos_Core.hpp>
57 #include <Kokkos_Pair.hpp>
58 #include <Kokkos_UnorderedMap.hpp>
59 #include <Kokkos_StaticCrsGraph.hpp>
61 #include <impl/Kokkos_Timer.hpp>
75 template<
typename ValueType ,
class Space >
77 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE // Don't remove this until Kokkos has removed the deprecated code path probably around September 2018
78 typedef Kokkos::StaticCrsGraph< unsigned , Space , void , unsigned >
StaticCrsGraphType ;
91 ,
coeff(
"crs_matrix_coeff" , arg_graph.entries.extent(0) )
95 template<
class ElemNodeIdView ,
class CrsGraphType ,
unsigned ElemNode >
102 typedef Kokkos::UnorderedMap< key_type, void , execution_space >
SetType ;
103 typedef typename CrsGraphType::row_map_type::non_const_type
RowMapType ;
107 typedef Kokkos::View< unsigned*[ElemNode][ElemNode] , execution_space >
111 struct TagScanNodeCount {};
112 struct TagFillGraphEntries {};
113 struct TagSortGraphEntries {};
114 struct TagFillElementGraph {};
148 const unsigned arg_node_count,
164 Kokkos::Impl::Timer wall_clock ;
170 size_t set_capacity = (28ull *
node_count) / 2;
171 unsigned failed_insert_count = 0 ;
182 Kokkos::parallel_reduce( Kokkos::RangePolicy<execution_space,TagFillNodeSet>(0,
elem_node_id.extent(0))
184 , failed_insert_count );
186 }
while ( failed_insert_count );
190 results.fill_node_set = wall_clock.seconds();
204 unsigned graph_entry_count = 0 ;
206 Kokkos::deep_copy( graph_entry_count ,
row_total );
210 graph.entries =
typename CrsGraphType::entries_type(
"graph_entries" , graph_entry_count );
216 results.scan_node_count = wall_clock.seconds();
223 results.fill_graph_entries = wall_clock.seconds();
240 results.sort_graph_entries = wall_clock.seconds();
250 results.fill_element_graph = wall_clock.seconds();
260 for (
unsigned row_local_node = 0 ; row_local_node <
elem_node_id.extent(1) ; ++row_local_node ) {
262 const unsigned row_node =
elem_node_id( ielem , row_local_node );
264 for (
unsigned col_local_node = row_local_node ; col_local_node <
elem_node_id.extent(1) ; ++col_local_node ) {
266 const unsigned col_node =
elem_node_id( ielem , col_local_node );
272 const key_type key = (row_node < col_node) ? make_pair( row_node, col_node ) : make_pair( col_node, row_node ) ;
274 const typename SetType::insert_result result =
node_node_set.insert( key );
277 if ( result.success() ) {
280 if ( row_node <
row_count.extent(0) ) { atomic_increment( &
row_count( row_node ) ); }
283 if ( col_node <
row_count.extent(0) && col_node != row_node ) { atomic_increment( &
row_count( col_node ) ); }
285 else if ( result.failed() ) {
300 const unsigned row_node = key.first ;
301 const unsigned col_node = key.second ;
304 typedef typename std::remove_reference< decltype( row_count(0) ) >::type atomic_incr_type;
305 const unsigned offset =
graph.row_map( row_node ) + atomic_fetch_add( &
row_count( row_node ) , atomic_incr_type(1) );
306 graph.entries( offset ) = col_node ;
309 if ( col_node <
row_count.extent(0) && col_node != row_node ) {
310 typedef typename std::remove_reference< decltype( row_count(0) ) >::type atomic_incr_type;
311 const unsigned offset =
graph.row_map( col_node ) + atomic_fetch_add( &
row_count( col_node ) , atomic_incr_type(1) );
312 graph.entries( offset ) = row_node ;
320 const unsigned row_beg =
graph.row_map( irow );
321 const unsigned row_end =
graph.row_map( irow + 1 );
322 for (
unsigned i = row_beg + 1 ; i < row_end ; ++i ) {
323 const unsigned col =
graph.entries(i);
325 for ( ; row_beg < j && col <
graph.entries(j-1) ; --j ) {
328 graph.entries(j) = col ;
335 for (
unsigned row_local_node = 0 ; row_local_node <
elem_node_id.extent(1) ; ++row_local_node ) {
337 const unsigned row_node =
elem_node_id( ielem , row_local_node );
339 for (
unsigned col_local_node = 0 ; col_local_node <
elem_node_id.extent(1) ; ++col_local_node ) {
341 const unsigned col_node =
elem_node_id( ielem , col_local_node );
343 unsigned entry = ~0u ;
345 if ( row_node + 1 <
graph.row_map.extent(0) ) {
347 const unsigned entry_end =
graph.row_map( row_node + 1 );
349 entry =
graph.row_map( row_node );
351 for ( ; entry < entry_end &&
graph.entries(entry) != col_node ; ++entry );
353 if ( entry == entry_end ) entry = ~0u ;
356 elem_graph( ielem , row_local_node , col_local_node ) = entry ;
386 void operator()(
const unsigned irow ,
unsigned & update ,
const bool final )
const
389 if (
final ) {
row_map( irow ) = update ; }
407 ,
volatile unsigned & update
408 ,
volatile const unsigned & input )
const { update += input ; }
412 void init(
unsigned & update )
const { update = 0 ; }
415 void join(
volatile unsigned & update
416 ,
volatile const unsigned & input )
const { update += input ; }
433 class CoordinateMap ,
typename ScalarType >
434 class ElementComputationBase
448 typedef Kokkos::View< scalar_type* , Kokkos::LayoutLeft, execution_space >
vector_type ;
462 typedef Kokkos::View< scalar_type*[FunctionCount][FunctionCount] , execution_space >
elem_matrices_type ;
521 double dpsidz[] )
const
523 enum { j11 = 0 , j12 = 1 , j13 = 2 ,
524 j21 = 3 , j22 = 4 , j23 = 5 ,
525 j31 = 6 , j32 = 7 , j33 = 8 };
529 double J[
TensorDim ] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
532 const double x1 = x[i] ;
533 const double x2 = y[i] ;
534 const double x3 = z[i] ;
536 const double g1 = grad[0][i] ;
537 const double g2 = grad[1][i] ;
538 const double g3 = grad[2][i] ;
556 static_cast<double>( J[j22] * J[j33] - J[j23] * J[j32] ) ,
557 static_cast<double>( J[j13] * J[j32] - J[j12] * J[j33] ) ,
558 static_cast<double>( J[j12] * J[j23] - J[j13] * J[j22] ) ,
560 static_cast<double>( J[j23] * J[j31] - J[j21] * J[j33] ) ,
561 static_cast<double>( J[j11] * J[j33] - J[j13] * J[j31] ) ,
562 static_cast<double>( J[j13] * J[j21] - J[j11] * J[j23] ) ,
564 static_cast<double>( J[j21] * J[j32] - J[j22] * J[j31] ) ,
565 static_cast<double>( J[j12] * J[j31] - J[j11] * J[j32] ) ,
566 static_cast<double>( J[j11] * J[j22] - J[j12] * J[j21] ) };
568 const double detJ = J[j11] * invJ[j11] +
572 const double detJinv = 1.0 / detJ ;
574 for (
unsigned i = 0 ; i <
TensorDim ; ++i ) { invJ[i] *= detJinv ; }
579 const double g0 = grad[0][i];
580 const double g1 = grad[1][i];
581 const double g2 = grad[2][i];
583 dpsidx[i] = g0 * invJ[j11] + g1 * invJ[j12] + g2 * invJ[j13];
584 dpsidy[i] = g0 * invJ[j21] + g1 * invJ[j22] + g2 * invJ[j23];
585 dpsidz[i] = g0 * invJ[j31] + g1 * invJ[j32] + g2 * invJ[j33];
600 template<
class FiniteElementMeshType ,
601 class SparseMatrixType ,
604 class ElementComputation ;
607 class CoordinateMap ,
typename ScalarType >
608 class ElementComputation
610 CrsMatrix< ScalarType , ExecutionSpace > ,
622 static const unsigned FunctionCount = base_type::FunctionCount;
624 static const unsigned ElemNodeCount = base_type::ElemNodeCount;
626 typedef Kokkos::View<scalar_type[FunctionCount],Kokkos::LayoutRight,execution_space,Kokkos::MemoryUnmanaged>
elem_vec_type;
627 typedef Kokkos::View<scalar_type[FunctionCount][FunctionCount],Kokkos::LayoutRight,execution_space,Kokkos::MemoryUnmanaged>
elem_mat_type;
637 base_type(arg_mesh, arg_solution, arg_elem_graph,
638 arg_jacobian, arg_residual) {}
645 parallel_for( nelem , *
this );
651 unsigned node_index[],
652 double x[],
double y[],
double z[],
676 const unsigned node_index[],
681 const unsigned row = node_index[i] ;
682 if ( row < this->
residual.extent(0) ) {
683 atomic_add( & this->
residual( row ) , res(i) );
686 const unsigned entry = this->
elem_graph( ielem , i , j );
687 if ( entry != ~0u ) {
704 double coeff_k = 3.456;
705 double coeff_src = 1.234;
706 double advection[] = { 1.1, 1.2, 1.3 };
717 dpsidx , dpsidy , dpsidz );
718 const double detJ_weight = detJ * integ_weight;
719 const double detJ_weight_coeff_k = detJ_weight * coeff_k;
726 value_at_pt += dof_values(m) * bases_vals[m] ;
727 gradx_at_pt += dof_values(m) * dpsidx[m] ;
728 grady_at_pt += dof_values(m) * dpsidy[m] ;
729 gradz_at_pt += dof_values(m) * dpsidz[m] ;
733 coeff_src * value_at_pt * value_at_pt ;
735 2.0 * coeff_src * value_at_pt ;
742 advection_x*gradx_at_pt +
743 advection_y*grady_at_pt +
744 advection_z*gradz_at_pt ;
747 const double bases_val_m = bases_vals[m] * detJ_weight ;
748 const double dpsidx_m = dpsidx[m] ;
749 const double dpsidy_m = dpsidy[m] ;
750 const double dpsidz_m = dpsidz[m] ;
753 detJ_weight_coeff_k * ( dpsidx_m * gradx_at_pt +
754 dpsidy_m * grady_at_pt +
755 dpsidz_m * gradz_at_pt ) +
756 bases_val_m * ( advection_term + source_term ) ;
759 const double dpsidx_n = dpsidx[
n] ;
760 const double dpsidy_n = dpsidy[
n] ;
761 const double dpsidz_n = dpsidz[
n] ;
763 detJ_weight_coeff_k * ( dpsidx_m * dpsidx_n +
764 dpsidy_m * dpsidy_n +
765 dpsidz_m * dpsidz_n ) +
766 bases_val_m * ( advection_x * dpsidx_n +
767 advection_y * dpsidy_n +
768 advection_z * dpsidz_n +
769 source_deriv * bases_vals[
n] ) ;
789 gatherSolution(ielem, val, node_index, x, y, z, elem_res, elem_mat);
792 computeElementResidualJacobian( val, x, y, z, elem_res , elem_mat );
795 scatterResidual( ielem, node_index, elem_res, elem_mat );
800 class CoordinateMap ,
typename ScalarType >
801 class ElementComputation
803 CrsMatrix< ScalarType , ExecutionSpace > ,
814 static const unsigned FunctionCount = base_type::FunctionCount;
816 static const unsigned ElemNodeCount = base_type::ElemNodeCount;
821 typedef Kokkos::View<fad_scalar_type*,Kokkos::LayoutRight,execution_space,Kokkos::MemoryUnmanaged>
elem_vec_type;
831 base_type(arg_mesh, arg_solution, arg_elem_graph,
832 arg_jacobian, arg_residual) {}
839 parallel_for( nelem , *
this );
845 unsigned node_index[],
846 double x[],
double y[],
double z[],
866 const unsigned node_index[],
870 const unsigned row = node_index[i] ;
871 if ( row < this->
residual.extent(0) ) {
872 atomic_add( & this->
residual( row ) , res(i).
val() );
875 const unsigned entry = this->
elem_graph( ielem , i , j );
876 if ( entry != ~0u ) {
878 res(i).fastAccessDx(j) );
892 double coeff_k = 3.456;
893 double coeff_src = 1.234;
894 double advection[] = { 1.1, 1.2, 1.3 };
905 dpsidx , dpsidy , dpsidz );
906 const double detJ_weight = detJ * integ_weight;
907 const double detJ_weight_coeff_k = detJ_weight * coeff_k;
914 value_at_pt += dof_values(m) * bases_vals[m] ;
915 gradx_at_pt += dof_values(m) * dpsidx[m] ;
916 grady_at_pt += dof_values(m) * dpsidy[m] ;
917 gradz_at_pt += dof_values(m) * dpsidz[m] ;
921 coeff_src * value_at_pt * value_at_pt ;
924 advection[0]*gradx_at_pt +
925 advection[1]*grady_at_pt +
926 advection[2]*gradz_at_pt;
929 const double bases_val_m = bases_vals[m] * detJ_weight ;
930 const double dpsidx_m = dpsidx[m] ;
931 const double dpsidy_m = dpsidy[m] ;
932 const double dpsidz_m = dpsidz[m] ;
935 detJ_weight_coeff_k * ( dpsidx_m * gradx_at_pt +
936 dpsidy_m * grady_at_pt +
937 dpsidz_m * gradz_at_pt ) +
938 bases_val_m * ( advection_term + source_term ) ;
956 gatherSolution( ielem, val, node_index, x, y, z, elem_res );
959 computeElementResidual( val, x, y, z, elem_res );
962 scatterResidual( ielem, node_index, elem_res );
967 class CoordinateMap ,
typename ScalarType >
968 class ElementComputation
970 CrsMatrix< ScalarType , ExecutionSpace > ,
972 public ElementComputation< Kokkos::Example::BoxElemFixture< ExecutionSpace , Order , CoordinateMap > ,
973 CrsMatrix< ScalarType , ExecutionSpace > ,
977 typedef ElementComputation< Kokkos::Example::BoxElemFixture< ExecutionSpace , Order , CoordinateMap > ,
978 CrsMatrix< ScalarType , ExecutionSpace > ,
984 static const unsigned FunctionCount = base_type::FunctionCount;
986 static const unsigned ElemNodeCount = base_type::ElemNodeCount;
990 typedef Kokkos::View<scalar_type[FunctionCount],Kokkos::LayoutRight,execution_space,Kokkos::MemoryUnmanaged>
scalar_elem_vec_type;
1001 base_type(arg_mesh, arg_solution, arg_elem_graph,
1002 arg_jacobian, arg_residual) {}
1009 parallel_for( nelem , *
this );
1015 unsigned node_index[],
1016 double x[],
double y[],
double z[],
1022 node_index[i] = ni ;
1040 double coeff_k = 3.456;
1041 double coeff_src = 1.234;
1042 double advection[] = { 1.1, 1.2, 1.3 };
1053 dpsidx , dpsidy , dpsidz );
1054 const double detJ_weight = detJ * integ_weight;
1055 const double detJ_weight_coeff_k = detJ_weight * coeff_k;
1062 value_at_pt.val() += dof_values(m) * bases_vals[m] ;
1063 value_at_pt.fastAccessDx(m) = bases_vals[m] ;
1065 gradx_at_pt.val() += dof_values(m) * dpsidx[m] ;
1066 gradx_at_pt.fastAccessDx(m) = dpsidx[m] ;
1068 grady_at_pt.val() += dof_values(m) * dpsidy[m] ;
1069 grady_at_pt.fastAccessDx(m) = dpsidy[m] ;
1071 gradz_at_pt.val() += dof_values(m) * dpsidz[m] ;
1072 gradz_at_pt.fastAccessDx(m) = dpsidz[m] ;
1076 coeff_src * value_at_pt * value_at_pt ;
1079 advection[0]*gradx_at_pt +
1080 advection[1]*grady_at_pt +
1081 advection[2]*gradz_at_pt;
1084 const double bases_val_m = bases_vals[m] * detJ_weight ;
1085 const double dpsidx_m = dpsidx[m] ;
1086 const double dpsidy_m = dpsidy[m] ;
1087 const double dpsidz_m = dpsidz[m] ;
1090 detJ_weight_coeff_k * ( dpsidx_m * gradx_at_pt +
1091 dpsidy_m * grady_at_pt +
1092 dpsidz_m * gradz_at_pt ) +
1093 bases_val_m * ( advection_term + source_term ) ;
1111 gatherSolution( ielem, val, node_index, x, y, z, elem_res );
1114 computeElementResidual( val, x, y, z, elem_res );
1117 this->scatterResidual( ielem, node_index, elem_res );
1122 class CoordinateMap ,
typename ScalarType >
1123 class ElementComputation
1125 CrsMatrix< ScalarType , ExecutionSpace > ,
1127 public ElementComputation< Kokkos::Example::BoxElemFixture< ExecutionSpace , Order , CoordinateMap > ,
1128 CrsMatrix< ScalarType , ExecutionSpace > ,
1132 typedef ElementComputation< Kokkos::Example::BoxElemFixture< ExecutionSpace , Order , CoordinateMap > ,
1133 CrsMatrix< ScalarType , ExecutionSpace > ,
1139 static const unsigned FunctionCount = base_type::FunctionCount;
1141 static const unsigned ElemNodeCount = base_type::ElemNodeCount;
1156 base_type(arg_mesh, arg_solution, arg_elem_graph,
1157 arg_jacobian, arg_residual) {}
1164 parallel_for( nelem , *
this );
1176 double coeff_k = 3.456;
1177 double coeff_src = 1.234;
1178 double advection[] = { 1.1, 1.2, 1.3 };
1194 dpsidx , dpsidy , dpsidz );
1195 const double detJ_weight = detJ * integ_weight;
1196 const double detJ_weight_coeff_k = detJ_weight * coeff_k;
1198 value_at_pt.val() = 0.0 ;
1199 gradx_at_pt.val() = 0.0 ;
1200 grady_at_pt.val() = 0.0 ;
1201 gradz_at_pt.val() = 0.0 ;
1203 value_at_pt.val() += dof_values(m) * bases_vals[m] ;
1204 gradx_at_pt.val() += dof_values(m) * dpsidx[m] ;
1205 grady_at_pt.val() += dof_values(m) * dpsidy[m] ;
1206 gradz_at_pt.val() += dof_values(m) * dpsidz[m] ;
1210 coeff_src * value_at_pt * value_at_pt ;
1213 advection[0]*gradx_at_pt +
1214 advection[1]*grady_at_pt +
1215 advection[2]*gradz_at_pt;
1218 const double bases_val_m = bases_vals[m] * detJ_weight ;
1220 detJ_weight_coeff_k * ( dpsidx[m] * gradx_at_pt +
1221 dpsidy[m] * grady_at_pt +
1222 dpsidz[m] * gradz_at_pt ) +
1223 bases_val_m * ( advection_term + source_term ) ;
1225 elem_res(m) += res.val();
1228 elem_mat(m,
n) += res.fastAccessDx(0) * bases_vals[
n] +
1229 res.fastAccessDx(1) * dpsidx[
n] +
1230 res.fastAccessDx(2) * dpsidy[
n] +
1231 res.fastAccessDx(3) * dpsidz[
n];
1251 this->gatherSolution( ielem, val, node_index, x, y, z, elem_res, elem_mat );
1254 computeElementResidualJacobian( val, x, y, z, elem_res, elem_mat );
1257 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
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
KOKKOS_INLINE_FUNCTION void join(volatile unsigned &update, volatile const unsigned &input) const
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
#define KOKKOS_INLINE_FUNCTION
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 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
KOKKOS_INLINE_FUNCTION void join(const TagFillNodeSet &, volatile unsigned &update, volatile const unsigned &input) 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