11 #ifndef PANZER_GATHER_BASIS_COORDINATES_IMPL_HPP
12 #define PANZER_GATHER_BASIS_COORDINATES_IMPL_HPP
14 #include "Teuchos_Assert.hpp"
15 #include "Phalanx_DataLayout.hpp"
21 #include "Teuchos_FancyOStream.hpp"
23 template<
typename EvalT,
typename TRAITS>
29 ss <<
"Basis_" << basisName <<
" BasisCoordinates";
33 template<
typename EvalT,
typename TRAITS>
37 basisName_ = basis.
name();
41 this->addEvaluatedField(basisCoordinates_);
42 this->addUnsharedField(Teuchos::rcp_const_cast<PHX::FieldTag>(basisCoordinates_.fieldTagPtr()));
44 this->setName(
"GatherBasisCoordinates: "+fieldName(basisName_));
48 template<
typename EvalT,
typename TRAITS>
55 Kokkos::deep_copy(basisCoordinates_.get_static_view(),0.0);
59 template<
typename EvalT,
typename TRAITS>
67 auto d_basisCoordinates = basisCoordinates_.get_static_view();
68 auto s_basis_coordinates = bv->basis_coordinates.get_static_view();
70 Kokkos::MDRangePolicy<PHX::Device,Kokkos::Rank<3>> policy({0,0,0},{int(workset.num_cells),s_basis_coordinates.extent_int(1),s_basis_coordinates.extent_int(2)});
71 Kokkos::parallel_for(
"GatherBasisCoords",policy, KOKKOS_LAMBDA(
const int i,
const int j,
const int k) {
72 auto d_basisCoordinates_tmp = d_basisCoordinates;
73 auto s_basis_coordinates_tmp = s_basis_coordinates;
74 if constexpr(Sacado::IsADType<typename EvalT::ScalarT>::value) {
75 d_basisCoordinates_tmp(i,j,k).val() = s_basis_coordinates_tmp(i,j,k);
78 d_basisCoordinates_tmp(i,j,k) = s_basis_coordinates_tmp(i,j,k);
std::string name() const
A unique key that is the combination of the basis type and basis order.
void evaluateFields(typename TRAITS::EvalData d)
void postRegistrationSetup(typename TRAITS::SetupData d, PHX::FieldManager< TRAITS > &vm)
Teuchos::RCP< PHX::DataLayout > coordinates
<Cell,Basis,Dim>
std::vector< std::string >::size_type getPureBasisIndex(std::string basis_name, const panzer::Workset &workset, WorksetDetailsAccessor &wda)
Returns the index in the workset bases for a particular PureBasis name.
Description and data layouts associated with a particular basis.
static std::string fieldName(const std::string &basisName)