Commit b20b6486 authored by Kenneth Leiter's avatar Kenneth Leiter
Browse files

BUG: Fix writing of single XdmfArray to a file.

parent ea06eaaa
......@@ -163,6 +163,12 @@ void XdmfWriter::setWriteXPaths(const bool writeXPaths)
void XdmfWriter::visit(XdmfArray & array, const boost::shared_ptr<XdmfBaseVisitor> visitor)
{
if (mImpl->mDepth == 0)
{
mImpl->openFile();
}
mImpl->mDepth++;
bool isSubclassed = array.getItemTag().compare(XdmfArray::ItemTag) != 0;
if(isSubclassed)
......@@ -226,6 +232,12 @@ void XdmfWriter::visit(XdmfArray & array, const boost::shared_ptr<XdmfBaseVisito
mImpl->mWriteXPaths = oldWriteXPaths;
}
mImpl->mDepth--;
if(mImpl->mDepth <= 0)
{
mImpl->closeFile();
}
}
void XdmfWriter::visit(XdmfItem & item, const boost::shared_ptr<XdmfBaseVisitor> visitor)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment