21#include <deal.II/distributed/fully_distributed_tria.h>
22#include <deal.II/distributed/grid_refinement.h>
24#include <deal.II/dofs/dof_renumbering.h>
26#include <deal.II/fe/fe_q.h>
27#include <deal.II/fe/fe_q_bubbles.h>
28#include <deal.II/fe/fe_simplex_p.h>
30#include <deal.II/grid/tria_iterator.h>
32#include <deal.II/numerics/data_out.h>
33#include <deal.II/numerics/data_out_faces.h>
34#include <deal.II/numerics/data_out_resample.h>
35#include <deal.II/numerics/error_estimator.h>
36#include <deal.II/numerics/matrix_tools.h>
37#include <deal.II/numerics/solution_transfer.h>
38#include <deal.II/numerics/vector_tools.h>
40#include <deal.II/opencascade/manifold_lib.h>
41#include <deal.II/opencascade/utilities.h>
48template <
int dim,
typename VectorType,
typename DofsType>
61 TimerOutput::wall_times)
72 const FE_SimplexP<dim> velocity_fe(
73 p_nsparam.fem_parameters.velocity_degree);
74 const FE_SimplexP<dim> pressure_fe(
75 p_nsparam.fem_parameters.pressure_degree);
76 fe = std::make_shared<FESystem<dim>>(velocity_fe, dim, pressure_fe, 1);
79 !p_nsparam.fem_parameters.enable_bubble_function_velocity ||
80 !p_nsparam.fem_parameters.enable_bubble_function_pressure,
82 "Bubble enrichment functions are not compatible with simplex meshes."));
84 mapping = std::make_shared<MappingFE<dim>>(velocity_fe);
86 std::make_shared<QGaussSimplex<dim>>(number_quadrature_points);
88 std::make_shared<QGaussSimplex<dim - 1>>(number_quadrature_points);
90 std::make_shared<parallel::fullydistributed::Triangulation<dim>>(
91 this->mpi_communicator);
92 dof_handler = std::make_shared<DoFHandler<dim>>(*this->triangulation);
97 std::shared_ptr<FiniteElement<dim>> fe_u;
98 std::shared_ptr<FiniteElement<dim>> fe_p;
100 if (p_nsparam.fem_parameters.enable_bubble_function_velocity)
101 fe_u = std::make_shared<FE_Q_Bubbles<dim>>(
102 p_nsparam.fem_parameters.velocity_degree);
105 std::make_shared<FE_Q<dim>>(p_nsparam.fem_parameters.velocity_degree);
107 if (p_nsparam.fem_parameters.enable_bubble_function_pressure)
108 fe_p = std::make_shared<FE_Q_Bubbles<dim>>(
109 p_nsparam.fem_parameters.pressure_degree);
112 std::make_shared<FE_Q<dim>>(p_nsparam.fem_parameters.pressure_degree);
114 fe = std::make_shared<FESystem<dim>>(*fe_u, dim, *fe_p, 1);
115 mapping = std::make_shared<MappingQ<dim>>(velocity_fem_degree);
116 cell_quadrature = std::make_shared<QGauss<dim>>(number_quadrature_points);
118 std::make_shared<QGauss<dim - 1>>(number_quadrature_points);
120 std::make_shared<parallel::distributed::Triangulation<dim>>(
121 this->mpi_communicator,
122 Triangulation<dim>::limit_level_difference_at_vertices,
123 (p_nsparam.linear_solver.at(fluid_dynamics).preconditioner ==
124 Parameters::LinearSolver::PreconditionerType::lsmg) ?
125 parallel::distributed::Triangulation<
126 dim>::construct_multigrid_hierarchy :
127 parallel::distributed::Triangulation<dim>::default_setting);
128 dof_handler = std::make_shared<DoFHandler<dim>>(*this->triangulation);
131 this->pcout.set_condition(
132 Utilities::MPI::this_mpi_process(this->mpi_communicator) == 0);
138 std::string output_dir_name =
145 if (stat(output_dir_name.c_str(), &buffer) != 0)
158 simulation_control = std::make_shared<SimulationControlAdjointSteady>(
159 simulation_parameters.simulation_control);
163 simulation_control = std::make_shared<SimulationControlTransient>(
164 simulation_parameters.simulation_control);
176 fluid_dynamics_formulation);
182 this->use_manifold_for_normal =
true;
184 this->use_manifold_for_normal =
false;
189 this->simulation_control->is_sdirk()),
190 ExcMessage(
"SDIRK time-stepping methods are not supported with "
191 "the mortar method. Use a BDF method instead."));
197 sdirk_vectors.previous_k_j_solutions.resize(
198 SimulationControl::get_number_of_stages(
199 this->simulation_control->get_assembly_method()));
213 .calculate_average_velocities ||
214 this->simulation_parameters.initial_condition->type ==
220 this->pcout <<
"Running on "
221 << Utilities::MPI::n_mpi_processes(this->mpi_communicator)
222 <<
" MPI rank(s)..." << std::endl;
224 this->pcout << std::setprecision(
229template <
int dim,
typename VectorType,
typename DofsType>
242 *this->face_quadrature,
243 *this->get_mapping());
254 this->this_mpi_process == 0)
257 this->
pcout <<
"Space-average velocity: " << average_velocity
268template <
int dim,
typename VectorType,
typename DofsType>
273 bool bc_exist =
false;
275 for (
auto const &[
id, type] :
287template <
int dim,
typename VectorType,
typename DofsType>
299 *this->face_quadrature,
300 *this->get_mapping());
304 this->this_mpi_process == 0)
306 std::cout << std::endl;
307 std::string independent_column_names =
"Boundary ID";
309 std::vector<std::string> dependent_column_names;
310 dependent_column_names.emplace_back(
"f_x");
311 dependent_column_names.emplace_back(
"f_y");
313 dependent_column_names.emplace_back(
"f_z");
314 dependent_column_names.emplace_back(
"f_xv");
315 dependent_column_names.emplace_back(
"f_yv");
317 dependent_column_names.emplace_back(
"f_zv");
318 dependent_column_names.emplace_back(
"f_xp");
319 dependent_column_names.emplace_back(
"f_yp");
321 dependent_column_names.emplace_back(
"f_zp");
323 std::vector<unsigned int> boundary_ids =
326 std::vector<Tensor<1, dim>> total_forces =
329 std::vector<Tensor<1, dim>> viscous_forces =
332 std::vector<Tensor<1, dim>> pressure_forces =
335 std::vector<std::vector<Tensor<1, dim>>> all_forces{total_forces,
341 independent_column_names,
343 dependent_column_names,
344 this->simulation_parameters.simulation_control.log_precision,
347 std::cout <<
"+------------------------------------------+" << std::endl;
348 std::cout <<
"| Force summary |" << std::endl;
349 std::cout <<
"+------------------------------------------+" << std::endl;
350 table.write_text(std::cout);
353 for (
auto const &[
id, type] : simulation_parameters.boundary_conditions.type)
355 if (simulation_control->is_steady())
357 this->forces_tables[id].add_value(
358 "cells", this->triangulation->n_global_active_cells());
362 this->forces_tables[id].add_value(
363 "time", simulation_control->get_current_time());
364 this->forces_tables[id].set_precision(
365 "time", simulation_parameters.forces_parameters.output_precision);
368 this->forces_tables[id].add_value(
"f_x",
369 this->forces_on_boundaries[0][
id][0]);
370 this->forces_tables[id].add_value(
"f_y",
371 this->forces_on_boundaries[0][
id][1]);
423template <
int dim,
typename VectorType,
typename DofsType>
430 std::map<types::boundary_id, Tensor<1, 3>> torques_on_boundaries =
435 *this->face_quadrature,
436 *this->get_mapping());
440 this->this_mpi_process == 0)
442 this->
pcout << std::endl;
443 std::string independent_column_names =
"Boundary ID";
445 std::vector<std::string> dependent_column_names;
446 dependent_column_names.emplace_back(
"T_x");
447 dependent_column_names.emplace_back(
"T_y");
448 dependent_column_names.emplace_back(
"T_z");
450 std::vector<unsigned int> boundary_ids =
452 std::vector<Tensor<1, 3>> torques =
457 independent_column_names,
459 dependent_column_names,
463 std::cout <<
"+------------------------------------------+" << std::endl;
464 std::cout <<
"| Torque summary |" << std::endl;
465 std::cout <<
"+------------------------------------------+" << std::endl;
466 table.write_text(std::cout);
469 for (
auto const &[boundary_id, type] :
479 this->torques_tables[boundary_id].add_value(
480 "time", simulation_control->get_current_time());
481 this->torques_tables[boundary_id].set_precision(
482 "time", simulation_parameters.forces_parameters.output_precision);
484 this->torques_tables[boundary_id].add_value(
485 "T_x", torques_on_boundaries[boundary_id][0]);
486 this->torques_tables[boundary_id].add_value(
487 "T_y", torques_on_boundaries[boundary_id][1]);
488 this->torques_tables[boundary_id].add_value(
489 "T_z", torques_on_boundaries[boundary_id][2]);
492 this->torques_tables[boundary_id].set_precision(
493 "T_x", simulation_parameters.forces_parameters.output_precision);
494 this->torques_tables[boundary_id].set_precision(
495 "T_y", simulation_parameters.forces_parameters.output_precision);
496 this->torques_tables[boundary_id].set_precision(
497 "T_z", simulation_parameters.forces_parameters.output_precision);
502template <
int dim,
typename VectorType,
typename DofsType>
517 error_table.set_scientific(
"error_pressure",
true);
518 error_table.omit_column_from_convergence_rate_evaluation(
"cells");
520 ConvergenceTable::reduction_rate_log2);
522 error_table.set_scientific(
"error_velocity",
true);
526 std::string filename =
529 std::ofstream output(filename.c_str());
531 std::vector<std::string> sub_columns;
535 sub_columns.emplace_back(
"cells");
536 sub_columns.emplace_back(
"error_velocity");
537 sub_columns.emplace_back(
"error_pressure");
542 error_table.set_precision(
"error_velocity",
543 simulation_control->get_log_precision());
545 error_table.write_text(std::cout);
552 this->pcout << std::defaultfloat;
554 this->
pcout << std::scientific;
558template <
int dim,
typename VectorType,
typename DofsType>
564 (*previous_solutions)[i] = (*previous_solutions)[i - 1];
570template <
int dim,
typename VectorType,
typename DofsType>
578 "Calculate CFL and percolate time vectors");
584 *this->cell_quadrature,
585 *this->get_mapping());
588 if (this->simulation_parameters.restart_parameters.checkpoint &&
589 simulation_control->get_iteration_number() != 0 &&
590 (simulation_control->get_iteration_number() %
591 this->simulation_parameters.restart_parameters.frequency ==
593 simulation_control->is_at_end()))
598 if (this->simulation_parameters.timer.type ==
602 this->pcout << std::defaultfloat;
603 this->computing_timer.print_summary();
604 this->pcout << std::scientific;
605 this->computing_timer.reset();
611template <
int dim,
typename VectorType,
typename DofsType>
619template <
int dim,
typename VectorType,
typename DofsType>
627template <
int dim,
typename VectorType,
typename DofsType>
632template <
int dim,
typename VectorType,
typename DofsType>
648 this->simulation_parameters.initial_condition->uvwp.set_time(
649 this->simulation_control->get_current_time());
650 set_initial_condition_fd(
651 this->simulation_parameters.initial_condition->type);
658template <
int dim,
typename VectorType,
typename DofsType>
671 const unsigned int n_stages =
681 for (
unsigned int stage = 0; stage < n_stages; ++stage)
726 if (this->
multiphysics->get_active_physics().size() > 1)
747template <
int dim,
typename VectorType,
typename DofsType>
760template <
int dim,
typename VectorType,
typename DofsType>
769 for (
unsigned int c_id = 0;
776 this->simulation_parameters.constrain_solid_domain
777 .temperature_min_values[c_id],
778 this->simulation_parameters.constrain_solid_domain
779 .temperature_max_values[c_id],
780 this->simulation_parameters.constrain_solid_domain
781 .filtered_phase_indicator_tolerance[c_id]);
786 const DoFHandler<dim> &dof_handler_ht =
790 std::make_shared<FEValues<dim>>(*this->
get_mapping(),
791 dof_handler_ht.get_fe(),
798 const DoFHandler<dim> &dof_handler_cls =
802 std::make_shared<FEValues<dim>>(*this->
get_mapping(),
803 dof_handler_cls.get_fe(),
809template <
int dim,
typename VectorType,
typename DofsType>
814 this->simulation_parameters.mesh_adaptation))
826template <
int dim,
typename VectorType,
typename DofsType>
835 for (
unsigned int i_box = 0;
837 ->number_of_refinement_boxes;
842 Triangulation<dim> box_to_refine;
845 ->refinement_boxes_meshes)[i_box],
849 for (
unsigned int i = 0;
851 ->box_additional_refinements[i_box];
854 if (
dynamic_cast<parallel::distributed::Triangulation<dim> *
>(
859 *
dynamic_cast<parallel::distributed::Triangulation<dim> *
>(
864 this->
pcout <<
"Initial refinement in box " << i_box <<
" - Step "
867 ->box_additional_refinements[i_box]
878 tria.prepare_coarsening_and_refinement();
881 SolutionTransfer<dim, VectorType> solution_transfer(
883 std::vector<SolutionTransfer<dim, VectorType>>
884 previous_solutions_transfer;
889 previous_solutions_transfer.emplace_back(
890 SolutionTransfer<dim, VectorType>(*this->
dof_handler,
true));
891 if constexpr (std::is_same_v<
893 LinearAlgebra::distributed::Vector<double>>)
895 previous_solutions_transfer[p]
896 .prepare_for_coarsening_and_refinement(
900 if constexpr (std::is_same_v<
902 LinearAlgebra::distributed::Vector<double>>)
903 present_solution.update_ghost_values();
904 solution_transfer.prepare_for_coarsening_and_refinement(
907 multiphysics->prepare_for_mesh_adaptation();
908 if (this->average_velocities_are_enabled())
909 average_velocities->prepare_for_mesh_adaptation();
911 tria.execute_coarsening_and_refinement();
918 solution_transfer.interpolate(tmp);
921 auto &nonzero_constraints = this->nonzero_constraints;
922 nonzero_constraints.distribute(tmp);
925 present_solution = tmp;
927 for (
unsigned int i = 0; i < previous_solutions->size(); ++i)
929 VectorType tmp_previous_solution = init_temporary_vector();
930 previous_solutions_transfer[i].interpolate(tmp_previous_solution);
931 nonzero_constraints.distribute(tmp_previous_solution);
932 (*previous_solutions)[i] = tmp_previous_solution;
935 multiphysics->post_mesh_adaptation();
936 if (this->average_velocities_are_enabled())
937 average_velocities->post_mesh_adaptation();
943template <
int dim,
typename VectorType,
typename DofsType>
947 if (
dynamic_cast<parallel::distributed::Triangulation<dim> *
>(
951 auto &tria = *
dynamic_cast<parallel::distributed::Triangulation<dim> *
>(
960 Vector<float> estimated_error_per_cell(tria.n_active_cells());
961 const FEValuesExtractors::Vector
velocity(0);
962 const FEValuesExtractors::Scalar
pressure(dim);
969 locally_relevant_solution.update_ghost_values();
974 std::vector<bool> global_refine_flags(dim * tria.n_active_cells(),
false);
975 std::vector<bool> global_coarsen_flags(dim * tria.n_active_cells(),
false);
977 bool first_variable(
true);
978 const double coarsening_factor =
mesh_controller.calculate_coarsening_factor(
981 unsigned int maximal_number_of_elements =
987 maximal_number_of_elements = INT_MAX;
989 for (
const std::pair<const Variable, Parameters::MultipleAdaptationParameters>
993 error_indicator_type = ivar.second.error_estimator;
994 double ivar_coarsening_factor = ivar.second.coarsening_fraction;
996 .mesh_controller_is_enabled)
997 ivar_coarsening_factor = coarsening_factor;
1002 error_indicator_type ==
1005 "For the pressure variable, only the Kelly error estimator is "
1008 KellyErrorEstimator<dim>::estimate(
1012 typename std::map<types::boundary_id,
1013 const Function<dim, double> *>(),
1014 locally_relevant_solution,
1015 estimated_error_per_cell,
1021 error_indicator_type ==
1024 "For the velocity variable, only the Kelly error estimator is "
1027 KellyErrorEstimator<dim>::estimate(
1031 typename std::map<types::boundary_id,
1032 const Function<dim, double> *>(),
1033 locally_relevant_solution,
1034 estimated_error_per_cell,
1040 multiphysics->compute_error_estimate(ivar, estimated_error_per_cell);
1045 parallel::distributed::GridRefinement::refine_and_coarsen_fixed_number(
1047 estimated_error_per_cell,
1048 ivar.second.refinement_fraction,
1049 ivar_coarsening_factor,
1050 maximal_number_of_elements);
1054 parallel::distributed::GridRefinement::
1055 refine_and_coarsen_fixed_fraction(tria,
1056 estimated_error_per_cell,
1057 ivar.second.refinement_fraction,
1058 ivar_coarsening_factor);
1063 .is_boundary_refinement_fixed)
1064 for (
const auto &cell : tria.active_cell_iterators())
1065 if (cell->is_locally_owned())
1067 if (cell->at_boundary())
1068 for (
const auto &face : cell->face_iterators())
1071 .boundaries_to_fix.begin(),
1072 this->simulation_parameters.mesh_adaptation
1073 .boundaries_to_fix.end(),
1074 face->boundary_id()) !=
1075 this->simulation_parameters.mesh_adaptation
1076 .boundaries_to_fix.end())
1078 cell->clear_refine_flag();
1079 cell->clear_coarsen_flag();
1084 std::vector<bool> current_refine_flags;
1085 std::vector<bool> current_coarsen_flags;
1087 tria.save_refine_flags(current_refine_flags);
1088 tria.save_coarsen_flags(current_coarsen_flags);
1094 global_refine_flags = current_refine_flags;
1095 global_coarsen_flags = current_coarsen_flags;
1097 first_variable =
false;
1102 for (std::vector<bool>::size_type i = 0;
1103 i != global_refine_flags.size();
1107 global_refine_flags[i] =
1108 global_refine_flags[i] || current_refine_flags[i];
1112 for (std::vector<bool>::size_type i = 0;
1113 i != global_coarsen_flags.size();
1117 global_coarsen_flags[i] =
1118 global_coarsen_flags[i] && current_coarsen_flags[i];
1123 for (
const auto &cell : tria.active_cell_iterators())
1125 cell->clear_coarsen_flag();
1126 cell->clear_refine_flag();
1131 tria.load_refine_flags(global_refine_flags);
1132 tria.load_coarsen_flags(global_coarsen_flags);
1134 if (tria.n_levels() >
1135 this->simulation_parameters.mesh_adaptation.maximum_refinement_level)
1136 for (
typename Triangulation<dim>::active_cell_iterator cell =
1137 tria.begin_active(this->simulation_parameters.mesh_adaptation
1138 .maximum_refinement_level);
1141 cell->clear_refine_flag();
1142 for (
typename Triangulation<dim>::active_cell_iterator cell =
1143 tria.begin_active(this->simulation_parameters.mesh_adaptation
1144 .minimum_refinement_level);
1147 this->simulation_parameters.mesh_adaptation.minimum_refinement_level);
1149 cell->clear_coarsen_flag();
1151 tria.prepare_coarsening_and_refinement();
1154 SolutionTransfer<dim, VectorType> solution_transfer(*this->
dof_handler,
true);
1155 std::vector<SolutionTransfer<dim, VectorType>> previous_solutions_transfer;
1160 previous_solutions_transfer.emplace_back(
1161 SolutionTransfer<dim, VectorType>(*this->
dof_handler,
true));
1163 LinearAlgebra::distributed::Vector<double>>)
1165 previous_solutions_transfer[i].prepare_for_coarsening_and_refinement(
1170 LinearAlgebra::distributed::Vector<double>>)
1178 tria.execute_coarsening_and_refinement();
1190template <
int dim,
typename VectorType,
typename DofsType>
1195 this->simulation_parameters.mesh_adaptation.maximum_refinement_level)
1197 AssertThrow(this->
triangulation->all_reference_cells_are_hyper_cube(),
1198 ExcMessage(
"Uniform refinement is not supported for "
1199 "simplex meshes."));
1206 SolutionTransfer<dim, VectorType> solution_transfer(*this->
dof_handler,
true);
1207 SolutionTransfer<dim, VectorType> solution_transfer_m2(*this->
dof_handler,
1209 SolutionTransfer<dim, VectorType> solution_transfer_m3(*this->
dof_handler,
1213 LinearAlgebra::distributed::Vector<double>>)
1216 solution_transfer.prepare_for_coarsening_and_refinement(
1219 std::vector<SolutionTransfer<dim, VectorType>> previous_solutions_transfer;
1225 previous_solutions_transfer.emplace_back(
1226 SolutionTransfer<dim, VectorType>(*this->
dof_handler,
true));
1229 LinearAlgebra::distributed::Vector<double>>)
1232 previous_solutions_transfer[i].prepare_for_coarsening_and_refinement(
1253template <
int dim,
typename VectorType,
typename DofsType>
1256 SolutionTransfer<dim, VectorType> &solution_transfer,
1257 std::vector<SolutionTransfer<dim, VectorType>> &previous_solutions_transfer)
1263 solution_transfer.interpolate(tmp);
1276 previous_solutions_transfer[i].interpolate(tmp_previous_solution);
1278 (*previous_solutions)[i] = tmp_previous_solution;
1286 if (this->
multiphysics->get_active_physics().size() > 1)
1290template <
int dim,
typename VectorType,
typename DofsType>
1316 this->
pcout <<
"Enstrophy: " << enstrophy << std::endl;
1321 this->simulation_parameters.post_processing.output_frequency ==
1323 this->this_mpi_process == 0)
1325 std::string filename =
1329 std::ofstream output(filename.c_str());
1339 TimerOutput::Scope t(this->
computing_timer,
"Calculate pressure power");
1341 const double pressure_power =
1355 this->
pcout <<
"Pressure power: " << pressure_power << std::endl;
1360 this->simulation_parameters.post_processing.output_frequency ==
1362 this->this_mpi_process == 0)
1364 std::string filename =
1368 std::ofstream output(filename.c_str());
1380 "Calculate viscous dissipation");
1392 viscous_dissipation);
1398 this->
pcout <<
"Viscous dissipation: " << viscous_dissipation
1404 this->simulation_parameters.post_processing.output_frequency ==
1406 this->this_mpi_process == 0)
1408 std::string filename =
1411 .viscous_dissipation_output_name +
1413 std::ofstream output(filename.c_str());
1426 "Calculate average velocities");
1436 TimerOutput::Scope t(this->
computing_timer,
"Calculate kinetic energy");
1448 this->
pcout <<
"Kinetic energy: " << kE << std::endl;
1453 this->simulation_parameters.post_processing.output_frequency ==
1455 this->this_mpi_process == 0)
1457 std::string filename =
1461 std::ofstream output(filename.c_str());
1472 "Calculate apparent viscosity");
1484 apparent_viscosity);
1488 this->
pcout <<
"Apparent viscosity: " << apparent_viscosity
1489 <<
" m^2/s" << std::endl;
1494 this->simulation_parameters.post_processing.output_frequency ==
1496 this->this_mpi_process == 0)
1498 std::string filename =
1501 .apparent_viscosity_output_name +
1503 std::ofstream output(filename.c_str());
1513 TimerOutput::Scope t(this->
computing_timer,
"Calculate pressure drop");
1515 double pressure_drop, total_pressure_drop;
1519 this->evaluation_point,
1523 this->simulation_parameters.post_processing.outlet_boundary_id);
1528 total_pressure_drop);
1532 this->
pcout <<
"Pressure drop: "
1534 .get_density_scale() *
1536 <<
" Pa" << std::endl;
1537 this->
pcout <<
"Total pressure drop: "
1539 .get_density_scale() *
1541 <<
" Pa" << std::endl;
1546 this->simulation_parameters.post_processing.output_frequency ==
1548 this->this_mpi_process == 0)
1550 std::string filename =
1554 std::ofstream output(filename.c_str());
1577 for (
auto const &[boundary_id, type] :
1580 std::pair<double, double> boundary_flow_rate =
1588 "flow-rate-" + Utilities::int_to_string(boundary_id, 2),
1589 boundary_flow_rate.first);
1591 "flow-rate-" + Utilities::int_to_string(boundary_id, 2),
true);
1595 this->
pcout <<
"Flow rate at boundary " +
1596 std::to_string(boundary_id) +
": "
1597 << boundary_flow_rate.first <<
" m^3/s" << std::endl;
1603 this->simulation_parameters.post_processing.output_frequency ==
1605 this->this_mpi_process == 0)
1607 std::string filename =
1611 std::ofstream output(filename.c_str());
1613 for (
auto const &[boundary_id, type] :
1616 "flow-rate-" + Utilities::int_to_string(boundary_id, 2), 12);
1627 this->simulation_parameters.forces_parameters
1628 .calculation_frequency ==
1632 this->simulation_parameters.forces_parameters
1633 .output_frequency ==
1642 this->simulation_parameters.forces_parameters
1643 .calculation_frequency ==
1647 this->simulation_parameters.forces_parameters
1648 .output_frequency ==
1660 "Calculate error w.r.t. analytical solution");
1668 const std::pair<double, double> errors =
1674 const double error_velocity = errors.first;
1675 const double error_pressure = errors.second;
1679 "Calculate error w.r.t. analytical solution");
1686 this->
error_table.add_value(
"error_velocity", error_velocity);
1687 this->
error_table.add_value(
"error_pressure", error_pressure);
1690 double total_time = 0;
1691 for (
auto it = summary.begin(); it != summary.end(); ++it)
1693 total_time += summary[it->first];
1696 this->
error_table.add_value(
"total_time", total_time);
1702 this->
error_table.add_value(
"error_velocity", error_velocity);
1708 double total_time = 0;
1709 for (
auto it = summary.begin(); it != summary.end(); ++it)
1711 total_time += summary[it->first];
1713 this->
error_table.add_value(
"total_time", total_time);
1719 this->simulation_parameters.multiphysics.cahn_hilliard)
1720 this->
error_table.add_value(
"error_pressure", error_pressure);
1725 this->
pcout <<
"L2 error velocity: " << error_velocity
1729 this->
pcout <<
"L2 error pressure: " << error_pressure
1753template <
int dim,
typename VectorType,
typename DofsType>
1757 const FEValuesExtractors::Vector velocities(0);
1758 const FEValuesExtractors::Scalar
pressure(dim);
1762 this->newton_update,
1763 this->fe->component_mask(velocities));
1767 this->newton_update,
1768 this->fe->component_mask(
pressure));
1776 double previous_solution_time =
1779 previous_solution_time);
1780 const FEValuesExtractors::Vector velocities(0);
1781 const FEValuesExtractors::Scalar
pressure(dim);
1782 VectorTools::interpolate(
1786 this->newton_update,
1787 this->fe->component_mask(velocities));
1788 VectorTools::interpolate(
1792 this->newton_update,
1793 this->fe->component_mask(
pressure));
1799template <
int dim,
typename VectorType,
typename DofsType>
1804 FEValuesExtractors::Vector velocities(0);
1805 FEValuesExtractors::Scalar
pressure(dim);
1811 if constexpr (std::is_same_v<VectorType, GlobalBlockVectorType>)
1813 std::vector<unsigned int> block_component(dim + 1, 0);
1814 block_component[dim] = 1;
1815 DoFRenumbering::component_wise(*this->
dof_handler, block_component);
1816 std::vector<types::global_dof_index> dofs_per_block =
1817 DoFTools::count_dofs_per_fe_block(*this->
dof_handler, block_component);
1819 unsigned int dof_u = dofs_per_block[0];
1820 unsigned int dof_p = dofs_per_block[1];
1822 IndexSet locally_relevant_dofs_acquisition;
1823 locally_relevant_dofs_acquisition =
1824 DoFTools::extract_locally_relevant_dofs(*this->
dof_handler);
1827 locally_relevant_dofs_acquisition.get_view(0, dof_u);
1829 locally_relevant_dofs_acquisition.get_view(dof_u, dof_u + dof_p);
1831 locally_relevant_dofs_acquisition);
1836 this->locally_relevant_dofs);
1839 DoFTools::make_hanging_node_constraints(*this->
dof_handler,
1841 for (
auto const &[
id, type] :
1846 VectorTools::interpolate_boundary_values(
1850 dealii::Functions::ZeroFunction<dim>(dim + 1),
1852 this->
fe->component_mask(velocities));
1856 std::set<types::boundary_id> no_normal_flux_boundaries;
1857 no_normal_flux_boundaries.insert(
id);
1858 VectorTools::compute_no_normal_flux_constraints(
1861 no_normal_flux_boundaries,
1869 .navier_stokes_functions.at(
id)
1872 .navier_stokes_functions.at(
id)
1875 .navier_stokes_functions.at(
id)
1877 VectorTools::interpolate_boundary_values(
1883 .navier_stokes_functions.at(
id)
1885 &this->simulation_parameters.boundary_conditions
1886 .navier_stokes_functions.at(
id)
1888 &this->simulation_parameters.boundary_conditions
1889 .navier_stokes_functions.at(
id)
1892 this->fe->component_mask(velocities));
1896 const auto &periodic_boundary =
1899 DoFTools::make_periodicity_constraints(*this->
dof_handler,
1901 periodic_boundary.neighbor_id,
1902 periodic_boundary.direction,
1912template <
int dim,
typename VectorType,
typename DofsType>
1916 FEValuesExtractors::Vector velocities(0);
1917 FEValuesExtractors::Scalar
pressure(dim);
1920 if constexpr (std::is_same_v<VectorType, GlobalBlockVectorType>)
1922 std::vector<unsigned int> block_component(dim + 1, 0);
1923 block_component[dim] = 1;
1924 DoFRenumbering::component_wise(*this->
dof_handler, block_component);
1925 std::vector<types::global_dof_index> dofs_per_block =
1926 DoFTools::count_dofs_per_fe_block(*this->
dof_handler, block_component);
1928 unsigned int dof_u = dofs_per_block[0];
1929 unsigned int dof_p = dofs_per_block[1];
1931 IndexSet locally_relevant_dofs_acquisition;
1932 locally_relevant_dofs_acquisition =
1933 DoFTools::extract_locally_relevant_dofs(*this->
dof_handler);
1936 locally_relevant_dofs_acquisition.get_view(0, dof_u);
1938 locally_relevant_dofs_acquisition.get_view(dof_u, dof_u + dof_p);
1940 locally_relevant_dofs_acquisition);
1945 DoFTools::extract_locally_relevant_dofs(*this->
dof_handler);
1947 this->locally_relevant_dofs);
1950 DoFTools::make_hanging_node_constraints(*this->
dof_handler,
1953 for (
auto const &[
id, type] :
1959 VectorTools::interpolate_boundary_values(
1963 dealii::Functions::ZeroFunction<dim>(dim + 1),
1965 this->
fe->component_mask(velocities));
1969 std::set<types::boundary_id> no_normal_flux_boundaries;
1970 no_normal_flux_boundaries.insert(
id);
1971 VectorTools::compute_no_normal_flux_constraints(
1974 no_normal_flux_boundaries,
1981 const auto &periodic_boundary =
1984 DoFTools::make_periodicity_constraints(*this->
dof_handler,
1986 periodic_boundary.neighbor_id,
1987 periodic_boundary.direction,
1988 this->zero_constraints);
2030template <
int dim,
typename VectorType,
typename DofsType>
2037 TimerOutput::Scope t(this->
computing_timer,
"Reinit mortar operators");
2042 this->
mortar_manager = std::make_shared<MortarManagerCircle<dim>>(
2049 this->
mortar_manager = std::make_shared<MortarManagerLinear<dim>>(
2050 *this->cell_quadrature,
2055 AssertThrow(
false, ExcMessage(
"Invalid mortar interface type."));
2060 std::make_shared<NavierStokesCouplingEvaluationSIPG<dim, double>>(
2064 .get_kinematic_viscosity_scale());
2067 std::make_shared<CouplingOperator<dim, double>>(
2078template <
int dim,
typename VectorType,
typename DofsType>
2081 const bool is_first)
2104 const double rotation_angle =
2111 const double angular_velocity =
2121 this->
pcout <<
"Rotor grid angle: " << rotation_angle <<
" rad \n"
2122 <<
"Rotor grid velocity: " << angular_velocity
2136 this->simulation_parameters.mortar_parameters.rotation_axis_direction);
2142 AssertThrow(
false, ExcMessage(
"Invalid mortar interface type."));
2145template <
int dim,
typename VectorType,
typename DofsType>
2160 for (
auto const &[
id, type] :
2173 .navier_stokes_functions.at(
id)
2176 .navier_stokes_functions.at(
id)
2179 .navier_stokes_functions.at(
id)
2182 .navier_stokes_functions.at(
id)
2185 .navier_stokes_functions.at(
id)
2186 ->traction_fn.set_time(time);
2196template <
int dim,
typename VectorType,
typename DofsType>
2201 std::string prefix =
2209 std::string prefix_boundary =
2226 std::vector<OutputStructTableHandler> table_output_structs =
2231template <
int dim,
typename VectorType,
typename DofsType>
2234 const std::string &checkpoint_file_prefix)
2236 const std::string filename = checkpoint_file_prefix +
".triangulation";
2238 "checkpoint file of the triangulation, given by "
2239 "'subsection restart' - 'set filename'");
2243 if (
auto tria =
dynamic_cast<parallel::distributed::Triangulation<dim> *
>(
2246 tria->load(filename.c_str());
2252 ExcMessage(
"Cannot open snapshot mesh file or read the "
2253 "triangulation stored there."));
2269 auto make_distributed = [
this]() {
2271 LinearAlgebra::distributed::Vector<double>>)
2279 VectorType distributed_system = make_distributed();
2280 x_system[0] = &(distributed_system);
2282 std::vector<VectorType> distributed_previous_solutions;
2286 distributed_previous_solutions.emplace_back(make_distributed());
2287 x_system[i + 1] = &distributed_previous_solutions[i];
2289 SolutionTransfer<dim, VectorType> system_trans_vectors(*this->
dof_handler);
2293 std::vector<VectorType *> sum_vectors =
2296 x_system.insert(x_system.end(), sum_vectors.begin(), sum_vectors.end());
2299 system_trans_vectors.deserialize(x_system);
2303 (*previous_solutions)[i] = distributed_previous_solutions[i];
2311 previous_solution.update_ghost_values();
2316template <
int dim,
typename VectorType,
typename DofsType>
2328 (this->simulation_parameters.initial_condition->type !=
2332 .initial_time_for_average_velocities +
2334 this->simulation_control->get_current_time())
2337 <<
"Warning: The checkpointed time-averaged velocity has been reinitialized because the initial averaging time has not yet been reached."
2347template <
int dim,
typename VectorType,
typename DofsType>
2351 const bool non_zero_constraints,
2352 AffineConstraints<double> &constraints)
2357 .get_number_of_solids() == 0)
2363 non_zero_constraints,
2367template <
int dim,
typename VectorType,
typename DofsType>
2370 const DoFHandler<dim> *dof_handler_ht)
2372 const unsigned int dofs_per_cell = this->
fe->dofs_per_cell;
2373 std::vector<types::global_dof_index> local_dof_indices(dofs_per_cell);
2381 bool restrain_domain_with_plane =
2383 .enable_domain_restriction_with_plane;
2384 Point<dim> plane_point(
2386 Tensor<1, dim> plane_normal_vector(
2388 .restriction_plane_normal_vector);
2391 const auto temperature_solution =
2393 std::vector<double> local_temperature_values(this->
cell_quadrature->size());
2395 for (
const auto &cell :
dof_handler->active_cell_iterators())
2397 if (cell->is_locally_owned() || cell->is_ghost())
2399 cell->get_dof_indices(local_dof_indices);
2403 if (!restrain_domain_with_plane ||
2406 plane_normal_vector))
2410 temperature_solution,
2411 local_temperature_values);
2413 local_temperature_values,
2414 stasis_constraint_struct);
2420template <
int dim,
typename VectorType,
typename DofsType>
2424 const DoFHandler<dim> *dof_handler_ht)
2426 const unsigned int dofs_per_cell = this->
fe->dofs_per_cell;
2427 std::vector<types::global_dof_index> local_dof_indices(dofs_per_cell);
2430 bool restrain_domain_with_plane =
2432 .enable_domain_restriction_with_plane;
2433 Point<dim> plane_point(
2435 Tensor<1, dim> plane_normal_vector(
2437 .restriction_plane_normal_vector);
2440 const auto filtered_phase_indicator_solution =
2442 std::vector<double> local_filtered_phase_indicator_values(
2446 const auto temperature_solution =
2448 std::vector<double> local_temperature_values(this->
cell_quadrature->size());
2455 for (
const auto &cell :
dof_handler->active_cell_iterators())
2457 if (cell->is_locally_owned() || cell->is_ghost())
2459 cell->get_dof_indices(local_dof_indices);
2463 if (!restrain_domain_with_plane ||
2466 plane_normal_vector))
2468 bool cell_is_in_right_fluid =
true;
2472 filtered_phase_indicator_solution,
2473 local_filtered_phase_indicator_values);
2478 for (
const double &filtered_phase_indicator :
2479 local_filtered_phase_indicator_values)
2481 if (abs(stasis_constraint_struct.fluid_id -
2482 filtered_phase_indicator) >=
2483 stasis_constraint_struct
2484 .filtered_phase_indicator_tolerance)
2486 cell_is_in_right_fluid =
false;
2494 if (!cell_is_in_right_fluid)
2499 temperature_solution,
2500 local_temperature_values);
2503 local_temperature_values,
2504 stasis_constraint_struct);
2511template <
int dim,
typename VectorType,
typename DofsType>
2515 const std::vector<types::global_dof_index> &local_dof_indices,
2516 const std::vector<double> &local_temperature_values,
2519 for (
const double &
temperature : local_temperature_values)
2532template <
int dim,
typename VectorType,
typename DofsType>
2533std::vector<OutputStruct<dim, VectorType>>
2536 return std::vector<OutputStruct<dim, VectorType>>();
2539template <
int dim,
typename VectorType,
typename DofsType>
2547 std::vector<std::string> solution_names(dim,
"velocity");
2548 solution_names.emplace_back(
"pressure");
2549 std::vector<DataComponentInterpretation::DataComponentInterpretation>
2550 data_component_interpretation(
2551 dim, DataComponentInterpretation::component_is_part_of_vector);
2552 data_component_interpretation.emplace_back(
2553 DataComponentInterpretation::component_is_scalar);
2559 data_component_interpretation);
2563 solution_output_structs.emplace_back(
2568 data_component_interpretation);
2571 .calculate_average_velocities ||
2572 this->simulation_parameters.initial_condition->type ==
2578 std::vector<std::string> average_solution_names(dim,
"average_velocity");
2579 average_solution_names.emplace_back(
"average_pressure");
2581 std::vector<DataComponentInterpretation::DataComponentInterpretation>
2582 average_data_component_interpretation(
2583 dim, DataComponentInterpretation::component_is_part_of_vector);
2584 average_data_component_interpretation.emplace_back(
2585 DataComponentInterpretation::component_is_scalar);
2586 solution_output_structs.emplace_back(
2590 average_solution_names,
2591 average_data_component_interpretation);
2596 std::vector<std::string> reynolds_normal_stress_names(
2597 dim,
"reynolds_normal_stress");
2598 reynolds_normal_stress_names.emplace_back(
"turbulent_kinetic_energy");
2599 std::vector<DataComponentInterpretation::DataComponentInterpretation>
2600 reynolds_normal_stress_data_component_interpretation(
2601 dim, DataComponentInterpretation::component_is_part_of_vector);
2602 reynolds_normal_stress_data_component_interpretation.emplace_back(
2603 DataComponentInterpretation::component_is_scalar);
2605 std::vector<std::string> reynolds_shear_stress_names = {
2606 "reynolds_shear_stress_uv"};
2609 reynolds_shear_stress_names.emplace_back(
"dummy_rss_2d");
2613 reynolds_shear_stress_names.emplace_back(
"reynolds_shear_stress_vw");
2614 reynolds_shear_stress_names.emplace_back(
"reynolds_shear_stress_uw");
2616 reynolds_shear_stress_names.emplace_back(
"dummy_rss");
2618 std::vector<DataComponentInterpretation::DataComponentInterpretation>
2619 reynolds_shear_stress_data_component_interpretation(
2620 dim, DataComponentInterpretation::component_is_scalar);
2621 reynolds_shear_stress_data_component_interpretation.emplace_back(
2622 DataComponentInterpretation::component_is_scalar);
2624 solution_output_structs.emplace_back(
2628 reynolds_normal_stress_names,
2629 reynolds_normal_stress_data_component_interpretation);
2631 solution_output_structs.emplace_back(
2635 reynolds_shear_stress_names,
2636 reynolds_shear_stress_data_component_interpretation);
2646 std::shared_ptr<QCriterionPostprocessor<dim>> qcriterion =
2647 std::make_shared<QCriterionPostprocessor<dim>>();
2648 solution_output_structs.emplace_back(
2655 std::shared_ptr<DivergencePostprocessor<dim>> divergence =
2656 std::make_shared<DivergencePostprocessor<dim>>();
2657 solution_output_structs.emplace_back(
2665 std::shared_ptr<GradientPostprocessor<dim>> gradient =
2666 std::make_shared<GradientPostprocessor<dim>>();
2667 solution_output_structs.emplace_back(
2676 std::shared_ptr<VorticityPostprocessor<dim>> vorticity =
2677 std::make_shared<VorticityPostprocessor<dim>>();
2678 solution_output_structs.emplace_back(
2686 std::vector<std::shared_ptr<DensityModel>> density_models =
2688 .get_density_vector();
2689 std::vector<std::shared_ptr<RheologicalModel>> rheological_models =
2691 .get_rheology_vector();
2693 const unsigned int n_fluids =
2695 .get_number_of_fluids();
2697 std::vector<std::shared_ptr<DensityPostprocessor<dim>>>
2698 density_postprocessors;
2699 density_postprocessors.reserve(n_fluids);
2700 std::vector<std::shared_ptr<KinematicViscosityPostprocessor<dim>>>
2701 kinematic_viscosity_postprocessors;
2702 kinematic_viscosity_postprocessors.reserve(n_fluids);
2703 std::vector<std::shared_ptr<DynamicViscosityPostprocessor<dim>>>
2704 dynamic_viscosity_postprocessors;
2705 dynamic_viscosity_postprocessors.reserve(n_fluids);
2707 for (
unsigned int f_id = 0; f_id < n_fluids; ++f_id)
2709 density_postprocessors.emplace_back(
2712 kinematic_viscosity_postprocessors.emplace_back(
2714 rheological_models[f_id], f_id));
2715 dynamic_viscosity_postprocessors.emplace_back(
2717 rheological_models[f_id],
2718 density_models[f_id]->get_density_ref(),
2723 if (!density_models[f_id]->is_constant_density_model() ||
2725 this->simulation_parameters.multiphysics.cahn_hilliard)
2726 solution_output_structs.emplace_back(
2730 density_postprocessors[f_id]);
2733 if (rheological_models[f_id]->is_non_newtonian_rheological_model())
2735 solution_output_structs.emplace_back(
2739 kinematic_viscosity_postprocessors[f_id]);
2743 this->simulation_parameters.multiphysics.cahn_hilliard)
2744 solution_output_structs.emplace_back(
2748 kinematic_viscosity_postprocessors[f_id]);
2753 .is_non_newtonian())
2755 auto shear_rate_processor =
2756 std::make_shared<ShearRatePostprocessor<dim>>();
2757 solution_output_structs.emplace_back(
2761 shear_rate_processor);
2770 solution_output_structs.emplace_back(
2777 Vector<float> subdomain(this->
triangulation->n_active_cells());
2778 for (
unsigned int i = 0; i < subdomain.size(); ++i)
2779 subdomain(i) = this->
triangulation->locally_owned_subdomain();
2781 solution_output_structs.emplace_back(
2782 std::in_place_type<OutputStructCellVector>, subdomain,
"subdomain");
2785 std::vector<OutputStruct<dim, VectorType>> additional_output_structs =
2788 for (
const auto &output_struct : additional_output_structs)
2789 solution_output_structs.emplace_back(output_struct);
2792template <
int dim,
typename VectorType,
typename DofsType>
2807 std::vector<OutputStruct<dim, VectorType>> solution_output_structs;
2813 DataOut<dim> data_out;
2816 DataOutBase::VtkFlags flags;
2818 flags.write_higher_order_cells =
true;
2819 data_out.set_flags(flags);
2825 for (
const auto &solution_output_struct : solution_output_structs)
2827 if (
auto solution_struct =
2829 &solution_output_struct))
2831 data_out.add_data_vector(
2832 solution_struct->dof_handler,
2833 solution_struct->solution,
2834 solution_struct->solution_names,
2835 solution_struct->data_component_interpretation);
2837 else if (
auto vector_struct =
2838 std::get_if<OutputStructCellVector>(&solution_output_struct))
2840 data_out.add_data_vector(vector_struct->solution,
2841 vector_struct->solution_name);
2843 else if (
auto postprocessor_struct =
2845 &solution_output_struct))
2847 data_out.add_data_vector(postprocessor_struct->dof_handler,
2848 postprocessor_struct->solution,
2849 *postprocessor_struct->data_postprocessor);
2854 std::vector<OutputStruct<dim, GlobalVectorType>> multiphysics_output_structs =
2857 for (
const auto &output_struct : multiphysics_output_structs)
2858 if (
auto solution_struct =
2862 data_out.add_data_vector(
2863 solution_struct->dof_handler,
2864 solution_struct->solution,
2865 solution_struct->solution_names,
2866 solution_struct->data_component_interpretation);
2868 else if (
auto vector_struct =
2869 std::get_if<OutputStructCellVector>(&output_struct))
2871 data_out.add_data_vector(vector_struct->solution,
2872 vector_struct->solution_name);
2874 else if (
auto postprocessor_struct =
2878 data_out.add_data_vector(postprocessor_struct->dof_handler,
2879 postprocessor_struct->solution,
2880 *postprocessor_struct->data_postprocessor);
2884 std::vector<OutputStruct<dim, GlobalBlockVectorType>>
2885 multiphysics_output_structs_block =
2886 multiphysics->gather_output_hook_global_block_vector();
2887 for (
const auto &output_struct : multiphysics_output_structs_block)
2888 if (
auto solution_struct =
2892 data_out.add_data_vector(
2893 solution_struct->dof_handler,
2894 solution_struct->solution,
2895 solution_struct->solution_names,
2896 solution_struct->data_component_interpretation);
2898 else if (
auto vector_struct =
2899 std::get_if<OutputStructCellVector>(&output_struct))
2901 data_out.add_data_vector(vector_struct->solution,
2902 vector_struct->solution_name);
2904 else if (
auto postprocessor_struct = std::get_if<
2908 data_out.add_data_vector(postprocessor_struct->dof_handler,
2909 postprocessor_struct->solution,
2910 *postprocessor_struct->data_postprocessor);
2917 DataOut<dim>::curved_inner_cells);
2932 DataOutFaces<dim> data_out_faces;
2936 DataOutBase::VtkFlags flags;
2938 flags.write_higher_order_cells =
true;
2939 data_out_faces.set_flags(flags);
2942 data_out_faces.attach_dof_handler(*this->
dof_handler);
2943 data_out_faces.add_data_vector(solution, boundary_id);
2944 data_out_faces.build_patches(*this->
get_mapping(), subdivision);
2956template <
int dim,
typename VectorType,
typename DofsType>
2963 for (
auto const &[boundary_id, type] :
2966 std::string filename =
2969 Utilities::int_to_string(boundary_id, 2) +
".dat";
2970 std::ofstream output(filename.c_str());
2977template <
int dim,
typename VectorType,
typename DofsType>
2984 for (
auto const &[boundary_id, type] :
2987 std::string filename =
2990 Utilities::int_to_string(boundary_id, 2) +
".dat";
2991 std::ofstream output(filename.c_str());
2998template <
int dim,
typename VectorType,
typename DofsType>
2999std::vector<OutputStructTableHandler>
3002 std::vector<OutputStructTableHandler> table_output_structs;
3005 std::string prefix =
3007 std::string suffix =
".checkpoint";
3015 table_output_structs.emplace_back(
3019 table_output_structs.emplace_back(
3023 table_output_structs.emplace_back(
3027 table_output_structs.emplace_back(
3036 table_output_structs.emplace_back(
3040 for (
auto const &[boundary_id, type] :
3043 table_output_structs.emplace_back(
3047 "_" + Utilities::int_to_string(boundary_id, 2) + suffix);
3050 for (
auto const &[boundary_id, type] :
3053 table_output_structs.emplace_back(
3057 "_" + Utilities::int_to_string(boundary_id, 2) + suffix);
3060 table_output_structs.emplace_back(
3065 return table_output_structs;
3068template <
int dim,
typename VectorType,
typename DofsType>
3073 std::string prefix =
3086 std::string prefix_boundary =
3095 std::vector<const VectorType *> sol_set_transfer;
3104 std::vector<const VectorType *> av_set_transfer =
3108 sol_set_transfer.insert(sol_set_transfer.end(),
3109 av_set_transfer.begin(),
3110 av_set_transfer.end());
3113 SolutionTransfer<dim, VectorType> system_trans_vectors(*this->
dof_handler);
3114 system_trans_vectors.prepare_for_serialization(sol_set_transfer);
3118 if (
auto tria =
dynamic_cast<parallel::distributed::Triangulation<dim> *
>(
3121 std::string triangulationName = prefix +
".triangulation";
3122 tria->save(prefix +
".triangulation");
3126 const std::vector<OutputStructTableHandler> &table_output_structs =
3131template <
int dim,
typename VectorType,
typename DofsType>
3136 const double pressure_scaling_factor =
3140 if (abs(pressure_scaling_factor - 1) < 1e-8)
3145 const unsigned int dofs_per_cell = this->
fe->dofs_per_cell;
3146 std::vector<types::global_dof_index> local_dof_indices(dofs_per_cell);
3148 std::unordered_set<unsigned int> rescaled_dofs_set;
3149 rescaled_dofs_set.clear();
3150 for (
const auto &cell :
dof_handler->active_cell_iterators())
3152 if (cell->is_locally_owned() || cell->is_ghost())
3154 cell->get_dof_indices(local_dof_indices);
3155 for (
unsigned int j = 0; j < local_dof_indices.size(); ++j)
3157 const unsigned int global_id = local_dof_indices[j];
3159 auto iterator = rescaled_dofs_set.find(global_id);
3160 if (iterator == rescaled_dofs_set.end())
3162 const int component_index =
3163 this->
fe->system_to_component_index(j).first;
3164 if (this->
dof_handler->locally_owned_dofs().is_element(
3166 component_index == dim)
3170 pressure_scaling_factor;
3172 rescaled_dofs_set.insert(global_id);
3179template <
int dim,
typename VectorType,
typename DofsType>
3184 "Calculate and output norms after Newton its");
3186 if constexpr (std::is_same_v<VectorType, GlobalVectorType> ||
3188 LinearAlgebra::distributed::Vector<double>>)
3190 FEValuesExtractors::Vector velocities(0);
3191 FEValuesExtractors::Scalar
pressure(dim);
3193 ComponentMask velocity_mask =
fe->component_mask(velocities);
3194 ComponentMask pressure_mask =
fe->component_mask(
pressure);
3196 const std::vector<IndexSet> index_set_velocity =
3197 DoFTools::locally_owned_dofs_per_component(*
dof_handler, velocity_mask);
3198 const std::vector<IndexSet> index_set_pressure =
3199 DoFTools::locally_owned_dofs_per_component(*
dof_handler, pressure_mask);
3201 double local_sum = 0.0;
3202 double local_max = std::numeric_limits<double>::lowest();
3204 for (
int d = 0; d < dim; ++d)
3206 for (
const auto &j : index_set_velocity[d])
3209 local_sum += dof_newton_update * dof_newton_update;
3210 local_max = std::max(local_max, std::abs(dof_newton_update));
3214 double global_velocity_l2_norm =
3216 double global_velocity_linfty_norm =
3220 local_max = std::numeric_limits<double>::lowest();
3222 for (
const auto &j : index_set_pressure[dim])
3225 local_sum += dof_newton_update * dof_newton_update;
3226 local_max = std::max(local_max, std::abs(dof_newton_update));
3229 double global_pressure_l2_norm =
3231 double global_pressure_linfty_norm =
3234 this->
pcout <<
"\n\t ||du||_L2 = " << std::setw(6)
3235 << global_velocity_l2_norm << std::setw(6)
3236 <<
"\t ||du||_Linfty = " << global_velocity_linfty_norm
3238 this->
pcout <<
"\t ||dp||_L2 = " << std::setw(6)
3239 << global_pressure_l2_norm << std::setw(6)
3240 <<
"\t ||dp||_Linfty = " << global_pressure_linfty_norm
3243 if constexpr (std::is_same_v<VectorType, GlobalBlockVectorType>)
3245 this->
pcout <<
"\t ||du||_L2 = " << std::setw(6)
3247 <<
"\t ||du||_Linfty = "
3249 this->
pcout <<
"\t ||dp||_L2 = " << std::setw(6)
3251 <<
"\t ||dp||_Linfty = "
3256template <
int dim,
typename VectorType,
typename DofsType>
3262 if constexpr (std::is_same_v<VectorType, GlobalVectorType> ||
3263 std::is_same_v<VectorType, GlobalBlockVectorType>)
3266 else if constexpr (std::is_same_v<
VectorType,
3267 LinearAlgebra::distributed::Vector<double>>)
3270 this->mpi_communicator);
3275template <
int dim,
typename VectorType,
typename DofsType>
3282 if (
dynamic_cast<parallel::distributed::Triangulation<dim> *
>(
3286 auto &tria = *
dynamic_cast<parallel::distributed::Triangulation<dim> *
>(
3289 tria.signals.weight.connect(
3290 [
this](
const typename parallel::distributed::Triangulation<
3291 dim>::cell_iterator &cell,
3292 const CellStatus ) ->
unsigned int {
3294 const unsigned int base_weight = 1000;
3297 const unsigned int rotor_bid =
3299 const unsigned int stator_bid =
3302 if (cell->is_locally_owned())
3304 for (
const auto face_no : cell->face_indices())
3306 const auto face = cell->face(face_no);
3307 if (face->at_boundary() && (face->boundary_id() == rotor_bid ||
3308 face->boundary_id() == stator_bid))
3325 std::vector<IndexSet>>;
3328 std::vector<IndexSet>>;
3330#ifndef LETHE_USE_LDV
3332 LinearAlgebra::distributed::Vector<double>,
3335 LinearAlgebra::distributed::Vector<double>,
unsigned int maximum_number_of_previous_solutions()
Get the maximum number of previous time steps supposed by the BDF schemes implemented in Lethe.
Calculates the time-averaged velocities and pressure and the independent components of the Reynolds...
BoundaryPostprocessor Post-processor class used to attach the boundary id to the faces when outputtin...
Compute the density scalar field of a material within a domain.
Compute the dynamic viscosity scalar field of a fluid within a domain.
This class implements a boundary conditions for the fluid dynamics solver where the velocity componen...
Compute the kinematic viscosity scalar field of a fluid within a domain.
std::vector< StasisConstraintWithTemperature > stasis_constraint_structs
virtual void output_newton_update_norms() override
Output the L2 and Linfty norms of the correction vector.
void constrain_stasis_with_temperature(const DoFHandler< dim > *dof_handler_ht)
Constrain a fluid's subdomains according to the temperature field to null velocity and pressure field...
void box_refine_mesh(const bool restart)
Allow the initial refinement of all cells of the principal mesh that are partially contained in one o...
ConvergenceTable error_table
std::map< types::boundary_id, TableHandler > torques_tables
std::map< types::boundary_id, TableHandler > forces_tables
PVDHandler pvdhandler_boundary
virtual void set_specified_fluid_dynamics_solution()
Specify the fluid dynamics solution instead of solving for it.
std::shared_ptr< MortarManagerBase< dim > > mortar_manager
std::shared_ptr< FESystem< dim > > fe
void connect_mortar_weight_signals()
Connect weight signals for load balancing of mortar cells. Cells touching mortar boundaries can be as...
Function< dim > * exact_solution
void get_cell_temperature_values(const typename DoFHandler< dim >::active_cell_iterator &cell, const DoFHandler< dim > *dof_handler_ht, const GlobalVectorType &temperature_solution, std::vector< double > &local_temperature_values)
Get cell's local temperature values at quadrature points.
std::shared_ptr< Quadrature< dim > > cell_quadrature
AffineConstraints< double > nonzero_constraints
void write_output_results(const VectorType &solution)
Generate post-processing parallel VTU files from vector of solution_output_struct.
const unsigned int pressure_fem_degree
void refine_mesh_adaptive()
virtual void update_multi_stage_solution(double time_step)
MPI_Comm mpi_communicator
std::vector< std::map< types::boundary_id, Tensor< 1, dim > > > forces_on_boundaries
virtual std::vector< OutputStructTableHandler > gather_tables()
Returns a vector of references to TableHandler objects that needs to be serialized/ deserialized for ...
DofsType locally_owned_dofs
void define_zero_constraints()
Define the zero constraints used to solve the problem.
SDIRKVectors sdirk_vectors
Instance of SDIRK-related vectors.
const unsigned int n_mpi_processes
unsigned int number_quadrature_points
virtual void update_solutions_for_multiphysics()
Required only for the matrix-free solver to update solutions within iterate function.
void constrain_stasis_with_temperature_cls(const DoFHandler< dim > *dof_handler_cls, const DoFHandler< dim > *dof_handler_ht)
Constrain fluids' subdomains according to the temperature field to null velocity and pressure fields ...
void rescale_pressure_dofs_in_newton_update()
This function is used to rescale pressure DOFs in the newton correction.
std::shared_ptr< GlobalBlockVectorType > present_solution
void write_output_torques()
Writes the torques per boundary condition to a text file output.
std::shared_ptr< Quadrature< dim - 1 > > face_quadrature
void write_output_forces()
Writes the forces per boundary condition to a text file output.
void transfer_solution(SolutionTransfer< dim, VectorType > &solution_transfer, std::vector< SolutionTransfer< dim, VectorType > > &previous_solutions_transfer)
Transfer solution after mesh refinement.
virtual AffineConstraints< double > & get_nonzero_constraints() override
void make_solid_domain(const DoFHandler< dim > &dof_handler, const bool non_zero_constraints, AffineConstraints< double > &constraints)
Turn regions of the mesh where the material_id>0 into a solid block by injecting velocity and pressur...
virtual void refine_mesh()
Allow the refinement of the mesh according to one of the 2 methods proposed.
virtual void read_checkpoint()
Restart a previous simulation from a checkpoint file.
void define_non_zero_constraints()
Define the non-zero constraints used to solve the problem.
virtual void enable_dynamic_zero_constraints_fd()
Enable the use of dynamic zero constraints by initializing required FEValues objects.
void postprocessing_torques(const VectorType &evaluation_point)
Post-processing function Outputs the torque acting on each boundary condition.
std::shared_ptr< Mapping< dim > > get_mapping()
virtual void finish_time_step()
Finishes the time step of the fluid dynamics. Post-processing and time stepping.
TableHandler apparent_viscosity_table
void rotate_rotor_mapping(const bool is_first)
Rotate rotor mapping in mortar method.
std::shared_ptr< FEValues< dim > > fe_values_temperature
void gather_output_results(const VectorType &solution, std::vector< OutputStruct< dim, VectorType > > &solution_output_structs)
Gather solution information to generate output results.
AffineConstraints< double > dynamic_zero_constraints
virtual void dynamic_flow_control()
If set to enable, dynamic_flow_control allows to control the flow by executing space-average velocity...
std::shared_ptr< NavierStokesCouplingEvaluationSIPG< dim, double > > mortar_coupling_evaluator
virtual void update_multiphysics_time_average_solution()=0
Update the time average velocity field solution.
const unsigned int this_mpi_process
SimulationParameters< dim > simulation_parameters
TableHandler kinetic_energy_table
bool use_manifold_for_normal
bool check_existance_of_bc(BoundaryConditions::FluidDynamicsBoundaryType bc)
Check if a specifique boundary condition exist.
bool average_velocities_are_enabled() const
Indicate whether the time-averaged velocity object holds vectors that must be preserved....
virtual void multi_stage_postresolution(unsigned int stage, Parameters::SimulationControl::TimeSteppingMethod method, double time_step)
Calculate from Update .
virtual void iterate()
Do a regular CFD iteration.
void finish_simulation_fd()
Finishes the simulation for fluid dynamics by calling the post-processing elements that are required.
void restore_average_velocities_after_checkpoint()
Restore the state of the time-averaged velocity object after its vectors have been deserialized.
std::shared_ptr< CouplingOperator< dim, double > > mortar_coupling_operator
TableHandler flow_rate_table
virtual void postprocess_fd(bool first_iteration)
Post-process fluid dynamics after an iteration.
TimerOutput computing_timer
std::shared_ptr< std::vector< GlobalBlockVectorType > > previous_solutions
VectorType evaluation_point
TableHandler pressure_power_table
std::shared_ptr< MappingQCache< dim > > mapping_cache
std::shared_ptr< Function< dim > > forcing_function
VectorType init_temporary_vector()
This function initializes correctly a temporary vector depending on the vector type.
std::shared_ptr< SimulationControl > simulation_control
void update_boundary_conditions()
Update non-zero constraints if the boundary is time dependent. Note: not implemented for the block fl...
VectorType local_evaluation_point
virtual std::vector< OutputStruct< dim, VectorType > > gather_output_hook()
Gather and return vector of output structs that are particular to some applications.
virtual void multi_stage_preresolution(unsigned int stage, Parameters::SimulationControl::TimeSteppingMethod method)
Update the sum_over_previous_stages variable to use it in the solver.
FlowControl< dim > flow_control
void refine_mesh_uniform()
TableHandler pressure_drop_table
std::shared_ptr< MultiphysicsInterface< dim > > multiphysics
virtual void set_solution_from_checkpoint(const std::string &checkpoint_file_prefix)
Read the solution from a checkpoint file and set it as the current solution.
std::shared_ptr< FEValues< dim > > fe_values_cls
NavierStokesBase(SimulationParameters< dim > &nsparam, const FluidDynamicsFormulation fluid_dynamics_formulation=FluidDynamicsFormulation::standard)
Construct the Navier-Stokes base and the multiphysics interface.
bool cell_in_constraining_domain(const typename DoFHandler< dim >::active_cell_iterator &cell, const Point< dim > &plane_point, const Tensor< 1, dim > &plane_normal_vector)
Checks and identifies if the cell is located in the constraining domain defined by a plane with its o...
AffineConstraints< double > zero_constraints
MeshController mesh_controller
virtual void percolate_time_vectors_fd()
finish_time_step Finishes the time step of the fluid dynamics Post-processing and time stepping
virtual void update_forcing_and_boundary_conditions()
Set the time of the forcing function and of the time-dependent boundary conditions to the current tim...
std::shared_ptr< AverageVelocities< dim, GlobalBlockVectorType, std::vector< IndexSet > > > average_velocities
virtual void setup_dofs()
Initialize the degree of freedom and the memory associated with them for fluid dynamics and enabled a...
TableHandler enstrophy_table
std::shared_ptr< Mapping< dim > > mapping
void identify_cell_and_constrain_velocity(const std::vector< types::global_dof_index > &local_dof_indices, const std::vector< double > &local_temperature_values, StasisConstraintWithTemperature &stasis_constraint_struct)
Identify if temperature DOFs of the cell are within the constraining range. If they are,...
TableHandler viscous_dissipation_table
void postprocessing_forces(const VectorType &evaluation_point)
Post-processing function Outputs the forces acting on each boundary condition.
void set_nodal_values()
Set the nodal values of velocity and pressure.
DofsType locally_relevant_dofs
void get_cell_filtered_phase_indicator_values(const typename DoFHandler< dim >::active_cell_iterator &cell, const DoFHandler< dim > *dof_handler_cls, const GlobalVectorType &filtered_phase_indicator_solution, std::vector< double > &local_filtered_phase_indicator_values)
Get cell's local filtered phase indicator values at quadrature points.
virtual void write_checkpoint()
Write the checkpoint.
std::shared_ptr< DoFHandler< dim > > dof_handler
std::shared_ptr< parallel::DistributedTriangulationBase< dim > > triangulation
void reinit_mortar_operators()
Initialize mortar coupling manager, operator, and evaluator.
const unsigned int velocity_fem_degree
Postprocessing - Defines the parameters for the post-processing. In Lethe, post-processing implies th...
bool calculate_pressure_drop
Enable pressure drop post-processing.
std::string kinetic_energy_output_name
Prefix for kinetic energy output.
bool calculate_pressure_power
Enable pressure power post-processing.
std::string pressure_power_output_name
Prefix for the pressure power output.
bool calculate_kinetic_energy
Enable total kinetic energy post-processing.
bool calculate_flow_rate
Enable flow rate post-processing.
bool calculate_enstrophy
Enable total enstrophy post-processing.
std::string apparent_viscosity_output_name
Prefix for the apparent viscosity output.
bool calculate_viscous_dissipation
Enable viscous dissipation post-processing.
std::string enstrophy_output_name
Prefix for the enstrophy output.
std::string viscous_dissipation_output_name
Prefix for the viscous dissipation output.
std::string pressure_drop_output_name
Prefix for pressure drop output.
bool calculate_apparent_viscosity
Enable calculating apparent viscosity.
std::string flow_rate_output_name
Prefix for flow rate output.
PhysicsSolver(const Parameters::NonLinearSolver non_linear_solver_parameters)
Constructor for the non-linear physics.
void solve_governing_system()
Solve the global system of equations according to a given strategy, either linear or not.
PhysicsSolverStrategy< VectorType > * physics_solving_strategy
Compute the velocity field in the Eulerian frame of reference for simulations carried out in a single...
static unsigned int get_number_of_stages(const Parameters::SimulationControl::TimeSteppingMethod &method)
Return the number of stages associated with the time-stepping method. For SDIRK methods,...
void check_file_exists(const std::string &file_name, const std::string &file_description)
Verify that a file that Lethe must read exists and can be opened, and raise an error stated in the us...
TableHandler make_table_scalars_tensors(const std::vector< T > &independent_values, const std::string &independent_column_name, const std::vector< Tensor< 1, dim > > &dependent_vector, const std::vector< std::string > &dependent_column_names, const unsigned int display_precision, const bool display_scientific_notation=false)
Generate a table from a vector of scalars (independent variable) and a vector of Tensor<1,...
std::vector< val > extract_values_from_map(const std::map< key, val > &map)
Extract the values from map object.
void create_output_folder(const std::string &dirname)
Creates the simulation output folder.
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 announce_string(const ConditionalOStream &pcout, const std::string &expression, const char delimiter='-')
Prints a string and then adds a line above and below made with dashes containing as many dashes as th...
std::vector< key > extract_keys_from_map(const std::map< key, val > &map)
Extract the keys from map object.
void deserialize_tables_vector(std::vector< OutputStructTableHandler > &table_output_structs, const MPI_Comm mpi_communicator)
Deserializes all the TableHandler objects in table_output_structs.
void build_refinement_box_triangulation(const Parameters::Mesh< dim, spacedim > &box_mesh_parameters, Triangulation< dim, spacedim > &box_triangulation)
Build the triangulation which delimits a mesh refinement box.
void mortar_workload_imbalance(const Triangulation< dim > &triangulation, const Parameters::Mortar< dim > &mortar_parameters, const ConditionalOStream &pcout)
Compute workload imbalance of mortar cells.
@ velocity
Velocity vector field from fluid dynamics.
@ pressure
Pressure scalar field from fluid dynamics.
@ temperature
Temperature scalar field from heat transfer.
FluidDynamicsFormulation
Formulation of the fluid dynamics equations solved by a Navier-Stokes solver.
PhysicsID
Unique identifiers for each physics module in Lethe.
@ fluid_dynamics
Fluid Dynamics (Velocity,Pressure).
@ heat_transfer
Heat transfer (Temperature).
FluidDynamicsBoundaryType
@ average_velocity_profile
std::variant< OutputStructPostprocessor< dim, VectorType >, OutputStructSolution< dim, VectorType >, OutputStructCellVector > OutputStruct
Variant handler of the three output structs (OutputStructPostprocessor, OutputStructSolution and Outp...
double calculate_pressure_power(const DoFHandler< dim > &dof_handler, const VectorType &evaluation_point, const Quadrature< dim > &quadrature_formula, const Mapping< dim > &mapping)
Calculate the average power done by pressure in the simulation domain. The average power is defined a...
std::pair< double, double > calculate_pressure_drop(const DoFHandler< dim > &dof_handler, const Mapping< dim > &mapping, const VectorType &evaluation_point, const Quadrature< dim > &cell_quadrature_formula, const Quadrature< dim - 1 > &face_quadrature_formula, const unsigned int inlet_boundary_id, const unsigned int outlet_boundary_id)
Calculate the pressure drop and total pressure drop between two boundaries. The pressure drop thus ca...
double calculate_apparent_viscosity(const DoFHandler< dim > &dof_handler, const VectorType &evaluation_point, const Quadrature< dim > &quadrature_formula, const Mapping< dim > &mapping, const PhysicalPropertiesManager &properties_manager)
Calculates the apparent viscosity of the fluid for non Newtonian flows.
std::map< types::boundary_id, Tensor< 1, 3 > > calculate_torques(const DoFHandler< dim > &dof_handler, const VectorType &evaluation_point, const PhysicalPropertiesManager &properties_manager, const BoundaryConditions::FluidDynamicsBoundaryConditions< dim > &boundary_conditions, const Quadrature< dim - 1 > &face_quadrature_formula, const Mapping< dim > &mapping)
Calculates the torques due to the fluid motion on every boundary conditions.
std::pair< double, double > calculate_flow_rate(const DoFHandler< dim > &dof_handler, const VectorType &present_solution, const unsigned int &boundary_id, const Quadrature< dim - 1 > &face_quadrature_formula, const Mapping< dim > &mapping)
calculate_flow_rate. This function calculates the volumetric flow rate at the selected boundary....
double calculate_kinetic_energy(const DoFHandler< dim > &dof_handler, const VectorType &evaluation_point, const Quadrature< dim > &quadrature_formula, const Mapping< dim > &mapping)
Calculate the average kinetic energy in the simulation domain.
double calculate_CFL(const DoFHandler< dim > &dof_handler, const VectorType &evaluation_point, const double time_step, const Quadrature< dim > &quadrature_formula, const Mapping< dim > &mapping)
Calculate the CFL condition on the simulation domain.
double calculate_average_velocity(const DoFHandler< dim > &dof_handler, const VectorType &present_solution, const unsigned int &boundary_id, const Quadrature< dim - 1 > &face_quadrature_formula, const Mapping< dim > &mapping)
calculate_average_velocity. This function calculates average velocity from the volumetric flow rate a...
std::pair< double, double > calculate_L2_error(const DoFHandler< dim > &dof_handler, const VectorType &evaluation_point, const Function< dim > *exact_solution, const Quadrature< dim > &quadrature_formula, const Mapping< dim > &mapping)
Calculates the L2 norm of the error on velocity and pressure.
std::vector< std::map< types::boundary_id, Tensor< 1, dim > > > calculate_forces(const DoFHandler< dim > &dof_handler, const VectorType &evaluation_point, const PhysicalPropertiesManager &properties_manager, const BoundaryConditions::FluidDynamicsBoundaryConditions< dim > &boundary_conditions, const Quadrature< dim - 1 > &face_quadrature_formula, const Mapping< dim > &mapping)
Calculates the force due to the fluid motion on every boundary conditions.
double calculate_enstrophy(const DoFHandler< dim > &dof_handler, const VectorType &evaluation_point, const Quadrature< dim > &quadrature_formula, const Mapping< dim > &mapping)
Calculate the average enstrophy in the simulation domain.
double calculate_viscous_dissipation(const DoFHandler< dim > &dof_handler, const VectorType &evaluation_point, const Quadrature< dim > &quadrature_formula, const Mapping< dim > &mapping, const PhysicalPropertiesManager &properties_manager)
Calculate the viscous dissipation of kinetic energy which is defined as ∫∇u.τdΩ/∫1dΩ
SDIRKTable sdirk_table(const Parameters::SimulationControl::TimeSteppingMethod method)
Construct the Butcher tableau (A, b, c) for a given SDIRK method.
void establish_solid_domain(const dealii::DoFHandler< dim > &dof_handler, const DofsType &locally_owned_dofs, const bool non_zero_constraints, dealii::AffineConstraints< double > &constraints)
Turn regions of the mesh where the material_id>0 into a solid block by injecting velocity and pressur...
void constrain_solid_cell_velocity_dofs(const dealii::FiniteElement< dim > &fe, const std::vector< dealii::types::global_dof_index > &local_dof_indices, const bool &non_zero_constraints, dealii::AffineConstraints< double > &constraints)
Constrain velocity DOFs of a solid cell.
void write_boundaries_vtu_and_pvd(PVDHandler &pvd_handler_boundary, const DataOutFaces< dim > &data_out_faces, const std::string &folder, const double time, const unsigned int iter, const unsigned int group_files, const MPI_Comm &mpi_communicator, const std::string &file_prefix=std::string("boundaries"), const unsigned int digits=5)
Output the Data Out Faces as vtu files, with a pvtu file and a pvd to store the timing This function ...
void write_vtu_and_pvd(PVDHandler &pvd_handler, const DataOutInterface< dim, spacedim > &data_out, const std::string &folder, const std::string &file_prefix, const double time, const unsigned int iter, const unsigned int group_files, const MPI_Comm &mpi_communicator, const unsigned int digits=5)
Output the data out to "group_files" vtu files, with a pvtu file and a pvd to store the timing This f...
Struct containing information about the solution output. It is used to pass the information required ...
Struct containing information about the solution output. It is used to pass all the information requi...
ErrorEstimator
Error estimator for the variable.
Structure representing a Butcher tableau for a SDIRK method.
Struct containing fluid id, temperature and phase indicator range information, and flag containers fo...
const double min_solid_temperature
Lower threshold values of the constraining field (temperature).
const double max_solid_temperature
Upper threshold values of the constraining field (temperature).
GlobalVectorType VectorType
dealii::TrilinosWrappers::MPI::BlockVector GlobalBlockVectorType
void write_checkpoint(TimerOutput &computing_timer, const DEMSolverParameters< dim > ¶meters, std::shared_ptr< SimulationControl > &simulation_control, PVDHandler &particles_pvdhandler, PVDHandler &grid_pvdhandler, parallel::distributed::Triangulation< dim > &triangulation, Particles::ParticleHandler< dim > &particle_handler, std::shared_ptr< Insertion< dim, PropertiesIndex > > &insertion_object, std::vector< std::shared_ptr< SerialSolid< dim - 1, dim > > > &solid_objects, const ConditionalOStream &pcout, MPI_Comm &mpi_communicator, const CheckpointControl &checkpoint_controller)
Write_checkpoint Write a DEM simulation checkpointing to allow for DEM simulation restart.