From 2e4c93f8eec19a038110c5897cee03c74bb5746f Mon Sep 17 00:00:00 2001 From: danielque Date: Wed, 23 Aug 2017 17:52:51 +0200 Subject: [PATCH] use info from OFstream to create output file header --- .../subModels/IOModel/IOModel/IOModel.C | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C index 702af50d..5a6a7054 100644 --- a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C +++ b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C @@ -97,8 +97,16 @@ fileName IOModel::buildFilePath(word dirName) const void IOModel::streamDataToPath(fileName path, double** array,int nPProc,word name,word type,word className,word finaliser) const { OFstream fileStream(path/name); - fileStream << "FoamFile\n"; - fileStream << "{version 2.0; format ascii;class "<< className << "; location 0;object "<< name <<";}\n"; + + fileStream + << "FoamFile\n{\n" + << " version " << fileStream.version() << ";\n" + << " format " << fileStream.format() << ";\n" + << " class " << className << ";\n" + << " location " << 0 << ";\n" + << " object " << name << ";\n" + << "}" << nl; + fileStream << nPProc <<"\n"; if (type == "origProcId")