43 #include "PanzerDiscFE_config.hpp"
47 #include "Kokkos_ViewFactory.hpp"
50 #include "Intrepid2_Utils.hpp"
51 #include "Intrepid2_FunctionSpaceTools.hpp"
52 #include "Intrepid2_Orientation.hpp"
53 #include "Intrepid2_OrientationTools.hpp"
56 #include "Phalanx_GetNonConstDynRankViewFromConstMDField.hpp"
61 template<
typename Scalar>
63 applyOrientationsImpl(
const int num_cells,
64 Kokkos::DynRankView<Scalar, PHX::Device> view,
65 Kokkos::DynRankView<Intrepid2::Orientation, PHX::Device> orientations,
66 const typename BasisValues2<Scalar>::IntrepidBasis & basis)
68 using ots=Intrepid2::OrientationTools<PHX::Device>;
70 auto sub_orientations = Kokkos::subview(orientations, std::make_pair(0,num_cells));
75 auto sub_view = Kokkos::subview(view, std::make_pair(0,num_cells), Kokkos::ALL(), Kokkos::ALL());
76 auto sub_view_clone =
Kokkos::createDynRankView(view,
"sub_view_clone", sub_view.extent(0), sub_view.extent(1), sub_view.extent(2));
77 Kokkos::deep_copy(sub_view_clone, sub_view);
80 ots::modifyBasisByOrientation(sub_view, sub_view_clone, sub_orientations, &basis);
81 }
else if (view.rank() == 4){
83 auto sub_view = Kokkos::subview(view, std::make_pair(0,num_cells), Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
84 auto sub_view_clone =
Kokkos::createDynRankView(view,
"sub_view_clone", sub_view.extent(0), sub_view.extent(1), sub_view.extent(2), sub_view.extent(3));
85 Kokkos::deep_copy(sub_view_clone, sub_view);
88 ots::modifyBasisByOrientation(sub_view, sub_view_clone, sub_orientations, &basis);
90 throw std::logic_error(
"applyOrientationsImpl : Unknown view of rank " + std::to_string(view.rank()));
93 template<
typename Scalar>
95 applyOrientationsImpl(
const int num_cells,
96 Kokkos::DynRankView<Scalar, PHX::Device> view,
97 const std::vector<Intrepid2::Orientation> & orientations,
98 const typename BasisValues2<Scalar>::IntrepidBasis & basis)
102 Kokkos::DynRankView<Intrepid2::Orientation,PHX::Device> device_orientations(
"drv_orts", num_cells);
103 auto host_orientations = Kokkos::create_mirror_view(device_orientations);
104 for(
int i=0; i < num_cells; ++i)
105 host_orientations(i) = orientations[i];
106 Kokkos::deep_copy(device_orientations,host_orientations);
109 applyOrientationsImpl(num_cells, view, device_orientations, basis);
115 template <
typename Scalar>
118 const bool allocArrays,
119 const bool buildWeighted)
120 : compute_derivatives(true)
121 , build_weighted(buildWeighted)
122 , alloc_arrays(allocArrays)
125 , references_evaluated(false)
126 , orientations_applied_(false)
128 , num_evaluate_cells_(0)
130 , num_orientations_cells_(0)
156 template <
typename Scalar>
162 const int in_num_cells)
164 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::evaluateValues(5 arg)",bv_ev_5);
166 build_weighted =
false;
168 setupUniform(basis_layout, cub_points, jac, jac_det, jac_inv, in_num_cells);
170 const auto elmtspace = getElementSpace();
171 const int num_dims = jac.extent(2);
175 getBasisValuesRef(
true,
true);
178 getVectorBasisValuesRef(
true,
true);
181 getGradBasisValuesRef(
true,
true);
185 getCurl2DVectorBasisRef(
true,
true);
186 else if(num_dims == 3)
187 getCurlVectorBasisRef(
true,
true);
191 getDivVectorBasisRef(
true,
true);
193 references_evaluated =
true;
197 getBasisValues(
false,
true,
true);
200 getVectorBasisValues(
false,
true,
true);
203 getGradBasisValues(
false,
true,
true);
207 getCurl2DVectorBasis(
false,
true,
true);
208 else if(num_dims == 3)
209 getCurlVectorBasis(
false,
true,
true);
213 getDivVectorBasis(
false,
true,
true);
216 orientations_applied_ = (orientations_.size()>0);
219 template <
typename Scalar>
227 bool use_node_coordinates,
228 const int in_num_cells)
230 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::evaluateValues(8 arg, uniform cub pts)",bv_ev_8u);
233 evaluateValues(cub_points, jac, jac_det, jac_inv, in_num_cells);
234 if(weighted_measure.size() > 0)
235 setWeightedMeasure(weighted_measure);
237 cell_node_coordinates_ = node_coordinates;
241 const auto elmtspace = getElementSpace();
242 const int num_dims = jac.extent(2);
245 getBasisValues(
true,
true,
true);
248 getVectorBasisValues(
true,
true,
true);
251 getGradBasisValues(
true,
true,
true);
255 getCurl2DVectorBasis(
true,
true,
true);
256 else if(num_dims == 3)
257 getCurlVectorBasis(
true,
true,
true);
261 getDivVectorBasis(
true,
true,
true);
264 if(use_node_coordinates){
265 getBasisCoordinatesRef(
true,
true);
266 getBasisCoordinates(
true,
true);
270 orientations_applied_ = (orientations_.size()>0);
273 template <
typename Scalar>
281 bool use_node_coordinates,
282 const int in_num_cells)
284 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::evaluateValues(8 arg,nonuniform cub pts)",bv_ev_8nu);
286 cell_node_coordinates_ = node_coordinates;
288 setup(basis_layout, cub_points, jac, jac_det, jac_inv, in_num_cells);
289 if(weighted_measure.size() > 0)
290 setWeightedMeasure(weighted_measure);
292 const auto elmtspace = getElementSpace();
293 const int num_dims = jac.extent(2);
296 getBasisValues(
false,
true,
true);
297 if(build_weighted) getBasisValues(
true,
true,
true);
301 getVectorBasisValues(
false,
true,
true);
302 if(build_weighted) getVectorBasisValues(
true,
true,
true);
306 getGradBasisValues(
false,
true,
true);
307 if(build_weighted) getGradBasisValues(
true,
true,
true);
312 getCurl2DVectorBasis(
false,
true,
true);
313 if(build_weighted) getCurl2DVectorBasis(
true,
true,
true);
314 }
else if(num_dims == 3) {
315 getCurlVectorBasis(
false,
true,
true);
316 if(build_weighted) getCurlVectorBasis(
true,
true,
true);
321 getDivVectorBasis(
false,
true,
true);
322 if(build_weighted) getDivVectorBasis(
true,
true,
true);
326 if(use_node_coordinates){
327 getBasisCoordinatesRef(
true,
true);
328 getBasisCoordinates(
true,
true);
332 orientations_applied_ = (orientations_.size()>0);
335 template <
typename Scalar>
342 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::evaluateValuesCV(5 arg)",bv_ev_cv_5);
346 evaluateValues(cub_points,jac,jac_det,jac_inv,weighted_measure,node_coordinates,
false,jac.extent(0));
349 template <
typename Scalar>
356 bool use_node_coordinates,
357 const int in_num_cells)
359 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::evaluateValuesCV(7 arg)",bv_ev_cv_7);
361 evaluateValues(cell_cub_points,jac,jac_det,jac_inv,weighted_measure,node_coordinates,use_node_coordinates,in_num_cells);
364 template <
typename Scalar>
367 const int in_num_cells)
369 num_evaluate_cells_ = in_num_cells < 0 ? node_coordinates.extent(0) : in_num_cells;
370 cell_node_coordinates_ = node_coordinates;
372 getBasisCoordinates(
true,
true);
376 template <
typename Scalar>
379 const int in_num_cells)
381 if (!intrepid_basis->requireOrientation())
384 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::applyOrientations()",bv_ev_app_orts);
391 const int num_cell_basis_layout = in_num_cells < 0 ? basis_layout->numCells() : in_num_cells;
392 const int num_cell_orientation = orientations.size();
393 const int num_cells = num_cell_basis_layout < num_cell_orientation ? num_cell_basis_layout : num_cell_orientation;
394 const int num_dim = basis_layout->dimension();
397 Kokkos::DynRankView<Intrepid2::Orientation,PHX::Device> device_orientations(
"device_orientations", num_cells);
398 auto host_orientations = Kokkos::create_mirror_view(device_orientations);
399 for(
int i=0; i < num_cells; ++i)
400 host_orientations(i) = orientations[i];
401 Kokkos::deep_copy(device_orientations,host_orientations);
404 applyOrientationsImpl<Scalar>(num_cells, basis_scalar.get_view(), device_orientations, *intrepid_basis);
405 if(build_weighted) applyOrientationsImpl<Scalar>(num_cells, weighted_basis_scalar.get_view(), device_orientations, *intrepid_basis);
406 if(compute_derivatives) applyOrientationsImpl<Scalar>(num_cells, grad_basis.get_view(), device_orientations, *intrepid_basis);
407 if(compute_derivatives and build_weighted) applyOrientationsImpl<Scalar>(num_cells, weighted_grad_basis.get_view(), device_orientations, *intrepid_basis);
411 applyOrientationsImpl<Scalar>(num_cells, basis_vector.get_view(), device_orientations, *intrepid_basis);
412 if(build_weighted) applyOrientationsImpl<Scalar>(num_cells, weighted_basis_vector.get_view(), device_orientations, *intrepid_basis);
414 if(compute_derivatives) applyOrientationsImpl<Scalar>(num_cells, curl_basis_scalar.get_view(), device_orientations, *intrepid_basis);
415 if(compute_derivatives and build_weighted) applyOrientationsImpl<Scalar>(num_cells, weighted_curl_basis_scalar.get_view(), device_orientations, *intrepid_basis);
418 if(compute_derivatives) applyOrientationsImpl<Scalar>(num_cells, curl_basis_vector.get_view(), device_orientations, *intrepid_basis);
419 if(compute_derivatives and build_weighted) applyOrientationsImpl<Scalar>(num_cells, weighted_curl_basis_vector.get_view(), device_orientations, *intrepid_basis);
424 applyOrientationsImpl<Scalar>(num_cells, basis_vector.get_view(), device_orientations, *intrepid_basis);
425 if(build_weighted) applyOrientationsImpl<Scalar>(num_cells, weighted_basis_vector.get_view(), device_orientations, *intrepid_basis);
426 if(compute_derivatives) applyOrientationsImpl<Scalar>(num_cells, div_basis.get_view(), device_orientations, *intrepid_basis);
427 if(compute_derivatives and build_weighted) applyOrientationsImpl<Scalar>(num_cells, weighted_div_basis.get_view(), device_orientations, *intrepid_basis);
430 orientations_applied_ =
true;
434 template <
typename Scalar>
441 template <
typename Scalar>
443 {
return basis_layout->getBasis()->getElementSpace(); }
445 template <
typename Scalar>
448 bool computeDerivatives)
452 compute_derivatives = computeDerivatives;
453 basis_layout = layout;
454 num_cells_ = basis_layout->
numCells();
461 int numcells = basisDesc->
numCells();
465 intrepid_basis = basisDesc->
getIntrepid2Basis<PHX::Device::execution_space,Scalar,Scalar>();
480 weighted_basis_scalar = af.
buildStaticArray<Scalar,Cell,BASIS,IP>(
"weighted_basis",numcells,card,num_quad);
485 if(compute_derivatives) {
486 grad_basis_ref = af.
buildStaticArray<Scalar,BASIS,IP,
Dim>(
"grad_basis_ref",card,num_quad,dim);
487 grad_basis = af.
buildStaticArray<Scalar,Cell,BASIS,IP,Dim>(
"grad_basis",numcells,card,num_quad,dim);
490 weighted_grad_basis = af.
buildStaticArray<Scalar,Cell,BASIS,IP,Dim>(
"weighted_grad_basis",numcells,card,num_quad,dim);
505 basis_vector = af.
buildStaticArray<Scalar,
Cell,BASIS,IP,Dim>(
"basis",numcells,card,num_quad,dim);
508 weighted_basis_vector = af.
buildStaticArray<Scalar,Cell,BASIS,IP,Dim>(
"weighted_basis",numcells,card,num_quad,dim);
518 if(compute_derivatives) {
521 curl_basis_ref_scalar = af.
buildStaticArray<Scalar,BASIS,IP>(
"curl_basis_ref",card,num_quad);
522 curl_basis_scalar = af.
buildStaticArray<Scalar,Cell,BASIS,IP>(
"curl_basis",numcells,card,num_quad);
525 weighted_curl_basis_scalar = af.
buildStaticArray<Scalar,Cell,BASIS,IP>(
"weighted_curl_basis",numcells,card,num_quad);
528 curl_basis_ref_vector = af.
buildStaticArray<Scalar,BASIS,IP,Dim>(
"curl_basis_ref",card,num_quad,dim);
529 curl_basis_vector = af.
buildStaticArray<Scalar,Cell,BASIS,IP,Dim>(
"curl_basis",numcells,card,num_quad,dim);
532 weighted_curl_basis_vector = af.
buildStaticArray<Scalar,Cell,BASIS,IP,Dim>(
"weighted_curl_basis",numcells,card,num_quad,dim);
544 basis_vector = af.
buildStaticArray<Scalar,
Cell,BASIS,IP,Dim>(
"basis",numcells,card,num_quad,dim);
547 weighted_basis_vector = af.
buildStaticArray<Scalar,Cell,BASIS,IP,Dim>(
"weighted_basis",numcells,card,num_quad,dim);
562 if(compute_derivatives) {
563 div_basis_ref = af.
buildStaticArray<Scalar,BASIS,IP>(
"div_basis_ref",card,num_quad);
564 div_basis = af.
buildStaticArray<Scalar,Cell,BASIS,IP>(
"div_basis",numcells,card,num_quad);
567 weighted_div_basis = af.
buildStaticArray<Scalar,Cell,BASIS,IP>(
"weighted_div_basis",numcells,card,num_quad);
579 weighted_basis_scalar = af.
buildStaticArray<Scalar,Cell,BASIS,IP>(
"weighted_basis",numcells,card,num_quad);
599 basis_coordinates = af.
buildStaticArray<Scalar,
Cell,BASIS,Dim>(
"basis_coordinates",numcells,card,dim);
607 template <
typename Scalar>
615 const int num_evaluated_cells)
617 basis_layout = basis;
618 intrepid_basis = basis->
getBasis()->getIntrepid2Basis<PHX::Device::execution_space,Scalar,Scalar>();
620 num_cells_ = basis_layout->numCells();
621 num_evaluate_cells_ = num_evaluated_cells >= 0 ? num_evaluated_cells : num_cells_;
622 build_weighted =
false;
625 cubature_points_ref_ = reference_points;
626 cubature_jacobian_ = point_jacobian;
627 cubature_jacobian_determinant_ = point_jacobian_determinant;
628 cubature_jacobian_inverse_ = point_jacobian_inverse;
634 template <
typename Scalar>
642 const int num_evaluated_cells)
644 basis_layout = basis;
645 intrepid_basis = basis->
getBasis()->getIntrepid2Basis<PHX::Device::execution_space,Scalar,Scalar>();
647 num_cells_ = basis_layout->numCells();
648 num_evaluate_cells_ = num_evaluated_cells >= 0 ? num_evaluated_cells : num_cells_;
649 cubature_points_uniform_ref_ = reference_points;
650 build_weighted =
false;
653 cubature_jacobian_ = point_jacobian;
654 cubature_jacobian_determinant_ = point_jacobian_determinant;
655 cubature_jacobian_inverse_ = point_jacobian_inverse;
661 template <
typename Scalar>
665 const int num_orientations_cells)
667 if(num_orientations_cells < 0)
668 num_orientations_cells_ = num_evaluate_cells_;
670 num_orientations_cells_ = num_orientations_cells;
671 if(orientations.size() == 0){
672 orientations_applied_ =
false;
675 orientations_ = orientations;
676 orientations_applied_ =
true;
682 template <
typename Scalar>
687 cell_node_coordinates_ = node_coordinates;
690 template <
typename Scalar>
693 auto pure_basis = basis_layout->getBasis();
694 return {pure_basis->order(),pure_basis->type()};
697 template <
typename Scalar>
703 basis_ref_scalar_evaluated_ =
false;
704 basis_scalar_evaluated_ =
false;
705 basis_ref_vector_evaluated_ =
false;
706 basis_vector_evaluated_ =
false;
707 grad_basis_ref_evaluated_ =
false;
708 grad_basis_evaluated_ =
false;
709 curl_basis_ref_scalar_evaluated_ =
false;
710 curl_basis_scalar_evaluated_ =
false;
711 curl_basis_ref_vector_evaluated_ =
false;
712 curl_basis_vector_evaluated_ =
false;
713 div_basis_ref_evaluated_ =
false;
714 div_basis_evaluated_ =
false;
715 weighted_basis_scalar_evaluated_ =
false;
716 weighted_basis_vector_evaluated_ =
false;
717 weighted_grad_basis_evaluated_ =
false;
718 weighted_curl_basis_scalar_evaluated_ =
false;
719 weighted_curl_basis_vector_evaluated_ =
false;
720 weighted_div_basis_evaluated_ =
false;
721 basis_coordinates_ref_evaluated_ =
false;
722 basis_coordinates_evaluated_ =
false;
750 template <
typename Scalar>
756 "BasisValues2::setWeightedMeasure : Weighted measure already set. Can only set weighted measure once after setup or setupUniform have beens called.");
757 cubature_weights_ = weighted_measure;
758 build_weighted =
true;
766 #define PANZER_CACHE_DATA(name) \
768 if(name.size()==tmp_##name.size()){ \
769 Kokkos::deep_copy(name.get_view(), tmp_##name.get_view()); \
773 name##_evaluated_ = true; \
776 template <
typename Scalar>
777 typename BasisValues2<Scalar>::ConstArray_BasisDim
780 const bool force)
const
783 if(basis_coordinates_ref_evaluated_ and not force)
784 return basis_coordinates_ref;
786 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getBasisCoordinatesRef()",bv_get_bc_ref);
790 const int num_card = basis_layout->cardinality();
791 const int num_dim = basis_layout->dimension();
793 using coordsScalarType =
typename Intrepid2::Basis<PHX::Device::execution_space,Scalar,Scalar>::scalarType;
794 auto tmp_basis_coordinates_ref = af.
buildStaticArray<coordsScalarType,
BASIS,
Dim>(
"basis_coordinates_ref", num_card, num_dim);
795 intrepid_basis->getDofCoords(tmp_basis_coordinates_ref.get_view());
796 PHX::Device().fence();
801 return tmp_basis_coordinates_ref;
804 template <
typename Scalar>
808 const bool force)
const
811 if(basis_ref_scalar_evaluated_ and not force)
812 return basis_ref_scalar;
814 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getBasisValuesRef()",bv_get_bV_ref);
825 const int num_quad = basis_layout->numPoints();
826 const int num_card = basis_layout->cardinality();
829 auto cubature_points_uniform_ref = PHX::getNonConstDynRankViewFromConstMDField(cubature_points_uniform_ref_);
831 intrepid_basis->getValues(tmp_basis_ref_scalar.get_view(), cubature_points_uniform_ref, Intrepid2::OPERATOR_VALUE);
832 PHX::Device().fence();
837 return tmp_basis_ref_scalar;
840 template <
typename Scalar>
844 const bool force)
const
847 if(basis_ref_vector_evaluated_ and not force)
848 return basis_ref_vector;
850 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getVectorBasisValuesRef()",bv_get_vec_bv_ref);
861 const int num_quad = basis_layout->numPoints();
862 const int num_card = basis_layout->cardinality();
863 const int num_dim = basis_layout->dimension();
866 auto cubature_points_uniform_ref = PHX::getNonConstDynRankViewFromConstMDField(cubature_points_uniform_ref_);
868 intrepid_basis->getValues(tmp_basis_ref_vector.get_view(),cubature_points_uniform_ref,Intrepid2::OPERATOR_VALUE);
869 PHX::Device().fence();
874 return tmp_basis_ref_vector;
877 template <
typename Scalar>
881 const bool force)
const
884 if(grad_basis_ref_evaluated_ and not force)
885 return grad_basis_ref;
887 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getGradBasisValuesRef()",bv_get_grad_bv_ref);
898 const int num_quad = basis_layout->numPoints();
899 const int num_card = basis_layout->cardinality();
900 const int num_dim = basis_layout->dimension();
903 auto cubature_points_uniform_ref = PHX::getNonConstDynRankViewFromConstMDField(cubature_points_uniform_ref_);
905 intrepid_basis->getValues(tmp_grad_basis_ref.get_view(), cubature_points_uniform_ref, Intrepid2::OPERATOR_GRAD);
906 PHX::Device().fence();
911 return tmp_grad_basis_ref;
914 template <
typename Scalar>
918 const bool force)
const
921 if(curl_basis_ref_scalar_evaluated_ and not force)
922 return curl_basis_ref_scalar;
924 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getCurl2DVectorBasisRef()",bv_get_curl2_bv_ref);
936 const int num_quad = basis_layout->numPoints();
937 const int num_card = basis_layout->cardinality();
939 auto tmp_curl_basis_ref_scalar = af.
buildStaticArray<Scalar,
BASIS,
IP>(
"dyn_curl_basis_ref_scalar",num_card,num_quad);
940 auto cubature_points_uniform_ref = PHX::getNonConstDynRankViewFromConstMDField(cubature_points_uniform_ref_);
942 intrepid_basis->getValues(tmp_curl_basis_ref_scalar.get_view(), cubature_points_uniform_ref, Intrepid2::OPERATOR_CURL);
943 PHX::Device().fence();
948 return tmp_curl_basis_ref_scalar;
951 template <
typename Scalar>
955 const bool force)
const
958 if(curl_basis_ref_vector_evaluated_ and not force)
959 return curl_basis_ref_vector;
961 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getCurlVectorBasisRef()",bv_get_curl_vec_bv_ref);
973 const int num_quad = basis_layout->numPoints();
974 const int num_card = basis_layout->cardinality();
975 const int num_dim = basis_layout->dimension();
977 auto tmp_curl_basis_ref_vector = af.
buildStaticArray<Scalar,
BASIS,
IP,
Dim>(
"dyn_curl_basis_ref_vector",num_card,num_quad,num_dim);
978 auto cubature_points_uniform_ref = PHX::getNonConstDynRankViewFromConstMDField(cubature_points_uniform_ref_);
980 intrepid_basis->getValues(tmp_curl_basis_ref_vector.get_view(), cubature_points_uniform_ref, Intrepid2::OPERATOR_CURL);
981 PHX::Device().fence();
986 return tmp_curl_basis_ref_vector;
989 template <
typename Scalar>
993 const bool force)
const
996 if(div_basis_ref_evaluated_ and not force)
997 return div_basis_ref;
999 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getDivVectorBasisRef()",bv_get_div_vec_bv_ref);
1010 const int num_quad = basis_layout->numPoints();
1011 const int num_card = basis_layout->cardinality();
1014 auto cubature_points_uniform_ref = PHX::getNonConstDynRankViewFromConstMDField(cubature_points_uniform_ref_);
1016 intrepid_basis->getValues(tmp_div_basis_ref.get_view(), cubature_points_uniform_ref, Intrepid2::OPERATOR_DIV);
1017 PHX::Device().fence();
1022 return tmp_div_basis_ref;
1025 template <
typename Scalar>
1029 const bool force)
const
1031 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getBasisCoordinates()",bv_get_bc);
1034 if(basis_coordinates_evaluated_ and not force)
1035 return basis_coordinates;
1039 const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1040 const auto s_node_coordinates = Kokkos::subview(cell_node_coordinates_.get_view(),cell_range,Kokkos::ALL(),Kokkos::ALL());
1044 const int num_card = basis_layout->cardinality();
1045 const int num_dim = basis_layout->dimension();
1047 auto tmp_basis_coordinates = af.buildStaticArray<Scalar,
Cell,
BASIS,
IP>(
"basis_coordinates", num_cells_, num_card, num_dim);
1048 auto s_aux = Kokkos::subview(tmp_basis_coordinates.get_view(),cell_range,Kokkos::ALL(),Kokkos::ALL());
1051 auto const_bcr = getBasisCoordinatesRef(
false);
1052 auto bcr = PHX::getNonConstDynRankViewFromConstMDField(const_bcr);
1054 Intrepid2::CellTools<PHX::Device::execution_space> cell_tools;
1055 cell_tools.mapToPhysicalFrame(s_aux, bcr, s_node_coordinates, *cell_topology_);
1056 PHX::Device().fence();
1061 return tmp_basis_coordinates;
1064 template <
typename Scalar>
1069 const bool force)
const
1072 if(weighted_basis_scalar_evaluated_ and not force)
1073 return weighted_basis_scalar;
1075 if(basis_scalar_evaluated_ and not force)
1076 return basis_scalar;
1078 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getBasisValues()",bv_get_bv);
1082 const int num_cells = num_cells_;
1083 const int num_points = basis_layout->numPoints();
1084 const int num_card = basis_layout->cardinality();
1090 const auto bv = getBasisValues(
false, force);
1093 auto tmp_weighted_basis_scalar = af.
buildStaticArray<Scalar,
Cell,
BASIS,
IP>(
"weighted_basis_scalar", num_cells, num_card, num_points);
1095 const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1096 auto s_aux = Kokkos::subview(tmp_weighted_basis_scalar.get_view(),cell_range,Kokkos::ALL(),Kokkos::ALL());
1097 auto s_cw = Kokkos::subview(cubature_weights_.get_view(),cell_range,Kokkos::ALL());
1098 auto s_bv = Kokkos::subview(bv.get_view(),cell_range,Kokkos::ALL(),Kokkos::ALL());
1100 using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1101 fst::multiplyMeasure(s_aux,s_cw,s_bv);
1109 return tmp_weighted_basis_scalar;
1113 const auto element_space = getElementSpace();
1123 if(hasUniformReferenceSpace()){
1125 auto cubature_points_uniform_ref = PHX::getNonConstDynRankViewFromConstMDField(cubature_points_uniform_ref_);
1128 auto cell_basis_ref_scalar = af.
buildStaticArray<Scalar,BASIS,IP>(
"cell_basis_ref_scalar",num_card,num_points);
1129 intrepid_basis->getValues(cell_basis_ref_scalar.get_view(),cubature_points_uniform_ref,Intrepid2::OPERATOR_VALUE);
1131 const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1132 auto s_aux = Kokkos::subview(tmp_basis_scalar.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1135 using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1137 auto s_cjd = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL());
1138 fst::HVOLtransformVALUE(s_aux,s_cjd,cell_basis_ref_scalar.get_view());
1140 fst::HGRADtransformVALUE(s_aux,cell_basis_ref_scalar.get_view());
1142 PHX::Device().fence();
1150 #ifdef KOKKOS_ENABLE_CUDA
1151 if constexpr (std::is_same<Kokkos::CudaUVMSpace,
typename decltype(tmp_basis_scalar.get_view())::memory_space>::value) {
1152 auto cubature_points_ref_host = Kokkos::create_mirror(Kokkos::HostSpace{},cubature_points_ref_.get_view());
1153 Kokkos::deep_copy(cubature_points_ref_host,cubature_points_ref_.get_view());
1154 auto tmp_basis_scalar_host = Kokkos::create_mirror(Kokkos::HostSpace{},tmp_basis_scalar.get_view());
1155 auto intrepid_basis_host = intrepid_basis->getHostBasis();
1157 for(
int cell=0; cell<num_evaluate_cells_; ++cell) {
1158 auto my_cell_basis_host = Kokkos::subview(tmp_basis_scalar_host,cell,Kokkos::ALL(),Kokkos::ALL());
1159 auto my_cell_cub_points_ref_host = Kokkos::subview(cubature_points_ref_host,cell,Kokkos::ALL(),Kokkos::ALL());
1160 intrepid_basis_host->getValues(my_cell_basis_host,my_cell_cub_points_ref_host);
1162 auto tmp_basis_scalar_ref = af.
buildStaticArray<Scalar,Cell,BASIS,IP>(
"tmp_basis_scalar_ref",num_cells,num_card,num_points);
1163 Kokkos::deep_copy(tmp_basis_scalar_ref.get_view(),tmp_basis_scalar_host);
1164 const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1165 auto s_aux = Kokkos::subview(tmp_basis_scalar.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1166 auto s_ref = Kokkos::subview(tmp_basis_scalar_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1168 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1170 auto s_cjd = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL());
1171 fst::HVOLtransformVALUE(s_aux,s_cjd,s_ref);
1173 fst::HGRADtransformVALUE(s_aux,s_ref);
1177 auto cubature_points_ref_host = Kokkos::create_mirror_view(cubature_points_ref_.get_view());
1178 Kokkos::deep_copy(cubature_points_ref_host,cubature_points_ref_.get_view());
1179 auto tmp_basis_scalar_host = Kokkos::create_mirror_view(tmp_basis_scalar.get_view());
1180 auto intrepid_basis_host = intrepid_basis->getHostBasis();
1182 for(
int cell=0; cell<num_evaluate_cells_; ++cell) {
1183 auto my_cell_basis_host = Kokkos::subview(tmp_basis_scalar_host,cell,Kokkos::ALL(),Kokkos::ALL());
1184 auto my_cell_cub_points_ref_host = Kokkos::subview(cubature_points_ref_host,cell,Kokkos::ALL(),Kokkos::ALL());
1185 intrepid_basis_host->getValues(my_cell_basis_host,my_cell_cub_points_ref_host);
1187 auto tmp_basis_scalar_ref = af.
buildStaticArray<Scalar,Cell,BASIS,IP>(
"tmp_basis_scalar_ref",num_cells,num_card,num_points);
1188 Kokkos::deep_copy(tmp_basis_scalar_ref.get_view(),tmp_basis_scalar_host);
1189 const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1190 auto s_aux = Kokkos::subview(tmp_basis_scalar.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1191 auto s_ref = Kokkos::subview(tmp_basis_scalar_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1193 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1195 auto s_cjd = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL());
1196 fst::HVOLtransformVALUE(s_aux,s_cjd,s_ref);
1198 fst::HGRADtransformVALUE(s_aux,s_ref);
1200 #ifdef KOKKOS_ENABLE_CUDA
1203 PHX::Device().fence();
1210 if(orientations_.size() > 0)
1211 applyOrientationsImpl<Scalar>(num_orientations_cells_, tmp_basis_scalar.get_view(), orientations_, *intrepid_basis);
1216 return tmp_basis_scalar;
1222 template <
typename Scalar>
1227 const bool force)
const
1230 if(weighted_basis_vector_evaluated_ and not force)
1231 return weighted_basis_vector;
1233 if(basis_vector_evaluated_ and not force)
1234 return basis_vector;
1236 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getVectorBasisValues()",bv_get_vec_bv);
1240 const int num_cells = num_cells_;
1241 const int num_points = basis_layout->numPoints();
1242 const int num_card = basis_layout->cardinality();
1243 const int num_dim = basis_layout->dimension();
1250 const auto bv = getVectorBasisValues(
false, force);
1253 auto tmp_weighted_basis_vector = af.
buildStaticArray<Scalar,
Cell,
BASIS,
IP,
Dim>(
"weighted_basis_vector", num_cells, num_card, num_points, num_dim);
1255 const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1256 auto s_aux = Kokkos::subview(tmp_weighted_basis_vector.get_view(),cell_range,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL());
1257 auto s_cw = Kokkos::subview(cubature_weights_.get_view(),cell_range,Kokkos::ALL());
1258 auto s_bv = Kokkos::subview(bv.get_view(),cell_range,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL());
1260 using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1261 fst::multiplyMeasure(s_aux, s_cw, s_bv);
1266 return tmp_weighted_basis_vector;
1270 const auto element_space = getElementSpace();
1278 TEUCHOS_ASSERT(cubature_jacobian_.size() > 0 && cubature_jacobian_determinant_.size() > 0);
1283 if(hasUniformReferenceSpace()){
1285 auto cubature_points_uniform_ref = PHX::getNonConstDynRankViewFromConstMDField(cubature_points_uniform_ref_);
1288 auto cell_basis_ref_vector = af.
buildStaticArray<Scalar,BASIS,IP,Dim>(
"cell_basis_ref_scalar",num_card,num_points,num_dim);
1289 intrepid_basis->getValues(cell_basis_ref_vector.get_view(),cubature_points_uniform_ref,Intrepid2::OPERATOR_VALUE);
1291 const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1292 auto s_aux = Kokkos::subview(tmp_basis_vector.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1295 using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1297 auto s_jac_inv = Kokkos::subview(cubature_jacobian_inverse_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1298 fst::HCURLtransformVALUE(s_aux,s_jac_inv,cell_basis_ref_vector.get_view());
1300 auto s_jac = Kokkos::subview(cubature_jacobian_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1301 auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL());
1302 fst::HDIVtransformVALUE(s_aux,s_jac, s_jac_det, cell_basis_ref_vector.get_view());
1304 PHX::Device().fence();
1313 #ifdef KOKKOS_ENABLE_CUDA
1314 if constexpr (std::is_same<Kokkos::CudaUVMSpace,
typename decltype(tmp_basis_vector.get_view())::memory_space>::value) {
1315 auto cubature_points_ref_host = Kokkos::create_mirror(Kokkos::HostSpace{},cubature_points_ref_.get_view());
1316 Kokkos::deep_copy(cubature_points_ref_host,cubature_points_ref_.get_view());
1317 auto tmp_basis_vector_host = Kokkos::create_mirror(Kokkos::HostSpace{},tmp_basis_vector.get_view());
1319 auto intrepid_basis_host = intrepid_basis->getHostBasis();
1320 for(
int cell=0; cell<num_evaluate_cells_; ++cell) {
1321 auto my_cell_basis_host = Kokkos::subview(tmp_basis_vector_host,cell,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL());
1322 auto my_cell_cub_points_ref_host = Kokkos::subview(cubature_points_ref_host,cell,Kokkos::ALL(),Kokkos::ALL());
1323 intrepid_basis_host->getValues(my_cell_basis_host,my_cell_cub_points_ref_host);
1325 auto tmp_basis_vector_ref = af.
buildStaticArray<Scalar,Cell,BASIS,IP,Dim>(
"tmp_basis_vector_ref",num_cells,num_card,num_points,num_dim);
1326 Kokkos::deep_copy(tmp_basis_vector_ref.get_view(),tmp_basis_vector_host);
1328 const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1329 auto s_aux = Kokkos::subview(tmp_basis_vector.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1330 auto s_ref = Kokkos::subview(tmp_basis_vector_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1332 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1334 auto s_jac_inv = Kokkos::subview(cubature_jacobian_inverse_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1335 fst::HCURLtransformVALUE(s_aux,s_jac_inv,s_ref);
1337 auto s_jac = Kokkos::subview(cubature_jacobian_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1338 auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL());
1339 fst::HDIVtransformVALUE(s_aux,s_jac, s_jac_det, s_ref);
1343 auto cubature_points_ref_host = Kokkos::create_mirror_view(cubature_points_ref_.get_view());
1344 Kokkos::deep_copy(cubature_points_ref_host,cubature_points_ref_.get_view());
1345 auto tmp_basis_vector_host = Kokkos::create_mirror_view(tmp_basis_vector.get_view());
1347 auto intrepid_basis_host = intrepid_basis->getHostBasis();
1348 for(
int cell=0; cell<num_evaluate_cells_; ++cell) {
1349 auto my_cell_basis_host = Kokkos::subview(tmp_basis_vector_host,cell,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL());
1350 auto my_cell_cub_points_ref_host = Kokkos::subview(cubature_points_ref_host,cell,Kokkos::ALL(),Kokkos::ALL());
1351 intrepid_basis_host->getValues(my_cell_basis_host,my_cell_cub_points_ref_host);
1353 auto tmp_basis_vector_ref = af.
buildStaticArray<Scalar,Cell,BASIS,IP,Dim>(
"tmp_basis_vector_ref",num_cells,num_card,num_points,num_dim);
1354 Kokkos::deep_copy(tmp_basis_vector_ref.get_view(),tmp_basis_vector_host);
1356 const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1357 auto s_aux = Kokkos::subview(tmp_basis_vector.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1358 auto s_ref = Kokkos::subview(tmp_basis_vector_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1360 using fst=Intrepid2::FunctionSpaceTools<PHX::Device>;
1362 auto s_jac_inv = Kokkos::subview(cubature_jacobian_inverse_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1363 fst::HCURLtransformVALUE(s_aux,s_jac_inv,s_ref);
1365 auto s_jac = Kokkos::subview(cubature_jacobian_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1366 auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL());
1367 fst::HDIVtransformVALUE(s_aux,s_jac, s_jac_det, s_ref);
1369 #ifdef KOKKOS_ENABLE_CUDA
1372 PHX::Device().fence();
1376 if(orientations_.size() > 0)
1377 applyOrientationsImpl<Scalar>(num_orientations_cells_, tmp_basis_vector.get_view(), orientations_, *intrepid_basis);
1382 return tmp_basis_vector;
1388 template <
typename Scalar>
1393 const bool force)
const
1396 if(weighted_grad_basis_evaluated_ and not force)
1397 return weighted_grad_basis;
1399 if(grad_basis_evaluated_ and not force)
1402 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getGradBasisValues()",bv_get_grad_bv);
1406 const int num_cells = num_cells_;
1407 const int num_points = basis_layout->numPoints();
1408 const int num_card = basis_layout->cardinality();
1409 const int num_dim = basis_layout->dimension();
1416 const auto bv = getGradBasisValues(
false, force);
1419 auto tmp_weighted_grad_basis = af.
buildStaticArray<Scalar,
Cell,
BASIS,
IP,
Dim>(
"weighted_grad_basis", num_cells, num_card, num_points, num_dim);
1421 const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1422 auto s_aux = Kokkos::subview(tmp_weighted_grad_basis.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1423 auto s_cw = Kokkos::subview(cubature_weights_.get_view(), cell_range, Kokkos::ALL());
1424 auto s_bv = Kokkos::subview(bv.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1426 using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1427 fst::multiplyMeasure(s_aux,s_cw,s_bv);
1432 return tmp_weighted_grad_basis;
1438 const auto element_space = getElementSpace();
1442 auto tmp_grad_basis = af.
buildStaticArray<Scalar,
Cell,BASIS,IP,Dim>(
"basis_scalar",num_cells,num_card,num_points,num_dim);
1444 if(hasUniformReferenceSpace()){
1446 auto cubature_points_uniform_ref = PHX::getNonConstDynRankViewFromConstMDField(cubature_points_uniform_ref_);
1449 intrepid_basis->getValues(cell_grad_basis_ref.get_view(),cubature_points_uniform_ref,Intrepid2::OPERATOR_GRAD);
1451 const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1452 auto s_aux = Kokkos::subview(tmp_grad_basis.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1453 auto s_jac_inv = Kokkos::subview(cubature_jacobian_inverse_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1456 using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1457 fst::HGRADtransformGRAD(s_aux, s_jac_inv,cell_grad_basis_ref.get_view());
1459 PHX::Device().fence();
1468 #ifdef KOKKOS_ENABLE_CUDA
1469 if constexpr (std::is_same<Kokkos::CudaUVMSpace,
typename decltype(tmp_grad_basis.get_view())::memory_space>::value) {
1470 auto cubature_points_ref_host = Kokkos::create_mirror(Kokkos::HostSpace{},cubature_points_ref_.get_view());
1471 Kokkos::deep_copy(cubature_points_ref_host,cubature_points_ref_.get_view());
1472 auto tmp_grad_basis_host = Kokkos::create_mirror(Kokkos::HostSpace{},tmp_grad_basis.get_view());
1474 auto intrepid_basis_host = intrepid_basis->getHostBasis();
1475 for(
int cell=0; cell<num_evaluate_cells_; ++cell) {
1476 auto my_cell_grad_basis_host = Kokkos::subview(tmp_grad_basis_host,cell,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL());
1477 auto my_cell_cub_points_ref_host = Kokkos::subview(cubature_points_ref_host,cell,Kokkos::ALL(),Kokkos::ALL());
1478 intrepid_basis_host->getValues(my_cell_grad_basis_host,my_cell_cub_points_ref_host,Intrepid2::OPERATOR_GRAD);
1480 auto tmp_grad_basis_ref = af.
buildStaticArray<Scalar,Cell,BASIS,IP,Dim>(
"tmp_grad_basis_ref",num_cells,num_card,num_points,num_dim);
1481 Kokkos::deep_copy(tmp_grad_basis_ref.get_view(),tmp_grad_basis_host);
1483 const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1484 auto s_aux = Kokkos::subview(tmp_grad_basis.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1485 auto s_jac_inv = Kokkos::subview(cubature_jacobian_inverse_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1486 auto s_ref = Kokkos::subview(tmp_grad_basis_ref.get_view(),cell_range,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL());
1489 using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1490 fst::HGRADtransformGRAD(s_aux, s_jac_inv, s_ref);
1493 auto cubature_points_ref_host = Kokkos::create_mirror_view(cubature_points_ref_.get_view());
1494 Kokkos::deep_copy(cubature_points_ref_host,cubature_points_ref_.get_view());
1495 auto tmp_grad_basis_host = Kokkos::create_mirror_view(tmp_grad_basis.get_view());
1497 auto intrepid_basis_host = intrepid_basis->getHostBasis();
1498 for(
int cell=0; cell<num_evaluate_cells_; ++cell) {
1499 auto my_cell_grad_basis_host = Kokkos::subview(tmp_grad_basis_host,cell,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL());
1500 auto my_cell_cub_points_ref_host = Kokkos::subview(cubature_points_ref_host,cell,Kokkos::ALL(),Kokkos::ALL());
1501 intrepid_basis_host->getValues(my_cell_grad_basis_host,my_cell_cub_points_ref_host,Intrepid2::OPERATOR_GRAD);
1503 auto tmp_grad_basis_ref = af.
buildStaticArray<Scalar,Cell,BASIS,IP,Dim>(
"tmp_grad_basis_ref",num_cells,num_card,num_points,num_dim);
1504 Kokkos::deep_copy(tmp_grad_basis_ref.get_view(),tmp_grad_basis_host);
1506 const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1507 auto s_aux = Kokkos::subview(tmp_grad_basis.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1508 auto s_jac_inv = Kokkos::subview(cubature_jacobian_inverse_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1509 auto s_ref = Kokkos::subview(tmp_grad_basis_ref.get_view(),cell_range,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL());
1512 using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1513 fst::HGRADtransformGRAD(s_aux, s_jac_inv, s_ref);
1514 #ifdef KOKKOS_ENABLE_CUDA
1517 PHX::Device().fence();
1521 if(orientations_.size() > 0)
1522 applyOrientationsImpl<Scalar>(num_orientations_cells_, tmp_grad_basis.get_view(), orientations_, *intrepid_basis);
1527 return tmp_grad_basis;
1533 template <
typename Scalar>
1538 const bool force)
const
1541 if(weighted_curl_basis_scalar_evaluated_ and not force)
1542 return weighted_curl_basis_scalar;
1544 if(curl_basis_scalar_evaluated_ and not force)
1545 return curl_basis_scalar;
1547 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getCurl2DVectorBasis()",bv_get_curl2d_vec_bv);
1551 const int num_cells = num_cells_;
1552 const int num_points = basis_layout->numPoints();
1553 const int num_card = basis_layout->cardinality();
1554 const int num_dim = basis_layout->dimension();
1561 const auto bv = getCurl2DVectorBasis(
false, force);
1564 auto tmp_weighted_curl_basis_scalar = af.
buildStaticArray<Scalar,
Cell,
BASIS,
IP>(
"weighted_curl_basis_scalar", num_cells, num_card, num_points);
1566 const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1567 auto s_aux = Kokkos::subview(tmp_weighted_curl_basis_scalar.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1568 auto s_cw = Kokkos::subview(cubature_weights_.get_view(), cell_range, Kokkos::ALL());
1569 auto s_bv = Kokkos::subview(bv.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1571 using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1572 fst::multiplyMeasure(s_aux,s_cw,s_bv);
1577 return tmp_weighted_curl_basis_scalar;
1584 const auto element_space = getElementSpace();
1589 if(hasUniformReferenceSpace()){
1591 auto cell_curl_basis_ref_scalar = af.
buildStaticArray<Scalar,BASIS,IP>(
"cell_curl_basis_ref_scalar",num_card,num_points);
1592 auto cubature_points_uniform_ref = PHX::getNonConstDynRankViewFromConstMDField(cubature_points_uniform_ref_);
1594 intrepid_basis->getValues(cell_curl_basis_ref_scalar.get_view(),cubature_points_uniform_ref,Intrepid2::OPERATOR_CURL);
1596 const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1597 auto s_aux = Kokkos::subview(tmp_curl_basis_scalar.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1598 auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL());
1603 using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1604 fst::HDIVtransformDIV(s_aux,s_jac_det,cell_curl_basis_ref_scalar.get_view());
1605 PHX::Device().fence();
1614 #ifdef KOKKOS_ENABLE_CUDA
1615 if constexpr (std::is_same<Kokkos::CudaUVMSpace,
typename decltype(tmp_curl_basis_scalar.get_view())::memory_space>::value) {
1616 auto cubature_points_ref_host = Kokkos::create_mirror(Kokkos::HostSpace{},cubature_points_ref_.get_view());
1617 Kokkos::deep_copy(cubature_points_ref_host,cubature_points_ref_.get_view());
1618 auto tmp_curl_basis_scalar_host = Kokkos::create_mirror(Kokkos::HostSpace{},tmp_curl_basis_scalar.get_view());
1620 auto intrepid_basis_host = intrepid_basis->getHostBasis();
1621 for(
int cell=0; cell<num_evaluate_cells_; ++cell) {
1622 auto my_cell_curl_basis_host = Kokkos::subview(tmp_curl_basis_scalar_host,cell,Kokkos::ALL(),Kokkos::ALL());
1623 auto my_cell_cub_points_ref_host = Kokkos::subview(cubature_points_ref_host,cell,Kokkos::ALL(),Kokkos::ALL());
1624 intrepid_basis_host->getValues(my_cell_curl_basis_host,my_cell_cub_points_ref_host,Intrepid2::OPERATOR_CURL);
1626 auto tmp_curl_basis_scalar_ref = af.
buildStaticArray<Scalar,Cell,BASIS,IP>(
"tmp_curl_basis_scalar_ref",num_cells,num_card,num_points);
1627 Kokkos::deep_copy(tmp_curl_basis_scalar_ref.get_view(),tmp_curl_basis_scalar_host);
1629 const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1630 auto s_aux = Kokkos::subview(tmp_curl_basis_scalar.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1631 auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL());
1632 auto s_ref = Kokkos::subview(tmp_curl_basis_scalar_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1637 using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1638 fst::HDIVtransformDIV(s_aux,s_jac_det,s_ref);
1641 auto cubature_points_ref_host = Kokkos::create_mirror_view(cubature_points_ref_.get_view());
1642 Kokkos::deep_copy(cubature_points_ref_host,cubature_points_ref_.get_view());
1643 auto tmp_curl_basis_scalar_host = Kokkos::create_mirror_view(tmp_curl_basis_scalar.get_view());
1645 auto intrepid_basis_host = intrepid_basis->getHostBasis();
1646 for(
int cell=0; cell<num_evaluate_cells_; ++cell) {
1647 auto my_cell_curl_basis_host = Kokkos::subview(tmp_curl_basis_scalar_host,cell,Kokkos::ALL(),Kokkos::ALL());
1648 auto my_cell_cub_points_ref_host = Kokkos::subview(cubature_points_ref_host,cell,Kokkos::ALL(),Kokkos::ALL());
1649 intrepid_basis_host->getValues(my_cell_curl_basis_host,my_cell_cub_points_ref_host,Intrepid2::OPERATOR_CURL);
1651 auto tmp_curl_basis_scalar_ref = af.
buildStaticArray<Scalar,Cell,BASIS,IP>(
"tmp_curl_basis_scalar_ref",num_cells,num_card,num_points);
1652 Kokkos::deep_copy(tmp_curl_basis_scalar_ref.get_view(),tmp_curl_basis_scalar_host);
1654 const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1655 auto s_aux = Kokkos::subview(tmp_curl_basis_scalar.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1656 auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL());
1657 auto s_ref = Kokkos::subview(tmp_curl_basis_scalar_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1662 using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1663 fst::HDIVtransformDIV(s_aux,s_jac_det,s_ref);
1664 #ifdef KOKKOS_ENABLE_CUDA
1667 PHX::Device().fence();
1670 if(orientations_.size() > 0)
1671 applyOrientationsImpl<Scalar>(num_orientations_cells_, tmp_curl_basis_scalar.get_view(), orientations_, *intrepid_basis);
1676 return tmp_curl_basis_scalar;
1682 template <
typename Scalar>
1687 const bool force)
const
1690 if(weighted_curl_basis_vector_evaluated_ and not force)
1691 return weighted_curl_basis_vector;
1693 if(curl_basis_vector_evaluated_ and not force)
1694 return curl_basis_vector;
1696 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getCurlVectorBasis()",bv_get_curl_vec_bv);
1700 const int num_cells = num_cells_;
1701 const int num_points = basis_layout->numPoints();
1702 const int num_card = basis_layout->cardinality();
1703 const int num_dim = basis_layout->dimension();
1710 const auto bv = getCurlVectorBasis(
false, force);
1713 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);
1715 const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1716 auto s_aux = Kokkos::subview(tmp_weighted_curl_basis_vector.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1717 auto s_cw = Kokkos::subview(cubature_weights_.get_view(), cell_range, Kokkos::ALL());
1718 auto s_bv = Kokkos::subview(bv.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1720 using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1721 fst::multiplyMeasure(s_aux, s_cw, s_bv);
1726 return tmp_weighted_curl_basis_vector;
1733 const auto element_space = getElementSpace();
1738 if(hasUniformReferenceSpace()){
1740 auto cell_curl_basis_ref_vector = af.
buildStaticArray<Scalar,BASIS,IP,Dim>(
"cell_curl_basis_ref_vector",num_card,num_points,num_dim);
1741 auto cubature_points_uniform_ref = PHX::getNonConstDynRankViewFromConstMDField(cubature_points_uniform_ref_);
1743 intrepid_basis->getValues(cell_curl_basis_ref_vector.get_view(),cubature_points_uniform_ref,Intrepid2::OPERATOR_CURL);
1745 const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1746 auto s_aux = Kokkos::subview(tmp_curl_basis_vector.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1747 auto s_jac = Kokkos::subview(cubature_jacobian_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1748 auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL());
1750 using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1751 fst::HCURLtransformCURL(s_aux, s_jac, s_jac_det,cell_curl_basis_ref_vector.get_view());
1752 PHX::Device().fence();
1761 #ifdef KOKKOS_ENABLE_CUDA
1762 if constexpr (std::is_same<Kokkos::CudaUVMSpace,
typename decltype(tmp_curl_basis_vector.get_view())::memory_space>::value) {
1763 auto cubature_points_ref_host = Kokkos::create_mirror(Kokkos::HostSpace{},cubature_points_ref_.get_view());
1764 Kokkos::deep_copy(cubature_points_ref_host,cubature_points_ref_.get_view());
1765 auto tmp_curl_basis_vector_host = Kokkos::create_mirror(Kokkos::HostSpace{},tmp_curl_basis_vector.get_view());
1767 auto intrepid_basis_host = intrepid_basis->getHostBasis();
1768 for(
int cell=0; cell<num_evaluate_cells_; ++cell) {
1769 auto my_cell_curl_basis_host = Kokkos::subview(tmp_curl_basis_vector_host,cell,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL());
1770 auto my_cell_cub_points_ref_host = Kokkos::subview(cubature_points_ref_host,cell,Kokkos::ALL(),Kokkos::ALL());
1771 intrepid_basis_host->getValues(my_cell_curl_basis_host,my_cell_cub_points_ref_host,Intrepid2::OPERATOR_CURL);
1773 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);
1774 Kokkos::deep_copy(tmp_curl_basis_vector_ref.get_view(),tmp_curl_basis_vector_host);
1776 const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1777 auto s_aux = Kokkos::subview(tmp_curl_basis_vector.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1778 auto s_jac = Kokkos::subview(cubature_jacobian_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1779 auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL());
1780 auto s_ref = Kokkos::subview(tmp_curl_basis_vector_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1782 using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1783 fst::HCURLtransformCURL(s_aux, s_jac, s_jac_det, s_ref);
1786 auto cubature_points_ref_host = Kokkos::create_mirror_view(cubature_points_ref_.get_view());
1787 Kokkos::deep_copy(cubature_points_ref_host,cubature_points_ref_.get_view());
1788 auto tmp_curl_basis_vector_host = Kokkos::create_mirror_view(tmp_curl_basis_vector.get_view());
1790 auto intrepid_basis_host = intrepid_basis->getHostBasis();
1791 for(
int cell=0; cell<num_evaluate_cells_; ++cell) {
1792 auto my_cell_curl_basis_host = Kokkos::subview(tmp_curl_basis_vector_host,cell,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL());
1793 auto my_cell_cub_points_ref_host = Kokkos::subview(cubature_points_ref_host,cell,Kokkos::ALL(),Kokkos::ALL());
1794 intrepid_basis_host->getValues(my_cell_curl_basis_host,my_cell_cub_points_ref_host,Intrepid2::OPERATOR_CURL);
1796 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);
1797 Kokkos::deep_copy(tmp_curl_basis_vector_ref.get_view(),tmp_curl_basis_vector_host);
1799 const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1800 auto s_aux = Kokkos::subview(tmp_curl_basis_vector.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1801 auto s_jac = Kokkos::subview(cubature_jacobian_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1802 auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL());
1803 auto s_ref = Kokkos::subview(tmp_curl_basis_vector_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
1805 using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1806 fst::HCURLtransformCURL(s_aux, s_jac, s_jac_det, s_ref);
1807 #ifdef KOKKOS_ENABLE_CUDA
1810 PHX::Device().fence();
1814 if(orientations_.size() > 0)
1815 applyOrientationsImpl<Scalar>(num_orientations_cells_, tmp_curl_basis_vector.get_view(), orientations_, *intrepid_basis);
1820 return tmp_curl_basis_vector;
1826 template <
typename Scalar>
1831 const bool force)
const
1834 if(weighted_div_basis_evaluated_ and not force)
1835 return weighted_div_basis;
1837 if(div_basis_evaluated_ and not force)
1840 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::basisValues2::getDevVectorBasis()",bv_get_div_vec_bv);
1844 const int num_cells = num_cells_;
1845 const int num_points = basis_layout->numPoints();
1846 const int num_card = basis_layout->cardinality();
1853 const auto bv = getDivVectorBasis(
false, force);
1856 auto tmp_weighted_div_basis = af.
buildStaticArray<Scalar,
Cell,
BASIS,
IP>(
"weighted_div_basis", num_cells, num_card, num_points);
1858 const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1859 auto s_aux = Kokkos::subview(tmp_weighted_div_basis.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1860 auto s_cw = Kokkos::subview(cubature_weights_.get_view(), cell_range, Kokkos::ALL());
1861 auto s_bv = Kokkos::subview(bv.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1863 using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1864 fst::multiplyMeasure(s_aux, s_cw, s_bv);
1869 return tmp_weighted_div_basis;
1875 const auto element_space = getElementSpace();
1880 if(hasUniformReferenceSpace()){
1882 auto cell_div_basis_ref = af.
buildStaticArray<Scalar,BASIS,IP>(
"cell_div_basis_ref",num_card,num_points);
1883 auto cubature_points_uniform_ref = PHX::getNonConstDynRankViewFromConstMDField(cubature_points_uniform_ref_);
1885 intrepid_basis->getValues(cell_div_basis_ref.get_view(),cubature_points_uniform_ref,Intrepid2::OPERATOR_DIV);
1887 const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1888 auto s_aux = Kokkos::subview(tmp_div_basis.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1889 auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL());
1891 using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1892 fst::HDIVtransformDIV(s_aux,s_jac_det,cell_div_basis_ref.get_view());
1893 PHX::Device().fence();
1902 #ifdef KOKKOS_ENABLE_CUDA
1903 if constexpr (std::is_same<Kokkos::CudaUVMSpace,
typename decltype(tmp_div_basis.get_view())::memory_space>::value) {
1904 auto cubature_points_ref_host = Kokkos::create_mirror(Kokkos::HostSpace{},cubature_points_ref_.get_view());
1905 Kokkos::deep_copy(cubature_points_ref_host,cubature_points_ref_.get_view());
1906 auto tmp_div_basis_host = Kokkos::create_mirror(Kokkos::HostSpace{},tmp_div_basis.get_view());
1908 auto intrepid_basis_host = intrepid_basis->getHostBasis();
1909 for(
int cell=0; cell<num_evaluate_cells_; ++cell) {
1910 auto my_cell_div_basis_host = Kokkos::subview(tmp_div_basis_host,cell,Kokkos::ALL(),Kokkos::ALL());
1911 auto my_cell_cub_points_ref_host = Kokkos::subview(cubature_points_ref_host,cell,Kokkos::ALL(),Kokkos::ALL());
1912 intrepid_basis_host->getValues(my_cell_div_basis_host,my_cell_cub_points_ref_host,Intrepid2::OPERATOR_DIV);
1914 auto tmp_div_basis_ref = af.
buildStaticArray<Scalar,Cell,BASIS,IP>(
"tmp_div_basis_ref",num_cells,num_card,num_points);
1915 Kokkos::deep_copy(tmp_div_basis_ref.get_view(),tmp_div_basis_host);
1917 const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1918 auto s_aux = Kokkos::subview(tmp_div_basis.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1919 auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL());
1920 auto s_ref = Kokkos::subview(tmp_div_basis_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1922 using fst=Intrepid2::FunctionSpaceTools<PHX::Device::execution_space>;
1923 fst::HDIVtransformDIV(s_aux,s_jac_det,s_ref);
1926 auto cubature_points_ref_host = Kokkos::create_mirror_view(cubature_points_ref_.get_view());
1927 Kokkos::deep_copy(cubature_points_ref_host,cubature_points_ref_.get_view());
1928 auto tmp_div_basis_host = Kokkos::create_mirror_view(tmp_div_basis.get_view());
1930 auto intrepid_basis_host = intrepid_basis->getHostBasis();
1931 for(
int cell=0; cell<num_evaluate_cells_; ++cell) {
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);
1936 auto tmp_div_basis_ref = af.
buildStaticArray<Scalar,Cell,BASIS,IP>(
"tmp_div_basis_ref",num_cells,num_card,num_points);
1937 Kokkos::deep_copy(tmp_div_basis_ref.get_view(),tmp_div_basis_host);
1939 const std::pair<int,int> cell_range(0,num_evaluate_cells_);
1940 auto s_aux = Kokkos::subview(tmp_div_basis.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL());
1941 auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, 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::execution_space>;
1945 fst::HDIVtransformDIV(s_aux,s_jac_det,s_ref);
1946 #ifdef KOKKOS_ENABLE_CUDA
1949 PHX::Device().fence();
1953 if(orientations_.size() > 0)
1954 applyOrientationsImpl<Scalar>(num_orientations_cells_, tmp_div_basis.get_view(), orientations_, *intrepid_basis);
1959 return tmp_div_basis;
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...
Kokkos::DynRankView< typename InputArray::value_type, PHX::Device > createDynRankView(const InputArray &a, const std::string &name, const DimensionPack...dims)
Wrapper to simplify Panzer use of Sacado ViewFactory.
bool grad_basis_evaluated_
ConstArray_BasisIP getCurl2DVectorBasisRef(const bool cache=true, const bool force=false) const
Get the curl of a vector basis evaluated at reference points.
bool basis_ref_vector_evaluated_
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)
bool basis_ref_scalar_evaluated_
Used to check if arrays have been cached.
bool curl_basis_ref_scalar_evaluated_
EElementSpace getElementSpace() const
ConstArray_BasisIPDim getVectorBasisValuesRef(const bool cache=true, const bool force=false) const
Get the vector basis values evaluated at reference points.
Teuchos::RCP< const CellTopologyInfo > getCellTopologyInfo() const
int cardinality() const
Returns the number of basis coefficients.
bool weighted_curl_basis_scalar_evaluated_
PHX::MDField< Scalar, T0 > buildStaticArray(const std::string &str, int d0) const
ConstArray_BasisIP getBasisValuesRef(const bool cache=true, const bool force=false) const
Get the basis values evaluated at reference points.
panzer::BasisDescriptor getBasisDescriptor() const
Return the basis descriptor.
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.
bool curl_basis_vector_evaluated_
Teuchos::RCP< const PureBasis > getBasis() const
bool weighted_basis_vector_evaluated_
int dimension() const
Returns the dimension of the basis from the topology.
bool weighted_grad_basis_evaluated_
void applyOrientations(const PHX::MDField< const Scalar, Cell, BASIS > &orientations)
Method to apply orientations to a basis values container.
Teuchos::RCP< const shards::CellTopology > getCellTopology() const
#define TEUCHOS_TEST_FOR_EXCEPT_MSG(throw_exception_test, msg)
bool basis_coordinates_evaluated_
bool weighted_div_basis_evaluated_
ConstArray_CellBasisIP getBasisValues(const bool weighted, const bool cache=true, const bool force=false) const
Get the basis values evaluated at mesh points.
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.
ConstArray_CellBasisDim getBasisCoordinates(const bool cache=true, const bool force=false) const
Carterisan coordinates for basis coefficients in mesh space.
PureBasis::EElementSpace getElementSpace() const
Teuchos::RCP< Intrepid2::Basis< PHX::Device::execution_space, double, double > > getIntrepid2Basis() const
ConstArray_BasisIP getDivVectorBasisRef(const bool cache=true, const bool force=false) const
Get the divergence of a vector basis evaluated at reference points.
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.
#define PANZER_CACHE_DATA(name)
void setupArrays(const Teuchos::RCP< const panzer::BasisIRLayout > &basis, bool computeDerivatives=true)
Sizes/allocates memory for arrays.
int numCells() const
Returns the number of cells in the data layouts.
bool basis_scalar_evaluated_
ConstArray_CellBasisIPDim getVectorBasisValues(const bool weighted, const bool cache=true, const bool force=false) const
Get the vector basis values evaluated at mesh points.
ConstArray_BasisIPDim getCurlVectorBasisRef(const bool cache=true, const bool force=false) const
Get the curl of a vector basis evaluated at reference points.
BasisValues2(const std::string &prefix="", const bool allocArrays=false, const bool buildWeighted=false)
Main constructor.
ConstArray_BasisDim getBasisCoordinatesRef(const bool cache=true, const bool force=false) const
Get the reference coordinates for basis.
void evaluateBasisCoordinates(const PHX::MDField< Scalar, Cell, NODE, Dim > &node_coordinates, const int in_num_cells=-1)
bool basis_coordinates_ref_evaluated_
bool curl_basis_ref_vector_evaluated_
#define TEUCHOS_ASSERT(assertion_test)
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.
bool grad_basis_ref_evaluated_
void setCellNodeCoordinates(PHX::MDField< Scalar, Cell, NODE, Dim > node_coordinates)
Set the cell node coordinates (required for getBasisCoordinates())
bool weighted_curl_basis_vector_evaluated_
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)
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.
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...
bool curl_basis_scalar_evaluated_
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.
bool basis_vector_evaluated_
ConstArray_BasisIPDim getGradBasisValuesRef(const bool cache=true, const bool force=false) const
Get the gradient of the basis evaluated at reference points.
bool div_basis_ref_evaluated_
bool div_basis_evaluated_
bool weighted_basis_scalar_evaluated_