precice / openfoam-adapter

OpenFOAM-preCICE adapter
https://precice.org/adapter-openfoam-overview.html
GNU General Public License v3.0
135 stars 80 forks source link

Group the modules together to reduce code duplication #16

Open MakisH opened 6 years ago

MakisH commented 6 years ago

At the moment, when writing a new module, the developer has to write almost the same code in order e.g. to load the new module. If we created a list of modules and iterated onto them, we would make it easier to add a new module. At the end, we could even really allow to deliver modules as "plug-ins".

This is a good issue for anyone interested in design patterns, but it is also of low priority, since at the end we don't need many modules. I will try to tackle this issue after the FSI module is ready.

floli commented 6 years ago

What is a module in that context?

MakisH commented 6 years ago

A set of classes in a different namespace, which treat all the problem-specific operations. We currently have a module for Conjugate Heat Transfer, we are now also developing a module for Fluid-Structure Interaction.

They are mostly decoupled from the core of the adapter, but still using a new module at the moment would require to duplicate a few lines of code in the main Adapter.C file.

MakisH commented 1 year ago

Looking back, I am not sure anymore if the current separation into modules makes much sense. We already have an example where temperature can be provided by two modules, which may need to interoperate: #276

I think that, in the long term, what would be nice would be: