62 std::vector<GlobalVector*>
const& x_prev,
63 std::size_t
const n_nodes)
const
65 using EntryInput = std::vector<double>;
67 for (std::size_t node_id = 0; node_id < n_nodes; ++node_id)
69 std::vector<InterpolationPoint> interpolation_points;
70 EntryInput base_entry_input;
75 auto const process_id = input_field.variable_id;
76 auto const& variable_name = input_field.name;
77 double input_field_value =
78 variable_name.find(
"_prev") == std::string::npos
79 ? x[process_id]->get(node_id)
80 : x_prev[process_id]->get(node_id);
82 (std::abs(input_field_value) + input_field_value) / 2;
83 auto bounding_seed_points =
84 input_field.getBoundingSeedPoints(input_field_value);
88 interpolation_points.push_back(interpolation_point);
90 base_entry_input.push_back(bounding_seed_points.first);
96 EntryInput bounding_entry_input{base_entry_input};
97 std::vector<std::size_t> bounding_entry_ids;
98 for (std::size_t i = 0; i < interpolation_points.size(); ++i)
100 bounding_entry_input[i] =
101 interpolation_points[i].bounding_points.second;
103 bounding_entry_input[i] =
104 interpolation_points[i].bounding_points.first;
109 if (input_field.name.find(
"_prev") != std::string::npos)
114 auto const output_field_name = input_field.name +
"_new";
115 auto const base_value =
117 auto new_value = base_value;
120 for (std::size_t i = 0; i < interpolation_points.size(); ++i)
122 auto const interpolation_point_value =
123 tabular_data.at(output_field_name)[bounding_entry_ids[i]];
125 (interpolation_point_value - base_value) /
126 (interpolation_points[i].bounding_points.second -
127 interpolation_points[i].bounding_points.first);
130 slope * (interpolation_points[i].value -
131 interpolation_points[i].bounding_points.first);
134 x[input_field.variable_id]->set(node_id, new_value);