23 current_table.declare_column(
"time");
25 current_table.set_scientific(
"time",
true);
34 for (
auto variable_it = keys_range.begin(); variable_it != keys_range.end();
43template <
typename VectorType>
46 const Mapping<dim> &mapping,
47 const DoFHandler<dim> &dof_handler,
50 const ConditionalOStream &pcout,
51 std::vector<double> &evaluated_scalar_values)
53 const auto &probing_points_of_the_variable =
58 const unsigned int first_selected_component =
65 probing_points_of_the_variable.points,
67 evaluated_scalar_values,
68 first_selected_component);
72 const std::string column_name =
81 for (
unsigned int i = 0; i < probing_points_of_the_variable.ids.size(); ++i)
84 const unsigned int &
id = probing_points_of_the_variable.ids[i];
86 const std::string &table_name =
88 const double &evaluated_value = evaluated_scalar_values[i];
93 pcout <<
"At probe " <<
id <<
" ("
94 << Patterns::Tools::Convert<Point<dim>>::to_string(
95 probing_points_of_the_variable.points[i])
96 <<
") - " << table_name << std::endl;
97 pcout <<
" Evaluated " << variable_name
98 <<
" value: " << evaluated_value << std::endl;
106 current_table.add_value(
"time", current_time);
107 current_table.add_value(column_name, evaluated_value);
113 const Mapping<2> &mapping,
114 const DoFHandler<2> &dof_handler,
117 const ConditionalOStream &pcout,
118 std::vector<double> &evaluated_scalar_values);
122 const Mapping<3> &mapping,
123 const DoFHandler<3> &dof_handler,
126 const ConditionalOStream &pcout,
127 std::vector<double> &evaluated_scalar_values);
131 const Mapping<2> &mapping,
132 const DoFHandler<2> &dof_handler,
135 const ConditionalOStream &pcout,
136 std::vector<double> &evaluated_scalar_values);
140 const Mapping<3> &mapping,
141 const DoFHandler<3> &dof_handler,
144 const ConditionalOStream &pcout,
145 std::vector<double> &evaluated_scalar_values);
150 const Mapping<2> &mapping,
151 const DoFHandler<2> &dof_handler,
152 const LinearAlgebra::distributed::Vector<double> &present_solution,
154 const ConditionalOStream &pcout,
155 std::vector<double> &evaluated_scalar_values);
159 const Mapping<3> &mapping,
160 const DoFHandler<3> &dof_handler,
161 const LinearAlgebra::distributed::Vector<double> &present_solution,
163 const ConditionalOStream &pcout,
164 std::vector<double> &evaluated_scalar_values);
168template <
typename VectorType>
171 const Mapping<dim> &mapping,
172 const DoFHandler<dim> &dof_handler,
175 const ConditionalOStream &pcout,
176 std::vector<Tensor<1, dim, double>> &evaluated_vector_values)
180 "Only implemented for velocity for now. Implementations for "
181 "TimeHarmonicMaxwell variables will be done later."));
183 const auto &probing_points_of_the_variable =
186 const unsigned int first_selected_component = 0;
191 probing_points_of_the_variable.points,
193 evaluated_vector_values,
194 first_selected_component);
198 const std::string column_name_prefix =
207 for (
unsigned int i = 0; i < probing_points_of_the_variable.ids.size(); ++i)
210 const unsigned int &
id = probing_points_of_the_variable.ids[i];
212 const std::string &table_name =
214 const Tensor<1, dim, double> &evaluated_value =
215 evaluated_vector_values[i];
220 pcout <<
"At probe " <<
id <<
" ("
221 << Patterns::Tools::Convert<Point<dim>>::to_string(
222 probing_points_of_the_variable.points[i])
223 <<
") - " << table_name << std::endl;
224 pcout <<
" Evaluated " << variable_name <<
" vector: "
225 << Patterns::Tools::Convert<Tensor<1, dim, double>>::to_string(
235 current_table.add_value(
"time", current_time);
236 current_table.add_value(column_name_prefix +
"_x", evaluated_value[0]);
237 current_table.add_value(column_name_prefix +
"_y", evaluated_value[1]);
238 if constexpr (dim == 3)
239 current_table.add_value(column_name_prefix +
"_z", evaluated_value[2]);
245 const Mapping<2> &mapping,
246 const DoFHandler<2> &dof_handler,
249 const ConditionalOStream &pcout,
250 std::vector<Tensor<1, 2, double>> &evaluated_vector_values);
254 const Mapping<3> &mapping,
255 const DoFHandler<3> &dof_handler,
258 const ConditionalOStream &pcout,
259 std::vector<Tensor<1, 3, double>> &evaluated_vector_values);
263 const Mapping<2> &mapping,
264 const DoFHandler<2> &dof_handler,
267 const ConditionalOStream &pcout,
268 std::vector<Tensor<1, 2, double>> &evaluated_vector_values);
272 const Mapping<3> &mapping,
273 const DoFHandler<3> &dof_handler,
276 const ConditionalOStream &pcout,
277 std::vector<Tensor<1, 3, double>> &evaluated_vector_values);
282 const Mapping<2> &mapping,
283 const DoFHandler<2> &dof_handler,
284 const LinearAlgebra::distributed::Vector<double> &present_solution,
286 const ConditionalOStream &pcout,
287 std::vector<Tensor<1, 2, double>> &evaluated_vector_values);
291 const Mapping<3> &mapping,
292 const DoFHandler<3> &dof_handler,
293 const LinearAlgebra::distributed::Vector<double> &present_solution,
295 const ConditionalOStream &pcout,
296 std::vector<Tensor<1, 3, double>> &evaluated_vector_values);
300std::vector<OutputStructTableHandler>
303 std::vector<OutputStructTableHandler> table_output_structs;
306 std::string suffix =
".checkpoint";
310 const auto &filename =
311 "probe_" + Utilities::int_to_string(i, 2) +
"_" +
315 prefix + filename + suffix);
318 return table_output_structs;
void prepare_probe_tables(const Variable &variable)
Prepares probe tables by setting the entry formats and precisions for all probes of the specified var...
const Parameters::PostProcessing< dim >::ProbingPoints probing_points_parameters
std::shared_ptr< SimulationControl > simulation_control
Simulation control for current time and current iteration number.
const unsigned int output_frequency
Postprocessing output frequency.
std::vector< OutputStructTableHandler > gather_tables()
Returns a vector of references to TableHandler objects that needs to be serialized/deserialized for t...
bool check_if_table_contains_current_time(const unsigned int &probe_id)
Checks if the table of a specified probing point (probe_id) already has a row entry for the current t...
void postprocess_probes(const Mapping< dim > &mapping, const DoFHandler< dim > &dof_handler, const VectorType &present_solution, const Variable variable, const ConditionalOStream &pcout, std::vector< double > &evaluated_scalar_values)
Evaluates scalar variables (e.g., pressure) at specified points in the domain using evaluate_values_a...
PostprocessingProbes(std::shared_ptr< SimulationControl > &simulation_control, const Parameters::PostProcessing< dim >::ProbingPoints &probing_points_parameters, const unsigned int output_frequency, const Parameters::Verbosity &verbosity)
Object that evaluates variables (e.g., velocity) at specified points in the domain.
const Parameters::Verbosity verbosity
Postprocessing verbosity.
const std::string output_folder
Path to the output folder where all .dat are saved.
const unsigned int table_precision
Precision of table entries.
std::vector< TableHandler > probe_tables
std::map< Variable, Utilities::MPI::RemotePointEvaluation< dim > > remote_point_evaluators
Remote point evaluators (1 evaluator per variable).
void evaluate_values_at_points(const Mapping< dim > &mapping, const DoFHandler< dim > &dof_handler, const VectorType &solution_field, const std::vector< Point< dim > > &evaluation_points, Utilities::MPI::RemotePointEvaluation< dim > &remote_point_evaluator, std::vector< double > &evaluated_scalar_values, const unsigned int first_selected_component=0)
Evaluates the values of a scalar field at remote points of the domain from the mapping,...
void announce_string(const ConditionalOStream &pcout, const std::string &expression, const char delimiter='-')
Prints a string and then adds a line above and below made with dashes containing as many dashes as th...
Variable
Solution fields of the different physics that are used as an indicator for multiple purposes (e....
@ chemical_potential_cahn_hilliard
Chemical potential scalar field from Cahn Hilliard.
@ velocity
Velocity vector field from fluid dynamics.
@ pressure
Pressure scalar field from fluid dynamics.
std::string get_variable_string(Variable variable)
Gets for every available Variable the string corresponding to the variable.
std::string get_variable_string_with_underscores(Variable variable)
Gets for every available Variable the string corresponding to the variable. Words are separated by un...
Probing points parameters. This is used to monitor the evolution of variables (e.g....
GlobalVectorType VectorType
dealii::TrilinosWrappers::MPI::Vector GlobalVectorType
dealii::TrilinosWrappers::MPI::BlockVector GlobalBlockVectorType