4#ifndef lethe_postprocessing_velocities_h
5#define lethe_postprocessing_velocities_h
9#include <deal.II/base/types.h>
11#include <deal.II/dofs/dof_handler.h>
13#include <deal.II/numerics/solution_transfer.h>
48template <
int dim,
typename VectorType,
typename DofsType>
82 const double ¤t_time,
83 const double &time_step);
106 std::shared_ptr<VectorType>
154 const DofsType &locally_relevant_dofs,
155 const MPI_Comm &mpi_communicator);
176 std::vector<const VectorType *>
177 save(
const std::string &prefix);
186 std::vector<VectorType *>
187 read(
const std::string &prefix);
380 SolutionTransfer<dim, VectorType>
388 SolutionTransfer<dim, VectorType>
VectorType sum_velocity_dt
Vector to store the sum of all the velocities multiplied by time step.
SolutionTransfer< dim, VectorType > solution_transfer_sum_reynolds_normal_stress_dt
Object used to transfer the average Reynolds normal stresses in case of mesh adaptation.
VectorType reynolds_normal_stress_dt
Vector to store the velocities multiplied by the time step to calculate the normal stresses.
VectorType sum_velocity_dt_with_ghost_cells
Ghosted vector to store the sum of all the velocities multiplied by time step.
VectorType average_velocities
Vector to store average velocities.
VectorType sum_rns_dt_with_ghost_cells
Ghosted vector to store sum of the velocities multiplied by the time step to calculate the normal str...
std::vector< const VectorType * > save(const std::string &prefix)
Save checkpoints to continuing averaging after restart.
VectorType velocity_dt
Vector to store the velocity multiplied by time step.
double inv_range_time
Inverse for total time for averaging.
std::shared_ptr< VectorType > get_av
Shared pointer to the getter vector for the average velocities.
SolutionTransfer< dim, VectorType > solution_transfer_sum_reynolds_shear_stress_dt
Object used to transfer the average Reynolds shear stresses in case of mesh adaptation.
void initialize_vectors(const DofsType &locally_owned_dofs, const DofsType &locally_relevant_dofs, const MPI_Comm &mpi_communicator)
Initialize all the important vectors for the average velocities and reynolds stresses calculation....
VectorType get_rns
Getter vector for the average Reynolds normal stresses.
VectorType sum_reynolds_shear_stress_dt
Vector to store the sum the velocities multiplied by the time step to calculate the shear stresses.
void sanitize_after_restart(const double current_time)
Sanitize the average velocity object after a checkpoint has been read by resetting all of the locally...
void post_mesh_adaptation()
Reestablish solution vectors after dynamic mesh adaptation.
VectorType get_rss
Getter vector for the average Reynolds shear stresses.
void calculate_reynolds_stresses(const VectorType &local_evaluation_point)
Calculate normal and other resolved time-averaged Reynold stresses and .
void gather_locally_owned_support_points()
Gather the degrees of freedom of every locally owned velocity support point, with the pressure degree...
VectorType sum_rss_dt_with_ghost_cells
Ghosted vector to store the sum the velocities multiplied by the time step to calculate the shear str...
void update_average_velocities()
std::vector< SupportPointDoFs > locally_owned_support_points
Degrees of freedom of the locally owned velocity support points.
const DoFHandler< dim > & dof_handler
DoFHandler of the velocity and pressure fields.
double dt_0
Store the first time step in case it varies.
const VectorType & get_reynolds_shear_stresses()
Give the time-averaged Reynolds shear stresses with ghost cells.
const VectorType & get_reynolds_normal_stresses()
Give the time-averaged Reynolds normal stresses with ghost cells.
void prepare_for_mesh_adaptation()
Prepare average velocity object for dynamic mesh adaptation.
void calculate_average_velocities(const VectorType &local_evaluation_point, const Parameters::PostProcessing< dim > &post_processing, const double ¤t_time, const double &time_step)
Calculate time-averaged velocities and pressure using vector with no ghost cells.
std::vector< VectorType * > read(const std::string &prefix)
Read checkpoints to continuing averaging after restart.
SolutionTransfer< dim, VectorType > solution_transfer_sum_velocity_dt
Object used to transfer the average velocities in case of mesh adaptation.
std::shared_ptr< VectorType > get_average_velocities()
Give the average of solutions with ghost cells.
bool has_started_averaging
Track whether we are within the averaging time period.
AverageVelocities(DoFHandler< dim > &dof_handler)
Constructor that initializes the solution transfer objects for the velocity and the Reynolds stresses...
void zero_average_after_restart()
Reinitialize the values of sum_velocities_dt_with_ghost_cells vector to 0 and the has_started_averagi...
VectorType reynolds_shear_stress_dt
Vector to store the velocities multiplied by the time step to calculate the shear stresses.
double real_initial_time
Initial time of the simulation.
VectorType reynolds_shear_stresses
Vector with average average Reynolds shear stresses.
VectorType sum_reynolds_normal_stress_dt
Vector to store sum of the velocities multiplied by the time step to calculate the normal stresses.
double total_time_for_average
Total period of time for averaging.
VectorType reynolds_normal_stresses
Vector with average Reynolds normal stresses.
Postprocessing - Defines the parameters for the post-processing. In Lethe, post-processing implies th...
Global indices of the degrees of freedom located at one velocity support point.
types::global_dof_index pressure
Degree of freedom of the pressure at the same support point, or numbers::invalid_dof_index if the pre...
std::array< types::global_dof_index, dim > velocity
Degrees of freedom of the dim velocity components.
GlobalVectorType VectorType