1 #ifndef VERTEXCFD_CLOSURE_CONDUCTIONFLUX_IMPL_HPP
2 #define VERTEXCFD_CLOSURE_CONDUCTIONFLUX_IMPL_HPP
4 #include <Panzer_HierarchicParallelism.hpp>
11 template<
class EvalType,
class Traits>
13 const panzer::IntegrationRule& ir,
14 const std::string& flux_prefix,
15 const std::string& gradient_prefix)
16 : _conduction_flux(flux_prefix +
"CONDUCTION_FLUX_energy", ir.dl_vector)
17 , _grad_temperature(gradient_prefix +
"GRAD_temperature", ir.dl_vector)
18 , _thermal_conductivity(
"thermal_conductivity", ir.dl_scalar)
19 , _num_space_dim(ir.spatial_dimension)
25 this->addDependentField(_grad_temperature);
26 this->addDependentField(_thermal_conductivity);
28 this->setName(
"Conduction Flux " + std::to_string(_num_space_dim) +
"D");
32 template<
class EvalType,
class Traits>
34 typename Traits::EvalData workset)
36 auto policy = panzer::HP::inst().teamPolicy<scalar_type, PHX::Device>(
38 Kokkos::parallel_for(this->getName(), policy, *
this);
42 template<
class EvalType,
class Traits>
44 const Kokkos::TeamPolicy<PHX::exec_space>::member_type& team)
const
46 const int cell = team.league_rank();
47 const int num_point = _conduction_flux.extent(1);
49 Kokkos::parallel_for(Kokkos::TeamThreadRange(team, 0, num_point),
50 [&](
const int point) {
51 for (
int dim = 0; dim < _num_space_dim; ++dim)
53 _conduction_flux(cell, point, dim)
54 = _thermal_conductivity(cell, point)
55 * _grad_temperature(cell, point, dim);
65 #endif // end VERTEXCFD_CLOSURE_CONDUCTIONFLUX_IMPL_HPP