Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
PostprocessingProbes< dim > Class Template Reference

#include <postprocessing_probes.h>

Public Member Functions

 PostprocessingProbes (std::shared_ptr< SimulationControl > &simulation_control, const Parameters::PostProcessing< dim >::ProbingPoints &probing_points_parameters, const unsigned int output_frequency, const Parameters::Verbosity &verbosity)
template<typename VectorType>
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)
template<typename VectorType>
void postprocess_probes (const Mapping< dim > &mapping, const DoFHandler< dim > &dof_handler, const VectorType &present_solution, const Variable variable, const ConditionalOStream &pcout, std::vector< Tensor< 1, dim, double > > &evaluated_vector_values)
void write_probing_points_tables ()
void reset_current_time_set ()
std::vector< OutputStructTableHandler > gather_tables ()
void write_checkpoint ()
void read_checkpoint ()

Public Attributes

const std::set< Variable > implemented_scalar_variables
const std::set< Variable > implemented_vector_variables = {Variable::velocity}

Private Member Functions

void prepare_probe_tables (const Variable &variable)
bool check_if_table_contains_current_time (const unsigned int &probe_id)

Private Attributes

std::shared_ptr< SimulationControl > simulation_control
const Parameters::PostProcessing< dim >::ProbingPoints probing_points_parameters
const unsigned int output_frequency
const std::string output_folder
const Parameters::Verbosity verbosity
std::set< unsigned int > probe_tables_with_current_time
std::vector< TableHandler > probe_tables
std::map< Variable, Utilities::MPI::RemotePointEvaluation< dim > > remote_point_evaluators
const unsigned int table_precision

Detailed Description

template<int dim>
class PostprocessingProbes< dim >

Definition at line 15 of file postprocessing_probes.h.

Constructor & Destructor Documentation

◆ PostprocessingProbes()

template<int dim>
PostprocessingProbes< dim >::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.

Within every physics postprocessing attribute (either NavierStokesBase::postprocess_fd() or AuxiliaryPhysics::postprocess()) the evaluation can made by calling the postprocess_probes() attribute of this object through the MultiphysicsInterface object. All evaluated values of variables of a same probe are stored within a same table. All tables are grouped in the PostprocessingProbes::probe_tables vector. Within the vector, the tables are ordered in increasing order of probe IDs.

Parameters
[in]simulation_controlSimulationControl object which is used to obtain the current time and current iteration number.
[in]probing_points_parametersSet of parameters describing the specified probing point and variables of interest.
[in]output_frequencyOutput iteration frequency for postprocessing.
[in]verbosityVerbosity level for console output.
Remarks
At the moment, probing for only the velocity, pressure, phase, and temperature variables are implemented. Implementation for other variables will follow.

Definition at line 7 of file postprocessing_probes.cc.

References output_folder, output_frequency, prepare_probe_tables(), probe_tables, probing_points_parameters, remote_point_evaluators, simulation_control, table_precision, and verbosity.

Member Function Documentation

◆ check_if_table_contains_current_time()

template<int dim>
bool PostprocessingProbes< dim >::check_if_table_contains_current_time ( const unsigned int & probe_id)
inlineprivate

Checks if the table of a specified probing point (probe_id) already has a row entry for the current time step.

Parameters
[in]probe_idIdentifier of the probing point investigated.
Returns
  • true if there already is an entry for the current time step.
  • false if there is no row for the current time step.

Definition at line 233 of file postprocessing_probes.h.

References probe_tables_with_current_time.

◆ gather_tables()

template<int dim>
std::vector< OutputStructTableHandler > PostprocessingProbes< dim >::gather_tables ( )

Returns a vector of references to TableHandler objects that needs to be serialized/deserialized for the postprocessed probes.

Returns
Structure containing a vector of references to TableHandler objects that needs to be serialized/deserialized for the postprocessed probes, and their corresponding filenames.

Definition at line 301 of file postprocessing_probes.cc.

References output_folder, probe_tables, and probing_points_parameters.

◆ postprocess_probes() [1/2]

template<int dim>
template<typename VectorType>
void PostprocessingProbes< dim >::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_at_points and fills appropriate probe tables.

Template Parameters
VectorTypeType of vector of the solution vector.
Parameters
[in]mappingMapping of the domain.
[in]dof_handlerDoF handler associated to the solution field.
[in]present_solutionVector containing the scalar solution field.
[in]variableVariable of interest.
[in]pcoutParallel console output stream.
[out]evaluated_scalar_valuesVector of evaluated scalar values.

Definition at line 45 of file postprocessing_probes.cc.

References announce_string(), check_if_table_contains_current_time(), chemical_potential_cahn_hilliard, evaluate_values_at_points(), get_variable_string(), get_variable_string_with_underscores(), pressure, probe_tables, probing_points_parameters, remote_point_evaluators, simulation_control, Parameters::verbose, and verbosity.

◆ postprocess_probes() [2/2]

template<int dim>
template<typename VectorType>
void PostprocessingProbes< dim >::postprocess_probes ( const Mapping< dim > & mapping,
const DoFHandler< dim > & dof_handler,
const VectorType & present_solution,
const Variable variable,
const ConditionalOStream & pcout,
std::vector< Tensor< 1, dim, double > > & evaluated_vector_values )

Evaluates vector variables (e.g., velocity) at specified points in the domain using evaluate_values_at_points() and fills appropriate probe tables.

Template Parameters
VectorTypeType of vector of the solution vector.
Parameters
[in]mappingMapping of the domain.
[in]dof_handlerDoF handler associated to the solution field.
[in]present_solutionVector containing the vector solution field. For distributed meshes, ghost elements must be updated.
[in]variableVariable of interest.
[in]pcoutParallel console output stream.
[out]evaluated_vector_valuesVector of evaluated vector values.
Remarks
At the moment, only the velocity variable is implemented.

Definition at line 170 of file postprocessing_probes.cc.

References announce_string(), check_if_table_contains_current_time(), evaluate_values_at_points(), get_variable_string(), get_variable_string_with_underscores(), probe_tables, probing_points_parameters, remote_point_evaluators, simulation_control, velocity, Parameters::verbose, and verbosity.

◆ prepare_probe_tables()

template<int dim>
void PostprocessingProbes< dim >::prepare_probe_tables ( const Variable & variable)
inlineprivate

Prepares probe tables by setting the entry formats and precisions for all probes of the specified variable.

Parameters
[in]variableVariable of interest.

Definition at line 183 of file postprocessing_probes.h.

References get_variable_string_with_underscores(), implemented_scalar_variables, implemented_vector_variables, probe_tables, probing_points_parameters, and table_precision.

◆ read_checkpoint()

template<int dim>
void PostprocessingProbes< dim >::read_checkpoint ( )
inline

Deserializes all probe tables.

Definition at line 160 of file postprocessing_probes.h.

References deserialize_tables_vector(), and gather_tables().

◆ reset_current_time_set()

template<int dim>
void PostprocessingProbes< dim >::reset_current_time_set ( )
inline

Clears the content of the set indicating if the current time has been added to a probe table. This is reset at every postprocessing time step.

Definition at line 129 of file postprocessing_probes.h.

References probe_tables_with_current_time.

◆ write_checkpoint()

template<int dim>
void PostprocessingProbes< dim >::write_checkpoint ( )
inline

Serializes all probe tables.

Definition at line 149 of file postprocessing_probes.h.

References gather_tables(), and serialize_tables_vector().

◆ write_probing_points_tables()

template<int dim>
void PostprocessingProbes< dim >::write_probing_points_tables ( )
inline

Writes the probe tables into output .dat file.

Definition at line 104 of file postprocessing_probes.h.

References output_folder, output_frequency, probe_tables, probing_points_parameters, and simulation_control.

Member Data Documentation

◆ implemented_scalar_variables

template<int dim>
const std::set<Variable> PostprocessingProbes< dim >::implemented_scalar_variables
Initial value:
=
@ phase
Phase indicator scalar field from CLS.
@ pressure
Pressure scalar field from fluid dynamics.
@ temperature
Temperature scalar field from heat transfer.

Set of valid scalar variables.

Definition at line 168 of file postprocessing_probes.h.

◆ implemented_vector_variables

template<int dim>
const std::set<Variable> PostprocessingProbes< dim >::implemented_vector_variables = {Variable::velocity}

Set of valid vector variables.

Definition at line 172 of file postprocessing_probes.h.

◆ output_folder

template<int dim>
const std::string PostprocessingProbes< dim >::output_folder
private

Path to the output folder where all .dat are saved.

Definition at line 257 of file postprocessing_probes.h.

◆ output_frequency

template<int dim>
const unsigned int PostprocessingProbes< dim >::output_frequency
private

Postprocessing output frequency.

Definition at line 254 of file postprocessing_probes.h.

◆ probe_tables

template<int dim>
std::vector<TableHandler> PostprocessingProbes< dim >::probe_tables
private

Tables of probe measures (1 table per probe). The table index in the vector corresponds to the probe ID.

Definition at line 269 of file postprocessing_probes.h.

◆ probe_tables_with_current_time

template<int dim>
std::set<unsigned int> PostprocessingProbes< dim >::probe_tables_with_current_time
private

Contains IDs of probe for which the current time has been added to the table to avoid duplication of time entries when a probing point contains multiple variables

Definition at line 265 of file postprocessing_probes.h.

◆ probing_points_parameters

template<int dim>
const Parameters::PostProcessing<dim>::ProbingPoints PostprocessingProbes< dim >::probing_points_parameters
private

Set of parameters describing the specified probing point and variables of interest

Definition at line 251 of file postprocessing_probes.h.

◆ remote_point_evaluators

template<int dim>
std::map<Variable, Utilities::MPI::RemotePointEvaluation<dim> > PostprocessingProbes< dim >::remote_point_evaluators
private

Remote point evaluators (1 evaluator per variable).

Definition at line 273 of file postprocessing_probes.h.

◆ simulation_control

template<int dim>
std::shared_ptr<SimulationControl> PostprocessingProbes< dim >::simulation_control
private

Simulation control for current time and current iteration number.

Definition at line 246 of file postprocessing_probes.h.

◆ table_precision

template<int dim>
const unsigned int PostprocessingProbes< dim >::table_precision
private
Initial value:
=
6

Precision of table entries.

Definition at line 276 of file postprocessing_probes.h.

◆ verbosity

template<int dim>
const Parameters::Verbosity PostprocessingProbes< dim >::verbosity
private

Postprocessing verbosity.

Definition at line 260 of file postprocessing_probes.h.


The documentation for this class was generated from the following files: