From 668b85582b49b3cd532e8e9a413658449493a405 Mon Sep 17 00:00:00 2001 From: danielque Date: Wed, 23 Aug 2017 17:50:22 +0200 Subject: [PATCH] simplify logic don't waste any time if type == "origProcId" --- .../cfdemParticle/subModels/IOModel/IOModel/IOModel.C | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C index 147c88c6..702af50d 100644 --- a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C +++ b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C @@ -101,14 +101,15 @@ void IOModel::streamDataToPath(fileName path, double** array,int nPProc,word nam fileStream << "{version 2.0; format ascii;class "<< className << "; location 0;object "<< name <<";}\n"; fileStream << nPProc <<"\n"; - - if(type!="origProcId") fileStream << "(\n"; - else if(type=="origProcId") + if (type == "origProcId") { if(nPProc>0) fileStream <<"{0}"<< "\n"; else fileStream <<"{}"<< "\n"; + return; } + fileStream << token::BEGIN_LIST << nl; + for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) { if (particleCloud_.cellIDs()[index][0] > -1) // particle Found @@ -123,7 +124,7 @@ void IOModel::streamDataToPath(fileName path, double** array,int nPProc,word nam } } - if(type!="origProcId") fileStream << ")\n"; + fileStream << token::END_LIST << nl; } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //