diff --git a/applications/test/surfaceMeshConvert/Test-surfaceMeshConvert.C b/applications/test/surfaceMeshConvert/Test-surfaceMeshConvert.C index 4f5f0cfb396cfd42863e1bfc1a7e6208722ace99..ecfead0f7e00cc7217db84efef7d2bb20f3b6759 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 633cfadf307710aa602d4726a39dc6e8ec57a13b..108812e8185a4fa44f7c97a4004060049a6d8130 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 6341817897ed2a0053ea3229d10e23e8f31828c1..e3d30a848e599fcba4a09abb9e206c3631a3bddf 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 5fbcb0d7cb9047787be011d9ceed152ca3a7b991..a4d245562a2a06bd600aae580b705950734c4760 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 50da0dacbadc1cf32787a8f13d38475ffa6db679..5aeed1de57ab9d850894b52047ef9d8e671ee07c 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 784ea98b641ebd5356059c4f41917c52923093e0..c807f4c4f59b1f5bfacb4fd22104b72fda5604cb 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 2fe74cfd22d6f02ae5c3ccf006246facfb05a733..974dfc7d0a984e3eb117ff6e975d9f55f894abca 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 ab85d286d9ea8063dac596b529d2d8b8c8b0d390..9f10185f416163c748d145c02fb21a6d76e9b06d 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 050e590d6635ebd847315b0e1ed6875f40ad0c3a..f425c30a9083f19bfbedc68ea433a4c9ec77ad46 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 89ac6ceefefbb66415292b366779a8cc1b03ae62..9434756da85bd07f57aaf8b8e1dd489197828693 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 fd24f7d060c7022ee898eb479602194eed184f66..a9b3d835807958cf2293d15b04b6c1fe90b82ae5 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 fc36e810735a7fac7ec3c8f9ff375f30f8452b25..146b9610dc8e842f023ca3c34bcccf755ec190fb 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 1127044043abea886978c29a5701b90db94ff620..32593064f9fb69f5fd804076bdaac1ee14ee68d7 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 b3e8af02a19ba3a9e249eec28525cb29e1b9f647..ab7cdf5186f3bdc2c1ead1173e413b1975fbcf7e 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 31d24ae9dcc33d7d90d1ad87ab0d8e0731b8704b..95e766c0478734cfeb1a6168f48c9577df14d94a 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 b6a202c0b128a241a6ddd927e5b79e3a0e136cff..7e063d23ecc707e937e62663015c45a60237a1ed 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 c81d1cc16e67e7acd2d9a9331d7ee2df941e26c0..3de09233f0076437194cf5a1402756c7f7bcb47d 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 e5166371f659749e466ff22fc3a2a99a27f2aaaf..dd7e5c483a714b76adebf403ffe32546e14e3f02 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 24e1fe3e4d8f44092bdb8a5227254f8632d4330e..3d222f1bea90f08d221559c2b167d0b4994976d9 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 ae049a5560d6e338e2eaa7eb60dd16381850357c..13dcc5d4b2ce733df510371e39e903e1dd113d20 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 9205688245162af782dd9ce0cda23a90eeac58ca..448e43e0c9bd05b32a8e8831bd497742fa1b9ac8 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 8a45daa9196b0d62ead1c80136bda46df5a0884e..6e9c8342bcf7f55720873c7252a0685a4dc43a46 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 e9d8bba81dc395bb91aaca30bf4cd6fb64f29b77..014d93a16249c3cd4a5caac7defa8296740e9878 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 615b7a2b9428acffcbad8f5103b41b45ea5c507e..b35d2752bdc7957024e14aec2f31cfae985b9ed4 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 ef445ef9d64fb5c7dfb1068d096f8efc2785d9fa..bca73a8c8777b6f3bbc8173551f9f7b367f38eaf 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 eac20cc94a210cf0ff4b100adf1419c469580569..67e68eea3d12017501266227e33def7f07fe5744 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 8352df5e62d9e17656dae3b60b929e0d4925451c..585ba1f44eb7c1efadf36035179348c98e357654 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 174a688acf36da9fdac35ea895d3ca0e2bdd6b68..554480dce4e6baa04f168be292d3015c3d964705 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 fc291ca7cf0ce48463147c0091ef9706ad5c995e..8bf25faa3ab3193ed0f63eb10155281a76b17f4d 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 ff9a5899678666a67f0bbbc7c3a2bdd31d7776dd..ca27467eb4274b2de010e77b651ad00f9544db04 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 24b339d8cbfb908a71baffa1cb59fe6b41aa240d..0000000000000000000000000000000000000000 --- 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 1918268d7c1e58ca777ca7ad0be12babbc2289b3..b67442d3aeabe581d2800c8ce4c5eeae34235a37 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 342595ba058c0cdbddf7b014a925dd3e44d0804a..7089d355bc4bacc5ddc786b5aec3d20fa5b8f76d 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 8845522109ce458115472bf04071864772775e0a..ac4a761d9cd0ebb7b640987a76839c8a147a6979 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 45cdff160fdf7c12a6a75c5c39731860ab61e14c..2a23c6fe0fdc4a368dd18d752088b02f3ae3ce45 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 4d697eb0393606d658c9898189de2302c12b65c6..78f281f2343761abc2cfb2d5051f44960a5055a6 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 4aeeecc01b7feceeef69c4bbe5cca9bbaa2971ef..8a04e20acc4c805ee74ae4c99cb592b8a2adb618 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 578cf216a682da0fa7de5bc3e53bfeee36d4a0be..6c60030fff68622e2cad475efb58095988891e53 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 dfbcc0119ba98d2b87a30dd8556d406d321a1e1b..6d0da8f573a8b2b806a8f4eb0c3e28a07a4454ee 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 461e59f8a22723fac2ec53aaf477a5b4d3be3bb0..ae142479dccaddceda53fe5d15719d0176db8dd4 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 25e7895e70305c7fc08d6b0aa815e94f3fe33b4b..47a216935c820135c255584eb48bc4459aa5916b 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 f9508f7323fa22e1dbdd942686c8bab787c07a98..d630f21f768d7e5dd4c6e24df23b1dd981820a95 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 c77fc40a377c259f6e718bd0bfcc6a46ad54f630..f3bc8745b78380ed360074534e7a2395b086ec1b 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 4686555d4559907fe2ae1ccaf64189f5b3558d87..5d98791597528b1000ba5212f9b028f4e7527f1e 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 3960a6e57e3f030c5d1317194f2633ae653f5ddc..64faf07a16a0efbe9ecc3f9005674d5dd28b97c6 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 b2dc0a7c3d11a565497b592a256550c274d7ab77..8cc9387ab20df3e540f9390a2a324fc079120bd5 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 8169b236bcd147d31d43909c63149684ab9290f8..e2688a39f10db446ab2518d2527208a973a660f1 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 e0dad4394585e54056974e94aded2c15fa21f486..031ff5fb56baa40400d1a5ceb9da9334790cb781 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"