/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . \*---------------------------------------------------------------------------*/ #include "foamVtkCoordSetWriter.H" #include "foamVtkOutput.H" #include "globalIndex.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // void Foam::vtk::coordSetWriter::beginPiece() { // Basic sizes nLocalPoints_ = 0; nLocalVerts_ = 0; nLocalLines_ = 0; nLocalPolys_ = 0; for (const pointField& pts : points_) { const label npts = pts.size(); nLocalPoints_ += npts; if (npts) { ++nLocalLines_; } } switch (elemOutput_) { case elemOutputType::NO_ELEMENTS: { nLocalVerts_ = nLocalLines_ = 0; break; } case elemOutputType::DEFAULT_ELEMENTS: { if (points_.size() < 2) { //OR nLocalVerts_ = nLocalPoints_; nLocalVerts_ = 0; nLocalLines_ = 0; } break; } case elemOutputType::POINT_ELEMENTS: { nLocalVerts_ = nLocalPoints_; nLocalLines_ = 0; break; } case elemOutputType::LINE_ELEMENTS: { // Already determined break; } } // Update sizes, similar to // vtk::polyWriter::beginPiece(const pointField&, const edgeList&) numberOfPoints_ = nLocalPoints_; numberOfCells_ = nLocalLines_; // if (parallel_) // { // reduce(numberOfPoints_, sumOp