44 const std::string & responseName,
45 const std::string & fieldName,
46 const int fieldComponent,
47 const Teuchos::Array<double>& point,
49 const Teuchos::RCP<const PureBasis>& basis,
50 const Teuchos::RCP<const panzer::GlobalIndexer> & indexer,
51 const Teuchos::RCP<ProbeScatterBase> & probeScatter)
68 field_ = PHX::MDField<const ScalarT,Cell,BASIS>(fieldName,
basis_->functional);
69 this->addDependentField(
field_);
73 TEUCHOS_ASSERT(
num_dim ==
static_cast<size_t>(
point_.size()));
79 std::string dummyName =
81 RCP<PHX::DataLayout> dl_dummy = rcp(
new PHX::MDALayout<panzer::Dummy>(0));
85 std::string n =
"Probe Response Scatter: " + responseName;
150 using HostSpace = Kokkos::DefaultHostExecutionSpace;
152 using HostDevice = HostSpace::device_type;
153 using CTD = Intrepid2::CellTools<HostDevice>;
154 using FST = Intrepid2::FunctionSpaceTools<HostDevice>;
157 const int num_points = 1;
158 Kokkos::DynRankView<int,HostSpace> inCell(
"inCell", this->
wda(d).cell_node_coordinates.extent_int(0), num_points);
159 Kokkos::DynRankView<double,HostSpace> physical_points_cell(
"physical_points_cell", this->
wda(d).cell_node_coordinates.extent_int(0), num_points,
num_dim);
162 Kokkos::MDRangePolicy<HostSpace,Kokkos::Rank<2>> policy({0,0},{d.
num_cells,
static_cast<decltype(d.num_cells)
>(
num_dim)});
163 Kokkos::parallel_for(
"copy node coords",policy,[&](
const int cell,
const int dim){
164 physical_points_cell(cell,0,dim) = tmp_point[dim];
168 auto cell_coords = this->
wda(d).cell_node_coordinates.get_view();
169 auto cell_coords_host = Kokkos::create_mirror_view(cell_coords);
170 Kokkos::deep_copy(cell_coords_host, cell_coords);
172 const double tol = 1.0e-12;
173 CTD::checkPointwiseInclusion(inCell,
174 physical_points_cell,
180 for (index_t cell=0; cell<static_cast<int>(d.
num_cells); ++cell) {
181 if (inCell(cell,0) == 1) {
195 const size_t num_nodes = this->
wda(d).cell_node_coordinates.extent(1);
196 Kokkos::DynRankView<double,HostSpace> cell_coords(
"cell_coords", 1,
int(num_nodes),
int(
num_dim));
197 auto cnc_host = Kokkos::create_mirror_view(this->
wda(d).cell_node_coordinates.get_view());
198 Kokkos::deep_copy(cnc_host,this->
wda(d).cell_node_coordinates.get_view());
199 for (
size_t i=0; i<num_nodes; ++i) {
200 for (
size_t j=0; j<
num_dim; ++j) {
201 cell_coords(0,i,j) = cnc_host(
cellIndex_,i,j);
204 Kokkos::DynRankView<double,HostSpace> physical_points(
"physical_points", 1, 1,
num_dim);
205 for (
size_t i=0; i<
num_dim; ++i)
206 physical_points(0,0,i) = physical_points_cell(0,0,i);
208 Kokkos::DynRankView<double,HostSpace> reference_points(
"reference_points", 1, 1,
num_dim);
209 CTD::mapToReferenceFrame(reference_points, physical_points, cell_coords, *
topology_);
211 Kokkos::DynRankView<double,HostSpace> reference_points_cell(
"reference_points_cell", 1,
num_dim);
212 for (
size_t i=0; i<
num_dim; ++i)
213 reference_points_cell(0,i) = reference_points(0,0,i);
220 Kokkos::DynRankView<double,HostSpace> ref_basis_values(
"ref_basis_values",
num_basis, 1);
221 basis_->getIntrepid2Basis<HostDevice,double,
double>()->getValues(ref_basis_values,
222 reference_points_cell,
223 Intrepid2::OPERATOR_VALUE);
226 auto basis_values_host = Kokkos::create_mirror_view(
basis_values_);
227 FST::HGRADtransformVALUE<double>(basis_values_host, ref_basis_values);
234 Kokkos::DynRankView<double,HostSpace> ref_basis_values(
"ref_basis_values",
num_basis, 1,
num_dim);
235 basis_->getIntrepid2Basis<HostDevice,double,
double>()->getValues(ref_basis_values,
236 reference_points_cell,
237 Intrepid2::OPERATOR_VALUE);
240 Kokkos::DynRankView<double,HostSpace> jac(
"jac", 1, 1,
num_dim,
num_dim);
241 CTD::setJacobian(jac, reference_points, cell_coords, *
topology_);
242 Kokkos::DynRankView<double,HostSpace> basis_values_vec(
"basis_values_vec", 1,
num_basis, 1,
num_dim);
244 Kokkos::DynRankView<double,HostSpace> jac_inv(
"jac_inv", 1, 1,
num_dim,
num_dim);
245 CTD::setJacobianInv(jac_inv, jac);
246 FST::HCURLtransformVALUE<double>(basis_values_vec, jac_inv,
250 Kokkos::DynRankView<double,HostSpace> jac_det(
"jac_det", 1, 1);
251 CTD::setJacobianDet(jac_det, jac);
252 FST::HDIVtransformVALUE<double>(basis_values_vec, jac, jac_det,
257 std::vector<double> orientation;
259 std::string blockId = this->
wda(d).block_id;
261 const std::vector<int> & elmtOffset =
globalIndexer_->getGIDFieldOffsets(blockId,fieldNum);
265 int offset = elmtOffset[i];
278 using HostSpace = Kokkos::DefaultHostExecutionSpace;
280 using HostDevice = HostSpace::device_type;
286 auto field_coeffs_host = Kokkos::create_mirror_view(
field_.get_view());
287 Kokkos::deep_copy(field_coeffs_host,
field_.get_view());
289 auto field_coeffs_host_subview = Kokkos::subview(field_coeffs_host,std::pair<int,int>(
cellIndex_,
cellIndex_+1),Kokkos::ALL);
291 auto field_val = Sacado::createDynRankViewWithType<Kokkos::DynRankView<ScalarT,HostSpace>>(field_coeffs_host,
"field_val_at_point", 1, 1);
293 auto basis_values_host = Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(),
basis_values_);
295 Intrepid2::FunctionSpaceTools<HostDevice>::evaluate(field_val, field_coeffs_host_subview, basis_values_host);