diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index b434376143..8d3dd89600 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -628,6 +628,7 @@ fields/cloud/cloud.C Fields = fields/Fields $(Fields)/Field/FieldBase.C +$(Fields)/fieldTypes.C $(Fields)/labelField/labelField.C $(Fields)/labelField/labelIOField.C $(Fields)/labelField/labelFieldIOField.C diff --git a/src/OpenFOAM/fields/Fields/fieldTypes.C b/src/OpenFOAM/fields/Fields/fieldTypes.C new file mode 100644 index 0000000000..aaa9f3f943 --- /dev/null +++ b/src/OpenFOAM/fields/Fields/fieldTypes.C @@ -0,0 +1,47 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +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 . + +\*---------------------------------------------------------------------------*/ + +#include "fieldTypes.H" +#include "labelIOField.H" +#include "scalarIOField.H" +#include "vectorIOField.H" +#include "sphericalTensorIOField.H" +#include "symmTensorIOField.H" +#include "tensorIOField.H" + +// * * * * * * * * * * * * * * * * Global Data * * * * * * * * * * * * * * * // + +const Foam::wordList Foam::fieldTypes::basic +({ + Foam::labelIOField::typeName, + Foam::scalarIOField::typeName, + Foam::vectorIOField::typeName, + Foam::sphericalTensorIOField::typeName, + Foam::symmTensorIOField::typeName, + Foam::tensorIOField::typeName +}); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/fields/Fields/fieldTypes.H b/src/OpenFOAM/fields/Fields/fieldTypes.H index 13e17a3cce..00458be778 100644 --- a/src/OpenFOAM/fields/Fields/fieldTypes.H +++ b/src/OpenFOAM/fields/Fields/fieldTypes.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -22,8 +22,7 @@ License along with OpenFOAM. If not, see . Description - Include the header files for all the primitive types that Fields are - instantiated for. + Header files for all the primitive types that Fields are instantiated for. \*---------------------------------------------------------------------------*/ @@ -54,6 +53,22 @@ Description Macro(symmTensor, __VA_ARGS__) \ Macro(tensor, __VA_ARGS__) + +/*---------------------------------------------------------------------------*\ + Namespace fieldTypes Declaration +\*---------------------------------------------------------------------------*/ + +namespace Foam +{ +namespace fieldTypes +{ + //- Standard basic field types (label, scalar, vector, tensor, etc) + // These also correspond to cloud output fields. + extern const wordList basic; + +} // End namespace fieldTypes +} // End namespace Foam + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif diff --git a/src/OpenFOAM/fields/GeometricFields/pointFields/pointFields.C b/src/OpenFOAM/fields/GeometricFields/pointFields/pointFields.C index 04363c13ef..bbd392e38c 100644 --- a/src/OpenFOAM/fields/GeometricFields/pointFields/pointFields.C +++ b/src/OpenFOAM/fields/GeometricFields/pointFields/pointFields.C @@ -26,36 +26,44 @@ License #include "polyMesh.H" #include "pointFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTemplate2TypeNameAndDebug(pointScalarField::Internal, 0); -defineTemplate2TypeNameAndDebug(pointVectorField::Internal, 0); -defineTemplate2TypeNameAndDebug -( - pointSphericalTensorField::Internal, - 0 -); -defineTemplate2TypeNameAndDebug -( - pointSymmTensorField::Internal, - 0 -); -defineTemplate2TypeNameAndDebug(pointTensorField::Internal, 0); + defineTemplate2TypeNameAndDebug(pointScalarField::Internal, 0); + defineTemplate2TypeNameAndDebug(pointVectorField::Internal, 0); + defineTemplate2TypeNameAndDebug + ( + pointSphericalTensorField::Internal, + 0 + ); + defineTemplate2TypeNameAndDebug + ( + pointSymmTensorField::Internal, + 0 + ); + defineTemplate2TypeNameAndDebug(pointTensorField::Internal, 0); -defineTemplateTypeNameAndDebug(pointScalarField, 0); -defineTemplateTypeNameAndDebug(pointVectorField, 0); -defineTemplateTypeNameAndDebug(pointSphericalTensorField, 0); -defineTemplateTypeNameAndDebug(pointSymmTensorField, 0); -defineTemplateTypeNameAndDebug(pointTensorField, 0); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + defineTemplateTypeNameAndDebug(pointScalarField, 0); + defineTemplateTypeNameAndDebug(pointVectorField, 0); + defineTemplateTypeNameAndDebug(pointSphericalTensorField, 0); + defineTemplateTypeNameAndDebug(pointSymmTensorField, 0); + defineTemplateTypeNameAndDebug(pointTensorField, 0); } // End namespace Foam -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// * * * * * * * * * * * * * * * * Global Data * * * * * * * * * * * * * * * // + +const Foam::wordList Foam::fieldTypes::point +({ + Foam::pointScalarField::typeName, + Foam::pointVectorField::typeName, + Foam::pointSphericalTensorField::typeName, + Foam::pointSymmTensorField::typeName, + Foam::pointTensorField::typeName +}); + + +// ************************************************************************* // diff --git a/src/OpenFOAM/fields/GeometricFields/pointFields/pointFields.H b/src/OpenFOAM/fields/GeometricFields/pointFields/pointFields.H index a2b5adc5ec..a246e7b0db 100644 --- a/src/OpenFOAM/fields/GeometricFields/pointFields/pointFields.H +++ b/src/OpenFOAM/fields/GeometricFields/pointFields/pointFields.H @@ -35,9 +35,9 @@ SourceFiles #define pointFields_H #include "GeometricFields.H" -#include "fieldTypes.H" -#include "pointPatchFields.H" #include "pointMesh.H" +#include "pointPatchFields.H" +#include "pointFieldsFwd.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/fields/GeometricFields/pointFields/pointFieldsFwd.H b/src/OpenFOAM/fields/GeometricFields/pointFields/pointFieldsFwd.H index 23cfd9c747..750fafb53c 100644 --- a/src/OpenFOAM/fields/GeometricFields/pointFields/pointFieldsFwd.H +++ b/src/OpenFOAM/fields/GeometricFields/pointFields/pointFieldsFwd.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -25,6 +25,7 @@ InClass Foam::pointFields Description + Forwards and collection of common point field types SourceFiles pointFields.C @@ -59,6 +60,19 @@ typedef GeometricField pointSymmTensorField; typedef GeometricField pointTensorField; + +/*---------------------------------------------------------------------------*\ + Namespace fieldTypes Declaration +\*---------------------------------------------------------------------------*/ + +namespace fieldTypes +{ + //- Standard point field types (scalar, vector, tensor, etc) + extern const wordList point; + +} // End namespace fieldTypes + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFields.H b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFields.H index 212c7f8b4b..180615271f 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFields.H +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFields.H @@ -27,7 +27,6 @@ License #define pointPatchFields_H #include "pointPatchField.H" -#include "fieldTypes.H" #include "pointPatchFieldsFwd.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteArea/fields/areaFields/areaFields.C b/src/finiteArea/fields/areaFields/areaFields.C index cfa922447f..be85c01adf 100644 --- a/src/finiteArea/fields/areaFields/areaFields.C +++ b/src/finiteArea/fields/areaFields/areaFields.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- | Copyright (C) 2016-2017 Wikki Ltd ------------------------------------------------------------------------------- @@ -28,24 +28,31 @@ License #include "faMesh.H" #include "areaFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTemplate2TypeNameAndDebug(areaScalarField::Internal, 0); + defineTemplate2TypeNameAndDebug(areaVectorField::Internal, 0); + defineTemplate2TypeNameAndDebug(areaSphericalTensorField::Internal, 0); + defineTemplate2TypeNameAndDebug(areaSymmTensorField::Internal, 0); + defineTemplate2TypeNameAndDebug(areaTensorField::Internal, 0); -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + defineTemplateTypeNameAndDebug(areaScalarField, 0); + defineTemplateTypeNameAndDebug(areaVectorField, 0); + defineTemplateTypeNameAndDebug(areaSphericalTensorField, 0); + defineTemplateTypeNameAndDebug(areaSymmTensorField, 0); + defineTemplateTypeNameAndDebug(areaTensorField, 0); -defineTemplate2TypeNameAndDebug(areaScalarField::Internal, 0); -defineTemplate2TypeNameAndDebug(areaVectorField::Internal, 0); -defineTemplate2TypeNameAndDebug(areaSphericalTensorField::Internal, 0); -defineTemplate2TypeNameAndDebug(areaSymmTensorField::Internal, 0); -defineTemplate2TypeNameAndDebug(areaTensorField::Internal, 0); +} // End namespace Foam -defineTemplateTypeNameAndDebug(areaScalarField, 0); -defineTemplateTypeNameAndDebug(areaVectorField, 0); -defineTemplateTypeNameAndDebug(areaSphericalTensorField, 0); -defineTemplateTypeNameAndDebug(areaSymmTensorField, 0); -defineTemplateTypeNameAndDebug(areaTensorField, 0); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// Specializations + +namespace Foam +{ template<> tmp> @@ -67,8 +74,19 @@ void GeometricField::replace *this == gsf; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - } // End namespace Foam -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// * * * * * * * * * * * * * * * * Global Data * * * * * * * * * * * * * * * // + +const Foam::wordList Foam::fieldTypes::area +({ + Foam::areaScalarField::typeName, + Foam::areaVectorField::typeName, + Foam::areaSphericalTensorField::typeName, + Foam::areaSymmTensorField::typeName, + Foam::areaTensorField::typeName +}); + + +// ************************************************************************* // diff --git a/src/finiteArea/fields/areaFields/areaFields.H b/src/finiteArea/fields/areaFields/areaFields.H index aa122ba532..85d24a4e00 100644 --- a/src/finiteArea/fields/areaFields/areaFields.H +++ b/src/finiteArea/fields/areaFields/areaFields.H @@ -54,7 +54,7 @@ SourceFiles namespace Foam { -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Specializations template<> tmp> diff --git a/src/finiteArea/fields/areaFields/areaFieldsFwd.H b/src/finiteArea/fields/areaFields/areaFieldsFwd.H index 9cef997428..9a8a012d03 100644 --- a/src/finiteArea/fields/areaFields/areaFieldsFwd.H +++ b/src/finiteArea/fields/areaFields/areaFieldsFwd.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- | Copyright (C) 2016-2017 Wikki Ltd ------------------------------------------------------------------------------- @@ -23,10 +23,8 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . -Class - areaFields - Description + Forwards and collection of common area field types SourceFiles areaFields.C @@ -60,6 +58,20 @@ typedef GeometricField typedef GeometricField areaSymmTensorField; typedef GeometricField areaTensorField; + + +/*---------------------------------------------------------------------------*\ + Namespace fieldTypes Declaration +\*---------------------------------------------------------------------------*/ + +namespace fieldTypes +{ + //- Standard area field types (scalar, vector, tensor, etc) + extern const wordList area; + +} // End namespace fieldTypes + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/finiteVolume/fields/volFields/volFields.C b/src/finiteVolume/fields/volFields/volFields.C index a5e05587d7..be0ea83983 100644 --- a/src/finiteVolume/fields/volFields/volFields.C +++ b/src/finiteVolume/fields/volFields/volFields.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -25,37 +25,40 @@ License #include "volFields.H" +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTemplate2TypeNameAndDebug(volScalarField::Internal, 0); + defineTemplate2TypeNameAndDebug(volVectorField::Internal, 0); + defineTemplate2TypeNameAndDebug + ( + volSphericalTensorField::Internal, + 0 + ); + defineTemplate2TypeNameAndDebug + ( + volSymmTensorField::Internal, + 0 + ); + defineTemplate2TypeNameAndDebug(volTensorField::Internal, 0); + + defineTemplateTypeNameAndDebug(volScalarField, 0); + defineTemplateTypeNameAndDebug(volVectorField, 0); + defineTemplateTypeNameAndDebug(volSphericalTensorField, 0); + defineTemplateTypeNameAndDebug(volSymmTensorField, 0); + defineTemplateTypeNameAndDebug(volTensorField, 0); + +} // End namespace Foam + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Specializations + namespace Foam { -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTemplate2TypeNameAndDebug(volScalarField::Internal, 0); -defineTemplate2TypeNameAndDebug(volVectorField::Internal, 0); -defineTemplate2TypeNameAndDebug -( - volSphericalTensorField::Internal, - 0 -); -defineTemplate2TypeNameAndDebug -( - volSymmTensorField::Internal, - 0 -); -defineTemplate2TypeNameAndDebug(volTensorField::Internal, 0); - -defineTemplateTypeNameAndDebug(volScalarField, 0); -defineTemplateTypeNameAndDebug(volVectorField, 0); -defineTemplateTypeNameAndDebug(volSphericalTensorField, 0); -defineTemplateTypeNameAndDebug(volSymmTensorField, 0); -defineTemplateTypeNameAndDebug(volTensorField, 0); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// specialization for scalar fields template<> tmp> GeometricField::component @@ -67,7 +70,6 @@ GeometricField::component } -// specialization for scalar fields template<> void GeometricField::replace ( @@ -78,8 +80,29 @@ void GeometricField::replace *this == gsf; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - } // End namespace Foam + +// * * * * * * * * * * * * * * * * Global Data * * * * * * * * * * * * * * * // + +const Foam::wordList Foam::fieldTypes::internal +({ + Foam::volScalarField::Internal::typeName, + Foam::volVectorField::Internal::typeName, + Foam::volSphericalTensorField::Internal::typeName, + Foam::volSymmTensorField::Internal::typeName, + Foam::volTensorField::Internal::typeName +}); + + +const Foam::wordList Foam::fieldTypes::volume +({ + Foam::volScalarField::typeName, + Foam::volVectorField::typeName, + Foam::volSphericalTensorField::typeName, + Foam::volSymmTensorField::typeName, + Foam::volTensorField::typeName +}); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/volFields/volFields.H b/src/finiteVolume/fields/volFields/volFields.H index 2372a59069..26b9e3717d 100644 --- a/src/finiteVolume/fields/volFields/volFields.H +++ b/src/finiteVolume/fields/volFields/volFields.H @@ -46,7 +46,7 @@ SourceFiles namespace Foam { -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Specializations template<> tmp> diff --git a/src/finiteVolume/fields/volFields/volFieldsFwd.H b/src/finiteVolume/fields/volFields/volFieldsFwd.H index fb1155177b..854132d443 100644 --- a/src/finiteVolume/fields/volFields/volFieldsFwd.H +++ b/src/finiteVolume/fields/volFields/volFieldsFwd.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -21,10 +21,11 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . -InClass - Foam::volFields +Namespace + Foam::fieldTypes Description + Collection of common field types SourceFiles volFields.C @@ -35,6 +36,7 @@ SourceFiles #define volFieldsFwd_H #include "fieldTypes.H" +#include "wordList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -58,6 +60,22 @@ typedef GeometricField typedef GeometricField volSymmTensorField; typedef GeometricField volTensorField; + +/*---------------------------------------------------------------------------*\ + Namespace fieldTypes Declaration +\*---------------------------------------------------------------------------*/ + +namespace fieldTypes +{ + //- Standard dimensioned field types (scalar, vector, tensor, etc) + extern const wordList internal; + + //- Standard volume field types (scalar, vector, tensor, etc) + extern const wordList volume; + +} // End namespace fieldTypes + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam