FS#116 Collect common box problem functionality in one class/file
Metadata
Property |
Value |
Project |
dumux |
Category |
Implicit models |
Reported by |
Bernd Flemisch (bernd@iws.uni-stuttgart.de) |
Reported at |
Jan 9, 2012 13:01 |
Type |
Feature Request |
Version |
Git |
Last edited by |
Bernd Flemisch (bernd@iws.uni-stuttgart.de) |
Last edited at |
Apr 10, 2012 10:24 |
Closed by |
Bernd Flemisch (bernd@iws.uni-stuttgart.de) |
Closed at |
Apr 10, 2012 10:24 |
Closed in version |
unknown (Id=0) |
Resolution |
Implemented |
Description
Almost all model specific box problem classes share common code and functionality, namely
1. temperature-related member functions: boxTemperature, temperatureAtPos, temperature.
2. gravity-related member functions and variable: boxGravity, gravityAtPos, gravity, gravity_.
3. spatial-parameters-related member functions and variable: spatialParameters, spatialParameters_.
I propose to collect all this within one class with the obvious advantage of less code duplication. Moreover, this step would make (most of) the model-specific box problem classes obsolete. I can think of two alternatives:
A. Move all this (1.-3.) into the already existing common BoxProblem class.
+: not again another inheritance layer.
-: all box models have the functionality, even the ones not needing it (e.g. Stokes). We would need a dummy spatial parameters class (maybe void or double would do).
B. Create a new class ?BoxProblem, e.g. PorousMediaBoxProblem, inheriting from BoxProblem, collect 1.-3. there.
+: Clearly separated functionality.
-: +1 inheritance layer if a model specific problem class is still needed.
Please let me know your thoughts.