/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Copyright (C) 2023-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 . Class Foam::GeometricFieldListSlicer Description Class to provide list slices to different parts of a geometric field See also Foam::FieldListSlice \*---------------------------------------------------------------------------*/ #ifndef GeometricFieldListSlicer_H #define GeometricFieldListSlicer_H #include "DimensionedFieldListSlicer.H" #include "GeometricField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { /*---------------------------------------------------------------------------*\ Class GeometricFieldListSlicer Declaration \*---------------------------------------------------------------------------*/ template class GeometricFieldListSlicer : public DimensionedFieldListSlicer { // Private Data //- Slices into the patch field data. Indexed by patch, then by field. List>> patchFields_; public: // Constructors //- Construct null. Set later. inline GeometricFieldListSlicer() {} //- Construct from a mesh and a list of fields template inline GeometricFieldListSlicer ( const GeoMesh& mesh, const UPtrList& geoFields ) { set(mesh, geoFields); } // Member Functions //- Set the field pointers template inline void set ( const GeoMesh& mesh, const UPtrList& geoFields ) { DimensionedFieldListSlicer::set(geoFields); List>> tpatchFields(mesh.boundary().size()); patchFields_.transfer(tpatchFields); forAll(mesh.boundary(), patchi) { FieldListSlicer::set ( [&](const label geoFieldi) -> decltype(auto) { return geoFields[geoFieldi].boundaryField()[patchi]; }, geoFields.size(), patchFields_[patchi] ); } } //- Return a slice for a patch element inline FieldListSlice patchSlice ( const label patchi, const label patchElementi ) const { return FieldListSlice(patchFields_[patchi], patchElementi); } }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif // ************************************************************************* //