150 using HostSpace = Kokkos::DefaultHostExecutionSpace;
151 using CTD = Intrepid2::CellTools<HostSpace>;
152 using FST = Intrepid2::FunctionSpaceTools<HostSpace>;
155 const int num_points = 1;
156 Kokkos::DynRankView<int,HostSpace> inCell(
"inCell", this->wda(d).cell_node_coordinates.extent_int(0), num_points);
157 Kokkos::DynRankView<double,HostSpace> physical_points_cell(
"physical_points_cell", this->wda(d).cell_node_coordinates.extent_int(0), num_points, num_dim);
158 auto tmp_point = point_;
160 Kokkos::MDRangePolicy<HostSpace,Kokkos::Rank<2>> policy({0,0},{d.
num_cells,
static_cast<decltype(d.num_cells)
>(num_dim)});
161 Kokkos::parallel_for(
"copy node coords",policy,[&](
const int cell,
const int dim){
162 physical_points_cell(cell,0,dim) = tmp_point[dim];
166 auto cell_coords = this->wda(d).cell_node_coordinates.get_view();
167 auto cell_coords_host = Kokkos::create_mirror_view(cell_coords);
168 Kokkos::deep_copy(cell_coords_host, cell_coords);
170 const double tol = 1.0e-12;
171 CTD::checkPointwiseInclusion(inCell,
172 physical_points_cell,
178 for (index_t cell=0; cell<static_cast<int>(d.
num_cells); ++cell) {
179 if (inCell(cell,0) == 1) {
193 const size_t num_nodes = this->wda(d).cell_node_coordinates.extent(1);
194 Kokkos::DynRankView<double,HostSpace> cell_coords(
"cell_coords", 1,
int(num_nodes),
int(num_dim));
195 auto cnc_host = Kokkos::create_mirror_view(this->wda(d).cell_node_coordinates.get_view());
196 Kokkos::deep_copy(cnc_host,this->wda(d).cell_node_coordinates.get_view());
197 for (
size_t i=0; i<num_nodes; ++i) {
198 for (
size_t j=0; j<num_dim; ++j) {
199 cell_coords(0,i,j) = cnc_host(cellIndex_,i,j);
202 Kokkos::DynRankView<double,HostSpace> physical_points(
"physical_points", 1, 1, num_dim);
203 for (
size_t i=0; i<num_dim; ++i)
204 physical_points(0,0,i) = physical_points_cell(0,0,i);
206 Kokkos::DynRankView<double,HostSpace> reference_points(
"reference_points", 1, 1, num_dim);
207 CTD::mapToReferenceFrame(reference_points, physical_points, cell_coords, *topology_);
209 Kokkos::DynRankView<double,HostSpace> reference_points_cell(
"reference_points_cell", 1, num_dim);
210 for (
size_t i=0; i<num_dim; ++i)
211 reference_points_cell(0,i) = reference_points(0,0,i);
218 Kokkos::DynRankView<double,HostSpace> ref_basis_values(
"ref_basis_values", num_basis, 1);
219 basis_->getIntrepid2Basis<HostSpace,double,
double>()->getValues(ref_basis_values,
220 reference_points_cell,
221 Intrepid2::OPERATOR_VALUE);
224 auto basis_values_host = Kokkos::create_mirror_view(basis_values_);
225 FST::HGRADtransformVALUE<double>(basis_values_host, ref_basis_values);
226 Kokkos::deep_copy(basis_values_,basis_values_host);
232 Kokkos::DynRankView<double,HostSpace> ref_basis_values(
"ref_basis_values", num_basis, 1, num_dim);
233 basis_->getIntrepid2Basis<HostSpace,double,
double>()->getValues(ref_basis_values,
234 reference_points_cell,
235 Intrepid2::OPERATOR_VALUE);
238 Kokkos::DynRankView<double,HostSpace>
jac(
"jac", 1, 1, num_dim, num_dim);
239 CTD::setJacobian(
jac, reference_points, cell_coords, *topology_);
240 Kokkos::DynRankView<double,HostSpace> basis_values_vec(
"basis_values_vec", 1, num_basis, 1, num_dim);
242 Kokkos::DynRankView<double,HostSpace> jac_inv(
"jac_inv", 1, 1, num_dim, num_dim);
243 CTD::setJacobianInv(jac_inv,
jac);
244 FST::HCURLtransformVALUE<double>(basis_values_vec, jac_inv,
248 Kokkos::DynRankView<double,HostSpace> jac_det(
"jac_det", 1, 1);
249 CTD::setJacobianDet(jac_det,
jac);
250 FST::HDIVtransformVALUE<double>(basis_values_vec,
jac, jac_det,
255 std::vector<double> orientation;
256 globalIndexer_->getElementOrientation(cellIndex_, orientation);
257 std::string blockId = this->wda(d).block_id;
258 int fieldNum = globalIndexer_->getFieldNum(fieldName_);
259 const std::vector<int> & elmtOffset = globalIndexer_->getGIDFieldOffsets(blockId,fieldNum);
262 for (
size_t i=0; i<num_basis; ++i) {
263 int offset = elmtOffset[i];
264 basis_values_(0,i,0) = orientation[offset] * basis_values_vec(0,i,0,fieldComponent_);