diff --git a/applications/utilities/parallelProcessing/redistributePar/Make/options b/applications/utilities/parallelProcessing/redistributePar/Make/options index d400986ff51ae4c5df3d43106e2c40ef3b71c049..b9ad1a5c17935f43e54abf9ac0fcb245d0f465a6 100644 --- a/applications/utilities/parallelProcessing/redistributePar/Make/options +++ b/applications/utilities/parallelProcessing/redistributePar/Make/options @@ -1,7 +1,9 @@ EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/fileFormats/lnInclude \ + -I$(LIB_SRC)/surfMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/finiteArea/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/mesh/snappyHexMesh/lnInclude \ @@ -9,8 +11,11 @@ EXE_INC = \ -I$(LIB_SRC)/parallel/decompose/decompose/lnInclude \ EXE_LIBS = \ - -lfiniteVolume \ + -lfileFormats \ + -lsurfMesh \ -lmeshTools \ + -lfiniteVolume \ + -lfiniteArea \ -llagrangian \ -ldynamicMesh \ -lsnappyHexMesh \ diff --git a/applications/utilities/parallelProcessing/redistributePar/distributedUnallocatedDirectFieldMapper.H b/applications/utilities/parallelProcessing/redistributePar/distributedUnallocatedDirectFieldMapper.H deleted file mode 100644 index fe90a568f6a82a2f480f4b8ffc8dc38197bfc53e..0000000000000000000000000000000000000000 --- a/applications/utilities/parallelProcessing/redistributePar/distributedUnallocatedDirectFieldMapper.H +++ /dev/null @@ -1,124 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | www.openfoam.com - \\/ M anipulation | -------------------------------------------------------------------------------- - Copyright (C) 2015 OpenFOAM Foundation - Copyright (C) 2019 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 <http://www.gnu.org/licenses/>. - -Class - Foam::distributedUnallocatedDirectFieldMapper - -Description - FieldMapper with direct mapping from remote quantities. - -\*---------------------------------------------------------------------------*/ - -#ifndef distributedUnallocatedDirectFieldMapper_H -#define distributedUnallocatedDirectFieldMapper_H - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class distributedUnallocatedDirectFieldMapper Declaration -\*---------------------------------------------------------------------------*/ - -class distributedUnallocatedDirectFieldMapper -: - public FieldMapper -{ - const labelUList& directAddressing_; - - const mapDistributeBase& distMap_; - - bool hasUnmapped_; - -public: - - // Constructors - - //- Construct given addressing - distributedUnallocatedDirectFieldMapper - ( - const labelUList& directAddressing, - const mapDistributeBase& distMap - ) - : - directAddressing_(directAddressing), - distMap_(distMap), - hasUnmapped_(directAddressing_.size() && min(directAddressing_) < 0) - {} - - - //- Destructor - virtual ~distributedUnallocatedDirectFieldMapper() = default; - - - // Member Functions - - virtual label size() const - { - return - ( - notNull(directAddressing_) - ? directAddressing_.size() - : distMap_.constructSize() - ); - } - - virtual bool direct() const - { - return true; - } - - virtual bool distributed() const - { - return true; - } - - virtual const mapDistributeBase& distributeMap() const - { - return distMap_; - } - - virtual bool hasUnmapped() const - { - return hasUnmapped_; - } - - virtual const labelUList& directAddressing() const - { - return directAddressing_; - } -}; - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/utilities/parallelProcessing/redistributePar/parFvFieldReconstructor.C b/applications/utilities/parallelProcessing/redistributePar/parFvFieldReconstructor.C index 2f28615932a4563f44e7a399fe236f4933180f53..45acf1bf566b982a02c71757c8608188f439a55b 100644 --- a/applications/utilities/parallelProcessing/redistributePar/parFvFieldReconstructor.C +++ b/applications/utilities/parallelProcessing/redistributePar/parFvFieldReconstructor.C @@ -27,7 +27,6 @@ License #include "parFvFieldReconstructor.H" - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // void Foam::parFvFieldReconstructor::createPatchFaceMaps() @@ -96,9 +95,8 @@ Foam::parFvFieldReconstructor::parFvFieldReconstructor void Foam::parFvFieldReconstructor::reconstructPoints() { - // Reconstruct the points for moving mesh cases and write - // them out - distributedUnallocatedDirectFieldMapper mapper + // Reconstruct the points for moving mesh cases and write them out + distributedFieldMapper mapper ( labelUList::null(), distMap_.pointMap() diff --git a/applications/utilities/parallelProcessing/redistributePar/parFvFieldReconstructorFields.C b/applications/utilities/parallelProcessing/redistributePar/parFvFieldReconstructorFields.C index 930133327692b5cab16ebcc10ce3f44445ea8c3b..4a314017641e36b2853cbfe9b3670c9fe7e37896 100644 --- a/applications/utilities/parallelProcessing/redistributePar/parFvFieldReconstructorFields.C +++ b/applications/utilities/parallelProcessing/redistributePar/parFvFieldReconstructorFields.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2015 OpenFOAM Foundation - Copyright (C) 2016-2018 OpenCFD Ltd. + Copyright (C) 2016-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -37,9 +37,8 @@ License #include "mapDistributePolyMesh.H" #include "processorFvPatch.H" -#include "directFvPatchFieldMapper.H" -#include "distributedUnallocatedDirectFieldMapper.H" -#include "distributedUnallocatedDirectFvPatchFieldMapper.H" +#include "distributedFieldMapper.H" +#include "distributedFvPatchFieldMapper.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // @@ -50,7 +49,7 @@ Foam::parFvFieldReconstructor::reconstructFvVolumeInternalField const DimensionedField<Type, volMesh>& fld ) const { - distributedUnallocatedDirectFieldMapper mapper + distributedFieldMapper mapper ( labelUList::null(), distMap_.cellMap() @@ -113,7 +112,7 @@ Foam::parFvFieldReconstructor::reconstructFvVolumeField // Create the internalField by remote mapping // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - distributedUnallocatedDirectFieldMapper mapper + distributedFieldMapper mapper ( labelUList::null(), distMap_.cellMap() @@ -138,7 +137,7 @@ Foam::parFvFieldReconstructor::reconstructFvVolumeField // Clone local patch field patchFields.set(patchI, bfld[patchI].clone()); - distributedUnallocatedDirectFvPatchFieldMapper mapper + distributedFvPatchFieldMapper mapper ( labelUList::null(), patchFaceMaps_[patchI] @@ -256,7 +255,7 @@ Foam::parFvFieldReconstructor::reconstructFvSurfaceField // Create the internalField by remote mapping // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - distributedUnallocatedDirectFieldMapper mapper + distributedFieldMapper mapper ( labelUList::null(), distMap_.faceMap() @@ -301,7 +300,7 @@ Foam::parFvFieldReconstructor::reconstructFvSurfaceField // Clone local patch field patchFields.set(patchI, bfld[patchI].clone()); - distributedUnallocatedDirectFvPatchFieldMapper mapper + distributedFvPatchFieldMapper mapper ( labelUList::null(), patchFaceMaps_[patchI] diff --git a/src/OpenFOAM/fields/Fields/Field/FieldMapper.H b/src/OpenFOAM/fields/Fields/Field/FieldMapper.H index d86e33a5d9c71b43d6241d0698c59214c5b00f1f..61dd46724c154607f0caf5f343edde47c48b0eaa 100644 --- a/src/OpenFOAM/fields/Fields/Field/FieldMapper.H +++ b/src/OpenFOAM/fields/Fields/Field/FieldMapper.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2015-2019 OpenCFD Ltd. + Copyright (C) 2015-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -32,8 +32,8 @@ Description \*---------------------------------------------------------------------------*/ -#ifndef FieldMapper_H -#define FieldMapper_H +#ifndef Foam_FieldMapper_H +#define Foam_FieldMapper_H #include "mapDistributeBase.H" #include "nullObject.H" @@ -49,14 +49,12 @@ namespace Foam class FieldMapper { - public: // Constructors - //- Null constructor - FieldMapper() - {} + //- Default construct + FieldMapper() = default; //- Destructor @@ -65,37 +63,43 @@ public: // Member Functions + //- The size of the mapper virtual label size() const = 0; + //- Is it a direct (non-interpolating) mapper? virtual bool direct() const = 0; + //- Does the mapper have remote contributions? virtual bool distributed() const { return false; } - virtual const mapDistributeBase& distributeMap() const + //- Any unmapped values? + // I.e. do all size() elements get value + virtual bool hasUnmapped() const = 0; + + //- Return the direct addressing values + virtual const labelUList& directAddressing() const { FatalErrorInFunction - << "attempt to access null distributeMap" + << "attempt to access null direct addressing" << abort(FatalError); - return NullObjectRef<mapDistributeBase>(); + return labelUList::null(); } - //- Are there unmapped values? I.e. do all size() elements get - // get value - virtual bool hasUnmapped() const = 0; - - virtual const labelUList& directAddressing() const + //- Return the distribution map + virtual const mapDistributeBase& distributeMap() const { FatalErrorInFunction - << "attempt to access null direct addressing" + << "attempt to access null distributeMap" << abort(FatalError); - return labelUList::null(); + return NullObjectRef<mapDistributeBase>(); } + //- Return the interpolation addressing virtual const labelListList& addressing() const { FatalErrorInFunction @@ -105,6 +109,7 @@ public: return labelListList::null(); } + //- Return the interpolation weights virtual const scalarListList& weights() const { FatalErrorInFunction @@ -117,10 +122,11 @@ public: // Member Operators + //- Perform mapping on the given field template<class Type> - tmp<Field<Type>> operator()(const Field<Type>& f) const + tmp<Field<Type>> operator()(const Field<Type>& fld) const { - return tmp<Field<Type>>::New(f, *this); + return tmp<Field<Type>>::New(fld, *this); } }; diff --git a/src/OpenFOAM/fields/Fields/Field/directFieldMapper.H b/src/OpenFOAM/fields/Fields/Field/directFieldMapper.H index 7555481a5a257bbb2244c51b694f1510c5d08d45..fc19dec74856418fe1bfc362f15a7b228c53b1fd 100644 --- a/src/OpenFOAM/fields/Fields/Field/directFieldMapper.H +++ b/src/OpenFOAM/fields/Fields/Field/directFieldMapper.H @@ -5,8 +5,8 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2013-2018 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2013 OpenFOAM Foundation + Copyright (C) 2019-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -25,72 +25,129 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::directFieldMapper + Foam::DirectFieldMapper Description - FieldMapper with direct mapping. + A templated direct mapper for the given FieldMapper type \*---------------------------------------------------------------------------*/ -#ifndef directFieldMapper_H -#define directFieldMapper_H +#ifndef Foam_directFieldMapper_H +#define Foam_directFieldMapper_H + +#include "FieldMapper.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { +// Forward Declarations +template<class FieldMapperType> class DirectFieldMapper; + +// Standard Types + +//- A FieldMapper with direct mapping +typedef DirectFieldMapper<FieldMapper> directFieldMapper; + + /*---------------------------------------------------------------------------*\ - Class directFieldMapper Declaration + Class DirectFieldMapper Declaration \*---------------------------------------------------------------------------*/ -class directFieldMapper +template<class FieldMapperType> +class DirectFieldMapper : - public FieldMapper + public FieldMapperType { - const labelUList& directAddressing_; + // Private Data + + //- Addressing from new back to old + const labelUList& directAddressing_; - bool hasUnmapped_; + //- Does map contain any unmapped values + bool hasUnmapped_; + + + // Private Member Functions + + //- Any negative (unmapped) values in the addressing? + static bool hasUnmappedEntry(const labelUList& directAddr) + { + for (const label val : directAddr) + { + if (val < 0) return true; // early exit + } + return false; + } public: + // Public Types + + //- The base mapper type + typedef FieldMapperType mapper_type; + + // Constructors - //- Construct given addressing - directFieldMapper(const labelUList& directAddressing) + //- Construct given addressing, check for unmapped (negative) values + explicit DirectFieldMapper + ( + const labelUList& directAddr, + const bool checkUnmapped = true + ) : - directAddressing_(directAddressing), - hasUnmapped_(directAddressing_.size() && min(directAddressing_) < 0) + FieldMapperType(), + directAddressing_(directAddr), + hasUnmapped_(checkUnmapped && hasUnmappedEntry(directAddr)) {} //- Destructor - virtual ~directFieldMapper() = default; + virtual ~DirectFieldMapper() = default; // Member Functions - label size() const + //- True if directAddressing is not the null object (unallocated) + virtual bool hasDirectAddressing() const + { + return notNull(directAddressing_); + } + + //- The mapper size is given by the size of the direct addressing + virtual label size() const { return directAddressing_.size(); } - bool direct() const + //- It is a direct mapper + virtual bool direct() const { return true; } - bool hasUnmapped() const + //- Any unmapped values? + virtual bool hasUnmapped() const { return hasUnmapped_; } - const labelUList& directAddressing() const + //- Allow modification + virtual bool& hasUnmapped() + { + return hasUnmapped_; + } + + //- Return the direct addressing values + virtual const labelUList& directAddressing() const { return directAddressing_; } }; + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/applications/utilities/parallelProcessing/redistributePar/distributedUnallocatedDirectFvPatchFieldMapper.H b/src/OpenFOAM/fields/Fields/Field/distributedFieldMapper.H similarity index 60% rename from applications/utilities/parallelProcessing/redistributePar/distributedUnallocatedDirectFvPatchFieldMapper.H rename to src/OpenFOAM/fields/Fields/Field/distributedFieldMapper.H index 7ce892a0600c9bec21af1f8b49cd5f509eade7e8..ec7cd5aa62760536de67987cfb899633edf47b98 100644 --- a/applications/utilities/parallelProcessing/redistributePar/distributedUnallocatedDirectFvPatchFieldMapper.H +++ b/src/OpenFOAM/fields/Fields/Field/distributedFieldMapper.H @@ -5,8 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2015 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -25,96 +24,102 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::distributedUnallocatedDirectFvPatchFieldMapper + Foam::DistributedFieldMapper Description - FieldMapper with direct mapping from remote quantities. + A templated field mapper + with direct mapping from local or remote quantities. \*---------------------------------------------------------------------------*/ -#ifndef distributedUnallocatedDirectFvPatchFieldMapper_H -#define distributedUnallocatedDirectFvPatchFieldMapper_H +#ifndef Foam_distributedFieldMapper_H +#define Foam_distributedFieldMapper_H -#include "fvPatchFieldMapper.H" +#include "directFieldMapper.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { +// Forward Declarations +template<class DirectFieldMapperType> class DistributedFieldMapper; + +// Standard Types + +//- A directFieldMapper with distributed (with local or remote) quantities +typedef DistributedFieldMapper<directFieldMapper> distributedFieldMapper; + + /*---------------------------------------------------------------------------*\ - Class distributedUnallocatedDirectFvPatchFieldMapper Declaration + Class DistributedFieldMapper Declaration \*---------------------------------------------------------------------------*/ -class distributedUnallocatedDirectFvPatchFieldMapper +template<class DirectFieldMapperType> +class DistributedFieldMapper : - public fvPatchFieldMapper + public DirectFieldMapperType { - const labelUList& directAddressing_; + // Private Data - const mapDistributeBase& distMap_; + //- The distributed map + const mapDistributeBase& distMap_; - bool hasUnmapped_; public: + // Public Types + + //- The base direct mapper type + typedef DirectFieldMapperType mapper_type; + + // Constructors - //- Construct given addressing - distributedUnallocatedDirectFvPatchFieldMapper + //- Construct with addressing and distribute map + DistributedFieldMapper ( - const labelUList& directAddressing, + const labelUList& directAddr, const mapDistributeBase& distMap ) : - directAddressing_(directAddressing), - distMap_(distMap), - hasUnmapped_(directAddressing_.size() && min(directAddressing_) < 0) + DirectFieldMapperType(directAddr), + distMap_(distMap) {} //- Destructor - virtual ~distributedUnallocatedDirectFvPatchFieldMapper() = default; + virtual ~DistributedFieldMapper() = default; // Member Functions + //- The mapper size is given by the direct addressing size (if valid) + //- or from the distributeMap construct size. virtual label size() const { return ( - notNull(directAddressing_) - ? directAddressing_.size() + DirectFieldMapperType::hasDirectAddressing() + ? DirectFieldMapperType::size() : distMap_.constructSize() ); } - virtual bool direct() const - { - return true; - } - + //- It is a distributed mapper virtual bool distributed() const { return true; } + //- Return the distribution map virtual const mapDistributeBase& distributeMap() const { return distMap_; } - - virtual bool hasUnmapped() const - { - return hasUnmapped_; - } - - virtual const labelUList& directAddressing() const - { - return directAddressing_; - } }; + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/directPointPatchFieldMapper.H b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/directPointPatchFieldMapper.H index 89a7aa3a5ae953d3364f1deffb201747130e3a20..a019f95ff107cc93e9e99c2a7ff53a046ad386c9 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/directPointPatchFieldMapper.H +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/directPointPatchFieldMapper.H @@ -5,8 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2013 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,17 +23,18 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. -Class +Typedef Foam::directPointPatchFieldMapper Description - direct pointPatchFieldMapper + A direct pointPatchFieldMapper \*---------------------------------------------------------------------------*/ -#ifndef directPointPatchFieldMapper_H -#define directPointPatchFieldMapper_H +#ifndef Foam_directPointPatchFieldMapper_H +#define Foam_directPointPatchFieldMapper_H +#include "directFieldMapper.H" #include "pointPatchFieldMapper.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -42,65 +42,11 @@ Description namespace Foam { -/*---------------------------------------------------------------------------*\ - Class directPointPatchFieldMapper Declaration -\*---------------------------------------------------------------------------*/ - -class directPointPatchFieldMapper -: - public pointPatchFieldMapper -{ - - //- Addressing from new back to old - const labelUList& directAddressing_; - - //- Does map contain any unmapped values - bool hasUnmapped_; - - -public: - - // Constructors - - //- Construct given addressing - directPointPatchFieldMapper(const labelUList& directAddressing) - : - directAddressing_(directAddressing), - hasUnmapped_(directAddressing_.size() && min(directAddressing_) < 0) - {} - - - //- Destructor - virtual ~directPointPatchFieldMapper() = default; - - - // Member Functions - - label size() const - { - return directAddressing_.size(); - } - - bool direct() const - { - return true; - } - - bool hasUnmapped() const - { - return hasUnmapped_; - } - - const labelUList& directAddressing() const - { - return directAddressing_; - } -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +typedef + DirectFieldMapper<pointPatchFieldMapper> + directPointPatchFieldMapper; -} // End namespace Foam +} // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/distributedPointPatchFieldMapper.H b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/distributedPointPatchFieldMapper.H new file mode 100644 index 0000000000000000000000000000000000000000..2203becd5facd1a525ea9283709f9b3b8b844c0a --- /dev/null +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/distributedPointPatchFieldMapper.H @@ -0,0 +1,56 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 <http://www.gnu.org/licenses/>. + +Typedef + Foam::distributedPointPatchFieldMapper + +Description + A directPointPatchFieldMapper + with direct mapping from local or remote quantities. + +\*---------------------------------------------------------------------------*/ + +#ifndef Foam_distributedPointPatchFieldMapper_H +#define Foam_distributedPointPatchFieldMapper_H + +#include "distributedFieldMapper.H" +#include "directPointPatchFieldMapper.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +typedef + DistributedFieldMapper<directPointPatchFieldMapper> + distributedPointPatchFieldMapper; + +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldMapper.H b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldMapper.H index 74da4d4290f58f34399108758ca126c301e5e817..02a4a5648304c34a04522447134fc1085b1092c3 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldMapper.H +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldMapper.H @@ -31,11 +31,10 @@ Description \*---------------------------------------------------------------------------*/ -#ifndef pointPatchFieldMapper_H -#define pointPatchFieldMapper_H +#ifndef Foam_pointPatchFieldMapper_H +#define Foam_pointPatchFieldMapper_H #include "primitiveFields.H" -#include "FieldMapper.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,14 +49,12 @@ class pointPatchFieldMapper : public FieldMapper { - public: // Constructors - //- Null constructor - pointPatchFieldMapper() - {} + //- Default construct + pointPatchFieldMapper() = default; }; diff --git a/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointBoundaryMeshMapper.H b/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointBoundaryMeshMapper.H index a44826132ba56565dec64f8d6381c9d106b9a754..6c155b54016858de99344a213d25c1955e261ec1 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointBoundaryMeshMapper.H +++ b/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointBoundaryMeshMapper.H @@ -50,7 +50,15 @@ class pointBoundaryMeshMapper : public PtrList<pointPatchMapper> { - // Private Member Functions +public: + + // Public Types + + //- The patch mapper type + typedef pointPatchMapper mapper_type; + + + // Generated Methods //- No copy construct pointBoundaryMeshMapper(const pointBoundaryMeshMapper&) = delete; @@ -59,8 +67,6 @@ class pointBoundaryMeshMapper void operator=(const pointBoundaryMeshMapper&) = delete; -public: - // Constructors //- Construct from components diff --git a/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointPatchMapper.C b/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointPatchMapper.C index 3ee1c907e609262acee34c61e5483d7f24e48724..e9a18985c0ed0bae221660c8daa33df6fd48da1b 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointPatchMapper.C +++ b/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointPatchMapper.C @@ -200,13 +200,4 @@ const Foam::scalarListList& Foam::pointPatchMapper::weights() const } -// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // - - -// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * // - - -// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // - - // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributePolyMesh.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributePolyMesh.C index f3f86cc68ca0ead04cb9f051b14dc8d0bac32d72..54abd9460ce2af712e2ad6dec0df7eaf4e193690 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributePolyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributePolyMesh.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2015-2018 OpenCFD Ltd. + Copyright (C) 2015-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -33,7 +33,7 @@ License void Foam::mapDistributePolyMesh::calcPatchSizes() { - oldPatchSizes_.setSize(oldPatchStarts_.size()); + oldPatchSizes_.resize_nocopy(oldPatchStarts_.size()); if (oldPatchStarts_.size()) { @@ -192,6 +192,12 @@ Foam::mapDistributePolyMesh::mapDistributePolyMesh(Istream& is) void Foam::mapDistributePolyMesh::transfer(mapDistributePolyMesh& rhs) { + if (this == &rhs) + { + // Self-assignment is a no-op + return; + } + nOldPoints_ = rhs.nOldPoints_; nOldFaces_ = rhs.nOldFaces_; nOldCells_ = rhs.nOldCells_; @@ -283,6 +289,12 @@ void Foam::mapDistributePolyMesh::distributePatchIndices(labelList& lst) const void Foam::mapDistributePolyMesh::operator=(const mapDistributePolyMesh& rhs) { + if (this == &rhs) + { + // Self-assignment is a no-op + return; + } + nOldPoints_ = rhs.nOldPoints_; nOldFaces_ = rhs.nOldFaces_; nOldCells_ = rhs.nOldCells_; @@ -298,7 +310,11 @@ void Foam::mapDistributePolyMesh::operator=(const mapDistributePolyMesh& rhs) void Foam::mapDistributePolyMesh::operator=(mapDistributePolyMesh&& rhs) { - transfer(rhs); + if (this != &rhs) + { + // Avoid self assignment + transfer(rhs); + } } @@ -327,9 +343,10 @@ Foam::Istream& Foam::operator>>(Istream& is, mapDistributePolyMesh& map) Foam::Ostream& Foam::operator<<(Ostream& os, const mapDistributePolyMesh& map) { - os << map.nOldPoints_ - << token::SPACE << map.nOldFaces_ - << token::SPACE << map.nOldCells_ << token::NL + os << map.nOldPoints_ << token::SPACE + << map.nOldFaces_ << token::SPACE + << map.nOldCells_ << token::NL + << map.oldPatchSizes_ << token::NL << map.oldPatchStarts_ << token::NL << map.oldPatchNMeshPoints_ << token::NL diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributePolyMesh.H b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributePolyMesh.H index 35636e4c88300c39adebf2202ce6a80a44690e9b..01947ed58004e613f22efed35f8f0d43e0beecd2 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributePolyMesh.H +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributePolyMesh.H @@ -41,8 +41,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef mapDistributePolyMesh_H -#define mapDistributePolyMesh_H +#ifndef Foam_mapDistributePolyMesh_H +#define Foam_mapDistributePolyMesh_H #include "mapDistribute.H" @@ -51,7 +51,7 @@ SourceFiles namespace Foam { -// Forward declarations +// Forward Declarations class mapPolyMesh; class polyMesh; class mapDistributePolyMesh; @@ -66,7 +66,7 @@ Ostream& operator<<(Ostream&, const mapDistributePolyMesh&); class mapDistributePolyMesh { - // Private data + // Private Data //- Number of old live points label nOldPoints_; @@ -112,7 +112,7 @@ public: // Constructors - //- Construct null + //- Default construct mapDistributePolyMesh(); //- Move construct @@ -165,7 +165,7 @@ public: ); //- Construct from Istream - mapDistributePolyMesh(Istream& is); + explicit mapDistributePolyMesh(Istream& is); // Member Functions @@ -173,61 +173,61 @@ public: // Access //- Number of points in mesh before distribution - label nOldPoints() const + label nOldPoints() const noexcept { return nOldPoints_; } //- Number of faces in mesh before distribution - label nOldFaces() const + label nOldFaces() const noexcept { return nOldFaces_; } //- Number of cells in mesh before distribution - label nOldCells() const + label nOldCells() const noexcept { return nOldCells_; } //- List of the old patch sizes - const labelList& oldPatchSizes() const + const labelList& oldPatchSizes() const noexcept { return oldPatchSizes_; } //- List of the old patch start labels - const labelList& oldPatchStarts() const + const labelList& oldPatchStarts() const noexcept { return oldPatchStarts_; } //- List of numbers of mesh points per old patch - const labelList& oldPatchNMeshPoints() const + const labelList& oldPatchNMeshPoints() const noexcept { return oldPatchNMeshPoints_; } //- Point distribute map - const mapDistribute& pointMap() const + const mapDistribute& pointMap() const noexcept { return pointMap_; } //- Face distribute map - const mapDistribute& faceMap() const + const mapDistribute& faceMap() const noexcept { return faceMap_; } //- Cell distribute map - const mapDistribute& cellMap() const + const mapDistribute& cellMap() const noexcept { return cellMap_; } //- Patch distribute map - const mapDistribute& patchMap() const + const mapDistribute& patchMap() const noexcept { return patchMap_; } @@ -240,30 +240,30 @@ public: //- Distribute list of point data template<class T> - void distributePointData(List<T>& lst) const + void distributePointData(List<T>& values) const { - pointMap_.distribute(lst); + pointMap_.distribute(values); } //- Distribute list of face data template<class T> - void distributeFaceData(List<T>& lst) const + void distributeFaceData(List<T>& values) const { - faceMap_.distribute(lst); + faceMap_.distribute(values); } //- Distribute list of cell data template<class T> - void distributeCellData(List<T>& lst) const + void distributeCellData(List<T>& values) const { - cellMap_.distribute(lst); + cellMap_.distribute(values); } //- Distribute list of patch data template<class T> - void distributePatchData(List<T>& lst) const + void distributePatchData(List<T>& values) const { - patchMap_.distribute(lst); + patchMap_.distribute(values); } @@ -294,12 +294,11 @@ public: // IOstream operators - //- Read dictionary from Istream + //- Read content (not dictionary) from Istream friend Istream& operator>>(Istream&, mapDistributePolyMesh&); - //- Write dictionary to Ostream + //- Write content (not dictionary) to Ostream friend Ostream& operator<<(Ostream&, const mapDistributePolyMesh&); - }; diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/morphFieldMapper.H b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/morphFieldMapper.H index 6574f830aef02b0509efd297f2dff149b11314b0..7aba3073ca1a7e50204ab68c5f2c8c1da17525be 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/morphFieldMapper.H +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/morphFieldMapper.H @@ -32,8 +32,8 @@ Description \*---------------------------------------------------------------------------*/ -#ifndef morphFieldMapper_H -#define morphFieldMapper_H +#ifndef Foam_morphFieldMapper_H +#define Foam_morphFieldMapper_H #include "Field.H" #include "Map.H" @@ -51,14 +51,12 @@ class morphFieldMapper : public FieldMapper { - public: // Constructors - //- Null constructor - morphFieldMapper() - {} + //- Default construct + morphFieldMapper() = default; //- Destructor @@ -75,7 +73,6 @@ public: //- Return list of inserted objects virtual const labelList& insertedObjectLabels() const = 0; - }; diff --git a/src/finiteArea/faMesh/faMeshMapper/faBoundaryMeshMapper.H b/src/finiteArea/faMesh/faMeshMapper/faBoundaryMeshMapper.H index 07ade39d6eab907d358478d5031a406587ae6773..8cb95b33583b6d2be42cd8c664cc04abaed64ea4 100644 --- a/src/finiteArea/faMesh/faMeshMapper/faBoundaryMeshMapper.H +++ b/src/finiteArea/faMesh/faMeshMapper/faBoundaryMeshMapper.H @@ -50,7 +50,15 @@ class faBoundaryMeshMapper : public PtrList<faPatchMapper> { - // Private Member Functions +public: + + // Public Types + + //- The patch mapper type + typedef faPatchMapper mapper_type; + + + // Generated Methods //- No copy construct faBoundaryMeshMapper(const faBoundaryMeshMapper&) = delete; @@ -59,8 +67,6 @@ class faBoundaryMeshMapper void operator=(const faBoundaryMeshMapper&) = delete; -public: - // Constructors //- Construct from components @@ -74,14 +80,14 @@ public: { const faBoundaryMesh& patches = mesh.boundary(); - forAll(patches, patchI) + forAll(patches, patchi) { set ( - patchI, + patchi, new faPatchMapper ( - patches[patchI], + patches[patchi], mpm ) ); diff --git a/src/finiteArea/fields/faPatchFields/faPatchField/directFaPatchFieldMapper.H b/src/finiteArea/fields/faPatchFields/faPatchField/directFaPatchFieldMapper.H new file mode 100644 index 0000000000000000000000000000000000000000..9b1108e4ef2b05c9e1f2d9ea223b3c14a3470e11 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/faPatchField/directFaPatchFieldMapper.H @@ -0,0 +1,55 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 <http://www.gnu.org/licenses/>. + +Typedef + Foam::directFaPatchFieldMapper + +Description + A direct faPatchFieldMapper + +\*---------------------------------------------------------------------------*/ + +#ifndef Foam_directFaPatchFieldMapper_H +#define Foam_directFaPatchFieldMapper_H + +#include "directFieldMapper.H" +#include "faPatchFieldMapper.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +typedef + DirectFieldMapper<faPatchFieldMapper> + directFaPatchFieldMapper; + +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/faPatchField/distributedFaPatchFieldMapper.H b/src/finiteArea/fields/faPatchFields/faPatchField/distributedFaPatchFieldMapper.H new file mode 100644 index 0000000000000000000000000000000000000000..9976a9a9c6b968fc854ae09cf1a097676a5311e7 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/faPatchField/distributedFaPatchFieldMapper.H @@ -0,0 +1,56 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 <http://www.gnu.org/licenses/>. + +Typedef + Foam::distributedFaPatchFieldMapper + +Description + A directFaPatchFieldMapper + with direct mapping from local or remote quantities. + +\*---------------------------------------------------------------------------*/ + +#ifndef Foam_distributedFaPatchFieldMapper_H +#define Foam_distributedFaPatchFieldMapper_H + +#include "distributedFieldMapper.H" +#include "directFaPatchFieldMapper.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +typedef + DistributedFieldMapper<directFaPatchFieldMapper> + distributedFaPatchFieldMapper; + +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/faPatchField/faPatchFieldMapper.H b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchFieldMapper.H index ebffab54a4ac6a0a54ce87f839231e29bfa376b1..4e006fc2656d591f3ba8d894496bec6b510977e8 100644 --- a/src/finiteArea/fields/faPatchFields/faPatchField/faPatchFieldMapper.H +++ b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchFieldMapper.H @@ -26,10 +26,13 @@ License Class Foam::faPatchFieldMapper +Description + A FieldMapper for finite-area patch fields + \*---------------------------------------------------------------------------*/ -#ifndef faPatchFieldMapper_H -#define faPatchFieldMapper_H +#ifndef Foam_faPatchFieldMapper_H +#define Foam_faPatchFieldMapper_H #include "primitiveFields.H" @@ -46,14 +49,12 @@ class faPatchFieldMapper : public FieldMapper { - public: // Constructors - //- Null constructor - faPatchFieldMapper() - {} + //- Default construct + faPatchFieldMapper() = default; }; diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/directFvPatchFieldMapper.H b/src/finiteVolume/fields/fvPatchFields/fvPatchField/directFvPatchFieldMapper.H index b969c6390dda595a617cc8d343fd469e5fcecef5..cab36edcdc3cc4d109d5311a19cf629f223b9b13 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/directFvPatchFieldMapper.H +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/directFvPatchFieldMapper.H @@ -5,8 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2013 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,17 +23,18 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. -Class +Typedef Foam::directFvPatchFieldMapper Description - direct fvPatchFieldMapper + A fvPatchFieldMapper with direct mapping \*---------------------------------------------------------------------------*/ -#ifndef directFvPatchFieldMapper_H -#define directFvPatchFieldMapper_H +#ifndef Foam_directFvPatchFieldMapper_H +#define Foam_directFvPatchFieldMapper_H +#include "directFieldMapper.H" #include "fvPatchFieldMapper.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -42,70 +42,11 @@ Description namespace Foam { -/*---------------------------------------------------------------------------*\ - Class directFvPatchFieldMapper Declaration -\*---------------------------------------------------------------------------*/ - -class directFvPatchFieldMapper -: - public fvPatchFieldMapper -{ - - //- Addressing from new back to old - const labelUList& directAddressing_; - - //- Does map contain any unmapped values - bool hasUnmapped_; - - -public: - - // Constructors - - //- Construct given addressing - directFvPatchFieldMapper(const labelUList& directAddressing) - : - directAddressing_(directAddressing), - hasUnmapped_(directAddressing_.size() && min(directAddressing_) < 0) - {} - - - //- Destructor - virtual ~directFvPatchFieldMapper() = default; - - - // Member Functions - - label size() const - { - return directAddressing_.size(); - } - - bool direct() const - { - return true; - } - - bool hasUnmapped() const - { - return hasUnmapped_; - } - - bool& hasUnmapped() - { - return hasUnmapped_; - } - - const labelUList& directAddressing() const - { - return directAddressing_; - } -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +typedef + DirectFieldMapper<fvPatchFieldMapper> + directFvPatchFieldMapper; -} // End namespace Foam +} // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/distributedFvPatchFieldMapper.H b/src/finiteVolume/fields/fvPatchFields/fvPatchField/distributedFvPatchFieldMapper.H new file mode 100644 index 0000000000000000000000000000000000000000..c65a5daea763967819cbaa3bf244fabf2dfbe8c4 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/distributedFvPatchFieldMapper.H @@ -0,0 +1,56 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 <http://www.gnu.org/licenses/>. + +Typedef + Foam::distributedFvPatchFieldMapper + +Description + A directFvPatchFieldMapper + with direct mapping from local or remote quantities. + +\*---------------------------------------------------------------------------*/ + +#ifndef Foam_distributedFvPatchFieldMapper_H +#define Foam_distributedFvPatchFieldMapper_H + +#include "distributedFieldMapper.H" +#include "directFvPatchFieldMapper.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +typedef + DistributedFieldMapper<directFvPatchFieldMapper> + distributedFvPatchFieldMapper; + +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldMapper.H b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldMapper.H index 8864d011ee07858b5ee86ff5d3ca3b06717d3bfa..d1877f75b2d45485c8eaac8a6b41936a1b970787 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldMapper.H +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldMapper.H @@ -27,12 +27,12 @@ Class Foam::fvPatchFieldMapper Description - Foam::fvPatchFieldMapper + A FieldMapper for finite-volume patch fields \*---------------------------------------------------------------------------*/ -#ifndef fvPatchFieldMapper_H -#define fvPatchFieldMapper_H +#ifndef Foam_fvPatchFieldMapper_H +#define Foam_fvPatchFieldMapper_H #include "primitiveFields.H" @@ -49,14 +49,12 @@ class fvPatchFieldMapper : public FieldMapper { - public: // Constructors - //- Null constructor - fvPatchFieldMapper() - {} + //- Default construct + fvPatchFieldMapper() = default; }; diff --git a/src/finiteVolume/fvMesh/fvMeshMapper/fvBoundaryMeshMapper.H b/src/finiteVolume/fvMesh/fvMeshMapper/fvBoundaryMeshMapper.H index 6ac290b9fd40e894c92d547f507f583dcc35b325..e533354e4d137fe772eeaa91a12cd817b9fc0149 100644 --- a/src/finiteVolume/fvMesh/fvMeshMapper/fvBoundaryMeshMapper.H +++ b/src/finiteVolume/fvMesh/fvMeshMapper/fvBoundaryMeshMapper.H @@ -50,7 +50,15 @@ class fvBoundaryMeshMapper : public PtrList<fvPatchMapper> { - // Private Member Functions +public: + + // Public Types + + //- The patch mapper type + typedef fvPatchMapper mapper_type; + + + // Generated Methods //- No copy construct fvBoundaryMeshMapper(const fvBoundaryMeshMapper&) = delete; @@ -59,8 +67,6 @@ class fvBoundaryMeshMapper void operator=(const fvBoundaryMeshMapper&) = delete; -public: - // Constructors //- Construct from components