Code simplification: GeometricField<Type, pointPatchField, pointMesh> -> PointField<Type>

Using the PointField<Type> partial specialisation of GeometricField<Type,
pointPatchField, pointMesh> simplified the code and improves readability.
This commit is contained in:
Henry Weller
2022-12-02 15:24:50 +00:00
parent 5f7993dab4
commit e84300d124
52 changed files with 179 additions and 184 deletions

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-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -533,7 +533,7 @@ void ensightField
template<class Type>
void ensightPointField
(
const GeometricField<Type, pointPatchField, pointMesh>& pf,
const PointField<Type>& pf,
const ensightMesh& eMesh,
const fileName& postProcPath,
const word& prepend,
@ -729,7 +729,7 @@ void ensightField
{
if (nodeValues)
{
tmp<GeometricField<Type, pointPatchField, pointMesh>> pfld
tmp<PointField<Type>> pfld
(
volPointInterpolation::New(vf.mesh()).interpolate(vf)
);

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
@ -123,7 +123,7 @@ public:
(
const UPtrList
<
const GeometricField<Type, pointPatchField, pointMesh>
const PointField<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
@ -66,12 +66,12 @@ void Foam::patchWriter::write
template<class Type>
void Foam::patchWriter::write
(
const UPtrList<const GeometricField<Type, pointPatchField, pointMesh>>& flds
const UPtrList<const PointField<Type>>& flds
)
{
forAll(flds, fieldi)
{
const GeometricField<Type, pointPatchField, pointMesh>& fld =
const PointField<Type>& fld =
flds[fieldi];
os_ << fld.name() << ' ' << pTraits<Type>::nComponents << ' '

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
@ -68,7 +68,7 @@ namespace vtkWriteOps
(
std::ostream&,
const bool binary,
const GeometricField<Type, pointPatchField, pointMesh>&,
const PointField<Type>&,
const vtkMesh&
);
@ -80,7 +80,7 @@ namespace vtkWriteOps
std::ostream&,
const bool binary,
const GeometricField<Type, fvPatchField, volMesh>&,
const GeometricField<Type, pointPatchField, pointMesh>&,
const PointField<Type>&,
const vtkMesh&
);

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
@ -65,7 +65,7 @@ void Foam::vtkWriteOps::write
(
std::ostream& os,
const bool binary,
const GeometricField<Type, pointPatchField, pointMesh>& pvf,
const PointField<Type>& pvf,
const vtkMesh& vMesh
)
{
@ -98,7 +98,7 @@ void Foam::vtkWriteOps::write
std::ostream& os,
const bool binary,
const GeometricField<Type, fvPatchField, volMesh>& vvf,
const GeometricField<Type, pointPatchField, pointMesh>& pvf,
const PointField<Type>& pvf,
const vtkMesh& vMesh
)
{

View File

@ -535,7 +535,7 @@ class vtkPVFoam
void convertVolFieldBlock
(
const GeometricField<Type, fvPatchField, volMesh>&,
autoPtr<GeometricField<Type, pointPatchField, pointMesh>>&,
autoPtr<PointField<Type>>&,
vtkMultiBlockDataSet* output,
const arrayRange&,
const List<polyDecomp>& decompLst
@ -641,7 +641,7 @@ class vtkPVFoam
template<class Type>
void convertPointFieldBlock
(
const GeometricField<Type, pointPatchField, pointMesh>&,
const PointField<Type>&,
vtkMultiBlockDataSet* output,
const arrayRange&,
const List<polyDecomp>&
@ -651,7 +651,7 @@ class vtkPVFoam
template<class Type>
void convertPointField
(
const GeometricField<Type, pointPatchField, pointMesh>&,
const PointField<Type>&,
const GeometricField<Type, fvPatchField, volMesh>&,
vtkMultiBlockDataSet* output,
const arrayRange&,

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-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -54,7 +54,7 @@ void Foam::vtkPVFoam::convertPointFields
if
(
iter()->headerClassName()
!= GeometricField<Type, pointPatchField, pointMesh>::typeName
!= PointField<Type>::typeName
)
{
continue;
@ -66,7 +66,7 @@ void Foam::vtkPVFoam::convertPointFields
<< fieldName << endl;
}
GeometricField<Type, pointPatchField, pointMesh> ptf
PointField<Type> ptf
(
*iter(),
pMesh
@ -172,7 +172,7 @@ void Foam::vtkPVFoam::convertPointFields
template<class Type>
void Foam::vtkPVFoam::convertPointFieldBlock
(
const GeometricField<Type, pointPatchField, pointMesh>& ptf,
const PointField<Type>& ptf,
vtkMultiBlockDataSet* output,
const arrayRange& range,
const List<polyDecomp>& decompLst
@ -201,7 +201,7 @@ void Foam::vtkPVFoam::convertPointFieldBlock
template<class Type>
void Foam::vtkPVFoam::convertPointField
(
const GeometricField<Type, pointPatchField, pointMesh>& ptf,
const PointField<Type>& ptf,
const GeometricField<Type, fvPatchField, volMesh>& tf,
vtkMultiBlockDataSet* output,
const arrayRange& range,

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-2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -73,7 +73,7 @@ void Foam::vtkPVFoam::convertVolFields
);
// Interpolated field (demand driven)
autoPtr<GeometricField<Type, pointPatchField, pointMesh>> ptfPtr;
autoPtr<PointField<Type>> ptfPtr;
if (interpFields)
{
if (debug)
@ -329,7 +329,7 @@ template<class Type>
void Foam::vtkPVFoam::convertVolFieldBlock
(
const GeometricField<Type, fvPatchField, volMesh>& tf,
autoPtr<GeometricField<Type, pointPatchField, pointMesh>>& ptfPtr,
autoPtr<PointField<Type>>& ptfPtr,
vtkMultiBlockDataSet* output,
const arrayRange& range,
const List<polyDecomp>& decompLst