diff --git a/packages/panzer/adapters-stk/example/MixedPoissonExample/Example_SineSolution_impl.hpp b/packages/panzer/adapters-stk/example/MixedPoissonExample/Example_SineSolution_impl.hpp index 683304edcd3e..5e362d86bd87 100644 --- a/packages/panzer/adapters-stk/example/MixedPoissonExample/Example_SineSolution_impl.hpp +++ b/packages/panzer/adapters-stk/example/MixedPoissonExample/Example_SineSolution_impl.hpp @@ -82,16 +82,19 @@ template void SineSolution::evaluateFields(typename Traits::EvalData workset) { using panzer::index_t; - for (index_t cell = 0; cell < workset.num_cells; ++cell) { - for (int point = 0; point < solution.extent_int(1); ++point) { + auto ip_coordinates = this->wda(workset).int_rules[ir_index]->ip_coordinates.get_static_view(); + auto solution_v = solution.get_static_view(); - const double & x = this->wda(workset).int_rules[ir_index]->ip_coordinates(cell,point,0); - const double & y = this->wda(workset).int_rules[ir_index]->ip_coordinates(cell,point,1); - const double & z = this->wda(workset).int_rules[ir_index]->ip_coordinates(cell,point,2); + Kokkos::parallel_for (workset.num_cells, KOKKOS_LAMBDA (const index_t cell) { + for (int point = 0; point < solution_v.extent_int(1); ++point) { - solution(cell,point) = std::sin(2.0*M_PI*x)*std::sin(2*M_PI*y)*std::sin(2.0*M_PI*z); + const double & x = ip_coordinates(cell,point,0); + const double & y = ip_coordinates(cell,point,1); + const double & z = ip_coordinates(cell,point,2); + + solution_v(cell,point) = std::sin(2.0*M_PI*x)*std::sin(2*M_PI*y)*std::sin(2.0*M_PI*z); } - } + }); } //********************************************************************** diff --git a/packages/panzer/adapters-stk/src/evaluators/Panzer_STK_ScatterVectorFields_impl.hpp b/packages/panzer/adapters-stk/src/evaluators/Panzer_STK_ScatterVectorFields_impl.hpp index 1f3622ac8a8b..be6b88adc1a3 100644 --- a/packages/panzer/adapters-stk/src/evaluators/Panzer_STK_ScatterVectorFields_impl.hpp +++ b/packages/panzer/adapters-stk/src/evaluators/Panzer_STK_ScatterVectorFields_impl.hpp @@ -137,8 +137,12 @@ evaluateFields(panzer::Traits::EvalData workset) // scaline field value only if the scaling parameter is specified, otherwise use 1.0 double scaling = (scaling_.size()>0) ? scaling_[fieldIndex] : 1.0; - for(unsigned i=0; isetCellFieldData(fieldName,blockId,localCellIds,cellValue.get_view(),scaling);