diff --git a/src/OpenFOAM/db/IOstreams/token/token.H b/src/OpenFOAM/db/IOstreams/token/token.H index 946e93e834..7c7698e098 100644 --- a/src/OpenFOAM/db/IOstreams/token/token.H +++ b/src/OpenFOAM/db/IOstreams/token/token.H @@ -337,10 +337,10 @@ public: TypeNameNoDebug("Compound"); //- No copy construct - Compound(const Compound&) = delete; + Compound(const Compound&) = delete; //- No copy assignment - Compound& operator=(const Compound&) = delete; + void operator=(const Compound&) = delete; // Constructors diff --git a/src/OpenFOAM/matrices/DiagonalMatrix/DiagonalMatrix.H b/src/OpenFOAM/matrices/DiagonalMatrix/DiagonalMatrix.H index 857daea5d8..ea9adb37a0 100644 --- a/src/OpenFOAM/matrices/DiagonalMatrix/DiagonalMatrix.H +++ b/src/OpenFOAM/matrices/DiagonalMatrix/DiagonalMatrix.H @@ -39,8 +39,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef DiagonalMatrix_H -#define DiagonalMatrix_H +#ifndef Foam_DiagonalMatrix_H +#define Foam_DiagonalMatrix_H #include "List.H" #include @@ -78,18 +78,18 @@ public: // Constructors - //- Construct empty from size - explicit DiagonalMatrix(const label n); + //- Construct from size, uninitialised content + explicit DiagonalMatrix(const label n); //- Construct from size and initialise all elems to zero - DiagonalMatrix(const label n, const Foam::zero); + DiagonalMatrix(const label n, const Foam::zero); //- Construct from size and initialise all elems to value - DiagonalMatrix(const label n, const Type& val); + DiagonalMatrix(const label n, const Type& val); //- Construct from the diagonal of a Matrix template - DiagonalMatrix(const Matrix& mat); + DiagonalMatrix(const Matrix& mat); // Member Functions diff --git a/src/OpenFOAM/matrices/EigenMatrix/EigenMatrix.H b/src/OpenFOAM/matrices/EigenMatrix/EigenMatrix.H index aa4a02562f..66cfa4a87d 100644 --- a/src/OpenFOAM/matrices/EigenMatrix/EigenMatrix.H +++ b/src/OpenFOAM/matrices/EigenMatrix/EigenMatrix.H @@ -225,30 +225,30 @@ public: // Access //- Return real eigenvalues or real part of complex eigenvalues - const DiagonalMatrix& EValsRe() const + const DiagonalMatrix& EValsRe() const noexcept { return EValsRe_; } //- Return zero-matrix for real eigenvalues //- or imaginary part of complex eigenvalues - const DiagonalMatrix& EValsIm() const + const DiagonalMatrix& EValsIm() const noexcept { return EValsIm_; } //- Return right eigenvectors matrix where each column is //- a right eigenvector that corresponds to an eigenvalue - const SquareMatrix& EVecs() const + const SquareMatrix& EVecs() const noexcept { return EVecs_; } //- Return right eigenvectors in unpacked form const SquareMatrix complexEVecs() const; - }; + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/OpenFOAM/matrices/Matrix/Matrix.H b/src/OpenFOAM/matrices/Matrix/Matrix.H index cdfa892253..7e299d96cf 100644 --- a/src/OpenFOAM/matrices/Matrix/Matrix.H +++ b/src/OpenFOAM/matrices/Matrix/Matrix.H @@ -136,7 +136,7 @@ public: //- Default construct (empty matrix) inline Matrix() noexcept; - //- Construct given number of rows/columns + //- Construct given number of rows/columns, uninitialised content Matrix(const label m, const label n); //- Construct with given number of rows/columns diff --git a/src/OpenFOAM/matrices/QRMatrix/QRMatrix.H b/src/OpenFOAM/matrices/QRMatrix/QRMatrix.H index dcb32cc6db..1e6a8d2a0d 100644 --- a/src/OpenFOAM/matrices/QRMatrix/QRMatrix.H +++ b/src/OpenFOAM/matrices/QRMatrix/QRMatrix.H @@ -252,7 +252,7 @@ public: // Constructors - //- Construct null + //- No default construct QRMatrix() = delete; //- Construct with a matrix and perform QR decomposition diff --git a/src/OpenFOAM/matrices/RectangularMatrix/RectangularMatrix.H b/src/OpenFOAM/matrices/RectangularMatrix/RectangularMatrix.H index 3e90bff571..179e5a1339 100644 --- a/src/OpenFOAM/matrices/RectangularMatrix/RectangularMatrix.H +++ b/src/OpenFOAM/matrices/RectangularMatrix/RectangularMatrix.H @@ -39,8 +39,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef RectangularMatrix_H -#define RectangularMatrix_H +#ifndef Foam_RectangularMatrix_H +#define Foam_RectangularMatrix_H #include "Matrix.H" #include "SquareMatrix.H" @@ -59,7 +59,6 @@ class RectangularMatrix : public Matrix, Type> { - public: // Generated Methods @@ -76,7 +75,7 @@ public: // Constructors - //- Construct a square matrix (rows == columns) + //- Construct a square matrix (rows == columns), uninitialised content inline explicit RectangularMatrix(const label n); //- Construct given number of rows/columns diff --git a/src/OpenFOAM/matrices/SquareMatrix/SquareMatrix.H b/src/OpenFOAM/matrices/SquareMatrix/SquareMatrix.H index 0a055c0539..8ccaeed341 100644 --- a/src/OpenFOAM/matrices/SquareMatrix/SquareMatrix.H +++ b/src/OpenFOAM/matrices/SquareMatrix/SquareMatrix.H @@ -81,7 +81,7 @@ public: // Constructors - //- Construct for given size (rows == cols) + //- Construct for given size (rows == cols), uninitialised content inline explicit SquareMatrix(const label n); //- Construct for given size (rows == cols) diff --git a/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrix.H b/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrix.H index 81f9536632..4475f12d49 100644 --- a/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrix.H +++ b/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrix.H @@ -40,8 +40,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef SymmetricSquareMatrix_H -#define SymmetricSquareMatrix_H +#ifndef Foam_SymmetricSquareMatrix_H +#define Foam_SymmetricSquareMatrix_H #include "SquareMatrix.H" @@ -59,7 +59,6 @@ class SymmetricSquareMatrix : public Matrix, Type> { - public: // Generated Methods @@ -71,12 +70,13 @@ public: SymmetricSquareMatrix(const SymmetricSquareMatrix&) = default; //- Copy assignment - SymmetricSquareMatrix& operator=(const SymmetricSquareMatrix&) = default; + SymmetricSquareMatrix& + operator=(const SymmetricSquareMatrix&) = default; // Constructors - //- Construct for given size (rows == cols) + //- Construct for given size (rows == cols), uninitialised content inline explicit SymmetricSquareMatrix(const label n); //- Construct for given size (rows == cols) @@ -113,6 +113,8 @@ public: }; +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // Global Functions //- Return the LU decomposed SymmetricSquareMatrix inverse diff --git a/src/finiteArea/fields/faPatchFields/basic/sliced/slicedFaPatchField.H b/src/finiteArea/fields/faPatchFields/basic/sliced/slicedFaPatchField.H index 78a432e81e..20fb843227 100644 --- a/src/finiteArea/fields/faPatchFields/basic/sliced/slicedFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/basic/sliced/slicedFaPatchField.H @@ -140,8 +140,8 @@ public: } - //- Destructor - virtual ~slicedFaPatchField(); + //- Destructor, resets pointers to avoid deletion of underlying field + virtual ~slicedFaPatchField(); // Member Functions diff --git a/src/finiteArea/fields/faePatchFields/basic/sliced/slicedFaePatchField.H b/src/finiteArea/fields/faePatchFields/basic/sliced/slicedFaePatchField.H index b7fb3fa912..17302930ee 100644 --- a/src/finiteArea/fields/faePatchFields/basic/sliced/slicedFaePatchField.H +++ b/src/finiteArea/fields/faePatchFields/basic/sliced/slicedFaePatchField.H @@ -132,8 +132,8 @@ public: } - //- Destructor - virtual ~slicedFaePatchField(); + //- Destructor, resets pointers to avoid deletion of underlying field + virtual ~slicedFaePatchField(); // Member Functions diff --git a/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.H index 0c9f707d4c..ad71341426 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.H @@ -138,8 +138,8 @@ public: } - //- Destructor - virtual ~slicedFvPatchField(); + //- Destructor, resets pointers to avoid deletion of underlying field + virtual ~slicedFvPatchField(); // Member Functions diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedPatchFieldBase.H b/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedPatchFieldBase.H index 9ee3d796e2..16aa8dc2d1 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedPatchFieldBase.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedPatchFieldBase.H @@ -233,7 +233,7 @@ public: //- Destructor - virtual ~mappedPatchFieldBase() = default; + virtual ~mappedPatchFieldBase() = default; // Member Functions diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.H index 3a82030519..809d4e0db3 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.H @@ -134,8 +134,8 @@ public: } - //- Destructor - virtual ~slicedFvsPatchField(); + //- Destructor, resets pointers to avoid deletion of underlying field + virtual ~slicedFvsPatchField(); // Member Functions diff --git a/src/meshTools/edgeMesh/edgeFormats/edgeMesh/edgeMeshFormat.H b/src/meshTools/edgeMesh/edgeFormats/edgeMesh/edgeMeshFormat.H index 8380c6f927..8636c4526c 100644 --- a/src/meshTools/edgeMesh/edgeFormats/edgeMesh/edgeMeshFormat.H +++ b/src/meshTools/edgeMesh/edgeFormats/edgeMesh/edgeMeshFormat.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2021 OpenCFD Ltd. + Copyright (C) 2021-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -38,8 +38,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef edgeMeshFormat_H -#define edgeMeshFormat_H +#ifndef Foam_edgeMeshFormat_H +#define Foam_edgeMeshFormat_H #include "edgeMesh.H" #include "Ostream.H" @@ -60,15 +60,6 @@ class edgeMeshFormat : public edgeMesh { - // Private Member Functions - - //- No copy construct - edgeMeshFormat(const edgeMeshFormat&) = delete; - - //- No copy assignment - void operator=(const edgeMeshFormat&) = delete; - - protected: // Protected Member Functions @@ -87,7 +78,7 @@ public: // Constructors //- Construct from file name - explicit edgeMeshFormat(const fileName&); + explicit edgeMeshFormat(const fileName& filename); // Selectors @@ -134,7 +125,7 @@ public: // Member Functions //- Read from file - virtual bool read(const fileName& name); + virtual bool read(const fileName& filename) override; //- Write edge mesh to file virtual void write @@ -142,7 +133,19 @@ public: const fileName& name, IOstreamOption streamOpt = IOstreamOption(), const dictionary& options = dictionary::null - ) const + ) const override + { + write(name, *this, streamOpt, options); + } + + //- Write edge mesh to file + virtual void write + ( + const fileName& name, + const word& fileType, /* ignored */ + IOstreamOption streamOpt = IOstreamOption(), + const dictionary& options = dictionary::null + ) const override { write(name, *this, streamOpt, options); } diff --git a/src/meshTools/edgeMesh/edgeFormats/nastran/NASedgeFormat.H b/src/meshTools/edgeMesh/edgeFormats/nastran/NASedgeFormat.H index e86c5b2c14..fa8abef3ab 100644 --- a/src/meshTools/edgeMesh/edgeFormats/nastran/NASedgeFormat.H +++ b/src/meshTools/edgeMesh/edgeFormats/nastran/NASedgeFormat.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2017-2021 OpenCFD Ltd. + Copyright (C) 2017-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -42,8 +42,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef NASedgeFormat_H -#define NASedgeFormat_H +#ifndef Foam_NASedgeFormat_H +#define Foam_NASedgeFormat_H #include "edgeMesh.H" #include "NASCore.H" @@ -64,14 +64,6 @@ class NASedgeFormat public edgeMesh, public NASCore { - // Private Member Functions - - //- No copy construct - NASedgeFormat(const NASedgeFormat&) = delete; - - //- No copy assignment - void operator=(const NASedgeFormat&) = delete; - public: // Constructors @@ -96,7 +88,7 @@ public: // Member Functions //- Read from a file - virtual bool read(const fileName& filename); + virtual bool read(const fileName& filename) override; }; diff --git a/src/meshTools/edgeMesh/edgeFormats/obj/OBJedgeFormat.H b/src/meshTools/edgeMesh/edgeFormats/obj/OBJedgeFormat.H index 331eaed156..69e295254c 100644 --- a/src/meshTools/edgeMesh/edgeFormats/obj/OBJedgeFormat.H +++ b/src/meshTools/edgeMesh/edgeFormats/obj/OBJedgeFormat.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2021 OpenCFD Ltd. + Copyright (C) 2021-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -37,8 +37,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef OBJedgeFormat_H -#define OBJedgeFormat_H +#ifndef Foam_OBJedgeFormat_H +#define Foam_OBJedgeFormat_H #include "edgeMesh.H" #include "Fstream.H" @@ -59,21 +59,12 @@ class OBJedgeFormat : public edgeMesh { - // Private Member Functions - - //- No copy construct - OBJedgeFormat(const OBJedgeFormat&) = delete; - - //- No copy assignment - void operator=(const OBJedgeFormat&) = delete; - - public: // Constructors //- Construct from file name - OBJedgeFormat(const fileName&); + explicit OBJedgeFormat(const fileName& filename); // Selectors @@ -89,9 +80,9 @@ public: virtual ~OBJedgeFormat() = default; - // Member Functions + // Static Functions - //- Write edge mesh to file + //- Write edge mesh to file in OBJ format static void write ( const fileName& filename, @@ -104,7 +95,7 @@ public: // Member Functions //- Read from file - virtual bool read(const fileName& name); + virtual bool read(const fileName& filename) override; //- Write to file virtual void write @@ -112,7 +103,19 @@ public: const fileName& name, IOstreamOption streamOpt = IOstreamOption(), const dictionary& options = dictionary::null - ) const + ) const override + { + write(name, *this, streamOpt, options); + } + + //- Write to file + virtual void write + ( + const fileName& name, + const word& fileType, /* ignored */ + IOstreamOption streamOpt = IOstreamOption(), + const dictionary& options = dictionary::null + ) const override { write(name, *this, streamOpt, options); } diff --git a/src/meshTools/edgeMesh/edgeFormats/starcd/STARCDedgeFormat.H b/src/meshTools/edgeMesh/edgeFormats/starcd/STARCDedgeFormat.H index 2a522a23a3..9b2d0167ab 100644 --- a/src/meshTools/edgeMesh/edgeFormats/starcd/STARCDedgeFormat.H +++ b/src/meshTools/edgeMesh/edgeFormats/starcd/STARCDedgeFormat.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2016-2021 OpenCFD Ltd. + Copyright (C) 2016-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -41,8 +41,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef STARCDedgeFormat_H -#define STARCDedgeFormat_H +#ifndef Foam_STARCDedgeFormat_H +#define Foam_STARCDedgeFormat_H #include "edgeMesh.H" #include "STARCDCore.H" @@ -75,14 +75,6 @@ class STARCDedgeFormat label starCellId = 1 // 1-based cellId ); - - //- No copy construct - STARCDedgeFormat(const STARCDedgeFormat&) = delete; - - //- No copy assignment - void operator=(const STARCDedgeFormat&) = delete; - - protected: // Protected Member Functions @@ -118,7 +110,7 @@ public: // Static Functions - //- Write edge mesh to file + //- Write edge mesh to file in STARCD format static void write ( const fileName& filename, @@ -131,7 +123,7 @@ public: // Member Functions //- Read from file - virtual bool read(const fileName& name); + virtual bool read(const fileName& name) override; //- Write to file virtual void write @@ -139,7 +131,19 @@ public: const fileName& name, IOstreamOption streamOpt = IOstreamOption(), const dictionary& options = dictionary::null - ) const + ) const override + { + write(name, *this, streamOpt, options); + } + + //- Write to file + virtual void write + ( + const fileName& name, + const word& fileType, /* ignored */ + IOstreamOption streamOpt = IOstreamOption(), + const dictionary& options = dictionary::null + ) const override { write(name, *this, streamOpt, options); } diff --git a/src/meshTools/edgeMesh/edgeFormats/vtk/VTKedgeFormat.H b/src/meshTools/edgeMesh/edgeFormats/vtk/VTKedgeFormat.H index 3f7ac6ec83..438c425dc7 100644 --- a/src/meshTools/edgeMesh/edgeFormats/vtk/VTKedgeFormat.H +++ b/src/meshTools/edgeMesh/edgeFormats/vtk/VTKedgeFormat.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2021 OpenCFD Ltd. + Copyright (C) 2021-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -35,8 +35,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef VTKedgeFormat_H -#define VTKedgeFormat_H +#ifndef Foam_VTKedgeFormat_H +#define Foam_VTKedgeFormat_H #include "edgeMesh.H" @@ -78,7 +78,7 @@ public: // Static Functions - //- Write edge mesh to file + //- Write edge mesh to file in legacy VTK format static void write ( const fileName& filename, @@ -91,7 +91,7 @@ public: // Member Functions //- Read from file - virtual bool read(const fileName& name); + virtual bool read(const fileName& filename) override; //- Write to file virtual void write @@ -99,7 +99,19 @@ public: const fileName& name, IOstreamOption streamOpt = IOstreamOption(), const dictionary& options = dictionary::null - ) const + ) const override + { + write(name, *this, streamOpt, options); + } + + //- Write to file + virtual void write + ( + const fileName& name, + const word& fileType, /* ignored */ + IOstreamOption streamOpt = IOstreamOption(), + const dictionary& options = dictionary::null + ) const override { write(name, *this, streamOpt, options); } diff --git a/src/meshTools/edgeMesh/edgeMesh.H b/src/meshTools/edgeMesh/edgeMesh.H index 57f066ea35..95397c379a 100644 --- a/src/meshTools/edgeMesh/edgeMesh.H +++ b/src/meshTools/edgeMesh/edgeMesh.H @@ -41,8 +41,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef edgeMesh_H -#define edgeMesh_H +#ifndef Foam_edgeMesh_H +#define Foam_edgeMesh_H #include "pointField.H" #include "edgeList.H" diff --git a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointBoundaryCondition/adjointBoundaryCondition.H b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointBoundaryCondition/adjointBoundaryCondition.H index 9d30c4bc77..22ce358b90 100644 --- a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointBoundaryCondition/adjointBoundaryCondition.H +++ b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointBoundaryCondition/adjointBoundaryCondition.H @@ -116,7 +116,7 @@ public: //- Destructor - virtual ~adjointBoundaryCondition() = default; + virtual ~adjointBoundaryCondition() = default; // Member Functions diff --git a/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurface.H b/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurface.H index 951921cfaa..23e9e952f5 100644 --- a/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurface.H +++ b/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurface.H @@ -46,8 +46,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef UnsortedMeshedSurface_H -#define UnsortedMeshedSurface_H +#ifndef Foam_UnsortedMeshedSurface_H +#define Foam_UnsortedMeshedSurface_H #include "MeshedSurface.H" #include "surfZoneIdentifierList.H" diff --git a/src/surfMesh/surfaceFormats/abaqus/ABAQUSsurfaceFormat.H b/src/surfMesh/surfaceFormats/abaqus/ABAQUSsurfaceFormat.H index 5ddbf34ad9..bc3aa4b377 100644 --- a/src/surfMesh/surfaceFormats/abaqus/ABAQUSsurfaceFormat.H +++ b/src/surfMesh/surfaceFormats/abaqus/ABAQUSsurfaceFormat.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -40,8 +40,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef ABAQUSsurfaceFormat_H -#define ABAQUSsurfaceFormat_H +#ifndef Foam_ABAQUSsurfaceFormat_H +#define Foam_ABAQUSsurfaceFormat_H #include "MeshedSurface.H" #include "MeshedSurfaceProxy.H" @@ -95,7 +95,7 @@ public: // Static Member Functions - //- Write surface mesh components by proxy + //- Write surface mesh components (by proxy) in ABAQUS format static void write ( const fileName& filename, @@ -108,18 +108,27 @@ public: // Member Functions //- Read from file - virtual bool read - ( - const fileName& filename - ); + virtual bool read(const fileName& filename) override; - //- Write surface mesh to file + //- Write surface mesh to file (by proxy) virtual void write ( const fileName& name, IOstreamOption streamOpt = IOstreamOption(), const dictionary& options = dictionary::null - ) const + ) const override + { + write(name, MeshedSurfaceProxy(*this), streamOpt, options); + } + + //- Write surface mesh to file (by proxy) + virtual void write + ( + const fileName& name, + const word& fileType, /* ignored */ + IOstreamOption streamOpt = IOstreamOption(), + const dictionary& options = dictionary::null + ) const override { write(name, MeshedSurfaceProxy(*this), streamOpt, options); } diff --git a/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormat.H b/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormat.H index bcde42a49e..d738fe45c6 100644 --- a/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormat.H +++ b/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormat.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2020 OpenCFD Ltd. + Copyright (C) 2016-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -48,8 +48,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef AC3DsurfaceFormat_H -#define AC3DsurfaceFormat_H +#ifndef Foam_AC3DsurfaceFormat_H +#define Foam_AC3DsurfaceFormat_H #include "MeshedSurface.H" #include "MeshedSurfaceProxy.H" @@ -78,7 +78,7 @@ public: // Constructors //- Construct from file name - AC3DsurfaceFormat(const fileName& filename); + explicit AC3DsurfaceFormat(const fileName& filename); //- Destructor @@ -109,15 +109,27 @@ public: // Member Functions //- Read from file - virtual bool read(const fileName& filename); + virtual bool read(const fileName& filename) override; - //- Write surface mesh to file + //- Write surface mesh to file (by proxy) virtual void write ( const fileName& name, IOstreamOption streamOpt = IOstreamOption(), const dictionary& options = dictionary::null - ) const + ) const override + { + write(name, MeshedSurfaceProxy(*this), streamOpt, options); + } + + //- Write surface mesh to file (by proxy) + virtual void write + ( + const fileName& name, + const word& fileType, /* ignored */ + IOstreamOption streamOpt = IOstreamOption(), + const dictionary& options = dictionary::null + ) const override { write(name, MeshedSurfaceProxy(*this), streamOpt, options); } diff --git a/src/surfMesh/surfaceFormats/fire/FLMAsurfaceFormat.H b/src/surfMesh/surfaceFormats/fire/FLMAsurfaceFormat.H index 6247ad4dfb..c2c59cfdc5 100644 --- a/src/surfMesh/surfaceFormats/fire/FLMAsurfaceFormat.H +++ b/src/surfMesh/surfaceFormats/fire/FLMAsurfaceFormat.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2016-2020 OpenCFD Ltd. + Copyright (C) 2016-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -45,8 +45,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef FLMAsurfaceFormat_H -#define FLMAsurfaceFormat_H +#ifndef Foam_FLMAsurfaceFormat_H +#define Foam_FLMAsurfaceFormat_H #include "MeshedSurface.H" #include "MeshedSurfaceProxy.H" @@ -79,14 +79,14 @@ protected: // Protected Member Functions - //- Write surface mesh components by proxy + //- Write surface mesh components (by proxy) static void write ( OSstream& os, const MeshedSurfaceProxy& surf ); - //- Write surface mesh components by proxy with/without compression + //- Write surface mesh components (by proxy) with/without compression static void write ( IOstreamOption::compressionType comp, @@ -109,7 +109,7 @@ public: // Static Functions - //- Write surface mesh components by proxy + //- Write surface mesh components (by proxy) static void write ( const fileName& filename, @@ -121,13 +121,25 @@ public: // Member Functions - //- Write surface mesh as flma file + //- Write surface mesh to file (by proxy) virtual void write ( const fileName& name, IOstreamOption streamOpt = IOstreamOption(), const dictionary& options = dictionary::null - ) const + ) const override + { + write(name, MeshedSurfaceProxy(*this), streamOpt, options); + } + + //- Write surface mesh to file (by proxy) + virtual void write + ( + const fileName& name, + const word& fileType, /* ignored */ + IOstreamOption streamOpt = IOstreamOption(), + const dictionary& options = dictionary::null + ) const override { write(name, MeshedSurfaceProxy(*this), streamOpt, options); } @@ -157,7 +169,7 @@ public: // Static Functions - //- Write surface mesh components by proxy + //- Write surface mesh components (by proxy) static void write ( const fileName& filename, @@ -169,13 +181,25 @@ public: // Member Functions - //- Write surface mesh as flmaz file + //- Write surface mesh as flmaz file (by proxy) virtual void write ( const fileName& name, IOstreamOption streamOpt = IOstreamOption(), const dictionary& options = dictionary::null - ) const + ) const override + { + write(name, MeshedSurfaceProxy(*this), streamOpt, options); + } + + //- Write surface mesh as flmaz file (by proxy) + virtual void write + ( + const fileName& name, + const word& fileType, /* ignored */ + IOstreamOption streamOpt = IOstreamOption(), + const dictionary& options = dictionary::null + ) const override { write(name, MeshedSurfaceProxy(*this), streamOpt, options); } diff --git a/src/surfMesh/surfaceFormats/gts/GTSsurfaceFormat.H b/src/surfMesh/surfaceFormats/gts/GTSsurfaceFormat.H index 2b3303912e..c77d2ce8ac 100644 --- a/src/surfMesh/surfaceFormats/gts/GTSsurfaceFormat.H +++ b/src/surfMesh/surfaceFormats/gts/GTSsurfaceFormat.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2020 OpenCFD Ltd. + Copyright (C) 2016-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -44,8 +44,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef GTSsurfaceFormat_H -#define GTSsurfaceFormat_H +#ifndef Foam_GTSsurfaceFormat_H +#define Foam_GTSsurfaceFormat_H #include "MeshedSurface.H" #include "MeshedSurfaceProxy.H" @@ -79,7 +79,7 @@ public: // Constructors //- Construct from file name - GTSsurfaceFormat(const fileName& filename); + explicit GTSsurfaceFormat(const fileName& filename); //- Destructor @@ -110,7 +110,7 @@ public: // Member Functions //- Read from file - virtual bool read(const fileName& filename); + virtual bool read(const fileName& filename) override; //- Write surface mesh to file virtual void write @@ -118,7 +118,19 @@ public: const fileName& name, IOstreamOption streamOpt = IOstreamOption(), const dictionary& options = dictionary::null - ) const + ) const override + { + write(name, *this, streamOpt, options); + } + + //- Write surface mesh to file + virtual void write + ( + const fileName& name, + const word& fileType, /* ignored */ + IOstreamOption streamOpt = IOstreamOption(), + const dictionary& options = dictionary::null + ) const override { write(name, *this, streamOpt, options); } diff --git a/src/surfMesh/surfaceFormats/nas/NASsurfaceFormat.H b/src/surfMesh/surfaceFormats/nas/NASsurfaceFormat.H index 780a273767..c7219e7597 100644 --- a/src/surfMesh/surfaceFormats/nas/NASsurfaceFormat.H +++ b/src/surfMesh/surfaceFormats/nas/NASsurfaceFormat.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2020 OpenCFD Ltd. + Copyright (C) 2016-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -51,8 +51,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef NASsurfaceFormat_H -#define NASsurfaceFormat_H +#ifndef Foam_NASsurfaceFormat_H +#define Foam_NASsurfaceFormat_H #include "MeshedSurface.H" #include "MeshedSurfaceProxy.H" @@ -93,7 +93,7 @@ public: // Constructors //- Construct from file name - NASsurfaceFormat(const fileName& filename); + explicit NASsurfaceFormat(const fileName& filename); //- Destructor @@ -102,7 +102,7 @@ public: // Static Functions - //- Write surface mesh components by proxy + //- Write surface mesh components (by proxy) in NAS format static void write ( const fileName& filename, @@ -115,15 +115,27 @@ public: // Member Functions //- Read from file - virtual bool read(const fileName& filename); + virtual bool read(const fileName& filename) override; - //- Write surface mesh to file + //- Write surface mesh to file (by proxy) virtual void write ( const fileName& name, IOstreamOption streamOpt = IOstreamOption(), const dictionary& options = dictionary::null - ) const + ) const override + { + write(name, MeshedSurfaceProxy(*this), streamOpt, options); + } + + //- Write surface mesh to file (by proxy) + virtual void write + ( + const fileName& name, + const word& fileType, /* ignored */ + IOstreamOption streamOpt = IOstreamOption(), + const dictionary& options = dictionary::null + ) const override { write(name, MeshedSurfaceProxy(*this), streamOpt, options); } diff --git a/src/surfMesh/surfaceFormats/obj/OBJsurfaceFormat.H b/src/surfMesh/surfaceFormats/obj/OBJsurfaceFormat.H index 80febb0c9a..ef1f3eab3c 100644 --- a/src/surfMesh/surfaceFormats/obj/OBJsurfaceFormat.H +++ b/src/surfMesh/surfaceFormats/obj/OBJsurfaceFormat.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2020 OpenCFD Ltd. + Copyright (C) 2016-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -43,8 +43,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef OBJsurfaceFormat_H -#define OBJsurfaceFormat_H +#ifndef Foam_OBJsurfaceFormat_H +#define Foam_OBJsurfaceFormat_H #include "MeshedSurface.H" #include "MeshedSurfaceProxy.H" @@ -71,7 +71,7 @@ public: // Constructors //- Construct from file name - OBJsurfaceFormat(const fileName& filename); + explicit OBJsurfaceFormat(const fileName& filename); //- Destructor @@ -80,7 +80,7 @@ public: // Static Functions - //- Write surface mesh components by proxy + //- Write surface mesh components (by proxy) in OBJ format static void write ( const fileName& filename, @@ -93,15 +93,27 @@ public: // Member Functions //- Read from file - virtual bool read(const fileName& filename); + virtual bool read(const fileName& filename) override; - //- Write surface mesh to file + //- Write surface mesh to file (by proxy) virtual void write ( const fileName& name, IOstreamOption streamOpt = IOstreamOption(), const dictionary& options = dictionary::null - ) const + ) const override + { + write(name, MeshedSurfaceProxy(*this), streamOpt, options); + } + + //- Write surface mesh to file (by proxy) + virtual void write + ( + const fileName& name, + const word& fileType, /* ignored */ + IOstreamOption streamOpt = IOstreamOption(), + const dictionary& options = dictionary::null + ) const override { write(name, MeshedSurfaceProxy(*this), streamOpt, options); } diff --git a/src/surfMesh/surfaceFormats/off/OFFsurfaceFormat.H b/src/surfMesh/surfaceFormats/off/OFFsurfaceFormat.H index b988b0f5a5..ced17ea6ce 100644 --- a/src/surfMesh/surfaceFormats/off/OFFsurfaceFormat.H +++ b/src/surfMesh/surfaceFormats/off/OFFsurfaceFormat.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2020 OpenCFD Ltd. + Copyright (C) 2016-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -50,8 +50,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef OFFsurfaceFormat_H -#define OFFsurfaceFormat_H +#ifndef Foam_OFFsurfaceFormat_H +#define Foam_OFFsurfaceFormat_H #include "MeshedSurface.H" #include "MeshedSurfaceProxy.H" @@ -78,7 +78,7 @@ public: // Constructors //- Construct from file name - OFFsurfaceFormat(const fileName& filename); + explicit OFFsurfaceFormat(const fileName& filename); //- Destructor @@ -87,7 +87,7 @@ public: // Static Functions - //- Write surface mesh components by proxy + //- Write surface mesh components (by proxy) in OFF format static void write ( const fileName& filename, @@ -100,15 +100,27 @@ public: // Member Functions //- Read from file - virtual bool read(const fileName& filename); + virtual bool read(const fileName& filename) override; - //- Write surface mesh to file + //- Write surface mesh to file (by proxy) virtual void write ( const fileName& name, IOstreamOption streamOpt = IOstreamOption(), const dictionary& options = dictionary::null - ) const + ) const override + { + write(name, MeshedSurfaceProxy(*this), streamOpt, options); + } + + //- Write surface mesh to file (by proxy) + virtual void write + ( + const fileName& name, + const word& fileType, /* ignored */ + IOstreamOption streamOpt = IOstreamOption(), + const dictionary& options = dictionary::null + ) const override { write(name, MeshedSurfaceProxy(*this), streamOpt, options); } diff --git a/src/surfMesh/surfaceFormats/smesh/SMESHsurfaceFormat.H b/src/surfMesh/surfaceFormats/smesh/SMESHsurfaceFormat.H index d99cd4e17d..9f42e6ba2a 100644 --- a/src/surfMesh/surfaceFormats/smesh/SMESHsurfaceFormat.H +++ b/src/surfMesh/surfaceFormats/smesh/SMESHsurfaceFormat.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2020 OpenCFD Ltd. + Copyright (C) 2016-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -45,8 +45,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef SMESHsurfaceFormat_H -#define SMESHsurfaceFormat_H +#ifndef Foam_SMESHsurfaceFormat_H +#define Foam_SMESHsurfaceFormat_H #include "MeshedSurface.H" #include "MeshedSurfaceProxy.H" @@ -82,7 +82,7 @@ public: // Static Functions - //- Write surface mesh components by proxy + //- Write surface mesh components (by proxy) in SMESH format static void write ( const fileName& filename, @@ -94,13 +94,25 @@ public: // Member Functions - //- Write surface mesh to file + //- Write surface mesh to file (by proxy) virtual void write ( const fileName& name, IOstreamOption streamOpt = IOstreamOption(), const dictionary& options = dictionary::null - ) const + ) const override + { + write(name, MeshedSurfaceProxy(*this), streamOpt, options); + } + + //- Write surface mesh to file (by proxy) + virtual void write + ( + const fileName& name, + const word& fileType, /* ignored */ + IOstreamOption streamOpt = IOstreamOption(), + const dictionary& options = dictionary::null + ) const override { write(name, MeshedSurfaceProxy(*this), streamOpt, options); } diff --git a/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormat.H b/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormat.H index c638436353..fe94aa4b6a 100644 --- a/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormat.H +++ b/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormat.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2020 OpenCFD Ltd. + Copyright (C) 2016-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -47,8 +47,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef STARCDsurfaceFormat_H -#define STARCDsurfaceFormat_H +#ifndef Foam_STARCDsurfaceFormat_H +#define Foam_STARCDsurfaceFormat_H #include "MeshedSurface.H" #include "MeshedSurfaceProxy.H" @@ -88,7 +88,7 @@ public: // Constructors //- Construct from file name - STARCDsurfaceFormat(const fileName& filename); + explicit STARCDsurfaceFormat(const fileName& filename); //- Destructor @@ -110,15 +110,27 @@ public: // Member Functions //- Read from file - virtual bool read(const fileName& filename); + virtual bool read(const fileName& filename) override; - //- Write surface mesh to file + //- Write surface mesh to file (by proxy) virtual void write ( const fileName& name, IOstreamOption streamOpt = IOstreamOption(), const dictionary& options = dictionary::null - ) const + ) const override + { + write(name, MeshedSurfaceProxy(*this), streamOpt, options); + } + + //- Write surface mesh to file (by proxy) + virtual void write + ( + const fileName& name, + const word& fileType, /* ignored */ + IOstreamOption streamOpt = IOstreamOption(), + const dictionary& options = dictionary::null + ) const override { write(name, MeshedSurfaceProxy(*this), streamOpt, options); } diff --git a/src/surfMesh/surfaceFormats/stl/STLsurfaceFormat.H b/src/surfMesh/surfaceFormats/stl/STLsurfaceFormat.H index b91bb1e849..aa67b6a0e0 100644 --- a/src/surfMesh/surfaceFormats/stl/STLsurfaceFormat.H +++ b/src/surfMesh/surfaceFormats/stl/STLsurfaceFormat.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2021 OpenCFD Ltd. + Copyright (C) 2016-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -44,8 +44,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef STLsurfaceFormat_H -#define STLsurfaceFormat_H +#ifndef Foam_STLsurfaceFormat_H +#define Foam_STLsurfaceFormat_H #include "STLReader.H" #include "MeshedSurface.H" @@ -94,7 +94,7 @@ public: // Constructors //- Construct from file name - STLsurfaceFormat(const fileName& filename); + explicit STLsurfaceFormat(const fileName& filename); //- Destructor @@ -133,8 +133,8 @@ public: const UnsortedMeshedSurface& surf ); - //- Write surface mesh components by proxy - // as ASCII or BINARY or dependent on the extension + //- Write surface mesh components (by proxy) in STL format + //- as ASCII or BINARY or dependent on the extension static void write ( const fileName& filename, @@ -154,8 +154,8 @@ public: ); - //- Write surface mesh components by proxy - // as ASCII or BINARY, depending on the extension + //- Write surface mesh components (by proxy) in STL format + //- as ASCII or BINARY, depending on the extension static void write ( const fileName& filename, @@ -165,7 +165,7 @@ public: ); //- Write UnsortedMeshedSurface - // as ASCII or BINARY, depending on the extension + //- as ASCII or BINARY, depending on the extension static void write ( const fileName& filename, @@ -178,15 +178,27 @@ public: // Member Functions //- Read from file - virtual bool read(const fileName& filename); + virtual bool read(const fileName& filename) override; - //- Write surface mesh to file + //- Write surface mesh to file (by proxy) virtual void write ( const fileName& name, IOstreamOption streamOpt = IOstreamOption(), const dictionary& options = dictionary::null - ) const + ) const override + { + write(name, MeshedSurfaceProxy(*this), streamOpt, options); + } + + //- Write surface mesh to file (by proxy) + virtual void write + ( + const fileName& name, + const word& fileType, /* ignored */ + IOstreamOption streamOpt = IOstreamOption(), + const dictionary& options = dictionary::null + ) const override { write(name, MeshedSurfaceProxy(*this), streamOpt, options); } diff --git a/src/surfMesh/surfaceFormats/tri/TRIsurfaceFormat.H b/src/surfMesh/surfaceFormats/tri/TRIsurfaceFormat.H index c9a1661711..7db53a02d4 100644 --- a/src/surfMesh/surfaceFormats/tri/TRIsurfaceFormat.H +++ b/src/surfMesh/surfaceFormats/tri/TRIsurfaceFormat.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2020 OpenCFD Ltd. + Copyright (C) 2016-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -45,8 +45,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef TRIsurfaceFormat_H -#define TRIsurfaceFormat_H +#ifndef Foam_TRIsurfaceFormat_H +#define Foam_TRIsurfaceFormat_H #include "MeshedSurface.H" #include "MeshedSurfaceProxy.H" @@ -84,7 +84,7 @@ public: // Constructors //- Construct from file name - TRIsurfaceFormat(const fileName& filename); + explicit TRIsurfaceFormat(const fileName& filename); //- Destructor @@ -93,7 +93,7 @@ public: // Static Functions - //- Write surface mesh components by proxy + //- Write surface mesh components (by proxy) in TRI format static void write ( const fileName& filename, @@ -115,15 +115,27 @@ public: // Member Functions //- Read from file - virtual bool read(const fileName& filename); + virtual bool read(const fileName& filename) override; - //- Write surface mesh to file + //- Write surface mesh to file (by proxy) virtual void write ( const fileName& name, IOstreamOption streamOpt = IOstreamOption(), const dictionary& options = dictionary::null - ) const + ) const override + { + write(name, MeshedSurfaceProxy(*this), streamOpt, options); + } + + //- Write surface mesh to file (by proxy) + virtual void write + ( + const fileName& name, + const word& fileType, /* ignored */ + IOstreamOption streamOpt = IOstreamOption(), + const dictionary& options = dictionary::null + ) const override { write(name, MeshedSurfaceProxy(*this), streamOpt, options); } diff --git a/src/surfMesh/surfaceFormats/vtk/VTKsurfaceFormat.H b/src/surfMesh/surfaceFormats/vtk/VTKsurfaceFormat.H index c32ea42e37..b744499b86 100644 --- a/src/surfMesh/surfaceFormats/vtk/VTKsurfaceFormat.H +++ b/src/surfMesh/surfaceFormats/vtk/VTKsurfaceFormat.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2020 OpenCFD Ltd. + Copyright (C) 2016-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -46,8 +46,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef VTKsurfaceFormat_H -#define VTKsurfaceFormat_H +#ifndef Foam_VTKsurfaceFormat_H +#define Foam_VTKsurfaceFormat_H #include "MeshedSurface.H" #include "MeshedSurfaceProxy.H" @@ -86,7 +86,7 @@ public: // Constructors //- Construct from file name - VTKsurfaceFormat(const fileName& filename); + explicit VTKsurfaceFormat(const fileName& filename); //- Destructor @@ -95,7 +95,7 @@ public: // Static Functions - //- Write surface mesh components by proxy + //- Write surface mesh components (by proxy) in legacy VTK format static void write ( const fileName& filename, @@ -117,15 +117,27 @@ public: // Member Functions //- Read from file - virtual bool read(const fileName& filename); + virtual bool read(const fileName& filename) override; - //- Write meshed surface to file + //- Write surface mesh to file (by proxy) virtual void write ( const fileName& name, IOstreamOption streamOpt = IOstreamOption(), const dictionary& options = dictionary::null - ) const + ) const override + { + write(name, MeshedSurfaceProxy(*this), streamOpt, options); + } + + //- Write surface mesh to file (by proxy) + virtual void write + ( + const fileName& name, + const word& fileType, /* ignored */ + IOstreamOption streamOpt = IOstreamOption(), + const dictionary& options = dictionary::null + ) const override { write(name, MeshedSurfaceProxy(*this), streamOpt, options); } diff --git a/src/surfMesh/surfaceFormats/vtp/VTPsurfaceFormat.H b/src/surfMesh/surfaceFormats/vtp/VTPsurfaceFormat.H index 2ab0e3490c..47438053f3 100644 --- a/src/surfMesh/surfaceFormats/vtp/VTPsurfaceFormat.H +++ b/src/surfMesh/surfaceFormats/vtp/VTPsurfaceFormat.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2017-2020 OpenCFD Ltd. + Copyright (C) 2017-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -46,8 +46,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef VTPsurfaceFormat_H -#define VTPsurfaceFormat_H +#ifndef Foam_VTPsurfaceFormat_H +#define Foam_VTPsurfaceFormat_H #include "MeshedSurface.H" #include "MeshedSurfaceProxy.H" @@ -95,7 +95,7 @@ public: // Static Functions - //- Write surface mesh components by proxy + //- Write surface mesh components (by proxy) in VTP format static void write ( const fileName& filename, @@ -116,13 +116,25 @@ public: // Member Functions - //- Write meshed surface to a file + //- Write surface mesh to file (by proxy) virtual void write ( const fileName& name, IOstreamOption streamOpt = IOstreamOption(), const dictionary& options = dictionary::null - ) const + ) const override + { + write(name, MeshedSurfaceProxy(*this), streamOpt, options); + } + + //- Write surface mesh to file (by proxy) + virtual void write + ( + const fileName& name, + const word& fileType, /* ignored */ + IOstreamOption streamOpt = IOstreamOption(), + const dictionary& options = dictionary::null + ) const override { write(name, MeshedSurfaceProxy(*this), streamOpt, options); } diff --git a/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormat.H b/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormat.H index 735a6803b5..81b6b12b2b 100644 --- a/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormat.H +++ b/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormat.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2020 OpenCFD Ltd. + Copyright (C) 2016-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -41,8 +41,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef X3DsurfaceFormat_H -#define X3DsurfaceFormat_H +#ifndef Foam_X3DsurfaceFormat_H +#define Foam_X3DsurfaceFormat_H #include "MeshedSurface.H" #include "MeshedSurfaceProxy.H" @@ -80,7 +80,7 @@ public: // Static Functions - //- Write surface mesh components by proxy + //- Write surface mesh components (by proxy) in X3D format static void write ( const fileName& filename, @@ -92,13 +92,25 @@ public: // Member Functions - //- Write surface mesh to file + //- Write surface mesh to file (by proxy) virtual void write ( const fileName& name, IOstreamOption streamOpt = IOstreamOption(), const dictionary& options = dictionary::null - ) const + ) const override + { + write(name, MeshedSurfaceProxy(*this), streamOpt, options); + } + + //- Write surface mesh to file (by proxy) + virtual void write + ( + const fileName& name, + const word& fileType, /* ignored */ + IOstreamOption streamOpt = IOstreamOption(), + const dictionary& options = dictionary::null + ) const override { write(name, MeshedSurfaceProxy(*this), streamOpt, options); } diff --git a/src/surfMesh/writers/common/surfaceWriter.H b/src/surfMesh/writers/common/surfaceWriter.H index 668833091e..d67c7b3f4f 100644 --- a/src/surfMesh/writers/common/surfaceWriter.H +++ b/src/surfMesh/writers/common/surfaceWriter.H @@ -237,7 +237,7 @@ protected: const tmp>& tfield ) const; -#undef declareSurfaceFieldMethod +#undef declareSurfaceFieldMethods #define declareSurfaceFieldMethods(Type) \ \ tmp> mergeField(const Field& fld) const; \