From 52e4e48b0506dde6ed36b8e5ee4fd935b51ca9c5 Mon Sep 17 00:00:00 2001 From: Laura Prieto Saavedra Date: Mon, 5 Aug 2024 11:35:09 -0400 Subject: [PATCH 1/5] Rename all relevant matrix-free files --- .../lethe-fluid-matrix-free/CMakeLists.txt | 2 +- ...tokes.cc => fluid_dynamics_matrix_free.cc} | 6 +-- doc/doxygen/main.h | 2 +- ..._stokes.h => fluid_dynamics_matrix_free.h} | 12 ++--- ...=> fluid_dynamics_matrix_free_operators.h} | 4 +- source/solvers/CMakeLists.txt | 8 ++-- ...tokes.cc => fluid_dynamics_matrix_free.cc} | 46 +++++++++---------- ...> fluid_dynamics_matrix_free_operators.cc} | 2 +- 8 files changed, 41 insertions(+), 41 deletions(-) rename applications/lethe-fluid-matrix-free/{mf_navier_stokes.cc => fluid_dynamics_matrix_free.cc} (94%) rename include/solvers/{mf_navier_stokes.h => fluid_dynamics_matrix_free.h} (98%) rename include/solvers/{mf_navier_stokes_operators.h => fluid_dynamics_matrix_free_operators.h} (99%) rename source/solvers/{mf_navier_stokes.cc => fluid_dynamics_matrix_free.cc} (98%) rename source/solvers/{mf_navier_stokes_operators.cc => fluid_dynamics_matrix_free_operators.cc} (99%) diff --git a/applications/lethe-fluid-matrix-free/CMakeLists.txt b/applications/lethe-fluid-matrix-free/CMakeLists.txt index 6b315f7329..8c36ba5910 100644 --- a/applications/lethe-fluid-matrix-free/CMakeLists.txt +++ b/applications/lethe-fluid-matrix-free/CMakeLists.txt @@ -1,3 +1,3 @@ -add_executable(lethe-fluid-matrix-free mf_navier_stokes.cc) +add_executable(lethe-fluid-matrix-free fluid_dynamics_matrix_free.cc) deal_ii_setup_target(lethe-fluid-matrix-free) target_link_libraries(lethe-fluid-matrix-free lethe-solvers) diff --git a/applications/lethe-fluid-matrix-free/mf_navier_stokes.cc b/applications/lethe-fluid-matrix-free/fluid_dynamics_matrix_free.cc similarity index 94% rename from applications/lethe-fluid-matrix-free/mf_navier_stokes.cc rename to applications/lethe-fluid-matrix-free/fluid_dynamics_matrix_free.cc index 82dccc7504..72a3cdb1f5 100644 --- a/applications/lethe-fluid-matrix-free/mf_navier_stokes.cc +++ b/applications/lethe-fluid-matrix-free/fluid_dynamics_matrix_free.cc @@ -13,7 +13,7 @@ * ---------------------------------------------------------------------*/ -#include "solvers/mf_navier_stokes.h" +#include "solvers/fluid_dynamics_matrix_free.h" int main(int argc, char *argv[]) @@ -41,7 +41,7 @@ main(int argc, char *argv[]) prm.parse_input(argv[1]); NSparam.parse(prm); - MFNavierStokesSolver<2> problem(NSparam); + FluidDynamicsMatrixFree<2> problem(NSparam); problem.solve(); } @@ -54,7 +54,7 @@ main(int argc, char *argv[]) prm.parse_input(argv[1]); NSparam.parse(prm); - MFNavierStokesSolver<3> problem(NSparam); + FluidDynamicsMatrixFree<3> problem(NSparam); problem.solve(); } else diff --git a/doc/doxygen/main.h b/doc/doxygen/main.h index 16bc55a316..b626b47900 100644 --- a/doc/doxygen/main.h +++ b/doc/doxygen/main.h @@ -25,7 +25,7 @@ navier_stokes_base_1 [label=<GLSNavierStokesSolver
(lethe-fluid)>,href="https://chaos-polymtl.github.io/lethe/doxygen/classGLSNavierStokesSolver.html", tooltip="GLSNavierStokesSolver"]; navier_stokes_base_2 [label=<GDNavierStokesSolver
(lethe-fluid-block)>,href="https://chaos-polymtl.github.io/lethe/doxygen/classGDNavierStokesSolver.html", tooltip="GDNavierStokesSolver"]; - navier_stokes_base_3 [label=<MFNavierStokesSolver
(lethe-fluid-matrix-free)>,href="https://chaos-polymtl.github.io/lethe/doxygen/classMFNavierStokesSolver.html", tooltip="MFNavierStokesSolver"]; + navier_stokes_base_3 [label=<FluidDynamicsMatrixFree
(lethe-fluid-matrix-free)>,href="https://chaos-polymtl.github.io/lethe/doxygen/classFluidDynamicsMatrixFree.html", tooltip="FluidDynamicsMatrixFree"]; navier_stokes_base:e -> navier_stokes_base_1:w [dir=back]; navier_stokes_base:e -> navier_stokes_base_2:w [dir=back]; diff --git a/include/solvers/mf_navier_stokes.h b/include/solvers/fluid_dynamics_matrix_free.h similarity index 98% rename from include/solvers/mf_navier_stokes.h rename to include/solvers/fluid_dynamics_matrix_free.h index 23552270e0..727e85c378 100644 --- a/include/solvers/mf_navier_stokes.h +++ b/include/solvers/fluid_dynamics_matrix_free.h @@ -13,12 +13,12 @@ * * ---------------------------------------------------------------------*/ -#ifndef lethe_mf_navier_stokes_h -#define lethe_mf_navier_stokes_h +#ifndef lehte_fluid_dynamics_matrix_free_h +#define lehte_fluid_dynamics_matrix_free_h #include -#include +#include #include #include @@ -274,7 +274,7 @@ class MFNavierStokesPreconditionGMG * the flow is solved. */ template -class MFNavierStokesSolver +class FluidDynamicsMatrixFree : public NavierStokesBase, IndexSet> @@ -288,13 +288,13 @@ class MFNavierStokesSolver * * @param[in] nsparam Relevant parameters for the solver. */ - MFNavierStokesSolver(SimulationParameters &nsparam); + FluidDynamicsMatrixFree(SimulationParameters &nsparam); /** * @brief Destructor. * */ - ~MFNavierStokesSolver(); + ~FluidDynamicsMatrixFree(); /** * @brief Solve the problem defined by simulation parameters by iterating diff --git a/include/solvers/mf_navier_stokes_operators.h b/include/solvers/fluid_dynamics_matrix_free_operators.h similarity index 99% rename from include/solvers/mf_navier_stokes_operators.h rename to include/solvers/fluid_dynamics_matrix_free_operators.h index cd4d198747..fb526c9045 100644 --- a/include/solvers/mf_navier_stokes_operators.h +++ b/include/solvers/fluid_dynamics_matrix_free_operators.h @@ -13,8 +13,8 @@ * * ---------------------------------------------------------------------*/ -#ifndef lethe_mf_navier_stokes_operators_h -#define lethe_mf_navier_stokes_operators_h +#ifndef lethe_fluid_dynamics_matrix_free_operators_h +#define lethe_fluid_dynamics_matrix_free_operators_h #include #include diff --git a/source/solvers/CMakeLists.txt b/source/solvers/CMakeLists.txt index 7641e07ff2..ca68668069 100644 --- a/source/solvers/CMakeLists.txt +++ b/source/solvers/CMakeLists.txt @@ -16,8 +16,8 @@ add_library(lethe-solvers initial_conditions.cc isothermal_compressible_navier_stokes_assembler.cc isothermal_compressible_navier_stokes_vof_assembler.cc - mf_navier_stokes.cc - mf_navier_stokes_operators.cc + fluid_dynamics_matrix_free.cc + fluid_dynamics_matrix_free_operators.cc multiphysics_interface.cc navier_stokes_assemblers.cc navier_stokes_base.cc @@ -56,8 +56,8 @@ add_library(lethe-solvers ../../include/solvers/initial_conditions.h ../../include/solvers/isothermal_compressible_navier_stokes_assembler.h ../../include/solvers/isothermal_compressible_navier_stokes_vof_assembler.h - ../../include/solvers/mf_navier_stokes.h - ../../include/solvers/mf_navier_stokes_operators.h + ../../include/solvers/fluid_dynamics_matrix_free.h + ../../include/solvers/fluid_dynamics_matrix_free_operators.h ../../include/solvers/multiphysics_interface.h ../../include/solvers/navier_stokes_assemblers.h ../../include/solvers/navier_stokes_base.h diff --git a/source/solvers/mf_navier_stokes.cc b/source/solvers/fluid_dynamics_matrix_free.cc similarity index 98% rename from source/solvers/mf_navier_stokes.cc rename to source/solvers/fluid_dynamics_matrix_free.cc index e1e693cb95..0d2bcf32e7 100644 --- a/source/solvers/mf_navier_stokes.cc +++ b/source/solvers/fluid_dynamics_matrix_free.cc @@ -20,7 +20,7 @@ #include #include -#include +#include #include @@ -1857,7 +1857,7 @@ MFNavierStokesPreconditionGMG::setup_ILU() } template -MFNavierStokesSolver::MFNavierStokesSolver( +FluidDynamicsMatrixFree::FluidDynamicsMatrixFree( SimulationParameters &nsparam) : NavierStokesBase(nsparam) { @@ -1880,14 +1880,14 @@ MFNavierStokesSolver::MFNavierStokesSolver( } template -MFNavierStokesSolver::~MFNavierStokesSolver() +FluidDynamicsMatrixFree::~FluidDynamicsMatrixFree() { this->dof_handler.clear(); } template void -MFNavierStokesSolver::solve() +FluidDynamicsMatrixFree::solve() { this->computing_timer.enter_subsection("Read mesh and manifolds"); @@ -1982,7 +1982,7 @@ MFNavierStokesSolver::solve() template void -MFNavierStokesSolver::setup_dofs_fd() +FluidDynamicsMatrixFree::setup_dofs_fd() { TimerOutput::Scope t(this->computing_timer, "Setup DoFs"); @@ -2119,7 +2119,7 @@ MFNavierStokesSolver::setup_dofs_fd() template void -MFNavierStokesSolver::update_boundary_conditions() +FluidDynamicsMatrixFree::update_boundary_conditions() { if (this->simulation_parameters.boundary_conditions.time_dependent) { @@ -2148,7 +2148,7 @@ MFNavierStokesSolver::update_boundary_conditions() template void -MFNavierStokesSolver::set_initial_condition_fd( +FluidDynamicsMatrixFree::set_initial_condition_fd( Parameters::InitialConditionType initial_condition_type, bool restart) { @@ -2393,7 +2393,7 @@ MFNavierStokesSolver::set_initial_condition_fd( template void -MFNavierStokesSolver::assemble_system_matrix() +FluidDynamicsMatrixFree::assemble_system_matrix() { // Required for compilation but not used for matrix free solvers. TimerOutput::Scope t(this->computing_timer, "Assemble matrix"); @@ -2401,7 +2401,7 @@ MFNavierStokesSolver::assemble_system_matrix() template void -MFNavierStokesSolver::assemble_system_rhs() +FluidDynamicsMatrixFree::assemble_system_rhs() { TimerOutput::Scope t(this->computing_timer, "Assemble RHS"); @@ -2418,7 +2418,7 @@ MFNavierStokesSolver::assemble_system_rhs() template void -MFNavierStokesSolver::update_multiphysics_time_average_solution() +FluidDynamicsMatrixFree::update_multiphysics_time_average_solution() { TimerOutput::Scope t(this->computing_timer, "Update multiphysics average solution"); @@ -2439,7 +2439,7 @@ MFNavierStokesSolver::update_multiphysics_time_average_solution() template void -MFNavierStokesSolver::calculate_time_derivative_previous_solutions() +FluidDynamicsMatrixFree::calculate_time_derivative_previous_solutions() { this->time_derivative_previous_solutions = 0; @@ -2458,7 +2458,7 @@ MFNavierStokesSolver::calculate_time_derivative_previous_solutions() template void -MFNavierStokesSolver::setup_GMG() +FluidDynamicsMatrixFree::setup_GMG() { TimerOutput::Scope t(this->computing_timer, "Setup GMG"); @@ -2481,7 +2481,7 @@ MFNavierStokesSolver::setup_GMG() template void -MFNavierStokesSolver::setup_ILU() +FluidDynamicsMatrixFree::setup_ILU() { TimerOutput::Scope t(this->computing_timer, "Setup ILU"); @@ -2506,7 +2506,7 @@ MFNavierStokesSolver::setup_ILU() template void -MFNavierStokesSolver::print_mg_setup_times() +FluidDynamicsMatrixFree::print_mg_setup_times() { if (this->simulation_parameters.linear_solver.at(PhysicsID::fluid_dynamics) .mg_verbosity == Parameters::Verbosity::extra_verbose) @@ -2543,7 +2543,7 @@ MFNavierStokesSolver::print_mg_setup_times() template void -MFNavierStokesSolver::update_solutions_for_multiphysics() +FluidDynamicsMatrixFree::update_solutions_for_multiphysics() { TimerOutput::Scope t(this->computing_timer, "Update solutions for multiphysics"); @@ -2592,7 +2592,7 @@ MFNavierStokesSolver::update_solutions_for_multiphysics() template void -MFNavierStokesSolver::define_non_zero_constraints() +FluidDynamicsMatrixFree::define_non_zero_constraints() { double time = this->simulation_control->get_current_time(); FEValuesExtractors::Vector velocities(0); @@ -2682,7 +2682,7 @@ MFNavierStokesSolver::define_non_zero_constraints() template void -MFNavierStokesSolver::define_zero_constraints() +FluidDynamicsMatrixFree::define_zero_constraints() { FEValuesExtractors::Vector velocities(0); FEValuesExtractors::Scalar pressure(dim); @@ -2761,7 +2761,7 @@ MFNavierStokesSolver::define_zero_constraints() template void -MFNavierStokesSolver::setup_preconditioner() +FluidDynamicsMatrixFree::setup_preconditioner() { this->present_solution.update_ghost_values(); @@ -2798,7 +2798,7 @@ MFNavierStokesSolver::setup_preconditioner() template void -MFNavierStokesSolver::solve_linear_system(const bool initial_step, +FluidDynamicsMatrixFree::solve_linear_system(const bool initial_step, const bool /* renewed_matrix */) { const double absolute_residual = @@ -2818,14 +2818,14 @@ MFNavierStokesSolver::solve_linear_system(const bool initial_step, template void -MFNavierStokesSolver::assemble_L2_projection() +FluidDynamicsMatrixFree::assemble_L2_projection() { // TODO } template void -MFNavierStokesSolver::solve_system_GMRES(const bool initial_step, +FluidDynamicsMatrixFree::solve_system_GMRES(const bool initial_step, const double absolute_residual, const double relative_residual) { @@ -2921,5 +2921,5 @@ MFNavierStokesSolver::solve_system_GMRES(const bool initial_step, "Distribute constraints after linear solve"); } -template class MFNavierStokesSolver<2>; -template class MFNavierStokesSolver<3>; +template class FluidDynamicsMatrixFree<2>; +template class FluidDynamicsMatrixFree<3>; diff --git a/source/solvers/mf_navier_stokes_operators.cc b/source/solvers/fluid_dynamics_matrix_free_operators.cc similarity index 99% rename from source/solvers/mf_navier_stokes_operators.cc rename to source/solvers/fluid_dynamics_matrix_free_operators.cc index 4b39afd089..0ce2c54292 100644 --- a/source/solvers/mf_navier_stokes_operators.cc +++ b/source/solvers/fluid_dynamics_matrix_free_operators.cc @@ -13,7 +13,7 @@ * * ---------------------------------------------------------------------*/ -#include "solvers/mf_navier_stokes_operators.h" +#include "solvers/fluid_dynamics_matrix_free_operators.h" #include /** From dfe0cb4482dd70f4ea4856931635c742bcca8953 Mon Sep 17 00:00:00 2001 From: Laura Prieto Saavedra Date: Mon, 5 Aug 2024 11:46:55 -0400 Subject: [PATCH 2/5] Indent --- source/solvers/fluid_dynamics_matrix_free.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/solvers/fluid_dynamics_matrix_free.cc b/source/solvers/fluid_dynamics_matrix_free.cc index 0d2bcf32e7..3e25e5daaa 100644 --- a/source/solvers/fluid_dynamics_matrix_free.cc +++ b/source/solvers/fluid_dynamics_matrix_free.cc @@ -2798,8 +2798,9 @@ FluidDynamicsMatrixFree::setup_preconditioner() template void -FluidDynamicsMatrixFree::solve_linear_system(const bool initial_step, - const bool /* renewed_matrix */) +FluidDynamicsMatrixFree::solve_linear_system( + const bool initial_step, + const bool /* renewed_matrix */) { const double absolute_residual = this->simulation_parameters.linear_solver.at(PhysicsID::fluid_dynamics) @@ -2826,8 +2827,8 @@ FluidDynamicsMatrixFree::assemble_L2_projection() template void FluidDynamicsMatrixFree::solve_system_GMRES(const bool initial_step, - const double absolute_residual, - const double relative_residual) + const double absolute_residual, + const double relative_residual) { auto &system_rhs = this->system_rhs; auto &nonzero_constraints = this->nonzero_constraints; From 6ea4e513b11f8d49c6f98c6de7a9a21b3e7e2035 Mon Sep 17 00:00:00 2001 From: Laura Prieto Saavedra Date: Mon, 5 Aug 2024 11:53:42 -0400 Subject: [PATCH 3/5] Add changelog entry --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2989f249fa..e5cadc882c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ## [Master] - 2024-08-05 +### Changed + +- MINOR Renamed all the files related to the `lethe-fluid-matrix-free` application: `mf_navier_stokes` to `fluid_dynamics_matrix_free` and `mf_navier_stokes_operators` to `fluid_dynamics_matrix_free_operators`. The main class `MFNavierStokesSolver` was also renamed to `FluidDynamicsMatrixFree`. [#1222](https://github.com/chaos-polymtl/lethe/pull/1222) + +## [Master] - 2024-08-05 + ### Removed - MINOR Removed the gear3 DEM integrator. It was never used, it did not possess any unit test and it was not even clear if it still worked. [#1221](https://github.com/chaos-polymtl/lethe/pull/1211) From 0aca0cdf9ec859f4c8bb045914306dd656eec362 Mon Sep 17 00:00:00 2001 From: Laura Prieto Saavedra <40216050+lpsaavedra@users.noreply.github.com> Date: Mon, 5 Aug 2024 11:54:38 -0400 Subject: [PATCH 4/5] Correct typo Co-authored-by: Peter Munch --- include/solvers/fluid_dynamics_matrix_free.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/solvers/fluid_dynamics_matrix_free.h b/include/solvers/fluid_dynamics_matrix_free.h index 727e85c378..a744515000 100644 --- a/include/solvers/fluid_dynamics_matrix_free.h +++ b/include/solvers/fluid_dynamics_matrix_free.h @@ -13,7 +13,7 @@ * * ---------------------------------------------------------------------*/ -#ifndef lehte_fluid_dynamics_matrix_free_h +#ifndef lethe_fluid_dynamics_matrix_free_h #define lehte_fluid_dynamics_matrix_free_h #include From 5d9d7e341ec9c7afa00fd40bca5447cc299b9e5f Mon Sep 17 00:00:00 2001 From: Laura Prieto Saavedra Date: Mon, 5 Aug 2024 11:58:07 -0400 Subject: [PATCH 5/5] Correct typo and fix indent --- include/solvers/fluid_dynamics_matrix_free.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/solvers/fluid_dynamics_matrix_free.h b/include/solvers/fluid_dynamics_matrix_free.h index a744515000..0096a89efe 100644 --- a/include/solvers/fluid_dynamics_matrix_free.h +++ b/include/solvers/fluid_dynamics_matrix_free.h @@ -14,7 +14,7 @@ * ---------------------------------------------------------------------*/ #ifndef lethe_fluid_dynamics_matrix_free_h -#define lehte_fluid_dynamics_matrix_free_h +#define lethe_fluid_dynamics_matrix_free_h #include