[staggered] Passing the object of partial(sol) to VtkWriter leads to segfault
When using the staggered scheme in a multi-domain context, initializing the VtkWriter like
auto partialSol = partial(sol);
StaggeredVtkOutputModule<GridVariables,
GetPropType<TypeTag, Properties::SolutionVector>> vtkWriter(*gridVariables, partialSol, name);
leads to a segfault.
If the writer is instead initialized like
auto partialSol = partial(sol);
StaggeredVtkOutputModule<GridVariables,
decltype(partialSol)> vtkWriter(*gridVariables, partialSol, name);
everything works as expected.
Could be related to the fact that partialSol
only stores references to the actual solution sub-vectors.
It indeed has a different type than SolutionVector
.
C++17 probably would elegantly fix this, since we could just remove SolutionVector
from the class template list because it could be inferred from the constructor.
Edited by Kilian Weishaupt