Skip to content

Commit

Permalink
Rename all relevant matrix-free files using Fluid Dynamics prefix (ch…
Browse files Browse the repository at this point in the history
…aos-polymtl#1222)

Description
This PR changes the name of the main class and the name of the files related to the matrix-free application. Is the first PR on a series of PRs that aim to rename all the Navier Stokes solvers of Lethe using the prefix FluidDynamics.

Testing
All the matrix-free tests should pass as only the name of the class and the name of files were changed.

Co-authored-by: Peter Munch <[email protected]>
Former-commit-id: 67e3107
  • Loading branch information
lpsaavedra and peterrum authored Aug 5, 2024
1 parent 81e21fd commit 491ecf0
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 44 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion applications/lethe-fluid-matrix-free/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
---------------------------------------------------------------------*/

#include "solvers/mf_navier_stokes.h"
#include "solvers/fluid_dynamics_matrix_free.h"

int
main(int argc, char *argv[])
Expand Down Expand Up @@ -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();
}

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion doc/doxygen/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
navier_stokes_base_1 [label=<<B>GLSNavierStokesSolver</B> <br/>(lethe-fluid)>,href="https://chaos-polymtl.github.io/lethe/doxygen/classGLSNavierStokesSolver.html", tooltip="GLSNavierStokesSolver"];
navier_stokes_base_2 [label=<<B>GDNavierStokesSolver</B> <br/> (lethe-fluid-block)>,href="https://chaos-polymtl.github.io/lethe/doxygen/classGDNavierStokesSolver.html", tooltip="GDNavierStokesSolver"];
navier_stokes_base_3 [label=<<B>MFNavierStokesSolver</B> <br/> (lethe-fluid-matrix-free)>,href="https://chaos-polymtl.github.io/lethe/doxygen/classMFNavierStokesSolver.html", tooltip="MFNavierStokesSolver"];
navier_stokes_base_3 [label=<<B>FluidDynamicsMatrixFree</B> <br/> (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];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
*
* ---------------------------------------------------------------------*/

#ifndef lethe_mf_navier_stokes_h
#define lethe_mf_navier_stokes_h
#ifndef lethe_fluid_dynamics_matrix_free_h
#define lethe_fluid_dynamics_matrix_free_h

#include <core/exceptions.h>

#include <solvers/mf_navier_stokes_operators.h>
#include <solvers/fluid_dynamics_matrix_free_operators.h>
#include <solvers/navier_stokes_base.h>

#include <deal.II/lac/precondition.h>
Expand Down Expand Up @@ -274,7 +274,7 @@ class MFNavierStokesPreconditionGMG
* the flow is solved.
*/
template <int dim>
class MFNavierStokesSolver
class FluidDynamicsMatrixFree
: public NavierStokesBase<dim,
LinearAlgebra::distributed::Vector<double>,
IndexSet>
Expand All @@ -288,13 +288,13 @@ class MFNavierStokesSolver
*
* @param[in] nsparam Relevant parameters for the solver.
*/
MFNavierStokesSolver(SimulationParameters<dim> &nsparam);
FluidDynamicsMatrixFree(SimulationParameters<dim> &nsparam);

/**
* @brief Destructor.
*
*/
~MFNavierStokesSolver();
~FluidDynamicsMatrixFree();

/**
* @brief Solve the problem defined by simulation parameters by iterating
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <core/bdf.h>
#include <core/simulation_control.h>
Expand Down
8 changes: 4 additions & 4 deletions source/solvers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <core/time_integration_utilities.h>
#include <core/utilities.h>

#include <solvers/mf_navier_stokes.h>
#include <solvers/fluid_dynamics_matrix_free.h>

#include <deal.II/base/multithread_info.h>

Expand Down Expand Up @@ -1857,7 +1857,7 @@ MFNavierStokesPreconditionGMG<dim>::setup_ILU()
}

template <int dim>
MFNavierStokesSolver<dim>::MFNavierStokesSolver(
FluidDynamicsMatrixFree<dim>::FluidDynamicsMatrixFree(
SimulationParameters<dim> &nsparam)
: NavierStokesBase<dim, VectorType, IndexSet>(nsparam)
{
Expand All @@ -1880,14 +1880,14 @@ MFNavierStokesSolver<dim>::MFNavierStokesSolver(
}

template <int dim>
MFNavierStokesSolver<dim>::~MFNavierStokesSolver()
FluidDynamicsMatrixFree<dim>::~FluidDynamicsMatrixFree()
{
this->dof_handler.clear();
}

template <int dim>
void
MFNavierStokesSolver<dim>::solve()
FluidDynamicsMatrixFree<dim>::solve()
{
this->computing_timer.enter_subsection("Read mesh and manifolds");

Expand Down Expand Up @@ -1982,7 +1982,7 @@ MFNavierStokesSolver<dim>::solve()

template <int dim>
void
MFNavierStokesSolver<dim>::setup_dofs_fd()
FluidDynamicsMatrixFree<dim>::setup_dofs_fd()
{
TimerOutput::Scope t(this->computing_timer, "Setup DoFs");

Expand Down Expand Up @@ -2119,7 +2119,7 @@ MFNavierStokesSolver<dim>::setup_dofs_fd()

template <int dim>
void
MFNavierStokesSolver<dim>::update_boundary_conditions()
FluidDynamicsMatrixFree<dim>::update_boundary_conditions()
{
if (this->simulation_parameters.boundary_conditions.time_dependent)
{
Expand Down Expand Up @@ -2148,7 +2148,7 @@ MFNavierStokesSolver<dim>::update_boundary_conditions()

template <int dim>
void
MFNavierStokesSolver<dim>::set_initial_condition_fd(
FluidDynamicsMatrixFree<dim>::set_initial_condition_fd(
Parameters::InitialConditionType initial_condition_type,
bool restart)
{
Expand Down Expand Up @@ -2393,15 +2393,15 @@ MFNavierStokesSolver<dim>::set_initial_condition_fd(

template <int dim>
void
MFNavierStokesSolver<dim>::assemble_system_matrix()
FluidDynamicsMatrixFree<dim>::assemble_system_matrix()
{
// Required for compilation but not used for matrix free solvers.
TimerOutput::Scope t(this->computing_timer, "Assemble matrix");
}

template <int dim>
void
MFNavierStokesSolver<dim>::assemble_system_rhs()
FluidDynamicsMatrixFree<dim>::assemble_system_rhs()
{
TimerOutput::Scope t(this->computing_timer, "Assemble RHS");

Expand All @@ -2418,7 +2418,7 @@ MFNavierStokesSolver<dim>::assemble_system_rhs()

template <int dim>
void
MFNavierStokesSolver<dim>::update_multiphysics_time_average_solution()
FluidDynamicsMatrixFree<dim>::update_multiphysics_time_average_solution()
{
TimerOutput::Scope t(this->computing_timer,
"Update multiphysics average solution");
Expand All @@ -2439,7 +2439,7 @@ MFNavierStokesSolver<dim>::update_multiphysics_time_average_solution()

template <int dim>
void
MFNavierStokesSolver<dim>::calculate_time_derivative_previous_solutions()
FluidDynamicsMatrixFree<dim>::calculate_time_derivative_previous_solutions()
{
this->time_derivative_previous_solutions = 0;

Expand All @@ -2458,7 +2458,7 @@ MFNavierStokesSolver<dim>::calculate_time_derivative_previous_solutions()

template <int dim>
void
MFNavierStokesSolver<dim>::setup_GMG()
FluidDynamicsMatrixFree<dim>::setup_GMG()
{
TimerOutput::Scope t(this->computing_timer, "Setup GMG");

Expand All @@ -2481,7 +2481,7 @@ MFNavierStokesSolver<dim>::setup_GMG()

template <int dim>
void
MFNavierStokesSolver<dim>::setup_ILU()
FluidDynamicsMatrixFree<dim>::setup_ILU()
{
TimerOutput::Scope t(this->computing_timer, "Setup ILU");

Expand All @@ -2506,7 +2506,7 @@ MFNavierStokesSolver<dim>::setup_ILU()

template <int dim>
void
MFNavierStokesSolver<dim>::print_mg_setup_times()
FluidDynamicsMatrixFree<dim>::print_mg_setup_times()
{
if (this->simulation_parameters.linear_solver.at(PhysicsID::fluid_dynamics)
.mg_verbosity == Parameters::Verbosity::extra_verbose)
Expand Down Expand Up @@ -2543,7 +2543,7 @@ MFNavierStokesSolver<dim>::print_mg_setup_times()

template <int dim>
void
MFNavierStokesSolver<dim>::update_solutions_for_multiphysics()
FluidDynamicsMatrixFree<dim>::update_solutions_for_multiphysics()
{
TimerOutput::Scope t(this->computing_timer,
"Update solutions for multiphysics");
Expand Down Expand Up @@ -2592,7 +2592,7 @@ MFNavierStokesSolver<dim>::update_solutions_for_multiphysics()

template <int dim>
void
MFNavierStokesSolver<dim>::define_non_zero_constraints()
FluidDynamicsMatrixFree<dim>::define_non_zero_constraints()
{
double time = this->simulation_control->get_current_time();
FEValuesExtractors::Vector velocities(0);
Expand Down Expand Up @@ -2682,7 +2682,7 @@ MFNavierStokesSolver<dim>::define_non_zero_constraints()

template <int dim>
void
MFNavierStokesSolver<dim>::define_zero_constraints()
FluidDynamicsMatrixFree<dim>::define_zero_constraints()
{
FEValuesExtractors::Vector velocities(0);
FEValuesExtractors::Scalar pressure(dim);
Expand Down Expand Up @@ -2761,7 +2761,7 @@ MFNavierStokesSolver<dim>::define_zero_constraints()

template <int dim>
void
MFNavierStokesSolver<dim>::setup_preconditioner()
FluidDynamicsMatrixFree<dim>::setup_preconditioner()
{
this->present_solution.update_ghost_values();

Expand Down Expand Up @@ -2798,8 +2798,9 @@ MFNavierStokesSolver<dim>::setup_preconditioner()

template <int dim>
void
MFNavierStokesSolver<dim>::solve_linear_system(const bool initial_step,
const bool /* renewed_matrix */)
FluidDynamicsMatrixFree<dim>::solve_linear_system(
const bool initial_step,
const bool /* renewed_matrix */)
{
const double absolute_residual =
this->simulation_parameters.linear_solver.at(PhysicsID::fluid_dynamics)
Expand All @@ -2818,16 +2819,16 @@ MFNavierStokesSolver<dim>::solve_linear_system(const bool initial_step,

template <int dim>
void
MFNavierStokesSolver<dim>::assemble_L2_projection()
FluidDynamicsMatrixFree<dim>::assemble_L2_projection()
{
// TODO
}

template <int dim>
void
MFNavierStokesSolver<dim>::solve_system_GMRES(const bool initial_step,
const double absolute_residual,
const double relative_residual)
FluidDynamicsMatrixFree<dim>::solve_system_GMRES(const bool initial_step,
const double absolute_residual,
const double relative_residual)
{
auto &system_rhs = this->system_rhs;
auto &nonzero_constraints = this->nonzero_constraints;
Expand Down Expand Up @@ -2921,5 +2922,5 @@ MFNavierStokesSolver<dim>::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>;
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* ---------------------------------------------------------------------*/

#include "solvers/mf_navier_stokes_operators.h"
#include "solvers/fluid_dynamics_matrix_free_operators.h"

#include <deal.II/grid/grid_generator.h>
/**
Expand Down

0 comments on commit 491ecf0

Please sign in to comment.