/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2018-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM, distributed under GPL-3.0-or-later. Description Code chunk for post-processing conversion of cloud(s) to VTK PolyData (.vtp extension). \*---------------------------------------------------------------------------*/ if (doLagrangian) { const fileName cloudPrefix = (regionDir/cloud::prefix); wordList cloudNames = ListOps::create ( readDir ( mesh.time().path()/mesh.time().timeName()/cloudPrefix, fileName::DIRECTORY ), nameOp() ); Pstream::combineReduce(cloudNames, ListOps::uniqueEqOp()); Foam::sort(cloudNames); // Consistent order for (const word& cloudName : cloudNames) { IOobjectList cloudObjs(mesh, runTime.timeName(), cloudPrefix/cloudName); bool isCloud = false; if (cloudObjs.erase("coordinates")) { isCloud = true; } if (cloudObjs.erase("positions")) { isCloud = true; } if (!returnReduceOr(isCloud)) { continue; } // Limited to basic IOField types cloudObjs.filterClasses ( stringListOps::foundOp(fieldTypes::basic) ); // Are there cloud fields (globally)? if (returnReduceAnd(cloudObjs.empty())) { continue; } vtk::lagrangianWriter writer ( meshProxy.baseMesh(), cloudName, writeOpts, // Output name for the cloud ( outputDir/regionDir/cloud::prefix / cloudName/cloudName + timeDesc ), UPstream::parRun() ); Info<< " Lagrangian: " << args.relativePath(writer.output()) << nl; writer.writeTimeValue(mesh.time().value()); writer.writeGeometry(); // Begin CellData/PointData writer.beginParcelData(); writer.writeFields