1 for (
const word& fieldType : fieldTypes)
3 const wordList fieldNames = objects.sortedNames(fieldType);
5 if (fieldType ==
"volScalarField")
7 gmvFile <<
"variable" <<
nl;
10 for (
const word& fieldName : fieldNames)
21 if (fieldType ==
"volScalarField")
24 gmvFile << fieldName <<
" 0" <<
nl;
25 for (label indx=0; indx<
mesh.nCells(); ++indx)
27 gmvFile <<
fld[indx] <<
" ";
32 if (fieldType ==
"volVectorField")
34 if (fieldName ==
vComp)
37 gmvFile <<
"velocity 0" <<
nl;
38 for (label indx=0;indx<
mesh.nCells();indx++)
40 gmvFile <<
fld[indx].x() <<
" ";
42 for (label indx=0;indx<
mesh.nCells();indx++)
44 gmvFile <<
fld[indx].y() <<
" ";
46 for (label indx=0;indx<
mesh.nCells();indx++)
48 gmvFile <<
fld[indx].z() <<
" ";
54 if (fieldType ==
"surfaceScalarField")
61 if (fieldType == cloud::prefix)
63 IOobject positionsHeader
72 IOobject coordinatesHeader
83 positionsHeader.typeHeaderOk<IOPosition<Cloud<passiveParticle>>>
87 || coordinatesHeader.typeHeaderOk<IOPosition<Cloud<passiveParticle>>>
93 Cloud<passiveParticle> particles(
mesh, cloud::defaultName);
95 IOobjectList objects(
mesh,
runTime.timeName(), cloud::prefix);
97 wordList lagrangianScalarNames(objects.sortedNames(
"scalarField"));
98 wordList lagrangianVectorNames(objects.sortedNames(
"vectorField"));
100 if (particles.size())
107 if (fieldType ==
"volScalarField")
109 gmvFile <<
"endvars" <<
nl;
constexpr char nl
The newline '\n' character (0x0a)
GeometricField< vector, fvPatchField, volMesh > volVectorField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
List< word > wordList
List of word.
word vComp(conversionProperties.get< word >("vector"))