Code simplification: GeometricField<Type, fvPatchField, volMesh> -> VolField<Type>

Using the VolField<Type> partial specialisation of
GeometricField<Type, fvPatchField, volMesh>
simplifies the code and improves readability.
This commit is contained in:
Henry Weller
2022-12-02 22:04:45 +00:00
parent fe368d5332
commit 2f4dd4fe27
274 changed files with 1796 additions and 1802 deletions

View File

@ -40,16 +40,16 @@ using namespace Foam;
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
template<class Type>
tmp<GeometricField<Type, fvPatchField, volMesh>>
tmp<VolField<Type>>
volField
(
const fvMeshSubset& meshSubsetter,
const GeometricField<Type, fvPatchField, volMesh>& vf
const VolField<Type>& vf
)
{
if (meshSubsetter.hasSubMesh())
{
tmp<GeometricField<Type, fvPatchField, volMesh>> tfld
tmp<VolField<Type>> tfld
(
meshSubsetter.interpolate(vf)
);
@ -300,7 +300,7 @@ void writePatchField
template<class Type>
void ensightField
(
const GeometricField<Type, fvPatchField, volMesh>& vf,
const VolField<Type>& vf,
const ensightMesh& eMesh,
const fileName& postProcPath,
const word& prepend,
@ -717,7 +717,7 @@ void ensightPointField
template<class Type>
void ensightField
(
const GeometricField<Type, fvPatchField, volMesh>& vf,
const VolField<Type>& vf,
const ensightMesh& eMesh,
const fileName& postProcPath,
const word& prepend,

View File

@ -229,7 +229,7 @@ void Foam::ensightVolField
partsList.writeField
(
os,
GeometricField<Type, fvPatchField, volMesh>
VolField<Type>
(
fieldObject,
mesh

View File

@ -123,7 +123,7 @@ public:
tmp<Field<Type>> getPatchField
(
const bool nearCellValue,
const GeometricField<Type, fvPatchField, volMesh>& vfld,
const VolField<Type>& vfld,
const label patchi
) const;

View File

@ -68,7 +68,7 @@ template<class Type>
Foam::tmp<Field<Type>> Foam::tecplotWriter::getPatchField
(
const bool nearCellValue,
const GeometricField<Type, fvPatchField, volMesh>& vfld,
const VolField<Type>& vfld,
const label patchi
) const
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -104,7 +104,7 @@ public:
void write
(
const volPointInterpolation&,
const UPtrList<const GeometricField<Type, fvPatchField, volMesh>>&
const UPtrList<const VolField<Type>>&
);
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -58,7 +58,7 @@ template<class Type>
void Foam::internalWriter::write
(
const volPointInterpolation& pInterp,
const UPtrList<const GeometricField<Type, fvPatchField, volMesh>>& flds
const UPtrList<const VolField<Type>>& flds
)
{
forAll(flds, i)

View File

@ -114,7 +114,7 @@ public:
template<class Type>
void write
(
const UPtrList<const GeometricField<Type, fvPatchField, volMesh>>&
const UPtrList<const VolField<Type>>&
);
//- Write pointFields
@ -132,7 +132,7 @@ public:
void write
(
const PrimitivePatchInterpolation<primitivePatch>&,
const UPtrList<const GeometricField<Type, fvPatchField, volMesh>>&
const UPtrList<const VolField<Type>>&
);
};

View File

@ -31,12 +31,12 @@ License
template<class Type>
void Foam::patchWriter::write
(
const UPtrList<const GeometricField<Type, fvPatchField, volMesh>>& flds
const UPtrList<const VolField<Type>>& flds
)
{
forAll(flds, fieldi)
{
const GeometricField<Type, fvPatchField, volMesh>& fld = flds[fieldi];
const VolField<Type>& fld = flds[fieldi];
os_ << fld.name() << ' ' << pTraits<Type>::nComponents << ' '
<< nFaces_ << " float" << std::endl;
@ -96,12 +96,12 @@ template<class Type>
void Foam::patchWriter::write
(
const PrimitivePatchInterpolation<primitivePatch>& pInter,
const UPtrList<const GeometricField<Type, fvPatchField, volMesh>>& flds
const UPtrList<const VolField<Type>>& flds
)
{
forAll(flds, fieldi)
{
const GeometricField<Type, fvPatchField, volMesh>& fld = flds[fieldi];
const VolField<Type>& fld = flds[fieldi];
os_ << fld.name() << ' ' << pTraits<Type>::nComponents << ' '
<< nPoints_ << " float" << std::endl;

View File

@ -79,7 +79,7 @@ namespace vtkWriteOps
(
std::ostream&,
const bool binary,
const GeometricField<Type, fvPatchField, volMesh>&,
const VolField<Type>&,
const PointField<Type>&,
const vtkMesh&
);
@ -101,7 +101,7 @@ namespace vtkWriteOps
std::ostream&,
const bool binary,
const volPointInterpolation&,
const PtrList<GeometricField<Type, fvPatchField, volMesh>>&,
const PtrList<VolField<Type>>&,
const vtkMesh&
);

View File

@ -97,7 +97,7 @@ void Foam::vtkWriteOps::write
(
std::ostream& os,
const bool binary,
const GeometricField<Type, fvPatchField, volMesh>& vvf,
const VolField<Type>& vvf,
const PointField<Type>& pvf,
const vtkMesh& vMesh
)
@ -147,7 +147,7 @@ void Foam::vtkWriteOps::write
std::ostream& os,
const bool binary,
const volPointInterpolation& pInterp,
const PtrList<GeometricField<Type, fvPatchField, volMesh>>& flds,
const PtrList<VolField<Type>>& flds,
const vtkMesh& vMesh
)
{