![]() |
Lethe Open-Source Library version 1.2.0
Developer Guide
|
#include <postprocessing_scalar.h>
Public Member Functions | |
| AverageScalar (const DoFHandler< dim > &dof_handler) | |
| void | calculate_average_scalar (const GlobalVectorType &local_evaluation_point, const Parameters::PostProcessing< dim > &post_processing, const double current_time, const double time_step) |
| void | initialize_vectors (const IndexSet &locally_owned_dofs, const IndexSet &locally_relevant_dofs, const MPI_Comm &mpi_communicator) |
| GlobalVectorType | get_average_scalar () |
| void | update_average_scalar () |
| void | prepare_for_mesh_adaptation () |
| void | post_mesh_adaptation () |
| std::vector< const GlobalVectorType * > | save (const std::string &prefix) |
| std::vector< GlobalVectorType * > | read (const std::string &prefix) |
| void | sanitize_after_restart () |
| void | zero_average_after_restart () |
Private Attributes | |
| GlobalVectorType | scalar_dt |
| GlobalVectorType | sum_scalar_dt |
| GlobalVectorType | sum_scalar_dt_with_ghost_cells |
| SolutionTransfer< dim, GlobalVectorType > | solution_transfer_sum_scalar_dt |
| GlobalVectorType | average_scalar |
| GlobalVectorType | average_scalar_with_ghost_cells |
| double | real_initial_time |
| double | total_time_for_average |
| double | dt |
| double | dt_0 |
| double | inv_range_time |
| bool | has_started_averaging |
Calculates the time-averaged scalar field.
| dim | An integer that denotes the dimension of the space in which the flow is solved. |
| VectorType | The vector type used for the solvers (Trilinos (normal or block) or deal.II vectors). |
| DofsType | The type of storage of indices which differs according to vector. |
Definition at line 27 of file postprocessing_scalar.h.
| AverageScalar< dim >::AverageScalar | ( | const DoFHandler< dim > & | dof_handler | ) |
Constructor that initializes the solution transfer objects for the scalar field.
| [in] | dof_handler | Used to initialize the solution transfer objects. The solution transfer object is later used for mesh adaptation. |
Definition at line 12 of file postprocessing_scalar.cc.
References has_started_averaging, solution_transfer_sum_scalar_dt, and total_time_for_average.
| void AverageScalar< dim >::calculate_average_scalar | ( | const GlobalVectorType & | local_evaluation_point, |
| const Parameters::PostProcessing< dim > & | post_processing, | ||
| const double | current_time, | ||
| const double | time_step ) |
Calculate time-averaged scalar field using vector with no ghost cells.
| [in] | local_evaluation_point | The solution vector with no ghost cells. |
| [in] | post_processing | The postprocessing parameters to get the initial time used for averaging. |
| [in] | current_time | The current time. |
| [in] | time_step | The time step. |
Definition at line 20 of file postprocessing_scalar.cc.
References average_scalar, dt, dt_0, has_started_averaging, Parameters::PostProcessing< dim >::initial_time_for_average_temp_and_hf, inv_range_time, real_initial_time, scalar_dt, sum_scalar_dt, and total_time_for_average.
|
inline |
Getter for the average scalar.
Definition at line 81 of file postprocessing_scalar.h.
References average_scalar.
| void AverageScalar< dim >::initialize_vectors | ( | const IndexSet & | locally_owned_dofs, |
| const IndexSet & | locally_relevant_dofs, | ||
| const MPI_Comm & | mpi_communicator ) |
Calculate time-averaged scalar field using vector with no ghost cells.
| [in] | locally_owned_dofs | Degrees of freedom owned by a single processor. |
| [in] | locally_relevant_dofs | Degrees of freedom that live on locally owned or ghost cells of a single processor. |
| [in] | mpi_communicator | The communicator information. |
Definition at line 60 of file postprocessing_scalar.cc.
References average_scalar, average_scalar_with_ghost_cells, scalar_dt, sum_scalar_dt, and sum_scalar_dt_with_ghost_cells.
| void AverageScalar< dim >::post_mesh_adaptation | ( | ) |
Reestablish solution vectors after dynamic mesh adaptation.
Definition at line 101 of file postprocessing_scalar.cc.
References solution_transfer_sum_scalar_dt, sum_scalar_dt, sum_scalar_dt_with_ghost_cells, and update_average_scalar().
| void AverageScalar< dim >::prepare_for_mesh_adaptation | ( | ) |
Prepare average scalar object for dynamic mesh adaptation.
Definition at line 92 of file postprocessing_scalar.cc.
References solution_transfer_sum_scalar_dt, sum_scalar_dt, and sum_scalar_dt_with_ghost_cells.
| std::vector< GlobalVectorType * > AverageScalar< dim >::read | ( | const std::string & | prefix | ) |
Read checkpoints to continuing averaging after restart.
| [in] | prefix | Name for checkpoint files. |
Definition at line 132 of file postprocessing_scalar.cc.
References check_file_exists(), dt_0, has_started_averaging, real_initial_time, and sum_scalar_dt_with_ghost_cells.
|
inline |
Sanitize the average scalar object after a checkpoint has been read by resetting all of the locally_owned vectors using the locally_relevant vectors. This is necessary because only the locally_relevant_vectors are saved, but the calculation routines expect that the content of the locally_owned vectors match that of the locally_relevant vectors.
Definition at line 133 of file postprocessing_scalar.h.
References sum_scalar_dt, and sum_scalar_dt_with_ghost_cells.
| std::vector< const GlobalVectorType * > AverageScalar< dim >::save | ( | const std::string & | prefix | ) |
Save checkpoints to continue the averaging after the restart.
| [in] | prefix | Name for checkpointing files. |
Definition at line 112 of file postprocessing_scalar.cc.
References dt_0, has_started_averaging, real_initial_time, sum_scalar_dt, and sum_scalar_dt_with_ghost_cells.
| void AverageScalar< dim >::update_average_scalar | ( | ) |
Prepare average scalar object for dynamic mesh adaptation.
Definition at line 80 of file postprocessing_scalar.cc.
References average_scalar, inv_range_time, sum_scalar_dt, and total_time_for_average.
| void AverageScalar< dim >::zero_average_after_restart | ( | ) |
Reinitialize the values of sum_scalar_dt_with_ghost_cells vector to 0 and the has_started_averaging flag to false. If the initial time for average temperature and heat flux parameter is greater than the simulation time, the checkpointed time-averaged heat flux is ignored after a restart. This allows users to restart a simulation with a different averaging start time.
Definition at line 154 of file postprocessing_scalar.cc.
References has_started_averaging, sum_scalar_dt, and sum_scalar_dt_with_ghost_cells.
|
private |
Time averaged scalar.
Definition at line 172 of file postprocessing_scalar.h.
|
private |
Time averaged scalar containing the locally owned and locally relevant dofs for all processes.
Definition at line 177 of file postprocessing_scalar.h.
|
private |
Time step.
Definition at line 194 of file postprocessing_scalar.h.
|
private |
First time step is stored in dt_0 and added to total_time_for_average to ensure the first average calculation does not result in a division by zero.
Definition at line 200 of file postprocessing_scalar.h.
|
private |
Track whether we are within the averaging time period.
Definition at line 212 of file postprocessing_scalar.h.
|
private |
Inverse of the total time for averaging.
Definition at line 206 of file postprocessing_scalar.h.
|
private |
Difference between the simulation starting time and the initial averaging time.
Definition at line 182 of file postprocessing_scalar.h.
|
private |
Vector to store the scalar field multiplied by time step.
Definition at line 149 of file postprocessing_scalar.h.
|
private |
Object to transfer the averaged scalar in case of mesh adaptation.
Definition at line 167 of file postprocessing_scalar.h.
|
private |
Vector to store the sum of all the scalar multiplied by time step.
Definition at line 155 of file postprocessing_scalar.h.
|
private |
Ghosted vector to store the sum of all the scalar multiplied by time step.
Definition at line 161 of file postprocessing_scalar.h.
|
private |
Vector to store the sum of all the scalar field multiplied by time step.
Definition at line 188 of file postprocessing_scalar.h.