Boundary conditions 'apply_bc_on_ghost_b_*'

What is the meaning of apply_bc_on_ghost_b_cells or apply_bc_on_ghost_b_faces?
Seriously? These routines just apply boundary conditions. There is no reason to specify in the name that only the ghost cells of the boundary of the whole domain are impacted.

I suggest to simply rename it apply_boundary_conditions.
This routine will comes in two flavors:

  • apply_cell_boundary_conditions for the cells
  • apply_face_boundary_conditions for the faces

A common interface might be used to simplify the code:

interface apply_boundary_conditions
    module procedure :: apply_cell_boundary_conditions
    module procedure :: apply_face_boundary_conditions
end interface

Not a big deal for a renaming. There are only 34 occurrences of these names across the code:

$ git grep apply_bc_on_ghost_b_ | wc -l
34

It seems to me that

src/lib/ … /implicit_discretization/ … /apply_bc_on_ghost_b_cells.f90

is very close to

src/lib/ … /implicit_discretization/ … /add_cell_bc.f90

but applies explicitly the boundary condition to some field instead of filling a matrix.

A modification to the boundary condition must logically be done in both files : seems like code duplicate here. If my guess is true, developers should be at least advised by code comments that both files should be reviewed.

OK to rename the routines as apply_cell_boundary_conditions and apply_cell_boundary_conditions.
Common interface is not used so far to encapsulate cell and face discretization routines, so we can avoid it.