/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Copyright (C) 2022-2026 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- 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 "cellCutPlot.H" #include "cutPolyIntegral.H" #include "generatedCellZone.H" #include "OSspecific.H" #include "setWriter.H" #include "SubField.H" #include "volFields.H" #include "writeFile.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { namespace cellCutPlot { // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // //- Allocate and return a pair of fields template autoPtr>> fieldPairPtr(const label size) { return autoPtr>> ( new Pair>(Field(size), Field(size)) ); } //- Allocate and return a pair of a pair of fields template autoPtr>>> fieldPairPairPtr(const label size) { return autoPtr>>> ( new Pair>> ( Pair>(Field(size), Field(size)), Pair>(Field(size), Field(size)) ) ); } //- Base class for classes which manage incomplete sets of face data class faceData { protected: const cellList& cells_; const cellEdgeAddressingList& cAddrs_; const scalarField& cellVolumes_; const faceList& faces_; const vectorField& faceAreas_; const pointField& faceCentres_; const pointField& points_; const scalarField& pointXs_; const scalarField& cutXs_; PtrList> faceis_; PtrList haveFaces_; inline label activeCuti(const label cuti) const { return cuti % faceis_.size(); } public: faceData ( const polyMesh& mesh, const label nActiveCuts, const scalarField& pointXs, const scalarField& cutXs ) : cells_(mesh.cells()), cAddrs_(cellEdgeAddressingList::New(mesh)), cellVolumes_(mesh.cellVolumes()), faces_(mesh.faces()), faceAreas_(mesh.faceAreas()), faceCentres_(mesh.faceCentres()), points_(mesh.points()), pointXs_(pointXs), cutXs_(cutXs), faceis_(nActiveCuts), haveFaces_(nActiveCuts) { forAll(faceis_, i) { faceis_.set(i, new DynamicList