mirror of
https://github.com/ParticulateFlow/CFDEMcoupling-PFM.git
synced 2025-12-08 06:37:44 +00:00
remove unnecessary copy to temp vector
This commit is contained in:
@ -96,7 +96,6 @@ fileName IOModel::buildFilePath(word dirName) const
|
|||||||
|
|
||||||
void IOModel::streamDataToPath(fileName path, double** array,int nPProc,word name,word type,word className,word finaliser) const
|
void IOModel::streamDataToPath(fileName path, double** array,int nPProc,word name,word type,word className,word finaliser) const
|
||||||
{
|
{
|
||||||
vector vec;
|
|
||||||
OFstream* fileStream = new OFstream(fileName(path/name));
|
OFstream* fileStream = new OFstream(fileName(path/name));
|
||||||
*fileStream << "FoamFile\n";
|
*fileStream << "FoamFile\n";
|
||||||
*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";
|
||||||
@ -117,8 +116,7 @@ void IOModel::streamDataToPath(fileName path, double** array,int nPProc,word nam
|
|||||||
if (type=="scalar"){
|
if (type=="scalar"){
|
||||||
*fileStream << array[index][0] << " \n";
|
*fileStream << array[index][0] << " \n";
|
||||||
}else if (type=="position" || type=="vector"){
|
}else if (type=="position" || type=="vector"){
|
||||||
for(int i=0;i<3;i++) vec[i] = array[index][i];
|
*fileStream <<"( "<< array[index][0] <<" "<<array[index][1]<<" "<<array[index][2]<<" ) "<< finaliser << " \n";
|
||||||
*fileStream <<"( "<< vec[0] <<" "<<vec[1]<<" "<<vec[2]<<" ) "<< finaliser << " \n";
|
|
||||||
}else if (type=="label"){
|
}else if (type=="label"){
|
||||||
*fileStream << index << finaliser << " \n";
|
*fileStream << index << finaliser << " \n";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user