FS#103 Specify problems and spatial parameters independently of the discretization
Metadata
Property |
Value |
Project |
dumux |
Category |
General |
Reported by |
Anonymous (Id=0) |
Reported at |
May 4, 2011 16:48 |
Type |
Feature Request |
Version |
Git |
Last edited by |
Andreas Lauser (andreas.lauser@iws.uni-stuttgart.de) |
Last edited at |
Mar 6, 2012 17:15 |
Closed by |
Andreas Lauser (andreas.lauser@iws.uni-stuttgart.de) |
Closed at |
Mar 6, 2012 17:15 |
Closed in version |
unknown (Id=0) |
Resolution |
Implemented |
Description
Currently, the programming interfaces of problem definitions is specific to the spatial discretization used by the model. For example, the box models use the following method to specify the initial condition:
void initial(PrimaryVariables &values, const Element &element, const FVElementGeometry &fvElemGeom, int scvIdx) const
{ ... }
It would be nice to have an programming interface which can also be used in conjunction with other discretizations. For this the model-specific parameters could be wrapped in a "context object". example:
template <class Context>
void initial(PrimaryVariables &values, const Context &context, int localIdx) const
{ ... }
All required parameters can then be accessed via the context object:
const Element &element = context.element();
const GlobalPosition &globalPos = context.globalPos(localIdx);
const FVElementGeometry &fvGeom = context.fvElemGeom();
The advantage of this approach is that it allows to specify simple problems independent of the spatial discretization but on the same time allows to use model specific parameters for more complicated problems.