Hello,
I am considering a possibility to use a DuMuX program not as an
executable, but as a shared library. In addition, this library is going
to pass the results to caller via memory, rather than storing .vtu files
on disk. Also, the library is to be called more than once, each time
accepting a different params.input, also via memory.
If anybody has done a similar thing, I will be grateful if you share
your experience.
The issues I see now are:
- Not sure if MPI will remain possible. But multiprocessing is not a
priority in my particular case, since the library will be used mostly
for 1D problems.
- DuMuX expects params.input to be a file, not a stream. But a more
generic DUNE interface accepts a stream, so I think it will not be hard
to adjust DuMuX's behavior.
- Some of the parameters in DuMuX codebase are only initialized once
(grep for "getParam" and "static" on the same line). For example,
assembly/boxlocalassembler.hh:
static const int numDiffMethod =
getParamFromGroup<int>(this->problem().paramGroup(),
"Assembly.NumericDifferenceMethod");
This would be a problem if I wanted to pass different
Assembly.NumericDifferenceMethod with sequential calls of the library.
Fortunately, I do not. Aside from problem-specific parameters, I want to
vary parameters of grid and time stepping, and it seems that they can be
re-initialized, as least for porous medium flow problems.
Do I miss any other obstacles?
Is there a consistent pattern in which parameters are initialized once
and which can be re-initialized?
Best regards,
Dmitry
_______________________________________________
DuMux mailing list
[email protected]
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux