simplify logic

don't waste any time if type == "origProcId"
This commit is contained in:
danielque
2017-08-23 17:50:22 +02:00
parent 6343a6a09c
commit 668b85582b

View File

@ -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 << "{version 2.0; format ascii;class "<< className << "; location 0;object "<< name <<";}\n";
fileStream << nPProc <<"\n"; fileStream << nPProc <<"\n";
if (type == "origProcId")
if(type!="origProcId") fileStream << "(\n";
else if(type=="origProcId")
{ {
if(nPProc>0) fileStream <<"{0}"<< "\n"; if(nPProc>0) fileStream <<"{0}"<< "\n";
else fileStream <<"{}"<< "\n"; else fileStream <<"{}"<< "\n";
return;
} }
fileStream << token::BEGIN_LIST << nl;
for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) for(int index = 0;index < particleCloud_.numberOfParticles(); ++index)
{ {
if (particleCloud_.cellIDs()[index][0] > -1) // particle Found 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 * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //