mirror of
https://github.com/ParticulateFlow/CFDEMcoupling-PFM.git
synced 2025-12-08 06:37:44 +00:00
simplify logic
don't waste any time if type == "origProcId"
This commit is contained in:
@ -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 * * * * * * * * * * * * * * //
|
||||||
|
|||||||
Reference in New Issue
Block a user