Interface of MultigridPreconditioner regarding Dirichlet boundaries #514
Labels
multigrid
Multigrid implementation
software design
Issue or pull request dealing with aspects of code design
Currently, the interface of the multigrid preconditioner contains the two data structures
std::map<dealii::boundary, dealii::Function>
std::map<dealii::boundary, dealii::ComponentMask>
(where the first map needs to include all boundary IDs and where we have the implicit convention in the code that a default component mask will be used if the corresponding boundary ID is not part of the second map).
The problem that I see is that
dealii::Function
in the first parameter above is never used, since multigrid applies only homogeneous Dirichlet boundary data. In this sense, it is a poor design.I see the following options:
map
toset
std::set<dealii::boundary>
std::map<dealii::boundary, dealii::ComponentMask>
std::map<dealii::boundary, dealii::ComponentMask>
The multigrid preconditioner implementation aims to be generic. There might be problems that do not use
ComponentMask
. Then, the design option 2. might be considered limitating as one is forced to useComponentMask
, while one could argue to hand over an emptymap
in case of design option 1.struct DirichletBoundaryData
(whatever this looks like internally)handed over to multigrid, in order to have full flexibility on the one hand, and avoid the need to change the multigrid interface again and again (as we observed in the past) when adding new functionality. Similar criticism holds as for option 2: Why should one use a more complicated data structure if the problem at hand is very basic, i.e. standard Dirichlet BCs with default component mask? Nevertheless, I wonder whether other function spaces (e.g. Hdiv) might call for option 3.
This issue originates from c3dc80b and will then probably initiate follow-up PRs for multigrid.
@kronbichler @bugrahantemur I am happy to hear your opinion.
The text was updated successfully, but these errors were encountered: