From 7db2a294136ea753ae705d379ea48be2a94fe182 Mon Sep 17 00:00:00 2001 From: Mark Olesen <Mark.Olesen@esi-group.com> Date: Tue, 1 Feb 2022 19:51:32 +0100 Subject: [PATCH] ENH: type aliases for common GeometricField forms (#2348) ENH: provide fieldTypes::surface names (as per fieldTypes::volume) ENH: reduce number of files for surface fields - combine face and point field declarations/definitions, simplify typeName definitions --- .../Test-surfaceMeshConvert.C | 1 - src/OpenFOAM/fields/Fields/fieldTypes.H | 6 +- .../GeometricFields/pointFields/pointFields.H | 2 - .../pointFields/pointFieldsFwd.H | 23 ++++-- src/finiteArea/fields/areaFields/areaFields.H | 4 +- .../fields/areaFields/areaFieldsFwd.H | 22 ++++-- src/finiteArea/fields/edgeFields/edgeFields.H | 2 - .../fields/edgeFields/edgeFieldsFwd.H | 17 +++-- .../surfaceFields/slicedSurfaceFields.H | 4 +- .../surfaceFields/slicedSurfaceFieldsFwd.H | 33 +++++---- .../fields/surfaceFields/surfaceFields.C | 16 +++++ .../fields/surfaceFields/surfaceFields.H | 6 +- .../fields/surfaceFields/surfaceFieldsFwd.H | 30 ++++++-- .../fields/volFields/slicedVolFields.H | 6 +- .../fields/volFields/slicedVolFieldsFwd.H | 31 ++++---- .../fields/volFields/volFieldsFwd.H | 24 +++++-- src/meshTools/Make/files | 2 +- src/meshTools/fields/polyGeoMesh.H | 4 +- .../fields/{polyFields.C => polyMeshFields.C} | 7 +- .../fields/polyMeshFields.H} | 45 ++++-------- .../{polyFields.H => polyMeshFieldsFwd.H} | 36 +++++----- .../sampledSurface/sampledSurface.C | 10 --- .../sampledSurface/sampledSurface.H | 10 --- .../sampledSurfaces/sampledSurfaces.C | 3 +- .../sampledSurfacesTemplates.C | 1 - src/surfMesh/Make/files | 2 - .../polySurface/fields/polySurfaceFields.C | 41 +++++------ .../polySurface/fields/polySurfaceFields.H | 9 ++- .../polySurface/fields/polySurfaceFieldsFwd.H | 29 ++++++-- .../polySurface/fields/polySurfaceGeoMesh.H | 4 +- .../fields/polySurfacePointFields.C | 66 ----------------- .../fields/polySurfacePointFields.H | 43 +----------- .../fields/polySurfacePointFieldsFwd.H | 70 +------------------ .../fields/polySurfacePointGeoMesh.H | 4 +- src/surfMesh/polySurface/polySurface.H | 7 +- .../polySurface/polySurfaceTemplates.C | 1 - src/surfMesh/surfMesh/fields/surfFields.C | 33 +++++---- src/surfMesh/surfMesh/fields/surfFields.H | 8 +-- src/surfMesh/surfMesh/fields/surfFieldsFwd.H | 60 +++++++++++++--- src/surfMesh/surfMesh/fields/surfGeoMesh.H | 4 +- .../surfMesh/fields/surfPointFields.H | 43 +----------- .../surfMesh/fields/surfPointFieldsFwd.H | 63 +---------------- .../surfMesh/fields/surfPointGeoMesh.H | 4 +- .../triSurface/fields/triSurfaceFields.C | 59 +++++----------- .../triSurface/fields/triSurfaceFields.H | 6 +- .../triSurface/fields/triSurfaceFieldsFwd.H | 29 ++++++-- .../triSurface/fields/triSurfaceGeoMesh.H | 4 +- .../fields/triSurfacePointGeoMesh.H | 4 +- 48 files changed, 379 insertions(+), 559 deletions(-) rename src/meshTools/fields/{polyFields.C => polyMeshFields.C} (98%) rename src/{surfMesh/surfMesh/fields/surfPointFields.C => meshTools/fields/polyMeshFields.H} (60%) rename src/meshTools/fields/{polyFields.H => polyMeshFieldsFwd.H} (71%) delete mode 100644 src/surfMesh/polySurface/fields/polySurfacePointFields.C diff --git a/applications/test/surfaceMeshConvert/Test-surfaceMeshConvert.C b/applications/test/surfaceMeshConvert/Test-surfaceMeshConvert.C index 4f5f0cfb396..ecfead0f7e0 100644 --- a/applications/test/surfaceMeshConvert/Test-surfaceMeshConvert.C +++ b/applications/test/surfaceMeshConvert/Test-surfaceMeshConvert.C @@ -62,7 +62,6 @@ Note #include "triSurface.H" #include "surfMesh.H" #include "surfFields.H" -#include "surfPointFields.H" #include "MeshedSurfaces.H" #include "ModifiableMeshedSurface.H" diff --git a/src/OpenFOAM/fields/Fields/fieldTypes.H b/src/OpenFOAM/fields/Fields/fieldTypes.H index 633cfadf307..108812e8185 100644 --- a/src/OpenFOAM/fields/Fields/fieldTypes.H +++ b/src/OpenFOAM/fields/Fields/fieldTypes.H @@ -29,8 +29,8 @@ Description \*---------------------------------------------------------------------------*/ -#ifndef fieldTypes_H -#define fieldTypes_H +#ifndef Foam_fieldTypes_H +#define Foam_fieldTypes_H #include "label.H" #include "scalar.H" @@ -40,9 +40,11 @@ Description #include "tensor.H" #include "triad.H" #include "macros.H" +#include "wordList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#define CAPITALIZE_label Label #define CAPITALIZE_scalar Scalar #define CAPITALIZE_vector Vector #define CAPITALIZE_sphericalTensor SphericalTensor diff --git a/src/OpenFOAM/fields/GeometricFields/pointFields/pointFields.H b/src/OpenFOAM/fields/GeometricFields/pointFields/pointFields.H index 6341817897e..e3d30a848e5 100644 --- a/src/OpenFOAM/fields/GeometricFields/pointFields/pointFields.H +++ b/src/OpenFOAM/fields/GeometricFields/pointFields/pointFields.H @@ -41,8 +41,6 @@ SourceFiles #include "pointPatchFields.H" #include "pointFieldsFwd.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - #endif // ************************************************************************* // diff --git a/src/OpenFOAM/fields/GeometricFields/pointFields/pointFieldsFwd.H b/src/OpenFOAM/fields/GeometricFields/pointFields/pointFieldsFwd.H index 5fbcb0d7cb9..a4d245562a2 100644 --- a/src/OpenFOAM/fields/GeometricFields/pointFields/pointFieldsFwd.H +++ b/src/OpenFOAM/fields/GeometricFields/pointFields/pointFieldsFwd.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -35,8 +35,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef pointFieldsFwd_H -#define pointFieldsFwd_H +#ifndef Foam_pointFieldsFwd_H +#define Foam_pointFieldsFwd_H #include "fieldTypes.H" @@ -45,15 +45,26 @@ SourceFiles namespace Foam { +template<class Type, class GeoMesh> class DimensionedField; +template<class Type, template<class> class PatchField, class GeoMesh> +class GeometricField; + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Forward Declarations class pointMesh; - template<class Type> class pointPatchField; -template<class Type, template<class> class PatchField, class GeoMesh> -class GeometricField; + +//- A point field for a given type +template<class Type> +using PointField = GeometricField<Type, pointPatchField, pointMesh>; + +//- A point internal field for a given type +template<class Type> +using PointInternalField = DimensionedField<Type, pointMesh>; + // Typedefs diff --git a/src/finiteArea/fields/areaFields/areaFields.H b/src/finiteArea/fields/areaFields/areaFields.H index 50da0dacbad..5aeed1de57a 100644 --- a/src/finiteArea/fields/areaFields/areaFields.H +++ b/src/finiteArea/fields/areaFields/areaFields.H @@ -38,8 +38,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef areaFields_H -#define areaFields_H +#ifndef Foam_areaFields_H +#define Foam_areaFields_H #include "objectRegistry.H" #include "GeometricFields.H" diff --git a/src/finiteArea/fields/areaFields/areaFieldsFwd.H b/src/finiteArea/fields/areaFields/areaFieldsFwd.H index 784ea98b641..c807f4c4f59 100644 --- a/src/finiteArea/fields/areaFields/areaFieldsFwd.H +++ b/src/finiteArea/fields/areaFields/areaFieldsFwd.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016-2017 Wikki Ltd - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -32,8 +32,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef areaFieldsFwd_H -#define areaFieldsFwd_H +#ifndef Foam_areaFieldsFwd_H +#define Foam_areaFieldsFwd_H #include "fieldTypes.H" @@ -42,15 +42,25 @@ SourceFiles namespace Foam { +template<class Type, class GeoMesh> class DimensionedField; +template<class Type, template<class> class PatchField, class GeoMesh> +class GeometricField; + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Forward Declarations class areaMesh; - template<class Type> class faPatchField; -template<class Type, template<class> class PatchField, class GeoMesh> -class GeometricField; + +//- An area field for a given type +template<class Type> +using AreaField = GeometricField<Type, faPatchField, areaMesh>; + +//- An area internal field for a given type +template<class Type> +using AreaInternalField = DimensionedField<Type, areaMesh>; + // Typedefs diff --git a/src/finiteArea/fields/edgeFields/edgeFields.H b/src/finiteArea/fields/edgeFields/edgeFields.H index 2fe74cfd22d..974dfc7d0a9 100644 --- a/src/finiteArea/fields/edgeFields/edgeFields.H +++ b/src/finiteArea/fields/edgeFields/edgeFields.H @@ -50,8 +50,6 @@ SourceFiles #include "edgeFieldsFwd.H" #include "calculatedFaePatchFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - #endif // ************************************************************************* // diff --git a/src/finiteArea/fields/edgeFields/edgeFieldsFwd.H b/src/finiteArea/fields/edgeFields/edgeFieldsFwd.H index ab85d286d9e..9f10185f416 100644 --- a/src/finiteArea/fields/edgeFields/edgeFieldsFwd.H +++ b/src/finiteArea/fields/edgeFields/edgeFieldsFwd.H @@ -31,8 +31,8 @@ Description \*---------------------------------------------------------------------------*/ -#ifndef edgeFieldsFwd_H -#define edgeFieldsFwd_H +#ifndef Foam_edgeFieldsFwd_H +#define Foam_edgeFieldsFwd_H #include "fieldTypes.H" @@ -41,15 +41,21 @@ Description namespace Foam { +template<class Type, template<class> class PatchField, class GeoMesh> +class GeometricField; + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Forward Declarations class edgeMesh; - template<class Type> class faePatchField; -template<class Type, template<class> class PatchField, class GeoMesh> -class GeometricField; + +/// Future? (TBD) +/// //- An (area) edge field for a given type +/// template<class Type> +/// using EdgeField = GeometricField<Type, faePatchField, edgeMesh>; + // Typedefs @@ -60,6 +66,7 @@ typedef GeometricField<sphericalTensor, faePatchField, edgeMesh> typedef GeometricField<symmTensor, faePatchField, edgeMesh> edgeSymmTensorField; typedef GeometricField<tensor, faePatchField, edgeMesh> edgeTensorField; + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/finiteVolume/fields/surfaceFields/slicedSurfaceFields.H b/src/finiteVolume/fields/surfaceFields/slicedSurfaceFields.H index 050e590d663..f425c30a908 100644 --- a/src/finiteVolume/fields/surfaceFields/slicedSurfaceFields.H +++ b/src/finiteVolume/fields/surfaceFields/slicedSurfaceFields.H @@ -28,8 +28,8 @@ InClass \*---------------------------------------------------------------------------*/ -#ifndef slicedSurfaceFields_H -#define slicedSurfaceFields_H +#ifndef Foam_slicedSurfaceFields_H +#define Foam_slicedSurfaceFields_H #include "SlicedGeometricField.H" #include "slicedFvsPatchField.H" diff --git a/src/finiteVolume/fields/surfaceFields/slicedSurfaceFieldsFwd.H b/src/finiteVolume/fields/surfaceFields/slicedSurfaceFieldsFwd.H index 89ac6ceefef..9434756da85 100644 --- a/src/finiteVolume/fields/surfaceFields/slicedSurfaceFieldsFwd.H +++ b/src/finiteVolume/fields/surfaceFields/slicedSurfaceFieldsFwd.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation + Copyright (C) 2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -28,8 +29,8 @@ InClass \*---------------------------------------------------------------------------*/ -#ifndef slicedSurfaceFieldsFwd_H -#define slicedSurfaceFieldsFwd_H +#ifndef Foam_slicedSurfaceFieldsFwd_H +#define Foam_slicedSurfaceFieldsFwd_H #include "fieldTypes.H" @@ -38,16 +39,6 @@ InClass namespace Foam { -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -class surfaceMesh; - -template<class Type> -class fvsPatchField; - -template<class Type> -class slicedFvsPatchField; - template < class Type, @@ -57,6 +48,23 @@ template > class SlicedGeometricField; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// Forward Declarations +class surfaceMesh; +template<class Type> class fvsPatchField; +template<class Type> class slicedFvsPatchField; + + +//- A (volume) surface field slice for a given type +template<class Type> +using SurfaceSliceField = +SlicedGeometricField<Type, fvsPatchField, slicedFvsPatchField, surfaceMesh>; + + +// Typedefs + typedef SlicedGeometricField<scalar, fvsPatchField, slicedFvsPatchField, surfaceMesh> slicedSurfaceScalarField; @@ -89,6 +97,7 @@ typedef SlicedGeometricField<tensor, fvsPatchField, slicedFvsPatchField, surfaceMesh> slicedSurfaceTensorField; + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/finiteVolume/fields/surfaceFields/surfaceFields.C b/src/finiteVolume/fields/surfaceFields/surfaceFields.C index fd24f7d060c..a9b3d835807 100644 --- a/src/finiteVolume/fields/surfaceFields/surfaceFields.C +++ b/src/finiteVolume/fields/surfaceFields/surfaceFields.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -71,4 +72,19 @@ defineTemplateTypeNameAndDebug(surfaceTensorField, 0); } // End namespace Foam + +// * * * * * * * * * * * * * * * * Global Data * * * * * * * * * * * * * * * // + +// Note hard-coded values are more reliable than other alternatives + +const Foam::wordList Foam::fieldTypes::surface +({ + "surfaceScalarField", + "surfaceVectorField", + "surfaceSphericalTensorField", + "surfaceSymmTensorField", + "surfaceTensorField" +}); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/surfaceFields/surfaceFields.H b/src/finiteVolume/fields/surfaceFields/surfaceFields.H index fc36e810735..146b9610dc8 100644 --- a/src/finiteVolume/fields/surfaceFields/surfaceFields.H +++ b/src/finiteVolume/fields/surfaceFields/surfaceFields.H @@ -34,8 +34,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef surfaceFields_H -#define surfaceFields_H +#ifndef Foam_surfaceFields_H +#define Foam_surfaceFields_H #include "GeometricFields.H" #include "surfaceMesh.H" @@ -44,8 +44,6 @@ SourceFiles #include "surfaceFieldsFwd.H" #include "calculatedFvsPatchFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - #endif // ************************************************************************* // diff --git a/src/finiteVolume/fields/surfaceFields/surfaceFieldsFwd.H b/src/finiteVolume/fields/surfaceFields/surfaceFieldsFwd.H index 1127044043a..32593064f9f 100644 --- a/src/finiteVolume/fields/surfaceFields/surfaceFieldsFwd.H +++ b/src/finiteVolume/fields/surfaceFields/surfaceFieldsFwd.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation + Copyright (C) 2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -33,8 +34,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef surfaceFieldsFwd_H -#define surfaceFieldsFwd_H +#ifndef Foam_surfaceFieldsFwd_H +#define Foam_surfaceFieldsFwd_H #include "fieldTypes.H" @@ -43,15 +44,21 @@ SourceFiles namespace Foam { +template<class Type, template<class> class PatchField, class GeoMesh> +class GeometricField; + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Forward Declarations class surfaceMesh; - template<class Type> class fvsPatchField; -template<class Type, template<class> class PatchField, class GeoMesh> -class GeometricField; + +//- A (volume) surface field for a given type +template<class Type> +using SurfaceField = GeometricField<Type, fvsPatchField, surfaceMesh>; + // Typedefs @@ -63,6 +70,19 @@ typedef GeometricField<symmTensor, fvsPatchField, surfaceMesh> surfaceSymmTensorField; typedef GeometricField<tensor, fvsPatchField, surfaceMesh> surfaceTensorField; + +/*---------------------------------------------------------------------------*\ + Namespace fieldTypes Declaration +\*---------------------------------------------------------------------------*/ + +namespace fieldTypes +{ + //- Standard surface field types (scalar, vector, tensor, etc) + extern const wordList surface; + +} // End namespace fieldTypes + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/finiteVolume/fields/volFields/slicedVolFields.H b/src/finiteVolume/fields/volFields/slicedVolFields.H index b3e8af02a19..ab7cdf5186f 100644 --- a/src/finiteVolume/fields/volFields/slicedVolFields.H +++ b/src/finiteVolume/fields/volFields/slicedVolFields.H @@ -28,16 +28,14 @@ InClass \*---------------------------------------------------------------------------*/ -#ifndef slicedVolFields_H -#define slicedVolFields_H +#ifndef Foam_slicedVolFields_H +#define Foam_slicedVolFields_H #include "SlicedGeometricField.H" #include "slicedFvPatchField.H" #include "volMesh.H" #include "slicedVolFieldsFwd.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - #endif // ************************************************************************* // diff --git a/src/finiteVolume/fields/volFields/slicedVolFieldsFwd.H b/src/finiteVolume/fields/volFields/slicedVolFieldsFwd.H index 31d24ae9dcc..95e766c0478 100644 --- a/src/finiteVolume/fields/volFields/slicedVolFieldsFwd.H +++ b/src/finiteVolume/fields/volFields/slicedVolFieldsFwd.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation + Copyright (C) 2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -28,8 +29,8 @@ InClass \*---------------------------------------------------------------------------*/ -#ifndef slicedVolFieldsFwd_H -#define slicedVolFieldsFwd_H +#ifndef Foam_slicedVolFieldsFwd_H +#define Foam_slicedVolFieldsFwd_H #include "fieldTypes.H" @@ -38,16 +39,6 @@ InClass namespace Foam { -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -class volMesh; - -template<class Type> -class fvPatchField; - -template<class Type> -class slicedFvPatchField; - template < class Type, @@ -57,6 +48,22 @@ template > class SlicedGeometricField; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// Forward Declarations +class volMesh; +template<class Type> class fvPatchField; +template<class Type> class slicedFvPatchField; + +//- A volume field slice for a given type +template<class Type> +using VolumeSliceField = +SlicedGeometricField<Type, fvPatchField, slicedFvPatchField, volMesh>; + + +// Typedefs + typedef SlicedGeometricField<scalar, fvPatchField, slicedFvPatchField, volMesh> slicedVolScalarField; diff --git a/src/finiteVolume/fields/volFields/volFieldsFwd.H b/src/finiteVolume/fields/volFields/volFieldsFwd.H index b6a202c0b12..7e063d23ecc 100644 --- a/src/finiteVolume/fields/volFields/volFieldsFwd.H +++ b/src/finiteVolume/fields/volFields/volFieldsFwd.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -35,26 +35,36 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef volFieldsFwd_H -#define volFieldsFwd_H +#ifndef Foam_volFieldsFwd_H +#define Foam_volFieldsFwd_H #include "fieldTypes.H" -#include "wordList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { +template<class Type, class GeoMesh> class DimensionedField; +template<class Type, template<class> class PatchField, class GeoMesh> +class GeometricField; + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Forward Declarations class volMesh; - template<class Type> class fvPatchField; -template<class Type, template<class> class PatchField, class GeoMesh> -class GeometricField; + +//- A volume field for a given type +template<class Type> +using VolumeField = GeometricField<Type, fvPatchField, volMesh>; + +//- A volume internal field for a given Type +template<class Type> +using VolumeInternalField = DimensionedField<Type, volMesh>; + // Typedefs diff --git a/src/meshTools/Make/files b/src/meshTools/Make/files index c81d1cc16e6..3de09233f00 100644 --- a/src/meshTools/Make/files +++ b/src/meshTools/Make/files @@ -81,7 +81,7 @@ meshSearch/meshSearch.C meshSearch/meshSearchFACE_CENTRE_TRISMeshObject.C meshSearch/meshSearchMeshObject.C -fields/polyFields.C +fields/polyMeshFields.C meshTools/meshTools.C algorithms = algorithms diff --git a/src/meshTools/fields/polyGeoMesh.H b/src/meshTools/fields/polyGeoMesh.H index e5166371f65..dd7e5c483a7 100644 --- a/src/meshTools/fields/polyGeoMesh.H +++ b/src/meshTools/fields/polyGeoMesh.H @@ -31,8 +31,8 @@ Description \*---------------------------------------------------------------------------*/ -#ifndef polyGeoMesh_H -#define polyGeoMesh_H +#ifndef Foam_polyGeoMesh_H +#define Foam_polyGeoMesh_H #include "GeoMesh.H" #include "polyMesh.H" diff --git a/src/meshTools/fields/polyFields.C b/src/meshTools/fields/polyMeshFields.C similarity index 98% rename from src/meshTools/fields/polyFields.C rename to src/meshTools/fields/polyMeshFields.C index 24e1fe3e4d8..3d222f1bea9 100644 --- a/src/meshTools/fields/polyFields.C +++ b/src/meshTools/fields/polyMeshFields.C @@ -25,13 +25,13 @@ License \*---------------------------------------------------------------------------*/ -#include "polyFields.H" +#include "polyMeshFields.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - // Naming to shadow volScalarField::Internal etc. // keep synchronized with finiteVolume volFields.C @@ -70,4 +70,5 @@ const word DimensionedField<tensor, polyGeoMesh>::typeName } // End namespace Foam + // ************************************************************************* // diff --git a/src/surfMesh/surfMesh/fields/surfPointFields.C b/src/meshTools/fields/polyMeshFields.H similarity index 60% rename from src/surfMesh/surfMesh/fields/surfPointFields.C rename to src/meshTools/fields/polyMeshFields.H index ae049a5560d..13dcc5d4b2c 100644 --- a/src/surfMesh/surfMesh/fields/surfPointFields.C +++ b/src/meshTools/fields/polyMeshFields.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2011 OpenFOAM Foundation + Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -23,40 +23,25 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. -\*---------------------------------------------------------------------------*/ - -#include "surfPointFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ +InClass + Foam::polyMeshFields -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +Description + A polyMesh-based naming and storage for internal volume fields when a + Foam::fvMesh is unavailable. Use sparingly. -template<> -const word surfPointLabelField::typeName("surfPointLabelField"); +SourceFields + polyMeshFields.C -template<> -const word surfPointScalarField::typeName("surfPointScalarField"); - -template<> -const word surfPointVectorField::typeName("surfPointVectorField"); - -template<> -const word surfPointSphericalTensorField::typeName -( - "surfPointSphericalTensorField" -); - -template<> -const word surfPointSymmTensorField::typeName("surfPointSymmTensorField"); +\*---------------------------------------------------------------------------*/ -template<> -const word surfPointTensorField::typeName("surfPointTensorField"); +#ifndef Foam_polyMeshFields_H +#define Foam_polyMeshFields_H -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "DimensionedField.H" +#include "polyGeoMesh.H" +#include "polyMeshFieldsFwd.H" -} // End namespace Foam +#endif // ************************************************************************* // diff --git a/src/meshTools/fields/polyFields.H b/src/meshTools/fields/polyMeshFieldsFwd.H similarity index 71% rename from src/meshTools/fields/polyFields.H rename to src/meshTools/fields/polyMeshFieldsFwd.H index 92056882451..448e43e0c9b 100644 --- a/src/meshTools/fields/polyFields.H +++ b/src/meshTools/fields/polyMeshFieldsFwd.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -23,36 +23,32 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. -InClass - Foam::polyFields - -Description - A polyMesh-based naming and storage for internal volume fields when a - Foam::fvMesh is unavailable. Use sparingly. - -SourceFields - polyFields.C - \*---------------------------------------------------------------------------*/ -#ifndef polyFields_H -#define polyFields_H +#ifndef Foam_polyMeshFieldsFwd_H +#define Foam_polyMeshFieldsFwd_H -#include "DimensionedField.H" -#include "polyGeoMesh.H" +#include "fieldTypes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { +template<class Type, class GeoMesh> class DimensionedField; + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Internal (volume) fields on a polyMesh + +class polyGeoMesh; + +typedef DimensionedField<scalar, polyGeoMesh> polyMeshScalarField; +typedef DimensionedField<vector, polyGeoMesh> polyMeshVectorField; +typedef DimensionedField<sphericalTensor, polyGeoMesh> + polyMeshSphericalTensorField; +typedef DimensionedField<symmTensor, polyGeoMesh> polyMeshSymmTensorField; +typedef DimensionedField<tensor, polyGeoMesh> polyMeshTensorField; -typedef DimensionedField<scalar,polyGeoMesh> polyScalarField; -typedef DimensionedField<vector,polyGeoMesh> polyVectorField; -typedef DimensionedField<sphericalTensor,polyGeoMesh> polySphericalTensorField; -typedef DimensionedField<symmTensor,polyGeoMesh> polySymmTensorField; -typedef DimensionedField<tensor,polyGeoMesh> polyTensorField; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/sampling/sampledSurface/sampledSurface/sampledSurface.C b/src/sampling/sampledSurface/sampledSurface/sampledSurface.C index 8a45daa9196..6e9c8342bcf 100644 --- a/src/sampling/sampledSurface/sampledSurface/sampledSurface.C +++ b/src/sampling/sampledSurface/sampledSurface/sampledSurface.C @@ -38,16 +38,6 @@ namespace Foam } -const Foam::wordList Foam::sampledSurface::surfaceFieldTypes -({ - "surfaceScalarField", - "surfaceVectorField", - "surfaceSphericalTensorField", - "surfaceSymmTensorField", - "surfaceTensorField" -}); - - // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // void Foam::sampledSurface::clearGeom() const diff --git a/src/sampling/sampledSurface/sampledSurface/sampledSurface.H b/src/sampling/sampledSurface/sampledSurface/sampledSurface.H index e9d8bba81dc..014d93a1624 100644 --- a/src/sampling/sampledSurface/sampledSurface/sampledSurface.H +++ b/src/sampling/sampledSurface/sampledSurface/sampledSurface.H @@ -98,16 +98,6 @@ class sampledSurface : public meshedSurf { -public: - - // Public Static Data - - //- Class names for surface field types - static const wordList surfaceFieldTypes; - - -private: - // Private Data //- The name of the sample surface diff --git a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C index 615b7a2b942..b35d2752bdc 100644 --- a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C +++ b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C @@ -31,6 +31,7 @@ License #include "mapPolyMesh.H" #include "volFields.H" +#include "surfaceFields.H" #include "HashOps.H" #include "ListOps.H" #include "Time.H" @@ -159,7 +160,7 @@ Foam::IOobjectList Foam::sampledSurfaces::preCheckFields() { nVolumeFields += n; } - else if (sampledSurface::surfaceFieldTypes.found(clsName)) + else if (fieldTypes::surface.found(clsName)) { nSurfaceFields += n; } diff --git a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfacesTemplates.C b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfacesTemplates.C index ef445ef9d64..bca73a8c877 100644 --- a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfacesTemplates.C +++ b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfacesTemplates.C @@ -31,7 +31,6 @@ License #include "surfaceFields.H" #include "polySurface.H" #include "polySurfaceFields.H" -#include "polySurfacePointFields.H" #include "surfMesh.H" #include "surfGeoMesh.H" diff --git a/src/surfMesh/Make/files b/src/surfMesh/Make/files index eac20cc94a2..67e68eea3d1 100644 --- a/src/surfMesh/Make/files +++ b/src/surfMesh/Make/files @@ -10,14 +10,12 @@ polySurface/polySurface.C polySurface/polySurfaceClear.C polySurface/polySurfaceIO.C polySurface/fields/polySurfaceFields.C -polySurface/fields/polySurfacePointFields.C surfaceRegistry/surfaceRegistry.C surfMesh/surfMesh.C surfMesh/surfMeshClear.C surfMesh/surfMeshIO.C surfMesh/fields/surfFields.C -surfMesh/fields/surfPointFields.C surfZone/surfZone.C surfZone/surfZoneIOList.C diff --git a/src/surfMesh/polySurface/fields/polySurfaceFields.C b/src/surfMesh/polySurface/fields/polySurfaceFields.C index 8352df5e62d..585ba1f44eb 100644 --- a/src/surfMesh/polySurface/fields/polySurfaceFields.C +++ b/src/surfMesh/polySurface/fields/polySurfaceFields.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -26,41 +26,36 @@ License \*---------------------------------------------------------------------------*/ #include "polySurfaceFields.H" +#include "className.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -template<> -const word polySurfaceLabelField::typeName -("polySurfaceLabelField"); - -template<> -const word polySurfaceScalarField::typeName -("polySurfaceScalarField"); +// Face fields -template<> -const word polySurfaceVectorField::typeName -("polySurfaceVectorField"); +defineTemplateTypeName(polySurfaceLabelField); +defineTemplateTypeName(polySurfaceScalarField); +defineTemplateTypeName(polySurfaceVectorField); +defineTemplateTypeName(polySurfaceSphericalTensorField); +defineTemplateTypeName(polySurfaceSymmTensorField); +defineTemplateTypeName(polySurfaceTensorField); -template<> -const word polySurfaceSphericalTensorField::typeName -("polySurfaceSphericalTensorField"); -template<> -const word polySurfaceSymmTensorField::typeName -("polySurfaceSymmTensorField"); +// Point fields -template<> -const word polySurfaceTensorField::typeName -("polySurfaceTensorField"); +defineTemplateTypeName(polySurfacePointLabelField); +defineTemplateTypeName(polySurfacePointScalarField); +defineTemplateTypeName(polySurfacePointVectorField); +defineTemplateTypeName(polySurfacePointSphericalTensorField); +defineTemplateTypeName(polySurfacePointSymmTensorField); +defineTemplateTypeName(polySurfacePointTensorField); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam + // ************************************************************************* // diff --git a/src/surfMesh/polySurface/fields/polySurfaceFields.H b/src/surfMesh/polySurface/fields/polySurfaceFields.H index 174a688acf3..554480dce4e 100644 --- a/src/surfMesh/polySurface/fields/polySurfaceFields.H +++ b/src/surfMesh/polySurface/fields/polySurfaceFields.H @@ -27,22 +27,21 @@ InClass Foam::polySurfaceFields Description - Fields for polySurface + Fields (face and point) for polySurface SourceFiles polySurfaceFields.C \*---------------------------------------------------------------------------*/ -#ifndef polySurfaceFields_H -#define polySurfaceFields_H +#ifndef Foam_polySurfaceFields_H +#define Foam_polySurfaceFields_H #include "DimensionedField.H" #include "polySurfaceGeoMesh.H" +#include "polySurfacePointGeoMesh.H" #include "polySurfaceFieldsFwd.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - #endif // ************************************************************************* // diff --git a/src/surfMesh/polySurface/fields/polySurfaceFieldsFwd.H b/src/surfMesh/polySurface/fields/polySurfaceFieldsFwd.H index fc291ca7cf0..8bf25faa3ab 100644 --- a/src/surfMesh/polySurface/fields/polySurfaceFieldsFwd.H +++ b/src/surfMesh/polySurface/fields/polySurfaceFieldsFwd.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -25,24 +25,30 @@ License \*---------------------------------------------------------------------------*/ -#ifndef polySurfacePointFieldsFwd_H -#define polySurfacePointFieldsFwd_H +#ifndef Foam_polySurfaceFieldsFwd_H +#define Foam_polySurfaceFieldsFwd_H #include "fieldTypes.H" -#include "polySurface.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +template<class Type, class GeoMesh> class DimensionedField; + -template<class Type, class GeoMesh> -class DimensionedField; +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Face Fields class polySurfaceGeoMesh; +//- A field on polySurface faces for a given type +template<class Type> +using PolyFaceField = DimensionedField<Type, polySurfaceGeoMesh>; + + +// Typedefs typedef DimensionedField<label, polySurfaceGeoMesh> polySurfaceLabelField; @@ -62,8 +68,17 @@ typedef Foam::DimensionedField<tensor, polySurfaceGeoMesh> polySurfaceTensorField; +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Point Fields + class polySurfacePointGeoMesh; +//- A field on polySurface face points for a given type +template<class Type> +using PolyPointField = DimensionedField<Type, polySurfacePointGeoMesh>; + + +// Typedefs typedef Foam::DimensionedField<label, polySurfacePointGeoMesh> polySurfacePointLabelField; diff --git a/src/surfMesh/polySurface/fields/polySurfaceGeoMesh.H b/src/surfMesh/polySurface/fields/polySurfaceGeoMesh.H index ff9a5899678..ca27467eb42 100644 --- a/src/surfMesh/polySurface/fields/polySurfaceGeoMesh.H +++ b/src/surfMesh/polySurface/fields/polySurfaceGeoMesh.H @@ -31,8 +31,8 @@ Description \*---------------------------------------------------------------------------*/ -#ifndef polySurfaceGeoMesh_H -#define polySurfaceGeoMesh_H +#ifndef Foam_polySurfaceGeoMesh_H +#define Foam_polySurfaceGeoMesh_H #include "polySurface.H" #include "GeoMesh.H" diff --git a/src/surfMesh/polySurface/fields/polySurfacePointFields.C b/src/surfMesh/polySurface/fields/polySurfacePointFields.C deleted file mode 100644 index 24b339d8cbf..00000000000 --- a/src/surfMesh/polySurface/fields/polySurfacePointFields.C +++ /dev/null @@ -1,66 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | www.openfoam.com - \\/ M anipulation | -------------------------------------------------------------------------------- - 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/>. - -\*---------------------------------------------------------------------------*/ - -#include "polySurfacePointFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -template<> -const word polySurfacePointLabelField::typeName -("polySurfacePointLabelField"); - -template<> -const word polySurfacePointScalarField::typeName -("polySurfacePointScalarField"); - -template<> -const word polySurfacePointVectorField::typeName -("polySurfacePointVectorField"); - -template<> -const word polySurfacePointSphericalTensorField::typeName -("polySurfacePointSphericalTensorField"); - -template<> -const word polySurfacePointSymmTensorField::typeName -("polySurfacePointSymmTensorField"); - -template<> -const word polySurfacePointTensorField::typeName -("polySurfacePointTensorField"); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/surfMesh/polySurface/fields/polySurfacePointFields.H b/src/surfMesh/polySurface/fields/polySurfacePointFields.H index 1918268d7c1..b67442d3aea 100644 --- a/src/surfMesh/polySurface/fields/polySurfacePointFields.H +++ b/src/surfMesh/polySurface/fields/polySurfacePointFields.H @@ -1,48 +1,9 @@ /*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | www.openfoam.com - \\/ M anipulation | -------------------------------------------------------------------------------- - 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/>. - -InClass - Foam::polySurfacePointFields - Description - Point fields for polySurface - -SourceFiles - polySurfacePointFields.C + Compatibility include (JAN-2022) \*---------------------------------------------------------------------------*/ -#ifndef polySurfacePointFields_H -#define polySurfacePointFields_H - -#include "DimensionedField.H" -#include "polySurfacePointGeoMesh.H" -#include "polySurfacePointFieldsFwd.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif +#include "polySurfaceFields.H" // ************************************************************************* // diff --git a/src/surfMesh/polySurface/fields/polySurfacePointFieldsFwd.H b/src/surfMesh/polySurface/fields/polySurfacePointFieldsFwd.H index 342595ba058..7089d355bc4 100644 --- a/src/surfMesh/polySurface/fields/polySurfacePointFieldsFwd.H +++ b/src/surfMesh/polySurface/fields/polySurfacePointFieldsFwd.H @@ -1,73 +1,9 @@ /*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | www.openfoam.com - \\/ M anipulation | -------------------------------------------------------------------------------- - 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/>. +Description + Compatibility include (JAN-2022) \*---------------------------------------------------------------------------*/ -#ifndef polySurfacePointFieldsFwd_H -#define polySurfacePointFieldsFwd_H - -#include "fieldTypes.H" -#include "polySurface.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -template<class Type, class GeoMesh> -class DimensionedField; - -class polySurfacePointGeoMesh; - -typedef Foam::DimensionedField<label, polySurfacePointGeoMesh> - polySurfacePointLabelField; - -typedef Foam::DimensionedField<scalar, polySurfacePointGeoMesh> - polySurfacePointScalarField; - -typedef Foam::DimensionedField<vector, polySurfacePointGeoMesh> - polySurfacePointVectorField; - -typedef Foam::DimensionedField<sphericalTensor, polySurfacePointGeoMesh> - polySurfacePointSphericalTensorField; - -typedef Foam::DimensionedField<symmTensor, polySurfacePointGeoMesh> - polySurfacePointSymmTensorField; - -typedef Foam::DimensionedField<tensor, polySurfacePointGeoMesh> - polySurfacePointTensorField; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif +#include "polySurfaceFieldsFwd.H" // ************************************************************************* // diff --git a/src/surfMesh/polySurface/fields/polySurfacePointGeoMesh.H b/src/surfMesh/polySurface/fields/polySurfacePointGeoMesh.H index 8845522109c..ac4a761d9cd 100644 --- a/src/surfMesh/polySurface/fields/polySurfacePointGeoMesh.H +++ b/src/surfMesh/polySurface/fields/polySurfacePointGeoMesh.H @@ -31,8 +31,8 @@ Description \*---------------------------------------------------------------------------*/ -#ifndef polySurfacePointGeoMesh_H -#define polySurfacePointGeoMesh_H +#ifndef Foam_polySurfacePointGeoMesh_H +#define Foam_polySurfacePointGeoMesh_H #include "polySurface.H" #include "GeoMesh.H" diff --git a/src/surfMesh/polySurface/polySurface.H b/src/surfMesh/polySurface/polySurface.H index 45cdff160fd..2a23c6fe0fd 100644 --- a/src/surfMesh/polySurface/polySurface.H +++ b/src/surfMesh/polySurface/polySurface.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019-2021 OpenCFD Ltd. + Copyright (C) 2019-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -38,14 +38,13 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef polySurface_H -#define polySurface_H +#ifndef Foam_polySurface_H +#define Foam_polySurface_H #include "objectRegistry.H" #include "PrimitivePatch.H" #include "meshedSurf.H" #include "polySurfaceFieldsFwd.H" -#include "polySurfacePointFieldsFwd.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/surfMesh/polySurface/polySurfaceTemplates.C b/src/surfMesh/polySurface/polySurfaceTemplates.C index 4d697eb0393..78f281f2343 100644 --- a/src/surfMesh/polySurface/polySurfaceTemplates.C +++ b/src/surfMesh/polySurface/polySurfaceTemplates.C @@ -27,7 +27,6 @@ License #include "polySurface.H" #include "polySurfaceFields.H" -#include "polySurfacePointFields.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // diff --git a/src/surfMesh/surfMesh/fields/surfFields.C b/src/surfMesh/surfMesh/fields/surfFields.C index 4aeeecc01b7..8a04e20acc4 100644 --- a/src/surfMesh/surfMesh/fields/surfFields.C +++ b/src/surfMesh/surfMesh/fields/surfFields.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation + Copyright (C) 2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -26,34 +27,36 @@ License \*---------------------------------------------------------------------------*/ #include "surfFields.H" +#include "className.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// Face fields -template<> -const word surfLabelField::typeName("surfLabelField"); +defineTemplateTypeName(surfLabelField); +defineTemplateTypeName(surfScalarField); +defineTemplateTypeName(surfVectorField); +defineTemplateTypeName(surfSphericalTensorField); +defineTemplateTypeName(surfSymmTensorField); +defineTemplateTypeName(surfTensorField); -template<> -const word surfScalarField::typeName("surfScalarField"); -template<> -const word surfVectorField::typeName("surfVectorField"); +// Point fields -template<> -const word surfSphericalTensorField::typeName("surfSphericalTensorField"); +defineTemplateTypeName(surfPointLabelField); +defineTemplateTypeName(surfPointScalarField); +defineTemplateTypeName(surfPointVectorField); +defineTemplateTypeName(surfPointSphericalTensorField); +defineTemplateTypeName(surfPointSymmTensorField); +defineTemplateTypeName(surfPointTensorField); -template<> -const word surfSymmTensorField::typeName("surfSymmTensorField"); - -template<> -const word surfTensorField::typeName("surfTensorField"); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam + // ************************************************************************* // diff --git a/src/surfMesh/surfMesh/fields/surfFields.H b/src/surfMesh/surfMesh/fields/surfFields.H index 578cf216a68..6c60030fff6 100644 --- a/src/surfMesh/surfMesh/fields/surfFields.H +++ b/src/surfMesh/surfMesh/fields/surfFields.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation + Copyright (C) 2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -34,15 +35,14 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef surfFields_H -#define surfFields_H +#ifndef Foam_surfFields_H +#define Foam_surfFields_H #include "DimensionedField.H" #include "surfGeoMesh.H" +#include "surfPointGeoMesh.H" #include "surfFieldsFwd.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - #endif // ************************************************************************* // diff --git a/src/surfMesh/surfMesh/fields/surfFieldsFwd.H b/src/surfMesh/surfMesh/fields/surfFieldsFwd.H index dfbcc0119ba..6d0da8f573a 100644 --- a/src/surfMesh/surfMesh/fields/surfFieldsFwd.H +++ b/src/surfMesh/surfMesh/fields/surfFieldsFwd.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation + Copyright (C) 2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -25,8 +26,8 @@ License \*---------------------------------------------------------------------------*/ -#ifndef surfFieldsFwd_H -#define surfFieldsFwd_H +#ifndef Foam_surfFieldsFwd_H +#define Foam_surfFieldsFwd_H #include "fieldTypes.H" @@ -35,19 +36,58 @@ License namespace Foam { +template<class Type, class GeoMesh> class DimensionedField; + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Face Fields class surfGeoMesh; -template<class Type, class GeoMesh> -class DimensionedField; +// Typedefs +typedef DimensionedField<label, surfGeoMesh> + surfLabelField; + +typedef DimensionedField<scalar, surfGeoMesh> + surfScalarField; + +typedef DimensionedField<vector, surfGeoMesh> + surfVectorField; + +typedef DimensionedField<sphericalTensor, surfGeoMesh> + surfSphericalTensorField; + +typedef DimensionedField<symmTensor, surfGeoMesh> + surfSymmTensorField; + +typedef DimensionedField<tensor, surfGeoMesh> + surfTensorField; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Point Fields + +class surfPointGeoMesh; + +// Typedefs +typedef DimensionedField<label, surfPointGeoMesh> + surfPointLabelField; + +typedef DimensionedField<scalar, surfPointGeoMesh> + surfPointScalarField; + +typedef DimensionedField<vector, surfPointGeoMesh> + surfPointVectorField; + +typedef DimensionedField<sphericalTensor, surfPointGeoMesh> + surfPointSphericalTensorField; + +typedef DimensionedField<symmTensor, surfPointGeoMesh> + surfPointSymmTensorField; + +typedef DimensionedField<tensor, surfPointGeoMesh> + surfPointTensorField; -typedef DimensionedField<label, surfGeoMesh> surfLabelField; -typedef DimensionedField<scalar, surfGeoMesh> surfScalarField; -typedef DimensionedField<vector, surfGeoMesh> surfVectorField; -typedef DimensionedField<sphericalTensor, surfGeoMesh> surfSphericalTensorField; -typedef DimensionedField<symmTensor, surfGeoMesh> surfSymmTensorField; -typedef DimensionedField<tensor, surfGeoMesh> surfTensorField; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/surfMesh/surfMesh/fields/surfGeoMesh.H b/src/surfMesh/surfMesh/fields/surfGeoMesh.H index 461e59f8a22..ae142479dcc 100644 --- a/src/surfMesh/surfMesh/fields/surfGeoMesh.H +++ b/src/surfMesh/surfMesh/fields/surfGeoMesh.H @@ -32,8 +32,8 @@ Description \*---------------------------------------------------------------------------*/ -#ifndef surfGeoMesh_H -#define surfGeoMesh_H +#ifndef Foam_surfGeoMesh_H +#define Foam_surfGeoMesh_H #include "GeoMesh.H" #include "surfMesh.H" diff --git a/src/surfMesh/surfMesh/fields/surfPointFields.H b/src/surfMesh/surfMesh/fields/surfPointFields.H index 25e7895e703..47a216935c8 100644 --- a/src/surfMesh/surfMesh/fields/surfPointFields.H +++ b/src/surfMesh/surfMesh/fields/surfPointFields.H @@ -1,48 +1,9 @@ /*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | www.openfoam.com - \\/ M anipulation | -------------------------------------------------------------------------------- - Copyright (C) 2011 OpenFOAM Foundation -------------------------------------------------------------------------------- -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::surfPointFields - Description - Point fields for surfMesh - -SourceFiles - surfPointFields.C + Compatibility include (JAN-2022) \*---------------------------------------------------------------------------*/ -#ifndef surfPointFields_H -#define surfPointFields_H - -#include "DimensionedField.H" -#include "surfPointGeoMesh.H" -#include "surfPointFieldsFwd.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif +#include "surfFields.H" // ************************************************************************* // diff --git a/src/surfMesh/surfMesh/fields/surfPointFieldsFwd.H b/src/surfMesh/surfMesh/fields/surfPointFieldsFwd.H index f9508f7323f..d630f21f768 100644 --- a/src/surfMesh/surfMesh/fields/surfPointFieldsFwd.H +++ b/src/surfMesh/surfMesh/fields/surfPointFieldsFwd.H @@ -1,66 +1,9 @@ /*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | www.openfoam.com - \\/ M anipulation | -------------------------------------------------------------------------------- - Copyright (C) 2011 OpenFOAM Foundation -------------------------------------------------------------------------------- -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/>. +Description + Compatibility include (JAN-2022) \*---------------------------------------------------------------------------*/ -#ifndef surfPointFieldsFwd_H -#define surfPointFieldsFwd_H - -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -class surfPointGeoMesh; - -template<class Type, class GeoMesh> -class DimensionedField; - -typedef DimensionedField<label, surfPointGeoMesh> - surfPointLabelField; -typedef DimensionedField<scalar, surfPointGeoMesh> - surfPointScalarField; -typedef DimensionedField<vector, surfPointGeoMesh> - surfPointVectorField; -typedef DimensionedField<sphericalTensor, surfPointGeoMesh> - surfPointSphericalTensorField; -typedef DimensionedField<symmTensor, surfPointGeoMesh> - surfPointSymmTensorField; -typedef DimensionedField<tensor, surfPointGeoMesh> - surfPointTensorField; - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif +#include "surfFieldsFwd.H" // ************************************************************************* // diff --git a/src/surfMesh/surfMesh/fields/surfPointGeoMesh.H b/src/surfMesh/surfMesh/fields/surfPointGeoMesh.H index c77fc40a377..f3bc8745b78 100644 --- a/src/surfMesh/surfMesh/fields/surfPointGeoMesh.H +++ b/src/surfMesh/surfMesh/fields/surfPointGeoMesh.H @@ -34,8 +34,8 @@ Description \*---------------------------------------------------------------------------*/ -#ifndef surfPointGeoMesh_H -#define surfPointGeoMesh_H +#ifndef Foam_surfPointGeoMesh_H +#define Foam_surfPointGeoMesh_H #include "GeoMesh.H" #include "surfMesh.H" diff --git a/src/surfMesh/triSurface/fields/triSurfaceFields.C b/src/surfMesh/triSurface/fields/triSurfaceFields.C index 4686555d455..5d987915975 100644 --- a/src/surfMesh/triSurface/fields/triSurfaceFields.C +++ b/src/surfMesh/triSurface/fields/triSurfaceFields.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation + Copyright (C) 2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -26,58 +27,34 @@ License \*---------------------------------------------------------------------------*/ #include "triSurfaceFields.H" +#include "className.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -template<> -const word triSurfaceLabelField::typeName("triSurfaceLabelField"); - -template<> -const word triSurfaceScalarField::typeName("triSurfaceScalarField"); - -template<> -const word triSurfaceVectorField::typeName("triSurfaceVectorField"); - -template<> -const word triSurfaceSphericalTensorField::typeName -("triSurfaceSphericalTensorField"); - -template<> -const word triSurfaceSymmTensorField::typeName -("triSurfaceSymmTensorField"); +// Face fields +defineTemplateTypeName(triSurfaceLabelField); +defineTemplateTypeName(triSurfaceScalarField); +defineTemplateTypeName(triSurfaceVectorField); +defineTemplateTypeName(triSurfaceSphericalTensorField); +defineTemplateTypeName(triSurfaceSymmTensorField); +defineTemplateTypeName(triSurfaceTensorField); -template<> -const word triSurfaceTensorField::typeName("triSurfaceTensorField"); +// Point fields -template<> -const word triSurfacePointLabelField::typeName("triSurfacePointLabelField"); - -template<> -const word triSurfacePointScalarField::typeName("triSurfacePointScalarField"); - -template<> -const word triSurfacePointVectorField::typeName("triSurfacePointVectorField"); - -template<> -const word triSurfacePointSphericalTensorField::typeName -("triSurfacePointSphericalTensorField"); - -template<> -const word triSurfacePointSymmTensorField::typeName -("triSurfacePointSymmTensorField"); - -template<> -const word triSurfacePointTensorField::typeName("triSurfacePointTensorField"); - +defineTemplateTypeName(triSurfacePointLabelField); +defineTemplateTypeName(triSurfacePointScalarField); +defineTemplateTypeName(triSurfacePointVectorField); +defineTemplateTypeName(triSurfacePointSphericalTensorField); +defineTemplateTypeName(triSurfacePointSymmTensorField); +defineTemplateTypeName(triSurfacePointTensorField); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam + // ************************************************************************* // diff --git a/src/surfMesh/triSurface/fields/triSurfaceFields.H b/src/surfMesh/triSurface/fields/triSurfaceFields.H index 3960a6e57e3..64faf07a16a 100644 --- a/src/surfMesh/triSurface/fields/triSurfaceFields.H +++ b/src/surfMesh/triSurface/fields/triSurfaceFields.H @@ -34,16 +34,14 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef triSurfaceFields_H -#define triSurfaceFields_H +#ifndef Foam_triSurfaceFields_H +#define Foam_triSurfaceFields_H #include "DimensionedField.H" #include "triSurfaceGeoMesh.H" #include "triSurfacePointGeoMesh.H" #include "triSurfaceFieldsFwd.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - #endif // ************************************************************************* // diff --git a/src/surfMesh/triSurface/fields/triSurfaceFieldsFwd.H b/src/surfMesh/triSurface/fields/triSurfaceFieldsFwd.H index b2dc0a7c3d1..8cc9387ab20 100644 --- a/src/surfMesh/triSurface/fields/triSurfaceFieldsFwd.H +++ b/src/surfMesh/triSurface/fields/triSurfaceFieldsFwd.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation + Copyright (C) 2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -25,52 +26,68 @@ License \*---------------------------------------------------------------------------*/ -#ifndef triSurfaceFieldsFwd_H -#define triSurfaceFieldsFwd_H +#ifndef Foam_triSurfaceFieldsFwd_H +#define Foam_triSurfaceFieldsFwd_H #include "fieldTypes.H" -#include "triSurface.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +template<class Type, class GeoMesh> class DimensionedField; + -template<class Type, class GeoMesh> -class DimensionedField; +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Face Fields class triSurfaceGeoMesh; +// Typedefs typedef Foam::DimensionedField<label, triSurfaceGeoMesh> triSurfaceLabelField; + typedef Foam::DimensionedField<scalar, triSurfaceGeoMesh> triSurfaceScalarField; + typedef Foam::DimensionedField<vector, triSurfaceGeoMesh> triSurfaceVectorField; + typedef Foam::DimensionedField<sphericalTensor, triSurfaceGeoMesh> triSurfaceSphericalTensorField; + typedef Foam::DimensionedField<symmTensor, triSurfaceGeoMesh> triSurfaceSymmTensorField; + typedef Foam::DimensionedField<tensor, triSurfaceGeoMesh> triSurfaceTensorField; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Point Fields + class triSurfacePointGeoMesh; typedef Foam::DimensionedField<label, triSurfacePointGeoMesh> triSurfacePointLabelField; + typedef Foam::DimensionedField<scalar, triSurfacePointGeoMesh> triSurfacePointScalarField; + typedef Foam::DimensionedField<vector, triSurfacePointGeoMesh> triSurfacePointVectorField; + typedef Foam::DimensionedField<sphericalTensor, triSurfacePointGeoMesh> triSurfacePointSphericalTensorField; + typedef Foam::DimensionedField<symmTensor, triSurfacePointGeoMesh> triSurfacePointSymmTensorField; + typedef Foam::DimensionedField<tensor, triSurfacePointGeoMesh> triSurfacePointTensorField; + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/surfMesh/triSurface/fields/triSurfaceGeoMesh.H b/src/surfMesh/triSurface/fields/triSurfaceGeoMesh.H index 8169b236bcd..e2688a39f10 100644 --- a/src/surfMesh/triSurface/fields/triSurfaceGeoMesh.H +++ b/src/surfMesh/triSurface/fields/triSurfaceGeoMesh.H @@ -32,8 +32,8 @@ Description \*---------------------------------------------------------------------------*/ -#ifndef triSurfaceGeoMesh_H -#define triSurfaceGeoMesh_H +#ifndef Foam_triSurfaceGeoMesh_H +#define Foam_triSurfaceGeoMesh_H #include "GeoMesh.H" #include "triSurface.H" diff --git a/src/surfMesh/triSurface/fields/triSurfacePointGeoMesh.H b/src/surfMesh/triSurface/fields/triSurfacePointGeoMesh.H index e0dad439458..031ff5fb56b 100644 --- a/src/surfMesh/triSurface/fields/triSurfacePointGeoMesh.H +++ b/src/surfMesh/triSurface/fields/triSurfacePointGeoMesh.H @@ -32,8 +32,8 @@ Description \*---------------------------------------------------------------------------*/ -#ifndef triSurfacePointGeoMesh_H -#define triSurfacePointGeoMesh_H +#ifndef Foam_triSurfacePointGeoMesh_H +#define Foam_triSurfacePointGeoMesh_H #include "GeoMesh.H" #include "triSurface.H" -- GitLab