mirror of
https://github.com/ParticulateFlow/CFDEMcoupling-PFM.git
synced 2025-12-08 06:37:44 +00:00
[OF6] adjust particle position IO
OF5 and above write barycentric coordinates of particles and include tetFace and tetPt in position file
This commit is contained in:
@ -30,6 +30,7 @@ Description
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "error.H"
|
#include "error.H"
|
||||||
|
#include "particle.H"
|
||||||
#include "IOModel.H"
|
#include "IOModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -99,13 +100,22 @@ void IOModel::streamDataToPath(const fileName& path, const double* const* array,
|
|||||||
OFstream fileStream(path/name);
|
OFstream fileStream(path/name);
|
||||||
|
|
||||||
fileStream
|
fileStream
|
||||||
<< "FoamFile\n{\n"
|
<< "/*--------------------------------*- C++ -*----------------------------------*\\" << nl
|
||||||
<< " version " << fileStream.version() << ";\n"
|
<< " ========= |" << nl
|
||||||
<< " format " << fileStream.format() << ";\n"
|
<< " \\\\ / F ield | OpenFOAM: The Open Source CFD Toolbox" << nl
|
||||||
<< " class " << className << ";\n"
|
<< " \\\\ / O peration | Website: https://openfoam.org" << nl
|
||||||
<< " location " << 0 << ";\n"
|
<< " \\\\ / A nd | Version: " << FOAMversion << nl
|
||||||
<< " object " << name << ";\n"
|
<< " \\\\/ M anipulation |" << nl
|
||||||
<< "}" << nl;
|
<< "\\*---------------------------------------------------------------------------*/" << nl
|
||||||
|
<< "FoamFile" << nl
|
||||||
|
<< "{" << nl
|
||||||
|
<< " version " << fileStream.version() << ";" << nl
|
||||||
|
<< " format " << fileStream.format() << ";" << nl
|
||||||
|
<< " class " << className << ";" << nl
|
||||||
|
<< " location " << 0 << ";" << nl
|
||||||
|
<< " object " << name << ";" << nl
|
||||||
|
<< "}" << nl
|
||||||
|
<< "// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //" << nl << nl;
|
||||||
|
|
||||||
fileStream << nPProc << "\n";
|
fileStream << nPProc << "\n";
|
||||||
|
|
||||||
@ -129,7 +139,19 @@ void IOModel::streamDataToPath(const fileName& path, const double* const* array,
|
|||||||
}
|
}
|
||||||
else if (type == "position")
|
else if (type == "position")
|
||||||
{
|
{
|
||||||
fileStream << "( "<< array[index][0] << " " << array[index][1] << " " << array[index][2] << " ) " << cellIDs[index][0] << " \n";
|
#if OPENFOAM_VERSION_MAJOR < 5
|
||||||
|
fileStream << "( " << array[index][0] << " " << array[index][1] << " " << array[index][2] << " ) " << cellIDs[index][0] << nl;
|
||||||
|
#else
|
||||||
|
particle part
|
||||||
|
(
|
||||||
|
particleCloud_.mesh(),
|
||||||
|
vector(array[index][0],array[index][1],array[index][2]),
|
||||||
|
cellIDs[index][0]
|
||||||
|
);
|
||||||
|
|
||||||
|
part.writePosition(fileStream);
|
||||||
|
fileStream << nl;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if (type == "vector")
|
else if (type == "vector")
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user