4#ifndef lethe_postprocessing_probes_h
5#define lethe_postprocessing_probes_h
64 template <
typename VectorType>
67 const DoFHandler<dim> &dof_handler,
70 const ConditionalOStream &pcout,
71 std::vector<double> &evaluated_scalar_values);
90 template <
typename VectorType>
93 const Mapping<dim> &mapping,
94 const DoFHandler<dim> &dof_handler,
97 const ConditionalOStream &pcout,
98 std::vector<Tensor<1, dim, double>> &evaluated_vector_values);
108 if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)
112 std::string file_path =
116 std::ofstream output(file_path.c_str());
142 std::vector<OutputStructTableHandler>
151 const std::vector<OutputStructTableHandler> &table_output_structs =
162 std::vector<OutputStructTableHandler> table_output_structs =
185 const auto &probing_points_of_variable =
190 for (
const unsigned int &
id : probing_points_of_variable.ids)
193 const std::string column_name =
198 current_table.declare_column(column_name);
200 current_table.set_scientific(column_name,
true);
205 current_table.declare_column(column_name +
"_x");
207 current_table.set_scientific(column_name +
"_x",
true);
208 current_table.declare_column(column_name +
"_y");
210 current_table.set_scientific(column_name +
"_y",
true);
211 if constexpr (dim == 3)
213 current_table.declare_column(column_name +
"_z");
214 current_table.set_precision(column_name +
"_z",
216 current_table.set_scientific(column_name +
"_z",
true);
272 std::map<Variable, Utilities::MPI::RemotePointEvaluation<dim>>
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.
const std::set< Variable > implemented_scalar_variables
Set of valid scalar variables.
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.
void reset_current_time_set()
Clears the content of the set indicating if the current time has been added to a probe table....
const Parameters::Verbosity verbosity
Postprocessing verbosity.
void write_probing_points_tables()
Writes the probe tables into output .dat file.
const std::string output_folder
Path to the output folder where all .dat are saved.
const unsigned int table_precision
Precision of table entries.
void read_checkpoint()
Deserializes all probe tables.
std::vector< TableHandler > probe_tables
void write_checkpoint()
Serializes all probe tables.
std::set< unsigned int > probe_tables_with_current_time
std::map< Variable, Utilities::MPI::RemotePointEvaluation< dim > > remote_point_evaluators
Remote point evaluators (1 evaluator per variable).
const std::set< Variable > implemented_vector_variables
Set of valid vector variables.
void serialize_tables_vector(const std::vector< OutputStructTableHandler > &table_output_structs, const MPI_Comm mpi_communicator)
Serializes all the TableHandler objects in table_output_structs.
void deserialize_tables_vector(std::vector< OutputStructTableHandler > &table_output_structs, const MPI_Comm mpi_communicator)
Deserializes all the TableHandler objects in table_output_structs.
Variable
Solution fields of the different physics that are used as an indicator for multiple purposes (e....
@ phase
Phase indicator scalar field from CLS.
@ velocity
Velocity vector field from fluid dynamics.
@ pressure
Pressure scalar field from fluid dynamics.
@ temperature
Temperature scalar field from heat transfer.
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...
Simulation control classes for managing time-stepping and iteration control in Lethe.
Probing points parameters. This is used to monitor the evolution of variables (e.g....
GlobalVectorType VectorType