I found the following issue with XDA
restart. But first, let me start with a working scenario:
- let's have a simulation with 2 variables:
'u' and 'v', where 'u' lives on the whole domain and 'v' only on half of
- save the result into an XDA file
- when restarting, we recreate the EquationSystems,
we add 'u' and 'v' sitting on the same domains
- we read the XDA file
- all is good and working.
Now if we get an XDA file (for example
from someone else) - we may not know where each variable lived. The way
to go would be to do:
- read the mesh file
- create EquationSystems object
- call read on the XDA file
However the XDA file does not contain
enough info to properly add variables, see system_io.C:212 where add_variable
is called with no subdomain param, which means all variables will live
everywhere and thus the read from XDA file will fail. A solution for this
problem would be to put additional info about the variable subdomain into
the XDA file. However it should not break the old XDA files, so I was thinking
to put there something like (1 2 3), which would mean a set of subdomain_id().
We could probably peek the stream for opening parenthesis to see if this
info is available there or not and take a proper action based on that.
If you have any comments, please let
me know. Meanwhile, I'll work on a patch that will enable this.