diff --git a/etc/controlDict b/etc/controlDict index 74d85e59017bac8b49d082aaf6dcfcf5551bf012..639c712d7ab2ca92aa4199e83c20c70cb003dfb8 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2412 | +| \\ / O peration | Version: v2506 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -209,6 +209,14 @@ OptimisationSwitches pbufs.tuning 0; + // ========== + // Allocation + // ========== + + // GeometricField with extra capacity for flattened boundary fields. + unifiedGeometricField 0; + + // ===== // Other // ===== diff --git a/src/OpenFOAM/fields/Fields/Field/Field.C b/src/OpenFOAM/fields/Fields/Field/Field.C index 1dd8d1be9dc07be20869eaa6352612e6724d246b..b2dab6c05f00539e3c58e997f719d7bc891ba6f0 100644 --- a/src/OpenFOAM/fields/Fields/Field/Field.C +++ b/src/OpenFOAM/fields/Fields/Field/Field.C @@ -236,7 +236,7 @@ void Foam::Field<Type>::assign(const entry& e, const label len) // Check lengths if (len >= 0 && len != lenRead) { - if (len < lenRead && allowConstructFromLargerSize) + if (len < lenRead && FieldBase::allowConstructFromLargerSize) { // Truncate the data this->resize(len); diff --git a/src/OpenFOAM/fields/Fields/Field/Field.H b/src/OpenFOAM/fields/Fields/Field/Field.H index c49292a0663df63ff250d603f31374e7d1aa1316..744ac9fac1fe6d6d951eb4bbedbcd2f6d48cba69 100644 --- a/src/OpenFOAM/fields/Fields/Field/Field.H +++ b/src/OpenFOAM/fields/Fields/Field/Field.H @@ -91,6 +91,40 @@ public: // Mostly required for things like column mesh, for example. static bool allowConstructFromLargerSize; + //- GeometricField with extra capacity for flattened boundary fields. + //- Uses opt-switch "unifiedGeometricField" + static bool unifiedGeometricField; + + //- Local boundary field consistency checks. + //- Uses opt-switch "localBoundaryConsistency" + static int localBoundaryConsistency_; + + //- Tolerance for local boundary field consistency checks. + //- Uses opt-switch "localBoundaryConsistency::tolerance" + static scalar localBoundaryTolerance_; + + + // Static Member Functions + + //- Warn about keyword changes for local boundary consistency checks. + // The supplied dictionary corresponds to the optimisationSwitches + static void warnLocalBoundaryConsistencyCompat(const dictionary&); + + //- Get flag for local boundary consistency checks. + static int localBoundaryConsistency() noexcept + { + return localBoundaryConsistency_; + } + + //- Set flag for local boundary consistency checks. + // \return the previous value + static int localBoundaryConsistency(int val) noexcept + { + int old(localBoundaryConsistency_); + localBoundaryConsistency_ = val; + return old; + } + // Constructors diff --git a/src/OpenFOAM/fields/Fields/Field/FieldBase.C b/src/OpenFOAM/fields/Fields/Field/FieldBase.C index fdbbb1e94b946c9b10fc8e171f1c3a9f50a213ed..4b08b2638a019d2fd223f8a9727541344ade681c 100644 --- a/src/OpenFOAM/fields/Fields/Field/FieldBase.C +++ b/src/OpenFOAM/fields/Fields/Field/FieldBase.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018-2022 OpenCFD Ltd. + Copyright (C) 2018-2025 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -26,6 +26,10 @@ License \*---------------------------------------------------------------------------*/ #include "Field.H" +#include "debug.H" +#include "dictionary.H" +#include "error.H" +#include "registerSwitch.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -33,5 +37,111 @@ const char* const Foam::FieldBase::typeName("Field"); bool Foam::FieldBase::allowConstructFromLargerSize = false; +bool Foam::FieldBase::unifiedGeometricField +( + Foam::debug::optimisationSwitch("unifiedGeometricField", 0) +); +registerOptSwitch +( + "unifiedGeometricField", + bool, + Foam::FieldBase::unifiedGeometricField +); + + +int Foam::FieldBase::localBoundaryConsistency_ +( + Foam::debug::optimisationSwitch("localBoundaryConsistency", 1) +); +registerOptSwitch +( + "localConsistency", + int, + Foam::FieldBase::localBoundaryConsistency_ +); + + +Foam::scalar Foam::FieldBase::localBoundaryTolerance_ +( + Foam::debug::floatOptimisationSwitch + ( + "localBoundaryConsistency::tolerance", 0 + ) +); +registerOptSwitch +( + "localBoundaryConsistency::tolerance", + Foam::scalar, + Foam::FieldBase::localBoundaryTolerance_ +); + + +// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // + +// This is a really ugly solution, but no obvious simpler method + +void Foam::FieldBase::warnLocalBoundaryConsistencyCompat +( + const dictionary& dict +) +{ + // New: localBoundaryConsistency + // Old: + // - localConsistency + // - point(Vector)Field::Boundary::localConsistency + // - point(Spherical|Symm)?TensorField::Boundary::localConsistency + // - (surface|vol)(Scalar|Vector)Field::Boundary::localConsistency + // - (surface|vol)(Spherical|Symm)?TensorField::Boundary::localConsistency + + // New: localBoundaryConsistency::tolerance + // Old: + // - (vol|surface)(Scalar|Vector)Field::Boundary::tolerance + // - (vol|surface)(Spherical|Symm)?TensorField::Boundary::tolerance + + { + constexpr int version(2412); + + const word flagName("localBoundaryConsistency"); + const word tolName("localBoundaryConsistency::tolerance"); + + // Warn: "using " kw -> flagName; + const auto emitWarning = + [=](const std::string& oldName, const std::string& newName) + { + if (error::master()) + { + std::cerr + << "--> FOAM IOWarning :" << nl + << " Found [v" << version << "] '" + << oldName.c_str() << "' entry instead of '" + << newName.c_str() << "'" << nl + << std::endl; + error::warnAboutAge("keyword", version); + } + }; + + for (const entry& e : dict) + { + const auto& kw = e.keyword(); + + if (kw.contains("Field::Boundary::")) + { + if (kw.ends_with("Field::Boundary::localConsistency")) + { + emitWarning(kw, flagName); + } + else if (kw.ends_with("Field::Boundary::tolerance")) + { + emitWarning(kw, tolName); + } + } + else if (kw == "localConsistency") + { + emitWarning(kw, flagName); + } + } + } +} + // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/GeoMesh/GeoMesh.H b/src/OpenFOAM/meshes/GeoMesh/GeoMesh.H index 21f0377d1f9517938c99d16639ce51bd8075fb4a..9845e9dd8614d29217d2fc9d8dc62489a670b465 100644 --- a/src/OpenFOAM/meshes/GeoMesh/GeoMesh.H +++ b/src/OpenFOAM/meshes/GeoMesh/GeoMesh.H @@ -29,10 +29,13 @@ Class Description Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc. + Derived classes are typically expected to implement the static methods + size() and boundary_size(). + \*---------------------------------------------------------------------------*/ -#ifndef GeoMesh_H -#define GeoMesh_H +#ifndef Foam_GeoMesh_H +#define Foam_GeoMesh_H #include "objectRegistry.H" diff --git a/src/OpenFOAM/meshes/pointMesh/pointMesh.H b/src/OpenFOAM/meshes/pointMesh/pointMesh.H index 8aaeb4f698c29acc8b6445972402e5e1c527b401..0634da54366d2c07e17d992a259e6d85edb963af 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointMesh.H +++ b/src/OpenFOAM/meshes/pointMesh/pointMesh.H @@ -121,15 +121,27 @@ public: ~pointMesh() = default; - // Member Functions + // Static Functions - //- Return size. Number of points + //- The geometric (internal) size - number of mesh points. + // Method name expected by GeoMesh interface static label size(const Mesh& mesh) { return mesh.GeoMesh<polyMesh>::mesh_.nPoints(); } - //- Return size. Number of points + //- The geometric boundary size - not implemented. + // Method name expected by GeoMesh interface + static label boundary_size(const Mesh& mesh) + { + return 0; + } + + + // Member Functions + + //- The geometric (internal) size - number of points. + // Method name expected by GeoMesh interface label size() const { return size(*this); diff --git a/src/finiteArea/areaMesh/areaFaMesh.H b/src/finiteArea/areaMesh/areaFaMesh.H index 039a574c7c19c12149811904c585eb096592d8da..35ceba46c84b20c40b9d4dfb64201c8adc5c7dbb 100644 --- a/src/finiteArea/areaMesh/areaFaMesh.H +++ b/src/finiteArea/areaMesh/areaFaMesh.H @@ -36,8 +36,8 @@ Author \*---------------------------------------------------------------------------*/ -#ifndef areaFaMesh_H -#define areaFaMesh_H +#ifndef Foam_areaFaMesh_H +#define Foam_areaFaMesh_H #include "GeoMesh.H" #include "faMesh.H" @@ -66,13 +66,32 @@ public: {} + // Static Functions + + //- The geometric (internal) size - number of faces. + // Method name expected by GeoMesh interface + static label size(const faMesh& mesh) noexcept + { + return mesh.nFaces(); + } + + //- The geometric boundary size - number of boundary edges. + // Method name expected by GeoMesh interface + static label boundary_size(const faMesh& mesh) noexcept + { + return mesh.nBoundaryEdges(); + } + + // Member Functions - //- Return size. Number of faces - static label size(const Mesh& mesh) { return mesh.nFaces(); } + //- The geometric (internal) size - number of faces. + // Method name expected by GeoMesh interface + label size() const noexcept + { + return size(mesh_); + } - //- Return size. Number of faces - label size() const { return size(mesh_); } //- Field of face centres const areaVectorField& C() const { return mesh_.areaCentres(); } diff --git a/src/finiteArea/edgeMesh/edgeFaMesh.H b/src/finiteArea/edgeMesh/edgeFaMesh.H index 214af6a9c746464fa1871fd799297e6cc76260b2..e4a298a83db8a423c25067aba13741eddda876e3 100644 --- a/src/finiteArea/edgeMesh/edgeFaMesh.H +++ b/src/finiteArea/edgeMesh/edgeFaMesh.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016-2017 Wikki Ltd - Copyright (C) 2021 OpenCFD Ltd. + Copyright (C) 2021-2025 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -36,8 +36,8 @@ Author \*---------------------------------------------------------------------------*/ -#ifndef edgeFaMesh_H -#define edgeFaMesh_H +#ifndef Foam_edgeFaMesh_H +#define Foam_edgeFaMesh_H #include "GeoMesh.H" #include "faMesh.H" @@ -66,13 +66,32 @@ public: {} + // Static Functions + + //- The geometric (internal) size - number of internal edges. + // Method name expected by GeoMesh interface + static label size(const faMesh& mesh) noexcept + { + return mesh.nInternalEdges(); + } + + //- The geometric boundary size - number of boundary edges. + // Method name expected by GeoMesh interface + static label boundary_size(const faMesh& mesh) noexcept + { + return mesh.nBoundaryEdges(); + } + + // Member Functions - //- Return size. Number of internal edges - static label size(const Mesh& mesh) { return mesh.nInternalEdges(); } + //- The geometric (internal) size - number of internal edges. + // Method name expected by GeoMesh interface + label size() const noexcept + { + return size(mesh_); + } - //- Return size. Number of internal edges - label size() const { return size(mesh_); } //- Field of edge centres const edgeVectorField& C() const { return mesh_.edgeCentres(); } diff --git a/src/finiteVolume/surfaceMesh/surfaceMesh.H b/src/finiteVolume/surfaceMesh/surfaceMesh.H index b82d2ac9822ed8c855039e0d69f865743dcad837..19399a0ba9e30ca02c232515a40b1ecd6212c8b5 100644 --- a/src/finiteVolume/surfaceMesh/surfaceMesh.H +++ b/src/finiteVolume/surfaceMesh/surfaceMesh.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation + Copyright (C) 2025 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,8 +32,8 @@ Description \*---------------------------------------------------------------------------*/ -#ifndef surfaceMesh_H -#define surfaceMesh_H +#ifndef Foam_surfaceMesh_H +#define Foam_surfaceMesh_H #include "GeoMesh.H" #include "fvMesh.H" @@ -62,20 +63,33 @@ public: {} - // Member Functions + // Static Functions - //- Return size. Number of internal faces - static label size(const Mesh& mesh) + //- The geometric (internal) size - number of internal faces. + // Method name expected by GeoMesh interface + static label size(const polyMesh& mesh) noexcept { return mesh.nInternalFaces(); } - //- Return size. Number of internal faces - label size() const + //- The geometric boundary size - number of boundary faces. + // Method name expected by GeoMesh interface + static label boundary_size(const polyMesh& mesh) noexcept + { + return mesh.nBoundaryFaces(); + } + + + // Member Functions + + //- The geometric mesh size - number of internal faces. + // Method name expected by GeoMesh interface + label size() const noexcept { return size(mesh_); } + //- Field of face centres const surfaceVectorField& C() const { diff --git a/src/finiteVolume/volMesh/volMesh.H b/src/finiteVolume/volMesh/volMesh.H index cde07521f3718dd350a31f1cb7934811b7c4dc9e..df014a7f7e065bd43e8768e7df9d0741d2154839 100644 --- a/src/finiteVolume/volMesh/volMesh.H +++ b/src/finiteVolume/volMesh/volMesh.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2021 OpenCFD Ltd. + Copyright (C) 2021,2025 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -32,13 +32,12 @@ Description \*---------------------------------------------------------------------------*/ -#ifndef volMesh_H -#define volMesh_H +#ifndef Foam_volMesh_H +#define Foam_volMesh_H #include "GeoMesh.H" #include "fvMesh.H" #include "primitiveMesh.H" -#include <type_traits> // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -57,23 +56,35 @@ public: // Constructors - //- Construct from fvMesh + //- Construct from fvMesh reference explicit volMesh(const fvMesh& mesh) : GeoMesh<fvMesh>(mesh) {} - // Member Functions + // Static Functions - //- Return size. Number of cells - static label size(const Mesh& mesh) + //- The geometric (internal) mesh size - number of cells. + // Method name expected by GeoMesh interface + static label size(const polyMesh& mesh) noexcept { return mesh.nCells(); } - //- Return size. Number of cells - label size() const + //- The geometric boundary size - number of boundary faces. + // Method name expected by GeoMesh interface + static label boundary_size(const polyMesh& mesh) noexcept + { + return mesh.nBoundaryFaces(); + } + + + // Member Functions + + //- The geometric (internal) mesh size - number of cells. + // Method name expected by GeoMesh interface + label size() const noexcept { return size(mesh_); } diff --git a/src/meshTools/fields/volume/polyGeoMesh.H b/src/meshTools/fields/volume/polyGeoMesh.H index dd7e5c483a714b76adebf403ffe32546e14e3f02..42c7213272a4c5382fccd7b1287620dec2f1599f 100644 --- a/src/meshTools/fields/volume/polyGeoMesh.H +++ b/src/meshTools/fields/volume/polyGeoMesh.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018-2021 OpenCFD Ltd. + Copyright (C) 2018-2025 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -61,16 +61,28 @@ public: {} - // Member Functions + // Static Functions - //- Return size. Number of cells - static label size(const Mesh& mesh) + //- The geometric (internal) mesh size - number of cells. + // Method name expected by GeoMesh interface + static label size(const polyMesh& mesh) noexcept { return mesh.nCells(); } - //- Return size. Number of cells - label size() const + //- The geometric boundary size - not used (internal fields only). + // Method name expected by GeoMesh interface + static label boundary_size(const polyMesh& mesh) noexcept + { + return 0; + } + + + // Member Functions + + //- The geometric (internal) mesh size - number of cells. + // Method name expected by GeoMesh interface + label size() const noexcept { return size(mesh_); } diff --git a/src/surfMesh/polySurface/fields/polySurfaceGeoMesh.H b/src/surfMesh/polySurface/fields/polySurfaceGeoMesh.H index 9adff973152e9535499531d1c4eda2c553cc5c1e..7cdc501d4d0dd0cecf1d06ef085639911c8bd5c6 100644 --- a/src/surfMesh/polySurface/fields/polySurfaceGeoMesh.H +++ b/src/surfMesh/polySurface/fields/polySurfaceGeoMesh.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019-2021 OpenCFD Ltd. + Copyright (C) 2019-2025 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -61,15 +61,27 @@ public: {} - // Member Functions + // Static Functions - //- Return size. Number of faces - static label size(const Mesh& mesh) + //- The geometric (internal) size - number of faces. + // Method name expected by GeoMesh interface + static label size(const polySurface& mesh) { return mesh.nFaces(); } - //- Return size. Number of faces + //- The geometric boundary size - not used. + // Method name expected by GeoMesh interface + static label boundary_size(const polySurface& mesh) noexcept + { + return 0; + } + + + // Member Functions + + //- The geometric (internal) size - number of faces. + // Method name expected by GeoMesh interface label size() const { return size(mesh_); diff --git a/src/surfMesh/polySurface/fields/polySurfacePointGeoMesh.H b/src/surfMesh/polySurface/fields/polySurfacePointGeoMesh.H index 8ccca1e11a31fec0a7b5d623221444ae0242aee8..d5cd53625e92c866aa8ed3a1ebc45bf7944d6ea6 100644 --- a/src/surfMesh/polySurface/fields/polySurfacePointGeoMesh.H +++ b/src/surfMesh/polySurface/fields/polySurfacePointGeoMesh.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019-2021 OpenCFD Ltd. + Copyright (C) 2019-2025 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -61,15 +61,27 @@ public: {} - // Member Functions + // Static Functions - //- Return size. Number of points - static label size(const Mesh& mesh) + //- The geometric (internal) size - number of points. + // Method name expected by GeoMesh interface + static label size(const polySurface& mesh) { return mesh.nPoints(); } - //- Return size. Number of points + //- The geometric boundary size - not used. + // Method name expected by GeoMesh interface + static label boundary_size(const polySurface& mesh) noexcept + { + return 0; + } + + + // Member Functions + + //- The geometric (internal) size - number of points. + // Method name expected by GeoMesh interface label size() const { return size(mesh_); diff --git a/src/surfMesh/surfMesh/fields/surfGeoMesh.H b/src/surfMesh/surfMesh/fields/surfGeoMesh.H index 4d4dd20d8767e80d22c6560da1e7497e0c4bdac2..75e94b62dd37a581359afe539a63e836db0a8402 100644 --- a/src/surfMesh/surfMesh/fields/surfGeoMesh.H +++ b/src/surfMesh/surfMesh/fields/surfGeoMesh.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation - Copyright (C) 2021 OpenCFD Ltd. + Copyright (C) 2021-2025 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -62,15 +62,27 @@ public: {} - // Member Functions + // Static Functions - //- Return size. Number of faces - static label size(const Mesh& mesh) + //- The geometric (internal) size - number of faces. + // Method name expected by GeoMesh interface + static label size(const surfMesh& mesh) { return mesh.nFaces(); } - //- Return size. Number of faces + //- The geometric boundary size - not used. + // Method name expected by GeoMesh interface + static label boundary_size(const surfMesh& mesh) noexcept + { + return 0; + } + + + // Member Functions + + //- The geometric (internal) size - number of faces. + // Method name expected by GeoMesh interface label size() const { return size(mesh_); diff --git a/src/surfMesh/surfMesh/fields/surfPointGeoMesh.H b/src/surfMesh/surfMesh/fields/surfPointGeoMesh.H index 6a152d3fe72f6dfcb1c966a17ee7881fb55fd121..6e00f61c3b052c03bff96f554b4f39296103738b 100644 --- a/src/surfMesh/surfMesh/fields/surfPointGeoMesh.H +++ b/src/surfMesh/surfMesh/fields/surfPointGeoMesh.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation - Copyright (C) 2021 OpenCFD Ltd. + Copyright (C) 2021,2025 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -64,15 +64,27 @@ public: {} - // Member Functions + // Static Functions - //- Return size. Number of points - static label size(const Mesh& mesh) + //- The geometric (internal) size - number of points. + // Method name expected by GeoMesh interface + static label size(const surfMesh& mesh) { return mesh.nPoints(); } - //- Return size. Number of points + //- The geometric boundary size - not used. + // Method name expected by GeoMesh interface + static label boundary_size(const surfMesh& mesh) noexcept + { + return 0; + } + + + // Member Functions + + //- The geometric (internal) size - number of points. + // Method name expected by GeoMesh interface label size() const { return size(mesh_); diff --git a/src/surfMesh/triSurface/fields/triSurfaceGeoMesh.H b/src/surfMesh/triSurface/fields/triSurfaceGeoMesh.H index e2688a39f10db446ab2518d2527208a973a660f1..9cfba9d34211f09fd454b3c8c308ce7cf217324f 100644 --- a/src/surfMesh/triSurface/fields/triSurfaceGeoMesh.H +++ b/src/surfMesh/triSurface/fields/triSurfaceGeoMesh.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation - Copyright (C) 2021 OpenCFD Ltd. + Copyright (C) 2021,2025 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -60,15 +60,27 @@ public: {} - // Member Functions + // Static Functions - //- Return size. Numer of faces - static label size(const Mesh& mesh) + //- The geometric (internal) size - number of faces. + // Method name expected by GeoMesh interface + static label size(const triSurface& mesh) { return mesh.size(); } - //- Return size. Numer of faces + //- The geometric boundary size - not used. + // Method name expected by GeoMesh interface + static label boundary_size(const triSurface& mesh) noexcept + { + return 0; + } + + + // Member Functions + + //- The geometric (internal) size - number of faces. + // Method name expected by GeoMesh interface label size() const { return size(mesh_); diff --git a/src/surfMesh/triSurface/fields/triSurfacePointGeoMesh.H b/src/surfMesh/triSurface/fields/triSurfacePointGeoMesh.H index 031ff5fb56baa40400d1a5ceb9da9334790cb781..5ffd6fa68988858ec014b5b37a18ae97e08ceac5 100644 --- a/src/surfMesh/triSurface/fields/triSurfacePointGeoMesh.H +++ b/src/surfMesh/triSurface/fields/triSurfacePointGeoMesh.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation - Copyright (C) 2021 OpenCFD Ltd. + Copyright (C) 2021,2025 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -60,15 +60,27 @@ public: {} - // Member Functions + // Static Functions - //- Return size. Number of points - static label size(const Mesh& mesh) + //- The geometric (internal) size - number of points. + // Method name expected by GeoMesh interface + static label size(const triSurface& mesh) { return mesh.points().size(); } - //- Return size. Number of points + //- The geometric boundary size - not applicable. + // Method name expected by GeoMesh interface + static label boundary_size(const triSurface& mesh) noexcept + { + return 0; + } + + + // Member Functions + + //- The geometric (internal) size - number of points. + // Method name expected by GeoMesh interface label size() const { return size(mesh_);