Chi-Tech
chi_ffinter_slice_execute.cc
Go to the documentation of this file.
1#include "chi_ffinter_slice.h"
2
8
9//###################################################################
10/**Executes the slice interpolation.*/
12{
13 const auto& ref_ff = *field_functions_.front();
14 const auto& sdm = ref_ff.GetSpatialDiscretization();
15 const auto& grid = sdm.Grid();
16
17 const auto& uk_man = ref_ff.GetUnknownManager();
18 const auto uid = 0;
19 const auto cid = ref_component_;
20
21 const auto field_data = ref_ff.GetGhostedFieldVector();
22
23 for (auto& cell_intersection : cell_intersections_)
24 {
25 const auto& cell = grid.local_cells[cell_intersection.ref_cell_local_id];
26 const auto& cell_mapping = sdm.GetCellMapping(cell);
27 const size_t num_nodes = cell_mapping.NumNodes();
28
29 std::vector<double> dof_values(num_nodes, 0.0);
30 for (size_t i=0; i<num_nodes; ++i)
31 {
32 const int64_t imap = sdm.MapDOFLocal(cell, i, uk_man, uid, cid);
33 dof_values[i] = field_data[imap];
34 }
35
36 std::vector<double> shape_values(num_nodes, 0.0);
37 for (auto& edge_intersection : cell_intersection.intersections)
38 {
39 cell_mapping.ShapeValues(edge_intersection.point, shape_values);
40 double point_value = 0.0;
41 for (size_t i=0; i<num_nodes; ++i)
42 point_value += dof_values[i]*shape_values[i];
43
44 edge_intersection.point_value = point_value;
45 }//for edge intersection
46 }//for cell intersection
47}
std::vector< chi_physics::FieldFunctionGridBasedPtr > field_functions_
std::vector< FFICellIntersection > cell_intersections_