116 using HostSpace = Kokkos::DefaultHostExecutionSpace;
117 using CTD = Intrepid2::CellTools<HostSpace>;
118 using FST = Intrepid2::FunctionSpaceTools<HostSpace>;
121 const int num_points = 1;
122 Kokkos::DynRankView<int,HostSpace> inCell(
"inCell", this->wda(d).cell_node_coordinates.extent_int(0), num_points);
123 Kokkos::DynRankView<double,HostSpace> physical_points_cell(
"physical_points_cell", this->wda(d).cell_node_coordinates.extent_int(0), num_points, num_dim);
124 auto tmp_point = point_;
126 Kokkos::MDRangePolicy<HostSpace,Kokkos::Rank<2>> policy({0,0},{d.
num_cells,
static_cast<decltype(d.num_cells)
>(num_dim)});
127 Kokkos::parallel_for(
"copy node coords",policy,[&](
const int cell,
const int dim){
128 physical_points_cell(cell,0,dim) = tmp_point[dim];
132 auto cell_coords = this->wda(d).cell_node_coordinates.get_view();
133 auto cell_coords_host = Kokkos::create_mirror_view(cell_coords);
134 Kokkos::deep_copy(cell_coords_host, cell_coords);
136 const double tol = 1.0e-12;
137 CTD::checkPointwiseInclusion(inCell,
138 physical_points_cell,
144 for (index_t cell=0; cell<static_cast<int>(d.
num_cells); ++cell) {
145 if (inCell(cell,0) == 1) {
159 const size_t num_nodes = this->wda(d).cell_node_coordinates.extent(1);
160 Kokkos::DynRankView<double,HostSpace> cell_coords(
"cell_coords", 1,
int(num_nodes),
int(num_dim));
161 auto cnc_host = Kokkos::create_mirror_view(this->wda(d).cell_node_coordinates.get_view());
162 Kokkos::deep_copy(cnc_host,this->wda(d).cell_node_coordinates.get_view());
163 for (
size_t i=0; i<num_nodes; ++i) {
164 for (
size_t j=0; j<num_dim; ++j) {
165 cell_coords(0,i,j) = cnc_host(cellIndex_,i,j);
168 Kokkos::DynRankView<double,HostSpace> physical_points(
"physical_points", 1, 1, num_dim);
169 for (
size_t i=0; i<num_dim; ++i)
170 physical_points(0,0,i) = physical_points_cell(0,0,i);
172 Kokkos::DynRankView<double,HostSpace> reference_points(
"reference_points", 1, 1, num_dim);
173 CTD::mapToReferenceFrame(reference_points, physical_points, cell_coords, *topology_);
175 Kokkos::DynRankView<double,HostSpace> reference_points_cell(
"reference_points_cell", 1, num_dim);
176 for (
size_t i=0; i<num_dim; ++i)
177 reference_points_cell(0,i) = reference_points(0,0,i);
184 Kokkos::DynRankView<double,HostSpace> ref_basis_values(
"ref_basis_values", num_basis, 1);
185 basis_->getIntrepid2Basis<HostSpace,double,
double>()->getValues(ref_basis_values,
186 reference_points_cell,
187 Intrepid2::OPERATOR_VALUE);
190 auto basis_values_host = Kokkos::create_mirror_view(basis_values_);
191 FST::HGRADtransformVALUE<double>(basis_values_host, ref_basis_values);
192 Kokkos::deep_copy(basis_values_,basis_values_host);
198 Kokkos::DynRankView<double,HostSpace> ref_basis_values(
"ref_basis_values", num_basis, 1, num_dim);
199 basis_->getIntrepid2Basis<HostSpace,double,
double>()->getValues(ref_basis_values,
200 reference_points_cell,
201 Intrepid2::OPERATOR_VALUE);
204 Kokkos::DynRankView<double,HostSpace>
jac(
"jac", 1, 1, num_dim, num_dim);
205 CTD::setJacobian(
jac, reference_points, cell_coords, *topology_);
206 Kokkos::DynRankView<double,HostSpace> basis_values_vec(
"basis_values_vec", 1, num_basis, 1, num_dim);
208 Kokkos::DynRankView<double,HostSpace> jac_inv(
"jac_inv", 1, 1, num_dim, num_dim);
209 CTD::setJacobianInv(jac_inv,
jac);
210 FST::HCURLtransformVALUE<double>(basis_values_vec, jac_inv,
214 Kokkos::DynRankView<double,HostSpace> jac_det(
"jac_det", 1, 1);
215 CTD::setJacobianDet(jac_det,
jac);
216 FST::HDIVtransformVALUE<double>(basis_values_vec,
jac, jac_det,
221 std::vector<double> orientation;
222 globalIndexer_->getElementOrientation(cellIndex_, orientation);
223 std::string blockId = this->wda(d).block_id;
224 int fieldNum = globalIndexer_->getFieldNum(fieldName_);
225 const std::vector<int> & elmtOffset = globalIndexer_->getGIDFieldOffsets(blockId,fieldNum);
228 for (
size_t i=0; i<num_basis; ++i) {
229 int offset = elmtOffset[i];
230 basis_values_(0,i,0) = orientation[offset] * basis_values_vec(0,i,0,fieldComponent_);