diff --git a/core/XdmfArray.cpp b/core/XdmfArray.cpp index 5b6602765142fb4e0acbd5fb9f76f2408da8799a..23989a37ebbafa6f4a57d3c140b849a0cf81ee40 100644 --- a/core/XdmfArray.cpp +++ b/core/XdmfArray.cpp @@ -1083,8 +1083,25 @@ XdmfArray::populateItem(const std::map & itemPropertie } } - std::string hdf5Path = contentVals[contentIndex].substr(0, colonLocation); - std::string dataSetPath = contentVals[contentIndex].substr(colonLocation+1); + std::string hdf5Path = + contentVals[contentIndex].substr(0, colonLocation); + std::string dataSetPath = + contentVals[contentIndex].substr(colonLocation+1); + + // FIXME: for other OS (e.g. windows) + if(hdf5Path.size() > 0 && hdf5Path[0] != '/') { + // Dealing with a relative path for hdf5 location + std::map::const_iterator xmlDir = + itemProperties.find("XMLDir"); + if(xmlDir == itemProperties.end()) { + XdmfError::message(XdmfError::FATAL, + "'XMLDir' not found in itemProperties in " + "XdmfArray::populateItem"); + } + std::stringstream newHDF5Path; + newHDF5Path << xmlDir->second << hdf5Path; + hdf5Path = newHDF5Path.str(); + } // Parse dimensions from the content std::vector contentDims; diff --git a/utils/XdmfExodusWriter.cpp b/utils/XdmfExodusWriter.cpp index ab90fc6b9b71769498a3b4f38b97e0900d0516fd..7a75c2301b779849af70e1364b15e8fdb8de101a 100644 --- a/utils/XdmfExodusWriter.cpp +++ b/utils/XdmfExodusWriter.cpp @@ -21,6 +21,7 @@ /* */ /*****************************************************************************/ +#include #include #include #include