mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
add mebos, a multiplexed ebos variant
`mebos` works similarly as `flow`, but in contrast to `flow`, `mebos`
only creates the deck in the common code path whilst the
'EclipseState' and the other higher-level parser objects are always
created internally by the vanguard. this approach avoids code
duplication and the worst effects of parser API creep.
to avoid having to compile non-trivial compile units multiple times,
the actual code of the variants is moved into `ebos_$VARIANT.{hh,cc}`
files and the respective compile units are each put into a small
static library whilst the main function of said libraries are invoked
by either the multiplexed or the respective specialized simulator's
`main()`. This is also somewhat similar of how `flow` works, with the
difference that `mebos` uses the blackoil variant to determine the
parameters it needs to know for parsing the deck instead of
introducing a "fake" type tag for this. The rationale is to reduce
compile time compared to the "fake type tag" approach and -- to a
lesser extend -- avoid unnecessary copy-and-pasting of code. In
particular, this means that for the vast majority of cases, only one
place needs changed in the code for all `ebos` variants if, for
example, the parser API requires further objects in the future.
This commit is contained in:
@@ -38,8 +38,26 @@ SET_BOOL_PROP(EbosThermalTypeTag, EnableEnergy, true);
|
||||
|
||||
END_PROPERTIES
|
||||
|
||||
int main(int argc, char **argv)
|
||||
namespace Ewoms {
|
||||
|
||||
void ebosThermalSetDeck(Opm::Deck* deck,
|
||||
Opm::ParseContext* parseContext,
|
||||
Opm::ErrorGuard* errorGuard,
|
||||
double externalSetupTime)
|
||||
{
|
||||
typedef TTAG(EbosThermalTypeTag) ProblemTypeTag;
|
||||
typedef GET_PROP_TYPE(ProblemTypeTag, Vanguard) Vanguard;
|
||||
|
||||
Vanguard::setExternalSetupTime(externalSetupTime);
|
||||
Vanguard::setExternalParseContext(parseContext);
|
||||
Vanguard::setExternalErrorGuard(errorGuard);
|
||||
Vanguard::setExternalDeck(deck);
|
||||
}
|
||||
|
||||
int ebosThermalMain(int argc, char **argv)
|
||||
{
|
||||
typedef TTAG(EbosThermalTypeTag) ProblemTypeTag;
|
||||
return Ewoms::start<ProblemTypeTag>(argc, argv);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user