43 #ifndef PANZER_DOF_IMPL_HPP
44 #define PANZER_DOF_IMPL_HPP
54 #include "Intrepid2_FunctionSpaceTools.hpp"
67 template<
typename EvalT,
typename TRAITS>
70 use_descriptors_(false),
71 dof_basis( p.get<std::string>(
"Name"),
80 if(basis->isScalarBasis()) {
82 p.
get<std::string>(
"Name"),
86 else if(basis->isVectorBasis()) {
88 p.
get<std::string>(
"Name"),
97 std::string n =
"DOF: " +
dof_basis.fieldTag().name() +
" ("+PHX::print<EvalT>()+
")";
102 template<
typename EvalT,
typename TRAITS>
104 DOF(
const PHX::FieldTag & input,
105 const PHX::FieldTag & output,
108 : use_descriptors_(true)
130 std::string n =
"DOF: " +
dof_basis.fieldTag().name() +
" ("+PHX::print<EvalT>()+
")";
135 template<
typename EvalT,
typename TRAITS>
140 this->utils.setFieldData(dof_basis,fm);
142 this->utils.setFieldData(dof_ip_vector,fm);
144 this->utils.setFieldData(dof_ip_scalar,fm);
147 if(not use_descriptors_)
152 template<
typename EvalT,
typename TRAITS>
157 : *this->wda(workset).bases[basis_index];
162 if(is_vector_basis) {
166 Kokkos::parallel_for(policy,functor,this->getName());
170 Kokkos::parallel_for(policy,functor,this->getName());
175 Kokkos::parallel_for(workset.num_cells,functor);
186 template<
typename TRAITS>
189 use_descriptors_(false),
190 dof_basis( p.get<std::string>(
"Name"),
202 offsets_array = Kokkos::View<int*,PHX::Device>(
"offsets",offsets.size());
203 for(std::size_t i=0;i<offsets.size();i++)
204 offsets_array(i) = offsets[i];
206 accelerate_jacobian_enabled =
true;
209 sensitivities_name =
true;
210 if (p.
isType<std::string>(
"Sensitivities Name"))
211 sensitivities_name = p.
get<std::string>(
"Sensitivities Name");
214 accelerate_jacobian_enabled =
false;
217 if(basis->isScalarBasis()) {
219 p.
get<std::string>(
"Name"),
223 else if(basis->isVectorBasis()) {
225 p.
get<std::string>(
"Name"),
234 std::string n =
"DOF: " +
dof_basis.fieldTag().name()
235 + ( accelerate_jacobian_enabled ?
" accel_jac " :
"slow_jac" )
236 +
" ("+PHX::print<panzer::Traits::Jacobian>()+
")";
241 template<
typename TRAITS>
243 DOF(
const PHX::FieldTag & input,
244 const PHX::FieldTag & output,
247 : use_descriptors_(true)
255 accelerate_jacobian_enabled =
false;
260 if(not is_vector_basis) {
271 std::string n =
"DOF: " +
dof_basis.fieldTag().name() +
" slow_jac(descriptor) ("+PHX::print<typename TRAITS::Jacobian>()+
")";
276 template<
typename TRAITS>
293 template<
typename TRAITS>
299 accelerate_jacobian =
false;
300 if(accelerate_jacobian_enabled && d.first_sensitivities_name==sensitivities_name) {
301 accelerate_jacobian =
true;
306 template<
typename TRAITS>
314 if(accelerate_jacobian) {
318 Kokkos::parallel_for(workset.num_cells,functor);
322 Kokkos::parallel_for(workset.num_cells,functor);
328 const int spaceDim = basisValues.
basis_vector.extent(3);
331 Kokkos::parallel_for(policy,functor,this->getName());
335 Kokkos::parallel_for(policy,functor,this->getName());
340 if(accelerate_jacobian) {
342 Kokkos::parallel_for(workset.num_cells,functor);
346 Kokkos::parallel_for(workset.num_cells,functor);
PHX::MDField< ScalarT, Cell, Point > dof_ip_scalar
DOF(const Teuchos::ParameterList &p)
T & get(const std::string &name, T def_value)
Kokkos::TeamPolicy< TeamPolicyProperties...> teamPolicy(const int &league_size)
Returns a TeamPolicy for hierarchic parallelism.
Array_CellBasisIP basis_scalar
panzer::BasisDescriptor bd_
Array_CellBasisIPDim basis_vector
const std::string & getType() const
Get type of basis.
panzer::Traits::Jacobian::ScalarT ScalarT
PHX::MDField< const ScalarT, Cell, Point > dof_basis
bool useSharedMemory() const
std::vector< std::string >::size_type getBasisIndex(std::string basis_name, const panzer::Workset &workset, WorksetDetailsAccessor &wda)
Returns the index in the workset bases for a particular BasisIRLayout name.
panzer::IntegrationDescriptor id_
void evaluateFields(typename TRAITS::EvalData d)
bool isType(const std::string &name) const
WorksetDetailsAccessor wda
static HP & inst()
Private ctor.
Interpolates basis DOF values to IP DOF values.
PHX::MDField< ScalarT, Cell, Point, Dim > dof_ip_vector
#define TEUCHOS_ASSERT(assertion_test)
void postRegistrationSetup(typename TRAITS::SetupData d, PHX::FieldManager< TRAITS > &fm)
Kokkos::View< const int *, PHX::Device > offsets