11#include "PanzerDiscFE_config.hpp"
15#include "Sacado_Fad_Kokkos_ViewFactory.hpp"
18#include "Intrepid2_Utils.hpp"
19#include "Intrepid2_FunctionSpaceTools.hpp"
20#include "Intrepid2_Orientation.hpp"
21#include "Intrepid2_OrientationTools.hpp"
24#include "Phalanx_GetNonConstDynRankViewFromConstMDField.hpp"
29template<
typename Scalar>
31applyOrientationsImpl(
const int num_cells,
32 Kokkos::DynRankView<Scalar, PHX::Device> view,
33 Kokkos::DynRankView<Intrepid2::Orientation, PHX::Device> orientations,
36 using ots=Intrepid2::OrientationTools<PHX::Device>;
38 auto sub_orientations = Kokkos::subview(orientations, std::make_pair(0,num_cells));
43 auto sub_view = Kokkos::subview(view, std::make_pair(0,num_cells), Kokkos::ALL(), Kokkos::ALL());
44 auto sub_view_clone = Sacado::createDynRankView(view,
"sub_view_clone", sub_view.extent(0), sub_view.extent(1), sub_view.extent(2));
45 Kokkos::deep_copy(sub_view_clone, sub_view);
48 ots::modifyBasisByOrientation(sub_view, sub_view_clone, sub_orientations, &basis);
49 }
else if (view.rank() == 4){
51 auto sub_view = Kokkos::subview(view, std::make_pair(0,num_cells), Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
52 auto sub_view_clone = Sacado::createDynRankView(view,
"sub_view_clone", sub_view.extent(0), sub_view.extent(1), sub_view.extent(2), sub_view.extent(3));
53 Kokkos::deep_copy(sub_view_clone, sub_view);
56 ots::modifyBasisByOrientation(sub_view, sub_view_clone, sub_orientations, &basis);
58 throw std::logic_error(
"applyOrientationsImpl : Unknown view of rank " + std::to_string(view.rank()));
61template<
typename Scalar>
63applyOrientationsImpl(
const int num_cells,
64 Kokkos::DynRankView<Scalar, PHX::Device> view,
65 const std::vector<Intrepid2::Orientation> & orientations,
70 Kokkos::DynRankView<Intrepid2::Orientation,PHX::Device> device_orientations(
"drv_orts", num_cells);
71 auto host_orientations = Kokkos::create_mirror_view(device_orientations);
72 for(
int i=0; i < num_cells; ++i)
73 host_orientations(i) = orientations[i];
74 Kokkos::deep_copy(device_orientations,host_orientations);
77 applyOrientationsImpl(num_cells, view, device_orientations, basis);
83template <
typename Scalar>
86 const bool allocArrays,
87 const bool buildWeighted)
124template <
typename Scalar>
127 const PHX::MDField<Scalar,Cell,IP,Dim,Dim> & jac,
128 const PHX::MDField<Scalar,Cell,IP> & jac_det,
129 const PHX::MDField<Scalar,Cell,IP,Dim,Dim> & jac_inv,
130 const int in_num_cells)
132 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::evaluateValues(5 arg)",bv_ev_5);
139 const int num_dims = jac.extent(2);
154 else if(num_dims == 3)
176 else if(num_dims == 3)
187template <
typename Scalar>
190 const PHX::MDField<Scalar,Cell,IP,Dim,Dim> & jac,
191 const PHX::MDField<Scalar,Cell,IP> & jac_det,
192 const PHX::MDField<Scalar,Cell,IP,Dim,Dim> & jac_inv,
193 const PHX::MDField<Scalar,Cell,IP> & weighted_measure,
194 const PHX::MDField<Scalar,Cell,NODE,Dim> & node_coordinates,
195 bool use_node_coordinates,
196 const int in_num_cells)
198 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::evaluateValues(8 arg, uniform cub pts)",bv_ev_8u);
202 if(weighted_measure.size() > 0)
210 const int num_dims = jac.extent(2);
224 else if(num_dims == 3)
232 if(use_node_coordinates){
241template <
typename Scalar>
243evaluateValues(
const PHX::MDField<Scalar,Cell,IP,Dim> & cub_points,
244 const PHX::MDField<Scalar,Cell,IP,Dim,Dim> & jac,
245 const PHX::MDField<Scalar,Cell,IP> & jac_det,
246 const PHX::MDField<Scalar,Cell,IP,Dim,Dim> & jac_inv,
247 const PHX::MDField<Scalar,Cell,IP> & weighted_measure,
248 const PHX::MDField<Scalar,Cell,NODE,Dim> & node_coordinates,
249 bool use_node_coordinates,
250 const int in_num_cells)
252 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::evaluateValues(8 arg,nonuniform cub pts)",bv_ev_8nu);
257 if(weighted_measure.size() > 0)
261 const int num_dims = jac.extent(2);
282 }
else if(num_dims == 3) {
294 if(use_node_coordinates){
303template <
typename Scalar>
306 const PHX::MDField<Scalar,Cell,IP,Dim,Dim> & jac,
307 const PHX::MDField<Scalar,Cell,IP> & jac_det,
308 const PHX::MDField<Scalar,Cell,IP,Dim,Dim> & jac_inv)
310 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::evaluateValuesCV(5 arg)",bv_ev_cv_5);
312 PHX::MDField<Scalar,Cell,IP> weighted_measure;
313 PHX::MDField<Scalar,Cell,NODE,Dim> node_coordinates;
314 evaluateValues(cub_points,jac,jac_det,jac_inv,weighted_measure,node_coordinates,
false,jac.extent(0));
317template <
typename Scalar>
320 const PHX::MDField<Scalar,Cell,IP,Dim,Dim> & jac,
321 const PHX::MDField<Scalar,Cell,IP> & jac_det,
322 const PHX::MDField<Scalar,Cell,IP,Dim,Dim> & jac_inv,
323 const PHX::MDField<Scalar,Cell,NODE,Dim> & node_coordinates,
324 bool use_node_coordinates,
325 const int in_num_cells)
327 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::evaluateValuesCV(7 arg)",bv_ev_cv_7);
328 PHX::MDField<Scalar,Cell,IP> weighted_measure;
329 evaluateValues(cell_cub_points,jac,jac_det,jac_inv,weighted_measure,node_coordinates,use_node_coordinates,in_num_cells);
332template <
typename Scalar>
335 const int in_num_cells)
344template <
typename Scalar>
347 const int in_num_cells)
352 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::applyOrientations()",bv_ev_app_orts);
359 const int num_cell_basis_layout = in_num_cells < 0 ?
basis_layout->numCells() : in_num_cells;
360 const int num_cell_orientation = orientations.size();
361 const int num_cells = num_cell_basis_layout < num_cell_orientation ? num_cell_basis_layout : num_cell_orientation;
365 Kokkos::DynRankView<Intrepid2::Orientation,PHX::Device> device_orientations(
"device_orientations", num_cells);
366 auto host_orientations = Kokkos::create_mirror_view(device_orientations);
367 for(
int i=0; i < num_cells; ++i)
368 host_orientations(i) = orientations[i];
369 Kokkos::deep_copy(device_orientations,host_orientations);
402template <
typename Scalar>
406 TEUCHOS_TEST_FOR_EXCEPT_MSG(
true,
"panzer::BasisValues2::applyOrientations : this should not be called.");
409template <
typename Scalar>
413template <
typename Scalar>
415setupArrays(
const Teuchos::RCP<const panzer::BasisIRLayout>& layout,
416 bool computeDerivatives)
423 Teuchos::RCP<const panzer::PureBasis> basisDesc = layout->getBasis();
426 int num_quad = layout->numPoints();
427 int dim = basisDesc->dimension();
428 int card = basisDesc->cardinality();
429 int numcells = basisDesc->numCells();
433 intrepid_basis = basisDesc->getIntrepid2Basis<PHX::Device,Scalar,Scalar>();
502 else { TEUCHOS_ASSERT(
false); }
564 else { TEUCHOS_ASSERT(
false); }
575template <
typename Scalar>
578setup(
const Teuchos::RCP<const panzer::BasisIRLayout> & basis,
579 PHX::MDField<const Scalar, Cell, IP, Dim> reference_points,
580 PHX::MDField<const Scalar, Cell, IP, Dim, Dim> point_jacobian,
581 PHX::MDField<const Scalar, Cell, IP> point_jacobian_determinant,
582 PHX::MDField<const Scalar, Cell, IP, Dim, Dim> point_jacobian_inverse,
583 const int num_evaluated_cells)
586 intrepid_basis = basis->getBasis()->getIntrepid2Basis<PHX::Device,Scalar,Scalar>();
602template <
typename Scalar>
605setupUniform(
const Teuchos::RCP<const panzer::BasisIRLayout> & basis,
606 PHX::MDField<const Scalar, IP, Dim> reference_points,
607 PHX::MDField<const Scalar, Cell, IP, Dim, Dim> point_jacobian,
608 PHX::MDField<const Scalar, Cell, IP> point_jacobian_determinant,
609 PHX::MDField<const Scalar, Cell, IP, Dim, Dim> point_jacobian_inverse,
610 const int num_evaluated_cells)
613 intrepid_basis = basis->getBasis()->getIntrepid2Basis<PHX::Device,Scalar,Scalar>();
629template <
typename Scalar>
632setOrientations(
const std::vector<Intrepid2::Orientation> & orientations,
633 const int num_orientations_cells)
635 if(num_orientations_cells < 0)
639 if(orientations.size() == 0){
650template <
typename Scalar>
658template <
typename Scalar>
662 return {pure_basis->order(),pure_basis->type()};
665template <
typename Scalar>
718template <
typename Scalar>
724 "BasisValues2::setWeightedMeasure : Weighted measure already set. Can only set weighted measure once after setup or setupUniform have beens called.");
734#define PANZER_CACHE_DATA(name) \
736 if(name.size()==tmp_##name.size()){ \
737 Kokkos::deep_copy(name.get_view(), tmp_##name.get_view()); \
741 name##_evaluated_ = true; \
744template <
typename Scalar>
748 const bool force)
const
754 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getBasisCoordinatesRef()",bv_get_bc_ref);
761 using coordsScalarType =
typename Intrepid2::Basis<PHX::Device,Scalar,Scalar>::scalarType;
762 auto tmp_basis_coordinates_ref = af.
buildStaticArray<coordsScalarType,
BASIS,
Dim>(
"basis_coordinates_ref", num_card, num_dim);
763 intrepid_basis->getDofCoords(tmp_basis_coordinates_ref.get_view());
764 PHX::ExecutionSpace().fence();
769 return tmp_basis_coordinates_ref;
772template <
typename Scalar>
776 const bool force)
const
782 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getBasisValuesRef()",bv_get_bV_ref);
799 intrepid_basis->getValues(tmp_basis_ref_scalar.get_view(), cubature_points_uniform_ref, Intrepid2::OPERATOR_VALUE);
800 PHX::ExecutionSpace().fence();
805 return tmp_basis_ref_scalar;
808template <
typename Scalar>
812 const bool force)
const
818 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getVectorBasisValuesRef()",bv_get_vec_bv_ref);
836 intrepid_basis->getValues(tmp_basis_ref_vector.get_view(),cubature_points_uniform_ref,Intrepid2::OPERATOR_VALUE);
837 PHX::ExecutionSpace().fence();
842 return tmp_basis_ref_vector;
845template <
typename Scalar>
849 const bool force)
const
855 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getGradBasisValuesRef()",bv_get_grad_bv_ref);
873 intrepid_basis->getValues(tmp_grad_basis_ref.get_view(), cubature_points_uniform_ref, Intrepid2::OPERATOR_GRAD);
874 PHX::ExecutionSpace().fence();
879 return tmp_grad_basis_ref;
882template <
typename Scalar>
886 const bool force)
const
892 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getCurl2DVectorBasisRef()",bv_get_curl2_bv_ref);
907 auto tmp_curl_basis_ref_scalar = af.
buildStaticArray<Scalar,
BASIS,
IP>(
"dyn_curl_basis_ref_scalar",num_card,num_quad);
910 intrepid_basis->getValues(tmp_curl_basis_ref_scalar.get_view(), cubature_points_uniform_ref, Intrepid2::OPERATOR_CURL);
911 PHX::ExecutionSpace().fence();
916 return tmp_curl_basis_ref_scalar;
919template <
typename Scalar>
923 const bool force)
const
929 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getCurlVectorBasisRef()",bv_get_curl_vec_bv_ref);
945 auto tmp_curl_basis_ref_vector = af.
buildStaticArray<Scalar,
BASIS,
IP,
Dim>(
"dyn_curl_basis_ref_vector",num_card,num_quad,num_dim);
948 intrepid_basis->getValues(tmp_curl_basis_ref_vector.get_view(), cubature_points_uniform_ref, Intrepid2::OPERATOR_CURL);
949 PHX::ExecutionSpace().fence();
954 return tmp_curl_basis_ref_vector;
957template <
typename Scalar>
961 const bool force)
const
967 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getDivVectorBasisRef()",bv_get_div_vec_bv_ref);
984 intrepid_basis->getValues(tmp_div_basis_ref.get_view(), cubature_points_uniform_ref, Intrepid2::OPERATOR_DIV);
985 PHX::ExecutionSpace().fence();
990 return tmp_div_basis_ref;
993template <
typename Scalar>
997 const bool force)
const
999 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getBasisCoordinates()",bv_get_bc);
1008 const auto s_node_coordinates = Kokkos::subview(
cell_node_coordinates_.get_view(),cell_range,Kokkos::ALL(),Kokkos::ALL());
1016 auto s_aux = Kokkos::subview(tmp_basis_coordinates.get_view(),cell_range,Kokkos::ALL(),Kokkos::ALL());
1020 auto bcr = PHX::getNonConstDynRankViewFromConstMDField(const_bcr);
1022 Intrepid2::CellTools<PHX::Device> cell_tools;
1023 cell_tools.mapToPhysicalFrame(s_aux, bcr, s_node_coordinates, *
cell_topology_);
1024 PHX::ExecutionSpace().fence();
1029 return tmp_basis_coordinates;
1032template <
typename Scalar>
1037 const bool force)
const
1046 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getBasisValues()",bv_get_bv);
1061 auto tmp_weighted_basis_scalar = af.
buildStaticArray<Scalar,
Cell,
BASIS,
IP>(
"weighted_basis_scalar", num_cells, num_card, num_points);
1064 auto s_aux = Kokkos::subview(tmp_weighted_basis_scalar.get_view(),cell_range,Kokkos::ALL(),Kokkos::ALL());
1065 auto s_cw = Kokkos::subview(
cubature_weights_.get_view(),cell_range,Kokkos::ALL());
1066 auto s_bv = Kokkos::subview(bv.get_view(),cell_range,Kokkos::ALL(),Kokkos::ALL());
1068 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1069 fst::multiplyMeasure(s_aux,s_cw,s_bv);
1077 return tmp_weighted_basis_scalar;
1096 auto cell_basis_ref_scalar = af.
buildStaticArray<Scalar,
BASIS,
IP>(
"cell_basis_ref_scalar",num_card,num_points);
1097 intrepid_basis->getValues(cell_basis_ref_scalar.get_view(),cubature_points_uniform_ref,Intrepid2::OPERATOR_VALUE);
1100 auto s_aux = Kokkos::subview(tmp_basis_scalar.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1103 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1106 fst::HVOLtransformVALUE(s_aux,s_cjd,cell_basis_ref_scalar.get_view());
1108 fst::HGRADtransformVALUE(s_aux,cell_basis_ref_scalar.get_view());
1110 PHX::ExecutionSpace().fence();
1123#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_IMPL_HIP_UNIFIED_MEMORY)
1124#ifdef KOKKOS_ENABLE_CUDA
1125 if constexpr (std::is_same<Kokkos::CudaUVMSpace,
typename decltype(tmp_basis_scalar.get_view())::memory_space>::value) {
1127 if constexpr (std::is_same<Kokkos::HIPSpace,
typename decltype(tmp_basis_scalar.get_view())::memory_space>::value) {
1129 auto cubature_points_ref_host = Kokkos::create_mirror(Kokkos::HostSpace{},
cubature_points_ref_.get_view());
1131 auto tmp_basis_scalar_host = Kokkos::create_mirror(Kokkos::HostSpace{},tmp_basis_scalar.get_view());
1135 auto my_cell_basis_host = Kokkos::subview(tmp_basis_scalar_host,cell,Kokkos::ALL(),Kokkos::ALL());
1136 auto my_cell_cub_points_ref_host = Kokkos::subview(cubature_points_ref_host,cell,Kokkos::ALL(),Kokkos::ALL());
1137 intrepid_basis_host->getValues(my_cell_basis_host,my_cell_cub_points_ref_host);
1140 Kokkos::deep_copy(tmp_basis_scalar_ref.get_view(),tmp_basis_scalar_host);
1142 auto s_aux = Kokkos::subview(tmp_basis_scalar.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1143 auto s_ref = Kokkos::subview(tmp_basis_scalar_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1145 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1148 fst::HVOLtransformVALUE(s_aux,s_cjd,s_ref);
1150 fst::HGRADtransformVALUE(s_aux,s_ref);
1156 auto tmp_basis_scalar_host = Kokkos::create_mirror_view(tmp_basis_scalar.get_view());
1160 auto my_cell_basis_host = Kokkos::subview(tmp_basis_scalar_host,cell,Kokkos::ALL(),Kokkos::ALL());
1161 auto my_cell_cub_points_ref_host = Kokkos::subview(cubature_points_ref_host,cell,Kokkos::ALL(),Kokkos::ALL());
1162 intrepid_basis_host->getValues(my_cell_basis_host,my_cell_cub_points_ref_host);
1165 Kokkos::deep_copy(tmp_basis_scalar_ref.get_view(),tmp_basis_scalar_host);
1167 auto s_aux = Kokkos::subview(tmp_basis_scalar.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1168 auto s_ref = Kokkos::subview(tmp_basis_scalar_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1170 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1173 fst::HVOLtransformVALUE(s_aux,s_cjd,s_ref);
1175 fst::HGRADtransformVALUE(s_aux,s_ref);
1177#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_IMPL_HIP_UNIFIED_MEMORY)
1180 PHX::ExecutionSpace().fence();
1193 return tmp_basis_scalar;
1199template <
typename Scalar>
1204 const bool force)
const
1213 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getVectorBasisValues()",bv_get_vec_bv);
1230 auto tmp_weighted_basis_vector = af.
buildStaticArray<Scalar,
Cell,
BASIS,
IP,
Dim>(
"weighted_basis_vector", num_cells, num_card, num_points, num_dim);
1233 auto s_aux = Kokkos::subview(tmp_weighted_basis_vector.get_view(),cell_range,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL());
1234 auto s_cw = Kokkos::subview(
cubature_weights_.get_view(),cell_range,Kokkos::ALL());
1235 auto s_bv = Kokkos::subview(bv.get_view(),cell_range,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL());
1237 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1238 fst::multiplyMeasure(s_aux, s_cw, s_bv);
1243 return tmp_weighted_basis_vector;
1249 TEUCHOS_ASSERT(num_dim != 1);
1266 intrepid_basis->getValues(cell_basis_ref_vector.get_view(),cubature_points_uniform_ref,Intrepid2::OPERATOR_VALUE);
1269 auto s_aux = Kokkos::subview(tmp_basis_vector.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1272 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1274 auto s_jac_inv = Kokkos::subview(
cubature_jacobian_inverse_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1275 fst::HCURLtransformVALUE(s_aux,s_jac_inv,cell_basis_ref_vector.get_view());
1277 auto s_jac = Kokkos::subview(
cubature_jacobian_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1279 fst::HDIVtransformVALUE(s_aux,s_jac, s_jac_det, cell_basis_ref_vector.get_view());
1281 PHX::ExecutionSpace().fence();
1295#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_IMPL_HIP_UNIFIED_MEMORY)
1296#ifdef KOKKOS_ENABLE_CUDA
1297 if constexpr (std::is_same<Kokkos::CudaUVMSpace,
typename decltype(tmp_basis_vector.get_view())::memory_space>::value) {
1299 if constexpr (std::is_same<Kokkos::HIPSpace,
typename decltype(tmp_basis_vector.get_view())::memory_space>::value) {
1301 auto cubature_points_ref_host = Kokkos::create_mirror(Kokkos::HostSpace{},
cubature_points_ref_.get_view());
1303 auto tmp_basis_vector_host = Kokkos::create_mirror(Kokkos::HostSpace{},tmp_basis_vector.get_view());
1307 auto my_cell_basis_host = Kokkos::subview(tmp_basis_vector_host,cell,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL());
1308 auto my_cell_cub_points_ref_host = Kokkos::subview(cubature_points_ref_host,cell,Kokkos::ALL(),Kokkos::ALL());
1309 intrepid_basis_host->getValues(my_cell_basis_host,my_cell_cub_points_ref_host);
1312 Kokkos::deep_copy(tmp_basis_vector_ref.get_view(),tmp_basis_vector_host);
1315 auto s_aux = Kokkos::subview(tmp_basis_vector.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1316 auto s_ref = Kokkos::subview(tmp_basis_vector_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1318 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1320 auto s_jac_inv = Kokkos::subview(
cubature_jacobian_inverse_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1321 fst::HCURLtransformVALUE(s_aux,s_jac_inv,s_ref);
1323 auto s_jac = Kokkos::subview(
cubature_jacobian_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1325 fst::HDIVtransformVALUE(s_aux,s_jac, s_jac_det, s_ref);
1331 auto tmp_basis_vector_host = Kokkos::create_mirror_view(tmp_basis_vector.get_view());
1335 auto my_cell_basis_host = Kokkos::subview(tmp_basis_vector_host,cell,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL());
1336 auto my_cell_cub_points_ref_host = Kokkos::subview(cubature_points_ref_host,cell,Kokkos::ALL(),Kokkos::ALL());
1337 intrepid_basis_host->getValues(my_cell_basis_host,my_cell_cub_points_ref_host);
1340 Kokkos::deep_copy(tmp_basis_vector_ref.get_view(),tmp_basis_vector_host);
1343 auto s_aux = Kokkos::subview(tmp_basis_vector.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1344 auto s_ref = Kokkos::subview(tmp_basis_vector_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1346 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1348 auto s_jac_inv = Kokkos::subview(
cubature_jacobian_inverse_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1349 fst::HCURLtransformVALUE(s_aux,s_jac_inv,s_ref);
1351 auto s_jac = Kokkos::subview(
cubature_jacobian_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1353 fst::HDIVtransformVALUE(s_aux,s_jac, s_jac_det, s_ref);
1355#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_IMPL_HIP_UNIFIED_MEMORY)
1358 PHX::ExecutionSpace().fence();
1368 return tmp_basis_vector;
1374template <
typename Scalar>
1379 const bool force)
const
1388 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getGradBasisValues()",bv_get_grad_bv);
1405 auto tmp_weighted_grad_basis = af.
buildStaticArray<Scalar,
Cell,
BASIS,
IP,
Dim>(
"weighted_grad_basis", num_cells, num_card, num_points, num_dim);
1408 auto s_aux = Kokkos::subview(tmp_weighted_grad_basis.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1409 auto s_cw = Kokkos::subview(
cubature_weights_.get_view(), cell_range, Kokkos::ALL());
1410 auto s_bv = Kokkos::subview(bv.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1412 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1413 fst::multiplyMeasure(s_aux,s_cw,s_bv);
1418 return tmp_weighted_grad_basis;
1435 intrepid_basis->getValues(cell_grad_basis_ref.get_view(),cubature_points_uniform_ref,Intrepid2::OPERATOR_GRAD);
1438 auto s_aux = Kokkos::subview(tmp_grad_basis.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1439 auto s_jac_inv = Kokkos::subview(
cubature_jacobian_inverse_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1442 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1443 fst::HGRADtransformGRAD(s_aux, s_jac_inv,cell_grad_basis_ref.get_view());
1445 PHX::ExecutionSpace().fence();
1459#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_IMPL_HIP_UNIFIED_MEMORY)
1460#ifdef KOKKOS_ENABLE_CUDA
1461 if constexpr (std::is_same<Kokkos::CudaUVMSpace,
typename decltype(tmp_grad_basis.get_view())::memory_space>::value) {
1463 if constexpr (std::is_same<Kokkos::HIPSpace,
typename decltype(tmp_grad_basis.get_view())::memory_space>::value) {
1465 auto cubature_points_ref_host = Kokkos::create_mirror(Kokkos::HostSpace{},
cubature_points_ref_.get_view());
1467 auto tmp_grad_basis_host = Kokkos::create_mirror(Kokkos::HostSpace{},tmp_grad_basis.get_view());
1471 auto my_cell_grad_basis_host = Kokkos::subview(tmp_grad_basis_host,cell,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL());
1472 auto my_cell_cub_points_ref_host = Kokkos::subview(cubature_points_ref_host,cell,Kokkos::ALL(),Kokkos::ALL());
1473 intrepid_basis_host->getValues(my_cell_grad_basis_host,my_cell_cub_points_ref_host,Intrepid2::OPERATOR_GRAD);
1476 Kokkos::deep_copy(tmp_grad_basis_ref.get_view(),tmp_grad_basis_host);
1479 auto s_aux = Kokkos::subview(tmp_grad_basis.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1480 auto s_jac_inv = Kokkos::subview(
cubature_jacobian_inverse_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1481 auto s_ref = Kokkos::subview(tmp_grad_basis_ref.get_view(),cell_range,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL());
1484 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1485 fst::HGRADtransformGRAD(s_aux, s_jac_inv, s_ref);
1490 auto tmp_grad_basis_host = Kokkos::create_mirror_view(tmp_grad_basis.get_view());
1494 auto my_cell_grad_basis_host = Kokkos::subview(tmp_grad_basis_host,cell,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL());
1495 auto my_cell_cub_points_ref_host = Kokkos::subview(cubature_points_ref_host,cell,Kokkos::ALL(),Kokkos::ALL());
1496 intrepid_basis_host->getValues(my_cell_grad_basis_host,my_cell_cub_points_ref_host,Intrepid2::OPERATOR_GRAD);
1499 Kokkos::deep_copy(tmp_grad_basis_ref.get_view(),tmp_grad_basis_host);
1502 auto s_aux = Kokkos::subview(tmp_grad_basis.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1503 auto s_jac_inv = Kokkos::subview(
cubature_jacobian_inverse_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1504 auto s_ref = Kokkos::subview(tmp_grad_basis_ref.get_view(),cell_range,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL());
1507 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1508 fst::HGRADtransformGRAD(s_aux, s_jac_inv, s_ref);
1509#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_IMPL_HIP_UNIFIED_MEMORY)
1512 PHX::ExecutionSpace().fence();
1522 return tmp_grad_basis;
1528template <
typename Scalar>
1533 const bool force)
const
1542 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getCurl2DVectorBasis()",bv_get_curl2d_vec_bv);
1559 auto tmp_weighted_curl_basis_scalar = af.
buildStaticArray<Scalar,
Cell,
BASIS,
IP>(
"weighted_curl_basis_scalar", num_cells, num_card, num_points);
1562 auto s_aux = Kokkos::subview(tmp_weighted_curl_basis_scalar.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1563 auto s_cw = Kokkos::subview(
cubature_weights_.get_view(), cell_range, Kokkos::ALL());
1564 auto s_bv = Kokkos::subview(bv.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1566 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1567 fst::multiplyMeasure(s_aux,s_cw,s_bv);
1572 return tmp_weighted_curl_basis_scalar;
1577 TEUCHOS_ASSERT(num_dim == 2);
1586 auto cell_curl_basis_ref_scalar = af.
buildStaticArray<Scalar,
BASIS,
IP>(
"cell_curl_basis_ref_scalar",num_card,num_points);
1589 intrepid_basis->getValues(cell_curl_basis_ref_scalar.get_view(),cubature_points_uniform_ref,Intrepid2::OPERATOR_CURL);
1592 auto s_aux = Kokkos::subview(tmp_curl_basis_scalar.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1598 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1599 fst::HDIVtransformDIV(s_aux,s_jac_det,cell_curl_basis_ref_scalar.get_view());
1600 PHX::ExecutionSpace().fence();
1614#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_IMPL_HIP_UNIFIED_MEMORY)
1615#ifdef KOKKOS_ENABLE_CUDA
1616 if constexpr (std::is_same<Kokkos::CudaUVMSpace,
typename decltype(tmp_curl_basis_scalar.get_view())::memory_space>::value) {
1618 if constexpr (std::is_same<Kokkos::HIPSpace,
typename decltype(tmp_curl_basis_scalar.get_view())::memory_space>::value) {
1620 auto cubature_points_ref_host = Kokkos::create_mirror(Kokkos::HostSpace{},
cubature_points_ref_.get_view());
1622 auto tmp_curl_basis_scalar_host = Kokkos::create_mirror(Kokkos::HostSpace{},tmp_curl_basis_scalar.get_view());
1626 auto my_cell_curl_basis_host = Kokkos::subview(tmp_curl_basis_scalar_host,cell,Kokkos::ALL(),Kokkos::ALL());
1627 auto my_cell_cub_points_ref_host = Kokkos::subview(cubature_points_ref_host,cell,Kokkos::ALL(),Kokkos::ALL());
1628 intrepid_basis_host->getValues(my_cell_curl_basis_host,my_cell_cub_points_ref_host,Intrepid2::OPERATOR_CURL);
1630 auto tmp_curl_basis_scalar_ref = af.
buildStaticArray<Scalar,
Cell,
BASIS,
IP>(
"tmp_curl_basis_scalar_ref",num_cells,num_card,num_points);
1631 Kokkos::deep_copy(tmp_curl_basis_scalar_ref.get_view(),tmp_curl_basis_scalar_host);
1634 auto s_aux = Kokkos::subview(tmp_curl_basis_scalar.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1636 auto s_ref = Kokkos::subview(tmp_curl_basis_scalar_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1641 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1642 fst::HDIVtransformDIV(s_aux,s_jac_det,s_ref);
1647 auto tmp_curl_basis_scalar_host = Kokkos::create_mirror_view(tmp_curl_basis_scalar.get_view());
1651 auto my_cell_curl_basis_host = Kokkos::subview(tmp_curl_basis_scalar_host,cell,Kokkos::ALL(),Kokkos::ALL());
1652 auto my_cell_cub_points_ref_host = Kokkos::subview(cubature_points_ref_host,cell,Kokkos::ALL(),Kokkos::ALL());
1653 intrepid_basis_host->getValues(my_cell_curl_basis_host,my_cell_cub_points_ref_host,Intrepid2::OPERATOR_CURL);
1655 auto tmp_curl_basis_scalar_ref = af.
buildStaticArray<Scalar,
Cell,
BASIS,
IP>(
"tmp_curl_basis_scalar_ref",num_cells,num_card,num_points);
1656 Kokkos::deep_copy(tmp_curl_basis_scalar_ref.get_view(),tmp_curl_basis_scalar_host);
1659 auto s_aux = Kokkos::subview(tmp_curl_basis_scalar.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1661 auto s_ref = Kokkos::subview(tmp_curl_basis_scalar_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1666 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1667 fst::HDIVtransformDIV(s_aux,s_jac_det,s_ref);
1668#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_IMPL_HIP_UNIFIED_MEMORY)
1671 PHX::ExecutionSpace().fence();
1680 return tmp_curl_basis_scalar;
1686template <
typename Scalar>
1691 const bool force)
const
1700 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getCurlVectorBasis()",bv_get_curl_vec_bv);
1717 auto tmp_weighted_curl_basis_vector = af.
buildStaticArray<Scalar,
Cell,
BASIS,
IP,
Dim>(
"weighted_curl_basis_vector", num_cells, num_card, num_points, num_dim);
1720 auto s_aux = Kokkos::subview(tmp_weighted_curl_basis_vector.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1721 auto s_cw = Kokkos::subview(
cubature_weights_.get_view(), cell_range, Kokkos::ALL());
1722 auto s_bv = Kokkos::subview(bv.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1724 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1725 fst::multiplyMeasure(s_aux, s_cw, s_bv);
1730 return tmp_weighted_curl_basis_vector;
1735 TEUCHOS_ASSERT(num_dim == 3);
1744 auto cell_curl_basis_ref_vector = af.
buildStaticArray<Scalar,
BASIS,
IP,
Dim>(
"cell_curl_basis_ref_vector",num_card,num_points,num_dim);
1747 intrepid_basis->getValues(cell_curl_basis_ref_vector.get_view(),cubature_points_uniform_ref,Intrepid2::OPERATOR_CURL);
1750 auto s_aux = Kokkos::subview(tmp_curl_basis_vector.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1751 auto s_jac = Kokkos::subview(
cubature_jacobian_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1754 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1755 fst::HCURLtransformCURL(s_aux, s_jac, s_jac_det,cell_curl_basis_ref_vector.get_view());
1756 PHX::ExecutionSpace().fence();
1770#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_IMPL_HIP_UNIFIED_MEMORY)
1771#ifdef KOKKOS_ENABLE_CUDA
1772 if constexpr (std::is_same<Kokkos::CudaUVMSpace,
typename decltype(tmp_curl_basis_vector.get_view())::memory_space>::value) {
1774 if constexpr (std::is_same<Kokkos::HIPSpace,
typename decltype(tmp_curl_basis_vector.get_view())::memory_space>::value) {
1776 auto cubature_points_ref_host = Kokkos::create_mirror(Kokkos::HostSpace{},
cubature_points_ref_.get_view());
1778 auto tmp_curl_basis_vector_host = Kokkos::create_mirror(Kokkos::HostSpace{},tmp_curl_basis_vector.get_view());
1782 auto my_cell_curl_basis_host = Kokkos::subview(tmp_curl_basis_vector_host,cell,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL());
1783 auto my_cell_cub_points_ref_host = Kokkos::subview(cubature_points_ref_host,cell,Kokkos::ALL(),Kokkos::ALL());
1784 intrepid_basis_host->getValues(my_cell_curl_basis_host,my_cell_cub_points_ref_host,Intrepid2::OPERATOR_CURL);
1786 auto tmp_curl_basis_vector_ref = af.
buildStaticArray<Scalar,
Cell,
BASIS,
IP,
Dim>(
"tmp_curl_basis_scalar_ref",num_cells,num_card,num_points,num_dim);
1787 Kokkos::deep_copy(tmp_curl_basis_vector_ref.get_view(),tmp_curl_basis_vector_host);
1790 auto s_aux = Kokkos::subview(tmp_curl_basis_vector.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1791 auto s_jac = Kokkos::subview(
cubature_jacobian_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1793 auto s_ref = Kokkos::subview(tmp_curl_basis_vector_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1795 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1796 fst::HCURLtransformCURL(s_aux, s_jac, s_jac_det, s_ref);
1801 auto tmp_curl_basis_vector_host = Kokkos::create_mirror_view(tmp_curl_basis_vector.get_view());
1805 auto my_cell_curl_basis_host = Kokkos::subview(tmp_curl_basis_vector_host,cell,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL());
1806 auto my_cell_cub_points_ref_host = Kokkos::subview(cubature_points_ref_host,cell,Kokkos::ALL(),Kokkos::ALL());
1807 intrepid_basis_host->getValues(my_cell_curl_basis_host,my_cell_cub_points_ref_host,Intrepid2::OPERATOR_CURL);
1809 auto tmp_curl_basis_vector_ref = af.
buildStaticArray<Scalar,
Cell,
BASIS,
IP,
Dim>(
"tmp_curl_basis_scalar_ref",num_cells,num_card,num_points,num_dim);
1810 Kokkos::deep_copy(tmp_curl_basis_vector_ref.get_view(),tmp_curl_basis_vector_host);
1813 auto s_aux = Kokkos::subview(tmp_curl_basis_vector.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1814 auto s_jac = Kokkos::subview(
cubature_jacobian_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1816 auto s_ref = Kokkos::subview(tmp_curl_basis_vector_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1818 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1819 fst::HCURLtransformCURL(s_aux, s_jac, s_jac_det, s_ref);
1820#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_IMPL_HIP_UNIFIED_MEMORY)
1823 PHX::ExecutionSpace().fence();
1833 return tmp_curl_basis_vector;
1839template <
typename Scalar>
1844 const bool force)
const
1853 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getDevVectorBasis()",bv_get_div_vec_bv);
1869 auto tmp_weighted_div_basis = af.
buildStaticArray<Scalar,
Cell,
BASIS,
IP>(
"weighted_div_basis", num_cells, num_card, num_points);
1872 auto s_aux = Kokkos::subview(tmp_weighted_div_basis.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1873 auto s_cw = Kokkos::subview(
cubature_weights_.get_view(), cell_range, Kokkos::ALL());
1874 auto s_bv = Kokkos::subview(bv.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1876 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1877 fst::multiplyMeasure(s_aux, s_cw, s_bv);
1882 return tmp_weighted_div_basis;
1898 intrepid_basis->getValues(cell_div_basis_ref.get_view(),cubature_points_uniform_ref,Intrepid2::OPERATOR_DIV);
1901 auto s_aux = Kokkos::subview(tmp_div_basis.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1904 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1905 fst::HDIVtransformDIV(s_aux,s_jac_det,cell_div_basis_ref.get_view());
1906 PHX::ExecutionSpace().fence();
1920#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_IMPL_HIP_UNIFIED_MEMORY)
1921#ifdef KOKKOS_ENABLE_CUDA
1922 if constexpr (std::is_same<Kokkos::CudaUVMSpace,
typename decltype(tmp_div_basis.get_view())::memory_space>::value) {
1924 if constexpr (std::is_same<Kokkos::HIPSpace,
typename decltype(tmp_div_basis.get_view())::memory_space>::value) {
1926 auto cubature_points_ref_host = Kokkos::create_mirror(Kokkos::HostSpace{},
cubature_points_ref_.get_view());
1928 auto tmp_div_basis_host = Kokkos::create_mirror(Kokkos::HostSpace{},tmp_div_basis.get_view());
1932 auto my_cell_div_basis_host = Kokkos::subview(tmp_div_basis_host,cell,Kokkos::ALL(),Kokkos::ALL());
1933 auto my_cell_cub_points_ref_host = Kokkos::subview(cubature_points_ref_host,cell,Kokkos::ALL(),Kokkos::ALL());
1934 intrepid_basis_host->getValues(my_cell_div_basis_host,my_cell_cub_points_ref_host,Intrepid2::OPERATOR_DIV);
1937 Kokkos::deep_copy(tmp_div_basis_ref.get_view(),tmp_div_basis_host);
1940 auto s_aux = Kokkos::subview(tmp_div_basis.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1942 auto s_ref = Kokkos::subview(tmp_div_basis_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1944 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1945 fst::HDIVtransformDIV(s_aux,s_jac_det,s_ref);
1950 auto tmp_div_basis_host = Kokkos::create_mirror_view(tmp_div_basis.get_view());
1954 auto my_cell_div_basis_host = Kokkos::subview(tmp_div_basis_host,cell,Kokkos::ALL(),Kokkos::ALL());
1955 auto my_cell_cub_points_ref_host = Kokkos::subview(cubature_points_ref_host,cell,Kokkos::ALL(),Kokkos::ALL());
1956 intrepid_basis_host->getValues(my_cell_div_basis_host,my_cell_cub_points_ref_host,Intrepid2::OPERATOR_DIV);
1959 Kokkos::deep_copy(tmp_div_basis_ref.get_view(),tmp_div_basis_host);
1962 auto s_aux = Kokkos::subview(tmp_div_basis.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1964 auto s_ref = Kokkos::subview(tmp_div_basis_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1966 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1967 fst::HDIVtransformDIV(s_aux,s_jac_det,s_ref);
1968#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_IMPL_HIP_UNIFIED_MEMORY)
1971 PHX::ExecutionSpace().fence();
1981 return tmp_div_basis;
#define PANZER_CACHE_DATA(name)
PHX::MDField< const Scalar, Cell, BASIS, IP > ConstArray_CellBasisIP
Array_CellBasisIP weighted_div_basis
Teuchos::RCP< const panzer::BasisIRLayout > basis_layout
ConstArray_BasisIP getCurl2DVectorBasisRef(const bool cache=true, const bool force=false) const
Get the curl of a vector basis evaluated at reference points.
Array_CellBasisIP basis_scalar
bool weighted_div_basis_evaluated_
Array_BasisIPDim grad_basis_ref
BasisValues2(const std::string &prefix="", const bool allocArrays=false, const bool buildWeighted=false)
Main constructor.
PHX::MDField< const Scalar, Cell, IP > cubature_jacobian_determinant_
Array_CellBasisIPDim weighted_curl_basis_vector
ConstArray_CellBasisIP getDivVectorBasis(const bool weighted, const bool cache=true, const bool force=false) const
Get the divergence of a vector basis evaluated at mesh points.
bool grad_basis_evaluated_
Array_BasisIP curl_basis_ref_scalar
Array_BasisDim basis_coordinates_ref
void evaluateValuesCV(const PHX::MDField< Scalar, Cell, IP, Dim > &cell_cub_points, const PHX::MDField< Scalar, Cell, IP, Dim, Dim > &jac, const PHX::MDField< Scalar, Cell, IP > &jac_det, const PHX::MDField< Scalar, Cell, IP, Dim, Dim > &jac_inv)
ConstArray_BasisIPDim getGradBasisValuesRef(const bool cache=true, const bool force=false) const
Get the gradient of the basis evaluated at reference points.
bool curl_basis_vector_evaluated_
Array_CellBasisIP weighted_curl_basis_scalar
bool basis_coordinates_evaluated_
ConstArray_BasisIPDim getVectorBasisValuesRef(const bool cache=true, const bool force=false) const
Get the vector basis values evaluated at reference points.
Array_CellBasisIPDim weighted_grad_basis
void setCellNodeCoordinates(PHX::MDField< Scalar, Cell, NODE, Dim > node_coordinates)
Set the cell node coordinates (required for getBasisCoordinates()).
bool orientations_applied_
bool basis_vector_evaluated_
PureBasis::EElementSpace getElementSpace() const
bool weighted_curl_basis_scalar_evaluated_
bool curl_basis_ref_scalar_evaluated_
Array_CellBasisIPDim curl_basis_vector
bool div_basis_ref_evaluated_
ConstArray_CellBasisIPDim getCurlVectorBasis(const bool weighted, const bool cache=true, const bool force=false) const
Get the curl of a 3D vector basis evaluated at mesh points.
int num_orientations_cells_
void evaluateBasisCoordinates(const PHX::MDField< Scalar, Cell, NODE, Dim > &node_coordinates, const int in_num_cells=-1)
Array_CellBasisIP curl_basis_scalar
bool weighted_basis_vector_evaluated_
bool weighted_grad_basis_evaluated_
void setup(const Teuchos::RCP< const panzer::BasisIRLayout > &basis, PHX::MDField< const Scalar, Cell, IP, Dim > reference_points, PHX::MDField< const Scalar, Cell, IP, Dim, Dim > point_jacobian, PHX::MDField< const Scalar, Cell, IP > point_jacobian_determinant, PHX::MDField< const Scalar, Cell, IP, Dim, Dim > point_jacobian_inverse, const int num_evaluated_cells=-1)
Setup for lazy evaluation for non-uniform point layout.
const std::vector< PHX::index_size_type > & getExtendedDimensions() const
Get the extended dimensions used by sacado AD allocations.
bool basis_ref_vector_evaluated_
ConstArray_CellBasisIP getBasisValues(const bool weighted, const bool cache=true, const bool force=false) const
Get the basis values evaluated at mesh points.
bool div_basis_evaluated_
ConstArray_BasisIP getBasisValuesRef(const bool cache=true, const bool force=false) const
Get the basis values evaluated at reference points.
PHX::MDField< const Scalar, BASIS, IP, Dim > ConstArray_BasisIPDim
bool grad_basis_ref_evaluated_
bool basis_coordinates_ref_evaluated_
Teuchos::RCP< const shards::CellTopology > cell_topology_
void setOrientations(const std::vector< Intrepid2::Orientation > &orientations, const int num_orientations_cells=-1)
Set the orientations object for applying orientations using the lazy evaluation path - required for c...
void evaluateValues(const PHX::MDField< Scalar, IP, Dim > &cub_points, const PHX::MDField< Scalar, Cell, IP, Dim, Dim > &jac, const PHX::MDField< Scalar, Cell, IP > &jac_det, const PHX::MDField< Scalar, Cell, IP, Dim, Dim > &jac_inv, const int in_num_cells=-1)
Array_BasisIPDim curl_basis_ref_vector
std::vector< PHX::index_size_type > ddims_
PHX::MDField< const Scalar, IP, Dim > cubature_points_uniform_ref_
Array_BasisIP div_basis_ref
ConstArray_CellBasisIPDim getGradBasisValues(const bool weighted, const bool cache=true, const bool force=false) const
Get the gradient of the basis evaluated at mesh points.
bool hasUniformReferenceSpace() const
Check if reference point space is uniform across all cells (faster evaluation).
PHX::MDField< const Scalar, Cell, IP, Dim > cubature_points_ref_
bool curl_basis_ref_vector_evaluated_
Array_CellBasisIP div_basis
PHX::MDField< const Scalar, Cell, BASIS, IP, Dim > ConstArray_CellBasisIPDim
bool weighted_basis_scalar_evaluated_
void setWeightedMeasure(PHX::MDField< const Scalar, Cell, IP > weighted_measure)
Set the cubature weights (weighted measure) for the basis values object - required to get weighted ba...
Array_CellBasisIPDim basis_vector
ConstArray_BasisDim getBasisCoordinatesRef(const bool cache=true, const bool force=false) const
Get the reference coordinates for basis.
Array_CellBasisDim basis_coordinates
bool weighted_curl_basis_vector_evaluated_
PHX::MDField< const Scalar, Cell, IP, Dim, Dim > cubature_jacobian_inverse_
ConstArray_CellBasisIP getCurl2DVectorBasis(const bool weighted, const bool cache=true, const bool force=false) const
Get the curl of a 2D vector basis evaluated at mesh points.
PHX::MDField< const Scalar, BASIS, IP > ConstArray_BasisIP
bool references_evaluated
Array_BasisIPDim basis_ref_vector
panzer::BasisDescriptor getBasisDescriptor() const
Return the basis descriptor.
ConstArray_BasisIPDim getCurlVectorBasisRef(const bool cache=true, const bool force=false) const
Get the curl of a vector basis evaluated at reference points.
Array_BasisIP basis_ref_scalar
bool basis_ref_scalar_evaluated_
Used to check if arrays have been cached.
Teuchos::RCP< IntrepidBasis > intrepid_basis
ConstArray_CellBasisDim getBasisCoordinates(const bool cache=true, const bool force=false) const
Carterisan coordinates for basis coefficients in mesh space.
PHX::MDField< const Scalar, Cell, IP > cubature_weights_
bool curl_basis_scalar_evaluated_
Array_CellBasisIPDim grad_basis
void setupArrays(const Teuchos::RCP< const panzer::BasisIRLayout > &basis, bool computeDerivatives=true)
Sizes/allocates memory for arrays.
void setupUniform(const Teuchos::RCP< const panzer::BasisIRLayout > &basis, PHX::MDField< const Scalar, IP, Dim > reference_points, PHX::MDField< const Scalar, Cell, IP, Dim, Dim > point_jacobian, PHX::MDField< const Scalar, Cell, IP > point_jacobian_determinant, PHX::MDField< const Scalar, Cell, IP, Dim, Dim > point_jacobian_inverse, const int num_evaluated_cells=-1)
Setup for lazy evaluation for uniform point layout.
Array_CellBasisIP weighted_basis_scalar
Intrepid2::Basis< PHX::Device, Scalar, Scalar > IntrepidBasis
PHX::MDField< const Scalar, Cell, BASIS, Dim > ConstArray_CellBasisDim
PHX::MDField< const Scalar, Cell, NODE, Dim > cell_node_coordinates_
Array_CellBasisIPDim weighted_basis_vector
PHX::MDField< const Scalar, Cell, IP, Dim, Dim > cubature_jacobian_
ConstArray_CellBasisIPDim getVectorBasisValues(const bool weighted, const bool cache=true, const bool force=false) const
Get the vector basis values evaluated at mesh points.
std::vector< Intrepid2::Orientation > orientations_
ConstArray_BasisIP getDivVectorBasisRef(const bool cache=true, const bool force=false) const
Get the divergence of a vector basis evaluated at reference points.
void applyOrientations(const PHX::MDField< const Scalar, Cell, BASIS > &orientations)
Method to apply orientations to a basis values container.
bool basis_scalar_evaluated_
PHX::MDField< const Scalar, BASIS, Dim > ConstArray_BasisDim
PHX::MDField< Scalar, T0 > buildStaticArray(const std::string &str, int d0) const