11 #ifndef PANZER_DOF_IMPL_HPP
12 #define PANZER_DOF_IMPL_HPP
22 #include "Intrepid2_FunctionSpaceTools.hpp"
35 template<
typename EvalT,
typename TRAITS>
38 use_descriptors_(false),
39 dof_basis( p.get<std::string>(
"Name"),
48 if(basis->isScalarBasis()) {
50 p.
get<std::string>(
"Name"),
54 else if(basis->isVectorBasis()) {
56 p.
get<std::string>(
"Name"),
65 std::string n =
"DOF: " +
dof_basis.fieldTag().name() +
" ("+PHX::print<EvalT>()+
")";
70 template<
typename EvalT,
typename TRAITS>
76 : use_descriptors_(true)
98 std::string n =
"DOF: " +
dof_basis.fieldTag().name() +
" ("+PHX::print<EvalT>()+
")";
103 template<
typename EvalT,
typename TRAITS>
108 this->utils.setFieldData(dof_basis,fm);
110 this->utils.setFieldData(dof_ip_vector,fm);
112 this->utils.setFieldData(dof_ip_scalar,fm);
115 if(not use_descriptors_)
120 template<
typename EvalT,
typename TRAITS>
125 : *this->wda(workset).bases[basis_index];
130 if(is_vector_basis) {
133 const int spaceDim = array.extent(3);
136 Kokkos::parallel_for(this->getName(),policy,functor);
140 Kokkos::parallel_for(this->getName(),policy,functor);
148 Kokkos::parallel_for(workset.num_cells,functor);
159 template<
typename TRAITS>
162 use_descriptors_(false),
163 dof_basis( p.get<std::string>(
"Name"),
175 offsets_array = PHX::View<int*>(
"offsets",offsets.size());
176 auto offsets_array_h = Kokkos::create_mirror_view(offsets_array);
177 for(std::size_t i=0;i<offsets.size();i++)
178 offsets_array_h(i) = offsets[i];
179 Kokkos::deep_copy(offsets_array, offsets_array_h);
181 accelerate_jacobian_enabled =
true;
184 sensitivities_name =
true;
185 if (p.
isType<std::string>(
"Sensitivities Name"))
186 sensitivities_name = p.
get<std::string>(
"Sensitivities Name");
189 accelerate_jacobian_enabled =
false;
192 if(basis->isScalarBasis()) {
194 p.
get<std::string>(
"Name"),
198 else if(basis->isVectorBasis()) {
200 p.
get<std::string>(
"Name"),
209 std::string n =
"DOF: " +
dof_basis.fieldTag().name()
210 + ( accelerate_jacobian_enabled ?
" accel_jac " :
"slow_jac" )
211 +
" ("+PHX::print<panzer::Traits::Jacobian>()+
")";
216 template<
typename TRAITS>
222 : use_descriptors_(true)
230 accelerate_jacobian_enabled =
false;
235 if(not is_vector_basis) {
246 std::string n =
"DOF: " +
dof_basis.fieldTag().name() +
" slow_jac(descriptor) ("+PHX::print<typename TRAITS::Jacobian>()+
")";
251 template<
typename TRAITS>
268 template<
typename TRAITS>
274 accelerate_jacobian =
false;
275 if(accelerate_jacobian_enabled && d.first_sensitivities_name==sensitivities_name) {
276 accelerate_jacobian =
true;
281 template<
typename TRAITS>
289 if(accelerate_jacobian) {
292 const int spaceDim = array.extent(3);
295 Kokkos::parallel_for(workset.num_cells,functor);
299 Kokkos::parallel_for(workset.num_cells,functor);
307 const int spaceDim = array.extent(3);
310 Kokkos::parallel_for(this->
getName(),policy,functor);
314 Kokkos::parallel_for(this->
getName(),policy,functor);
321 if(accelerate_jacobian) {
323 Kokkos::parallel_for(workset.num_cells,functor);
327 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
PHX::View< const int * > offsets
panzer::BasisDescriptor bd_
Array_CellBasisIPDim basis_vector
const std::string & getType() const
Get type of basis.
ConstArray_CellBasisIP getBasisValues(const bool weighted, const bool cache=true, const bool force=false) const
Get the basis values evaluated at mesh points.
panzer::Traits::Jacobian::ScalarT ScalarT
PHX::MDField< const ScalarT, Cell, Point > dof_basis
virtual const std::string & getName() const =0
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_
virtual void preEvaluate(typename Traits::PreEvalData d)=0
ConstArray_CellBasisIPDim getVectorBasisValues(const bool weighted, const bool cache=true, const bool force=false) const
Get the vector basis values evaluated at mesh points.
void evaluateFields(typename TRAITS::EvalData d)
bool isType(const std::string &name) const
WorksetDetailsAccessor wda
static HP & inst()
Private ctor.
PHX::MDField< ScalarT, Cell, Point, Dim > dof_ip_vector
#define TEUCHOS_ASSERT(assertion_test)
void postRegistrationSetup(typename TRAITS::SetupData d, PHX::FieldManager< TRAITS > &fm)