4#ifndef lethe_average_scalar_in_time_h
5#define lethe_average_scalar_in_time_h
9#include <deal.II/numerics/solution_transfer.h>
56 const double current_time,
57 const double time_step);
73 const IndexSet &locally_relevant_dofs,
74 const MPI_Comm &mpi_communicator);
111 std::vector<const GlobalVectorType *>
112 save(
const std::string &prefix);
121 std::vector<GlobalVectorType *>
122 read(
const std::string &prefix);
SolutionTransfer< dim, GlobalVectorType > solution_transfer_sum_scalar_dt
Object to transfer the averaged scalar in case of mesh adaptation.
std::vector< const GlobalVectorType * > save(const std::string &prefix)
Save checkpoints to continue the averaging after the restart.
GlobalVectorType average_scalar_with_ghost_cells
Time averaged scalar containing the locally owned and locally relevant dofs for all processes.
void zero_average_after_restart()
Reinitialize the values of sum_scalar_dt_with_ghost_cells vector to 0 and the has_started_averaging f...
GlobalVectorType get_average_scalar()
Getter for the average scalar.
GlobalVectorType average_scalar
Time averaged scalar.
double inv_range_time
Inverse of the total time for averaging.
void prepare_for_mesh_adaptation()
Prepare average scalar object for dynamic mesh adaptation.
GlobalVectorType scalar_dt
Vector to store the scalar field multiplied by time step.
bool has_started_averaging
Track whether we are within the averaging time period.
GlobalVectorType sum_scalar_dt_with_ghost_cells
Ghosted vector to store the sum of all the scalar multiplied by time step.
GlobalVectorType sum_scalar_dt
Vector to store the sum of all the scalar multiplied by time step.
double dt_0
First time step is stored in dt_0 and added to total_time_for_average to ensure the first average cal...
double total_time_for_average
Vector to store the sum of all the scalar field multiplied by time step.
void 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.
AverageScalar(const DoFHandler< dim > &dof_handler)
Constructor that initializes the solution transfer objects for the scalar field.
void sanitize_after_restart()
Sanitize the average scalar object after a checkpoint has been read by resetting all of the locally_o...
void 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.
void post_mesh_adaptation()
Reestablish solution vectors after dynamic mesh adaptation.
double real_initial_time
Difference between the simulation starting time and the initial averaging time.
std::vector< GlobalVectorType * > read(const std::string &prefix)
Read checkpoints to continuing averaging after restart.
void update_average_scalar()
Prepare average scalar object for dynamic mesh adaptation.
Postprocessing - Defines the parameters for the post-processing. In Lethe, post-processing implies th...
dealii::TrilinosWrappers::MPI::Vector GlobalVectorType