11#ifndef __Panzer_DOF_Functors_hpp__
12#define __Panzer_DOF_Functors_hpp__
14#include "Phalanx_MDField.hpp"
15#include "Phalanx_KokkosDeviceTypes.hpp"
49namespace dof_functors {
58template <
typename ScalarT,
typename Array,
int spaceDim>
69 using scratch_view = Kokkos::View<ScalarT* ,typename PHX::DevLayout<ScalarT>::type,
typename PHX::exec_space::scratch_memory_space,Kokkos::MemoryUnmanaged>;
79 PHX::View<ScalarT***> in_dof_ip,
81 bool in_use_shared_memory =
false)
90 KOKKOS_INLINE_FUNCTION
91 void operator()(
const Kokkos::TeamPolicy<PHX::exec_space>::member_type& team)
const
93 const int cell = team.league_rank();
96 Kokkos::parallel_for(Kokkos::TeamThreadRange(team,0,
numPoints), [&] (
const int& pt) {
97 for (
int d=0; d<spaceDim; ++d) {
113 if (Sacado::IsADType<ScalarT>::value) {
122 Kokkos::parallel_for(Kokkos::TeamThreadRange(team,0,
numFields), [&] (
const int& dof) {
128 for (
int dim=0; dim < spaceDim; ++dim) {
130 Kokkos::parallel_for(Kokkos::TeamThreadRange(team,0,
numPoints), [&] (
const int& pt) {
131 point_values(pt) = 0.0;
136 Kokkos::parallel_for(Kokkos::TeamThreadRange(team,0,
numPoints), [&] (
const int& pt) {
137 point_values(pt) += dof_values(dof) *
basis(cell,dof,pt,dim);
142 Kokkos::parallel_for(Kokkos::TeamThreadRange(team,0,
numPoints), [&] (
const int& pt) {
143 dof_ip(cell,pt,dim) = point_values(pt);
157 if (Sacado::IsADType<ScalarT>::value)
172template <
typename ScalarT,
typename Array>
191 PHX::MDField<ScalarT,Cell,Point> in_dof_ip,
199 KOKKOS_INLINE_FUNCTION
226template <
typename ScalarT,
typename Array,
int spaceDim>
229 PHX::MDField<ScalarT,Cell,Point,Dim>
dof_ip;
247 PHX::MDField<ScalarT,Cell,Point,Dim> in_dof_ip,
248 PHX::View<const int*> in_offsets,
256 KOKKOS_INLINE_FUNCTION
260 for (
int d=0; d<spaceDim; d++) {
270 dof_ip(cell,pt,d).val() +=
dof_basis(cell, bf).val() * Sacado::scalarValue(
basis(cell, bf, pt, d));
290template <
typename ScalarT,
typename Array>
311 PHX::MDField<ScalarT,Cell,Point> in_dof_ip,
312 PHX::View<const int*> in_offsets,
320 KOKKOS_INLINE_FUNCTION
Scalar-valued DOF interpolation functor using the fast-sensitivity optimization.
PHX::Device execution_space
PHX::MDField< ScalarT, Cell, Point > dof_ip
KOKKOS_INLINE_FUNCTION void operator()(const unsigned int cell) const
Computes dof_ip (value and its one nonzero sensitivity) for all points of one cell.
EvaluateDOFFastSens_Scalar(PHX::MDField< const ScalarT, Cell, Point > in_dof_basis, PHX::MDField< ScalarT, Cell, Point > in_dof_ip, PHX::View< const int * > in_offsets, Array in_basis)
Constructor.
PHX::MDField< const ScalarT, Cell, Point > dof_basis
PHX::View< const int * > offsets
Vector-valued DOF interpolation functor using the fast-sensitivity optimization.
PHX::View< const int * > offsets
PHX::Device execution_space
EvaluateDOFFastSens_Vector(PHX::MDField< const ScalarT, Cell, Point > in_dof_basis, PHX::MDField< ScalarT, Cell, Point, Dim > in_dof_ip, PHX::View< const int * > in_offsets, Array in_basis)
Constructor.
PHX::MDField< ScalarT, Cell, Point, Dim > dof_ip
PHX::MDField< const ScalarT, Cell, Point > dof_basis
KOKKOS_INLINE_FUNCTION void operator()(const unsigned int cell) const
Computes dof_ip (value and its one nonzero sensitivity) for all points/dimensions of one cell.
Scalar-valued DOF interpolation functor with full derivative propagation.
PHX::MDField< ScalarT, Cell, Point > dof_ip
EvaluateDOFWithSens_Scalar(PHX::MDField< const ScalarT, Cell, Point > in_dof_basis, PHX::MDField< ScalarT, Cell, Point > in_dof_ip, Array in_basis)
Constructor.
PHX::MDField< const ScalarT, Cell, Point > dof_basis
KOKKOS_INLINE_FUNCTION void operator()(const unsigned int cell) const
Computes dof_ip for all points of one cell.
PHX::Device execution_space
Vector-valued DOF interpolation functor with full derivative propagation.
const bool use_shared_memory
PHX::View< const ScalarT ** > dof_basis
size_t team_shmem_size(int) const
Returns the team scratch memory size (in bytes) required by operator() when use_shared_memory is enab...
KOKKOS_INLINE_FUNCTION void operator()(const Kokkos::TeamPolicy< PHX::exec_space >::member_type &team) const
Computes dof_ip for one cell (team.league_rank()), optionally staging through team scratch memory.
Kokkos::View< ScalarT *,typename PHX::DevLayout< ScalarT >::type, typename PHX::exec_space::scratch_memory_space, Kokkos::MemoryUnmanaged > scratch_view
EvaluateDOFWithSens_Vector(PHX::View< const ScalarT ** > in_dof_basis, PHX::View< ScalarT *** > in_dof_ip, Array in_basis, bool in_use_shared_memory=false)
Constructor.
PHX::View< ScalarT *** > dof_ip