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

@ -121,7 +121,7 @@ void subsetPointFields
const fvMeshSubset& subsetter, const fvMeshSubset& subsetter,
const pointMesh& pMesh, const pointMesh& pMesh,
const wordList& fieldNames, const wordList& fieldNames,
PtrList<GeometricField<Type, pointPatchField, pointMesh>>& subFields PtrList<PointField<Type>>& subFields
) )
{ {
const fvMesh& baseMesh = subsetter.baseMesh(); const fvMesh& baseMesh = subsetter.baseMesh();
@ -132,7 +132,7 @@ void subsetPointFields
Info<< "Subsetting field " << fieldName << endl; Info<< "Subsetting field " << fieldName << endl;
GeometricField<Type, pointPatchField, pointMesh> fld PointField<Type> fld
( (
IOobject IOobject
( (

View File

@ -145,10 +145,10 @@ public:
//- Decompose point field //- Decompose point field
template<class Type> template<class Type>
tmp<GeometricField<Type, pointPatchField, pointMesh>> tmp<PointField<Type>>
decomposeField decomposeField
( (
const GeometricField<Type, pointPatchField, pointMesh>& const PointField<Type>&
) const; ) const;
//- Decompose a list of fields //- Decompose a list of fields

View File

@ -32,7 +32,7 @@ template<class Type>
Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh>> Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh>>
Foam::pointFieldDecomposer::decomposeField Foam::pointFieldDecomposer::decomposeField
( (
const GeometricField<Type, pointPatchField, pointMesh>& field const PointField<Type>& field
) const ) const
{ {
// Create and map the internal field values // Create and map the internal field values
@ -73,9 +73,9 @@ Foam::pointFieldDecomposer::decomposeField
} }
// Create the field for the processor // Create the field for the processor
return tmp<GeometricField<Type, pointPatchField, pointMesh>> return tmp<PointField<Type>>
( (
new GeometricField<Type, pointPatchField, pointMesh> new PointField<Type>
( (
IOobject IOobject
( (

View File

@ -114,7 +114,7 @@ public:
//- Reconstruct field //- Reconstruct field
template<class Type> template<class Type>
tmp<GeometricField<Type, pointPatchField, pointMesh>> tmp<PointField<Type>>
reconstructField(const IOobject& fieldIoObject); reconstructField(const IOobject& fieldIoObject);
//- Reconstruct and write all fields //- Reconstruct and write all fields

View File

@ -32,7 +32,7 @@ Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh>>
Foam::pointFieldReconstructor::reconstructField(const IOobject& fieldIoObject) Foam::pointFieldReconstructor::reconstructField(const IOobject& fieldIoObject)
{ {
// Read the field for all the processors // Read the field for all the processors
PtrList<GeometricField<Type, pointPatchField, pointMesh>> procFields PtrList<PointField<Type>> procFields
( (
procMeshes_.size() procMeshes_.size()
); );
@ -42,7 +42,7 @@ Foam::pointFieldReconstructor::reconstructField(const IOobject& fieldIoObject)
procFields.set procFields.set
( (
proci, proci,
new GeometricField<Type, pointPatchField, pointMesh> new PointField<Type>
( (
IOobject IOobject
( (
@ -67,7 +67,7 @@ Foam::pointFieldReconstructor::reconstructField(const IOobject& fieldIoObject)
forAll(procMeshes_, proci) forAll(procMeshes_, proci)
{ {
const GeometricField<Type, pointPatchField, pointMesh>& const PointField<Type>&
procField = procFields[proci]; procField = procFields[proci];
// Get processor-to-global addressing for use in rmap // Get processor-to-global addressing for use in rmap
@ -118,9 +118,9 @@ Foam::pointFieldReconstructor::reconstructField(const IOobject& fieldIoObject)
// Construct and write the field // Construct and write the field
// setting the internalField and patchFields // setting the internalField and patchFields
return tmp<GeometricField<Type, pointPatchField, pointMesh>> return tmp<PointField<Type>>
( (
new GeometricField<Type, pointPatchField, pointMesh> new PointField<Type>
( (
IOobject IOobject
( (
@ -149,7 +149,7 @@ void Foam::pointFieldReconstructor::reconstructFields
{ {
word fieldClassName word fieldClassName
( (
GeometricField<Type, pointPatchField, pointMesh>::typeName PointField<Type>::typeName
); );
IOobjectList fields = objects.lookupClass(fieldClassName); IOobjectList fields = objects.lookupClass(fieldClassName);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -533,7 +533,7 @@ void ensightField
template<class Type> template<class Type>
void ensightPointField void ensightPointField
( (
const GeometricField<Type, pointPatchField, pointMesh>& pf, const PointField<Type>& pf,
const ensightMesh& eMesh, const ensightMesh& eMesh,
const fileName& postProcPath, const fileName& postProcPath,
const word& prepend, const word& prepend,
@ -729,7 +729,7 @@ void ensightField
{ {
if (nodeValues) if (nodeValues)
{ {
tmp<GeometricField<Type, pointPatchField, pointMesh>> pfld tmp<PointField<Type>> pfld
( (
volPointInterpolation::New(vf.mesh()).interpolate(vf) volPointInterpolation::New(vf.mesh()).interpolate(vf)
); );

View File

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

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -66,12 +66,12 @@ void Foam::patchWriter::write
template<class Type> template<class Type>
void Foam::patchWriter::write void Foam::patchWriter::write
( (
const UPtrList<const GeometricField<Type, pointPatchField, pointMesh>>& flds const UPtrList<const PointField<Type>>& flds
) )
{ {
forAll(flds, fieldi) forAll(flds, fieldi)
{ {
const GeometricField<Type, pointPatchField, pointMesh>& fld = const PointField<Type>& fld =
flds[fieldi]; flds[fieldi];
os_ << fld.name() << ' ' << pTraits<Type>::nComponents << ' ' os_ << fld.name() << ' ' << pTraits<Type>::nComponents << ' '

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -68,7 +68,7 @@ namespace vtkWriteOps
( (
std::ostream&, std::ostream&,
const bool binary, const bool binary,
const GeometricField<Type, pointPatchField, pointMesh>&, const PointField<Type>&,
const vtkMesh& const vtkMesh&
); );
@ -80,7 +80,7 @@ namespace vtkWriteOps
std::ostream&, std::ostream&,
const bool binary, const bool binary,
const GeometricField<Type, fvPatchField, volMesh>&, const GeometricField<Type, fvPatchField, volMesh>&,
const GeometricField<Type, pointPatchField, pointMesh>&, const PointField<Type>&,
const vtkMesh& const vtkMesh&
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -65,7 +65,7 @@ void Foam::vtkWriteOps::write
( (
std::ostream& os, std::ostream& os,
const bool binary, const bool binary,
const GeometricField<Type, pointPatchField, pointMesh>& pvf, const PointField<Type>& pvf,
const vtkMesh& vMesh const vtkMesh& vMesh
) )
{ {
@ -98,7 +98,7 @@ void Foam::vtkWriteOps::write
std::ostream& os, std::ostream& os,
const bool binary, const bool binary,
const GeometricField<Type, fvPatchField, volMesh>& vvf, const GeometricField<Type, fvPatchField, volMesh>& vvf,
const GeometricField<Type, pointPatchField, pointMesh>& pvf, const PointField<Type>& pvf,
const vtkMesh& vMesh const vtkMesh& vMesh
) )
{ {

View File

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

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -54,7 +54,7 @@ void Foam::vtkPVFoam::convertPointFields
if if
( (
iter()->headerClassName() iter()->headerClassName()
!= GeometricField<Type, pointPatchField, pointMesh>::typeName != PointField<Type>::typeName
) )
{ {
continue; continue;
@ -66,7 +66,7 @@ void Foam::vtkPVFoam::convertPointFields
<< fieldName << endl; << fieldName << endl;
} }
GeometricField<Type, pointPatchField, pointMesh> ptf PointField<Type> ptf
( (
*iter(), *iter(),
pMesh pMesh
@ -172,7 +172,7 @@ void Foam::vtkPVFoam::convertPointFields
template<class Type> template<class Type>
void Foam::vtkPVFoam::convertPointFieldBlock void Foam::vtkPVFoam::convertPointFieldBlock
( (
const GeometricField<Type, pointPatchField, pointMesh>& ptf, const PointField<Type>& ptf,
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const arrayRange& range, const arrayRange& range,
const List<polyDecomp>& decompLst const List<polyDecomp>& decompLst
@ -201,7 +201,7 @@ void Foam::vtkPVFoam::convertPointFieldBlock
template<class Type> template<class Type>
void Foam::vtkPVFoam::convertPointField void Foam::vtkPVFoam::convertPointField
( (
const GeometricField<Type, pointPatchField, pointMesh>& ptf, const PointField<Type>& ptf,
const GeometricField<Type, fvPatchField, volMesh>& tf, const GeometricField<Type, fvPatchField, volMesh>& tf,
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const arrayRange& range, const arrayRange& range,

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -73,7 +73,7 @@ void Foam::vtkPVFoam::convertVolFields
); );
// Interpolated field (demand driven) // Interpolated field (demand driven)
autoPtr<GeometricField<Type, pointPatchField, pointMesh>> ptfPtr; autoPtr<PointField<Type>> ptfPtr;
if (interpFields) if (interpFields)
{ {
if (debug) if (debug)
@ -329,7 +329,7 @@ template<class Type>
void Foam::vtkPVFoam::convertVolFieldBlock void Foam::vtkPVFoam::convertVolFieldBlock
( (
const GeometricField<Type, fvPatchField, volMesh>& tf, const GeometricField<Type, fvPatchField, volMesh>& tf,
autoPtr<GeometricField<Type, pointPatchField, pointMesh>>& ptfPtr, autoPtr<PointField<Type>>& ptfPtr,
vtkMultiBlockDataSet* output, vtkMultiBlockDataSet* output,
const arrayRange& range, const arrayRange& range,
const List<polyDecomp>& decompLst const List<polyDecomp>& decompLst

View File

@ -54,14 +54,12 @@ class GeometricField;
template<class Type> template<class Type>
using PointField = GeometricField<Type, pointPatchField, pointMesh>; using PointField = GeometricField<Type, pointPatchField, pointMesh>;
typedef GeometricField<label, pointPatchField, pointMesh> pointLabelField; typedef PointField<label> pointLabelField;
typedef GeometricField<scalar, pointPatchField, pointMesh> pointScalarField; typedef PointField<scalar> pointScalarField;
typedef GeometricField<vector, pointPatchField, pointMesh> pointVectorField; typedef PointField<vector> pointVectorField;
typedef GeometricField<sphericalTensor, pointPatchField, pointMesh> typedef PointField<sphericalTensor> pointSphericalTensorField;
pointSphericalTensorField; typedef PointField<symmTensor> pointSymmTensorField;
typedef GeometricField<symmTensor, pointPatchField, pointMesh> typedef PointField<tensor> pointTensorField;
pointSymmTensorField;
typedef GeometricField<tensor, pointPatchField, pointMesh> pointTensorField;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,7 +30,7 @@ License
template<class Type> template<class Type>
Type Foam::interpolatePointToCell Type Foam::interpolatePointToCell
( (
const GeometricField<Type, pointPatchField, pointMesh>& ptf, const PointField<Type>& ptf,
const label celli const label celli
) )
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -50,7 +50,7 @@ namespace Foam
template<class Type> template<class Type>
Type interpolatePointToCell Type interpolatePointToCell
( (
const GeometricField<Type, pointPatchField, pointMesh>& ptf, const PointField<Type>& ptf,
const label celli const label celli
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -108,8 +108,8 @@ class fvMeshAdder
const mapAddedPolyMesh& meshMap, const mapAddedPolyMesh& meshMap,
const labelListList& oldMeshPoints, const labelListList& oldMeshPoints,
GeometricField<Type, pointPatchField, pointMesh>& fld, PointField<Type>& fld,
const GeometricField<Type, pointPatchField, pointMesh>& fldToAdd const PointField<Type>& fldToAdd
); );
//- Update single dimensionedField. //- Update single dimensionedField.

View File

@ -603,15 +603,15 @@ void Foam::fvMeshAdder::MapPointField
const mapAddedPolyMesh& meshMap, const mapAddedPolyMesh& meshMap,
const labelListList& oldMeshPoints, const labelListList& oldMeshPoints,
GeometricField<Type, pointPatchField, pointMesh>& fld, PointField<Type>& fld,
const GeometricField<Type, pointPatchField, pointMesh>& fldToAdd const PointField<Type>& fldToAdd
) )
{ {
// This is a bit tricky: // This is a bit tricky:
// - mesh pointed to by fld is invalid // - mesh pointed to by fld is invalid
// - pointPatches pointed to be fld are invalid // - pointPatches pointed to be fld are invalid
typename GeometricField<Type, pointPatchField, pointMesh>:: typename PointField<Type>::
Boundary& bfld = fld.boundaryFieldRef(); Boundary& bfld = fld.boundaryFieldRef();
// Internal field // Internal field

View File

@ -292,20 +292,20 @@ public:
//- Map point field //- Map point field
template<class Type> template<class Type>
static tmp<GeometricField<Type, pointPatchField, pointMesh>> static tmp<PointField<Type>>
interpolate interpolate
( (
const GeometricField<Type, pointPatchField, pointMesh>&, const PointField<Type>&,
const pointMesh& sMesh, const pointMesh& sMesh,
const labelList& patchMap, const labelList& patchMap,
const labelList& pointMap const labelList& pointMap
); );
template<class Type> template<class Type>
tmp<GeometricField<Type, pointPatchField, pointMesh>> tmp<PointField<Type>>
interpolate interpolate
( (
const GeometricField<Type, pointPatchField, pointMesh>& const PointField<Type>&
) const; ) const;
//- Map dimensioned field //- Map dimensioned field

View File

@ -358,7 +358,7 @@ template<class Type>
Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh>> Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh>>
Foam::fvMeshSubset::interpolate Foam::fvMeshSubset::interpolate
( (
const GeometricField<Type, pointPatchField, pointMesh>& pf, const PointField<Type>& pf,
const pointMesh& sMesh, const pointMesh& sMesh,
const labelList& patchMap, const labelList& patchMap,
const labelList& pointMap const labelList& pointMap
@ -400,9 +400,9 @@ Foam::fvMeshSubset::interpolate
} }
// Create the complete field from the pieces // Create the complete field from the pieces
tmp<GeometricField<Type, pointPatchField, pointMesh>> tresF tmp<PointField<Type>> tresF
( (
new GeometricField<Type, pointPatchField, pointMesh> new PointField<Type>
( (
IOobject IOobject
( (
@ -419,13 +419,13 @@ Foam::fvMeshSubset::interpolate
patchFields patchFields
) )
); );
GeometricField<Type, pointPatchField, pointMesh>& resF = tresF.ref(); PointField<Type>& resF = tresF.ref();
// 2. Change the pointPatchFields to the correct type using a mapper // 2. Change the pointPatchFields to the correct type using a mapper
// constructor (with reference to the now correct internal field) // constructor (with reference to the now correct internal field)
typename GeometricField<Type, pointPatchField, pointMesh>:: typename PointField<Type>::
Boundary& bf = resF.boundaryFieldRef(); Boundary& bf = resF.boundaryFieldRef();
forAll(bf, patchi) forAll(bf, patchi)
@ -490,7 +490,7 @@ template<class Type>
Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh>> Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh>>
Foam::fvMeshSubset::interpolate Foam::fvMeshSubset::interpolate
( (
const GeometricField<Type, pointPatchField, pointMesh>& sf const PointField<Type>& sf
) const ) const
{ {
return interpolate return interpolate

View File

@ -170,17 +170,17 @@ class motionSmootherAlgo
//- Average of connected points. //- Average of connected points.
template<class Type> template<class Type>
tmp<GeometricField<Type, pointPatchField, pointMesh>> avg tmp<PointField<Type>> avg
( (
const GeometricField<Type, pointPatchField, pointMesh>& fld, const PointField<Type>& fld,
const scalarField& edgeWeight const scalarField& edgeWeight
) const; ) const;
//- Average position of connected points. //- Average position of connected points.
template<class Type> template<class Type>
tmp<GeometricField<Type, pointPatchField, pointMesh>> avgPositions tmp<PointField<Type>> avgPositions
( (
const GeometricField<Type, pointPatchField, pointMesh>& fld, const PointField<Type>& fld,
const scalarField& edgeWeight const scalarField& edgeWeight
) const; ) const;
@ -188,7 +188,7 @@ class motionSmootherAlgo
template<class Type> template<class Type>
static void checkConstraints static void checkConstraints
( (
GeometricField<Type, pointPatchField, pointMesh>& PointField<Type>&
); );
//- Test synchronisation of generic field (not positions!) on points //- Test synchronisation of generic field (not positions!) on points
@ -466,9 +466,9 @@ public:
template<class Type> template<class Type>
void smooth void smooth
( (
const GeometricField<Type, pointPatchField, pointMesh>& fld, const PointField<Type>& fld,
const scalarField& edgeWeight, const scalarField& edgeWeight,
GeometricField<Type, pointPatchField, pointMesh>& newFld PointField<Type>& newFld
) const; ) const;

View File

@ -35,7 +35,7 @@ License
template<class Type> template<class Type>
void Foam::motionSmootherAlgo::checkConstraints void Foam::motionSmootherAlgo::checkConstraints
( (
GeometricField<Type, pointPatchField, pointMesh>& pf PointField<Type>& pf
) )
{ {
const polyMesh& mesh = pf.mesh(); const polyMesh& mesh = pf.mesh();
@ -135,20 +135,20 @@ template<class Type>
Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh>> Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh>>
Foam::motionSmootherAlgo::avg Foam::motionSmootherAlgo::avg
( (
const GeometricField<Type, pointPatchField, pointMesh>& fld, const PointField<Type>& fld,
const scalarField& edgeWeight const scalarField& edgeWeight
) const ) const
{ {
tmp<GeometricField<Type, pointPatchField, pointMesh>> tres tmp<PointField<Type>> tres
( (
GeometricField<Type, pointPatchField, pointMesh>::New PointField<Type>::New
( (
"avg("+fld.name()+')', "avg("+fld.name()+')',
fld.mesh(), fld.mesh(),
dimensioned<Type>("zero", fld.dimensions(), Zero) dimensioned<Type>("zero", fld.dimensions(), Zero)
) )
); );
GeometricField<Type, pointPatchField, pointMesh>& res = tres.ref(); PointField<Type>& res = tres.ref();
const polyMesh& mesh = fld.mesh()(); const polyMesh& mesh = fld.mesh()();
@ -224,9 +224,9 @@ Foam::motionSmootherAlgo::avg
template<class Type> template<class Type>
void Foam::motionSmootherAlgo::smooth void Foam::motionSmootherAlgo::smooth
( (
const GeometricField<Type, pointPatchField, pointMesh>& fld, const PointField<Type>& fld,
const scalarField& edgeWeight, const scalarField& edgeWeight,
GeometricField<Type, pointPatchField, pointMesh>& newFld PointField<Type>& newFld
) const ) const
{ {
tmp<pointVectorField> tavgFld = avg(fld, edgeWeight); tmp<pointVectorField> tavgFld = avg(fld, edgeWeight);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -78,9 +78,9 @@ tmp<GeometricField<Type, fvPatchField, volMesh>> levelSetAverage
const volScalarField& levelC, const volScalarField& levelC,
const pointScalarField& levelP, const pointScalarField& levelP,
const GeometricField<Type, fvPatchField, volMesh>& positiveC, const GeometricField<Type, fvPatchField, volMesh>& positiveC,
const GeometricField<Type, pointPatchField, pointMesh>& positiveP, const PointField<Type>& positiveP,
const GeometricField<Type, fvPatchField, volMesh>& negativeC, const GeometricField<Type, fvPatchField, volMesh>& negativeC,
const GeometricField<Type, pointPatchField, pointMesh>& negativeP const PointField<Type>& negativeP
); );
//- Calculate the volume-fraction that a level set occupies. This gives the //- Calculate the volume-fraction that a level set occupies. This gives the

View File

@ -176,9 +176,9 @@ Foam::levelSetAverage
const volScalarField& levelC, const volScalarField& levelC,
const pointScalarField& levelP, const pointScalarField& levelP,
const GeometricField<Type, fvPatchField, volMesh>& positiveC, const GeometricField<Type, fvPatchField, volMesh>& positiveC,
const GeometricField<Type, pointPatchField, pointMesh>& positiveP, const PointField<Type>& positiveP,
const GeometricField<Type, fvPatchField, volMesh>& negativeC, const GeometricField<Type, fvPatchField, volMesh>& negativeC,
const GeometricField<Type, pointPatchField, pointMesh>& negativeP const PointField<Type>& negativeP
) )
{ {
const fvMesh& mesh = levelC.mesh(); const fvMesh& mesh = levelC.mesh();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -45,7 +45,7 @@ Foam::fv::faceCorrectedSnGrad<Type>::fullGradCorrection
{ {
const fvMesh& mesh = this->mesh(); const fvMesh& mesh = this->mesh();
GeometricField<Type, pointPatchField, pointMesh> pvf PointField<Type> pvf
( (
volPointInterpolation::New(mesh).interpolate(vf) volPointInterpolation::New(mesh).interpolate(vf)
); );

View File

@ -46,7 +46,7 @@ template<class Type>
Foam::interpolationCellPoint<Type>::interpolationCellPoint Foam::interpolationCellPoint<Type>::interpolationCellPoint
( (
const GeometricField<Type, fvPatchField, volMesh>& psi, const GeometricField<Type, fvPatchField, volMesh>& psi,
tmp<GeometricField<Type, pointPatchField, pointMesh>> psip tmp<PointField<Type>> psip
) )
: :
fieldInterpolation<Type, interpolationCellPoint<Type>>(psi), fieldInterpolation<Type, interpolationCellPoint<Type>>(psi),

View File

@ -69,7 +69,7 @@ public:
interpolationCellPoint interpolationCellPoint
( (
const GeometricField<Type, fvPatchField, volMesh>& psi, const GeometricField<Type, fvPatchField, volMesh>& psi,
tmp<GeometricField<Type, pointPatchField, pointMesh>> psip tmp<PointField<Type>> psip
); );

View File

@ -43,7 +43,7 @@ Foam::interpolationCellPointWallModified<Type>::calcPointField
<< typeName << " interpolation is only defined for vector fields" << typeName << " interpolation is only defined for vector fields"
<< exit(FatalError); << exit(FatalError);
return tmp<GeometricField<TYPE, pointPatchField, pointMesh>>(nullptr); return tmp<PointField<TYPE>>(nullptr);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -62,7 +62,7 @@ class interpolationCellPointWallModified
//- Compute the point field for a type. This just throws an error. This //- Compute the point field for a type. This just throws an error. This
// interpolation method is only defined for vector fields. // interpolation method is only defined for vector fields.
template <class TYPE> template <class TYPE>
tmp<GeometricField<TYPE, pointPatchField, pointMesh>> calcPointField tmp<PointField<TYPE>> calcPointField
( (
const GeometricField<TYPE, fvPatchField, volMesh>& psi const GeometricField<TYPE, fvPatchField, volMesh>& psi
) const; ) const;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -43,23 +43,20 @@ SourceFiles
#ifndef pointMVCWeight_H #ifndef pointMVCWeight_H
#define pointMVCWeight_H #define pointMVCWeight_H
#include "point.H"
#include "pointFieldsFwd.H"
#include "scalarField.H" #include "scalarField.H"
#include "vectorField.H" #include "vectorField.H"
#include "Map.H" #include "Map.H"
#include "DynamicList.H" #include "DynamicList.H"
#include "point.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
class polyMesh;
class pointMesh;
template<class T> class pointPatchField;
template<class Type, template<class> class PatchField, class GeoMesh>
class GeometricField;
class face; class face;
class polyMesh;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class pointMVCWeight Declaration Class pointMVCWeight Declaration
@ -142,7 +139,7 @@ public:
template<class Type> template<class Type>
inline Type interpolate inline Type interpolate
( (
const GeometricField<Type, pointPatchField, pointMesh>& psip const PointField<Type>& psip
) const; ) const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,7 +30,7 @@ License
template<class Type> template<class Type>
inline Type Foam::pointMVCWeight::interpolate inline Type Foam::pointMVCWeight::interpolate
( (
const GeometricField<Type, pointPatchField, pointMesh>& psip const PointField<Type>& psip
) const ) const
{ {
const labelList& vertices = psip.mesh()().cellPoints()[cellIndex_]; const labelList& vertices = psip.mesh()().cellPoints()[cellIndex_];

View File

@ -52,7 +52,7 @@ Foam::interpolationVolPointInterpolation<Type>::
interpolationVolPointInterpolation interpolationVolPointInterpolation
( (
const GeometricField<Type, fvPatchField, volMesh>& psi, const GeometricField<Type, fvPatchField, volMesh>& psi,
tmp<GeometricField<Type, pointPatchField, pointMesh>> psip tmp<PointField<Type>> psip
) )
: :
psip_(psip) psip_(psip)

View File

@ -52,7 +52,7 @@ protected:
// Protected data // Protected data
//- Interpolated volfield //- Interpolated volfield
const GeometricField<Type, pointPatchField, pointMesh> psip_; const PointField<Type> psip_;
public: public:
@ -74,7 +74,7 @@ public:
interpolationVolPointInterpolation interpolationVolPointInterpolation
( (
const GeometricField<Type, fvPatchField, volMesh>& psi, const GeometricField<Type, fvPatchField, volMesh>& psi,
tmp<GeometricField<Type, pointPatchField, pointMesh>> psip tmp<PointField<Type>> psip
); );
@ -86,7 +86,7 @@ public:
// Member Functions // Member Functions
//- Access the point field //- Access the point field
inline const GeometricField<Type, pointPatchField, pointMesh>& inline const PointField<Type>&
psip() const psip() const
{ {
return psip_; return psip_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -40,7 +40,7 @@ correction
{ {
const fvMesh& mesh = this->mesh(); const fvMesh& mesh = this->mesh();
GeometricField<Type, pointPatchField, pointMesh> pvf PointField<Type> pvf
( (
volPointInterpolation::New(mesh).interpolate(vf) volPointInterpolation::New(mesh).interpolate(vf)
); );

View File

@ -424,7 +424,7 @@ void Foam::pointConstraints::constrainDisplacement
template<> template<>
void Foam::pointConstraints::constrainCorners<Foam::scalar> void Foam::pointConstraints::constrainCorners<Foam::scalar>
( (
GeometricField<scalar, pointPatchField, pointMesh>& pf PointField<scalar>& pf
) const ) const
{} {}
@ -432,7 +432,7 @@ void Foam::pointConstraints::constrainCorners<Foam::scalar>
template<> template<>
void Foam::pointConstraints::constrainCorners<Foam::label> void Foam::pointConstraints::constrainCorners<Foam::label>
( (
GeometricField<label, pointPatchField, pointMesh>& pf PointField<label>& pf
) const ) const
{} {}

View File

@ -155,14 +155,14 @@ public:
template<class Type> template<class Type>
static void setPatchFields static void setPatchFields
( (
GeometricField<Type, pointPatchField, pointMesh>& PointField<Type>&
); );
//- Apply patch-patch constraints only //- Apply patch-patch constraints only
template<class Type> template<class Type>
void constrainCorners void constrainCorners
( (
GeometricField<Type, pointPatchField, pointMesh>& pf PointField<Type>& pf
) const; ) const;
//- Apply boundary conditions (single-patch constraints) and //- Apply boundary conditions (single-patch constraints) and
@ -172,7 +172,7 @@ public:
template<class Type> template<class Type>
void constrain void constrain
( (
GeometricField<Type, pointPatchField, pointMesh>& pf, PointField<Type>& pf,
const bool overrideValue = false const bool overrideValue = false
) const; ) const;
@ -196,13 +196,13 @@ public:
template<> template<>
void pointConstraints::constrainCorners<scalar> void pointConstraints::constrainCorners<scalar>
( (
GeometricField<scalar, pointPatchField, pointMesh>& pf PointField<scalar>& pf
) const; ) const;
template<> template<>
void pointConstraints::constrainCorners<label> void pointConstraints::constrainCorners<label>
( (
GeometricField<label, pointPatchField, pointMesh>& pf PointField<label>& pf
) const; ) const;

View File

@ -88,10 +88,10 @@ void Foam::pointConstraints::syncUntransformedData
template<class Type> template<class Type>
void Foam::pointConstraints::setPatchFields void Foam::pointConstraints::setPatchFields
( (
GeometricField<Type, pointPatchField, pointMesh>& pf PointField<Type>& pf
) )
{ {
typename GeometricField<Type, pointPatchField, pointMesh>:: typename PointField<Type>::
Boundary& pfbf = pf.boundaryFieldRef(); Boundary& pfbf = pf.boundaryFieldRef();
forAll(pfbf, patchi) forAll(pfbf, patchi)
@ -110,7 +110,7 @@ void Foam::pointConstraints::setPatchFields
template<class Type> template<class Type>
void Foam::pointConstraints::constrainCorners void Foam::pointConstraints::constrainCorners
( (
GeometricField<Type, pointPatchField, pointMesh>& pf PointField<Type>& pf
) const ) const
{ {
forAll(patchPatchPointConstraintPoints_, pointi) forAll(patchPatchPointConstraintPoints_, pointi)
@ -127,7 +127,7 @@ void Foam::pointConstraints::constrainCorners
template<class Type> template<class Type>
void Foam::pointConstraints::constrain void Foam::pointConstraints::constrain
( (
GeometricField<Type, pointPatchField, pointMesh>& pf, PointField<Type>& pf,
const bool overrideFixedValue const bool overrideFixedValue
) const ) const
{ {

View File

@ -78,7 +78,7 @@ void Foam::volPointInterpolation::pushUntransformedData
template<class Type> template<class Type>
void Foam::volPointInterpolation::addSeparated void Foam::volPointInterpolation::addSeparated
( (
GeometricField<Type, pointPatchField, pointMesh>& pf PointField<Type>& pf
) const ) const
{ {
if (debug) if (debug)
@ -86,10 +86,10 @@ void Foam::volPointInterpolation::addSeparated
Pout<< "volPointInterpolation::addSeparated" << endl; Pout<< "volPointInterpolation::addSeparated" << endl;
} }
typename GeometricField<Type, pointPatchField, pointMesh>:: typename PointField<Type>::
Internal& pfi = pf.ref(); Internal& pfi = pf.ref();
typename GeometricField<Type, pointPatchField, pointMesh>:: typename PointField<Type>::
Boundary& pfbf = pf.boundaryFieldRef(); Boundary& pfbf = pf.boundaryFieldRef();
forAll(pfbf, patchi) forAll(pfbf, patchi)
@ -127,14 +127,14 @@ template<class Type>
void Foam::volPointInterpolation::interpolateInternalField void Foam::volPointInterpolation::interpolateInternalField
( (
const GeometricField<Type, fvPatchField, volMesh>& vf, const GeometricField<Type, fvPatchField, volMesh>& vf,
GeometricField<Type, pointPatchField, pointMesh>& pf PointField<Type>& pf
) const ) const
{ {
if (debug) if (debug)
{ {
Pout<< "volPointInterpolation::interpolateInternalField(" Pout<< "volPointInterpolation::interpolateInternalField("
<< "const GeometricField<Type, fvPatchField, volMesh>&, " << "const GeometricField<Type, fvPatchField, volMesh>&, "
<< "GeometricField<Type, pointPatchField, pointMesh>&) : " << "PointField<Type>&) : "
<< "interpolating field from cells to points" << "interpolating field from cells to points"
<< endl; << endl;
} }
@ -211,7 +211,7 @@ template<class Type>
void Foam::volPointInterpolation::interpolateBoundaryField void Foam::volPointInterpolation::interpolateBoundaryField
( (
const GeometricField<Type, fvPatchField, volMesh>& vf, const GeometricField<Type, fvPatchField, volMesh>& vf,
GeometricField<Type, pointPatchField, pointMesh>& pf PointField<Type>& pf
) const ) const
{ {
const primitivePatch& boundary = boundaryPtr_(); const primitivePatch& boundary = boundaryPtr_();
@ -329,7 +329,7 @@ template<class Type>
void Foam::volPointInterpolation::interpolateBoundaryField void Foam::volPointInterpolation::interpolateBoundaryField
( (
const GeometricField<Type, fvPatchField, volMesh>& vf, const GeometricField<Type, fvPatchField, volMesh>& vf,
GeometricField<Type, pointPatchField, pointMesh>& pf, PointField<Type>& pf,
const bool overrideFixedValue const bool overrideFixedValue
) const ) const
{ {
@ -346,14 +346,14 @@ template<class Type>
void Foam::volPointInterpolation::interpolate void Foam::volPointInterpolation::interpolate
( (
const GeometricField<Type, fvPatchField, volMesh>& vf, const GeometricField<Type, fvPatchField, volMesh>& vf,
GeometricField<Type, pointPatchField, pointMesh>& pf PointField<Type>& pf
) const ) const
{ {
if (debug) if (debug)
{ {
Pout<< "volPointInterpolation::interpolate(" Pout<< "volPointInterpolation::interpolate("
<< "const GeometricField<Type, fvPatchField, volMesh>&, " << "const GeometricField<Type, fvPatchField, volMesh>&, "
<< "GeometricField<Type, pointPatchField, pointMesh>&) : " << "PointField<Type>&) : "
<< "interpolating field from cells to points" << "interpolating field from cells to points"
<< endl; << endl;
} }
@ -376,9 +376,9 @@ Foam::volPointInterpolation::interpolate
const pointMesh& pm = pointMesh::New(vf.mesh()); const pointMesh& pm = pointMesh::New(vf.mesh());
// Construct tmp<pointField> // Construct tmp<pointField>
tmp<GeometricField<Type, pointPatchField, pointMesh>> tpf tmp<PointField<Type>> tpf
( (
GeometricField<Type, pointPatchField, pointMesh>::New PointField<Type>::New
( (
"volPointInterpolate(" + vf.name() + ')', "volPointInterpolate(" + vf.name() + ')',
pm, pm,
@ -405,7 +405,7 @@ Foam::volPointInterpolation::interpolate
) const ) const
{ {
// Construct tmp<pointField> // Construct tmp<pointField>
tmp<GeometricField<Type, pointPatchField, pointMesh>> tpf = tmp<PointField<Type>> tpf =
interpolate(tvf(), patchFieldTypes); interpolate(tvf(), patchFieldTypes);
tvf.clear(); tvf.clear();
return tpf; return tpf;
@ -444,9 +444,9 @@ Foam::volPointInterpolation::interpolate
} }
tmp<GeometricField<Type, pointPatchField, pointMesh>> tpf tmp<PointField<Type>> tpf
( (
GeometricField<Type, pointPatchField, pointMesh>::New PointField<Type>::New
( (
name, name,
pm, pm,
@ -521,7 +521,7 @@ Foam::volPointInterpolation::interpolate
) const ) const
{ {
// Construct tmp<pointField> // Construct tmp<pointField>
tmp<GeometricField<Type, pointPatchField, pointMesh>> tpf = tmp<PointField<Type>> tpf =
interpolate(tvf()); interpolate(tvf());
tvf.clear(); tvf.clear();
return tpf; return tpf;

View File

@ -115,7 +115,7 @@ public:
//- Interpolate volField using inverse distance weighting //- Interpolate volField using inverse distance weighting
// returning pointField // returning pointField
template<class Type> template<class Type>
tmp<GeometricField<Type, pointPatchField, pointMesh>> interpolate tmp<PointField<Type>> interpolate
( (
const GeometricField<Type, fvPatchField, volMesh>& const GeometricField<Type, fvPatchField, volMesh>&
) const; ) const;
@ -123,7 +123,7 @@ public:
//- Interpolate tmp<volField> using inverse distance weighting //- Interpolate tmp<volField> using inverse distance weighting
// returning pointField // returning pointField
template<class Type> template<class Type>
tmp<GeometricField<Type, pointPatchField, pointMesh>> interpolate tmp<PointField<Type>> interpolate
( (
const tmp<GeometricField<Type, fvPatchField, volMesh>>& const tmp<GeometricField<Type, fvPatchField, volMesh>>&
) const; ) const;
@ -137,7 +137,7 @@ public:
void interpolateUnconstrained void interpolateUnconstrained
( (
const GeometricField<Type, fvPatchField, volMesh>&, const GeometricField<Type, fvPatchField, volMesh>&,
GeometricField<Type, pointPatchField, pointMesh>& PointField<Type>&
) const; ) const;
//- Interpolate from volField to pointField //- Interpolate from volField to pointField
@ -146,13 +146,13 @@ public:
void interpolate void interpolate
( (
const GeometricField<Type, fvPatchField, volMesh>&, const GeometricField<Type, fvPatchField, volMesh>&,
GeometricField<Type, pointPatchField, pointMesh>& PointField<Type>&
) const; ) const;
//- Interpolate volField using inverse distance weighting //- Interpolate volField using inverse distance weighting
// returning pointField with name. Optionally caches. // returning pointField with name. Optionally caches.
template<class Type> template<class Type>
tmp<GeometricField<Type, pointPatchField, pointMesh>> interpolate tmp<PointField<Type>> interpolate
( (
const GeometricField<Type, fvPatchField, volMesh>&, const GeometricField<Type, fvPatchField, volMesh>&,
const word& name, const word& name,

View File

@ -39,14 +39,14 @@ template<class Type>
void Foam::volPointInterpolation::interpolateUnconstrained void Foam::volPointInterpolation::interpolateUnconstrained
( (
const GeometricField<Type, fvPatchField, volMesh>& vf, const GeometricField<Type, fvPatchField, volMesh>& vf,
GeometricField<Type, pointPatchField, pointMesh>& pf PointField<Type>& pf
) const ) const
{ {
if (debug) if (debug)
{ {
Pout<< "volPointInterpolation::interpolateUnconstrained(" Pout<< "volPointInterpolation::interpolateUnconstrained("
<< "const GeometricField<Type, fvPatchField, volMesh>&, " << "const GeometricField<Type, fvPatchField, volMesh>&, "
<< "GeometricField<Type, pointPatchField, pointMesh>&) : " << "PointField<Type>&) : "
<< "interpolating field from cells to points" << "interpolating field from cells to points"
<< endl; << endl;
} }
@ -139,7 +139,7 @@ template<class Type>
void Foam::volPointInterpolation::interpolate void Foam::volPointInterpolation::interpolate
( (
const GeometricField<Type, fvPatchField, volMesh>& vf, const GeometricField<Type, fvPatchField, volMesh>& vf,
GeometricField<Type, pointPatchField, pointMesh>& pf PointField<Type>& pf
) const ) const
{ {
interpolateUnconstrained(vf, pf); interpolateUnconstrained(vf, pf);
@ -180,9 +180,9 @@ Foam::volPointInterpolation::interpolate
} }
} }
tmp<GeometricField<Type, pointPatchField, pointMesh>> tpf tmp<PointField<Type>> tpf
( (
GeometricField<Type, pointPatchField, pointMesh>::New PointField<Type>::New
( (
name, name,
pm, pm,
@ -255,7 +255,7 @@ Foam::volPointInterpolation::interpolate
const tmp<GeometricField<Type, fvPatchField, volMesh>>& tvf const tmp<GeometricField<Type, fvPatchField, volMesh>>& tvf
) const ) const
{ {
tmp<GeometricField<Type, pointPatchField, pointMesh>> tpf = tmp<PointField<Type>> tpf =
interpolate(tvf()); interpolate(tvf());
tvf.clear(); tvf.clear();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -64,7 +64,7 @@ protected:
template<class Type> template<class Type>
wordList cellMotionBoundaryTypes wordList cellMotionBoundaryTypes
( (
const typename GeometricField<Type, pointPatchField, pointMesh>:: const typename PointField<Type>::
Boundary& pmUbf Boundary& pmUbf
) const; ) const;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -32,7 +32,7 @@ License
template<class Type> template<class Type>
Foam::wordList Foam::fvMotionSolver::cellMotionBoundaryTypes Foam::wordList Foam::fvMotionSolver::cellMotionBoundaryTypes
( (
const typename GeometricField<Type, pointPatchField, pointMesh>:: const typename PointField<Type>::
Boundary& pmUbf Boundary& pmUbf
) const ) const
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -96,9 +96,9 @@ void Foam::cellMotionFvPatchField<Type>::updateCoeffs()
word pfName = this->internalField().name(); word pfName = this->internalField().name();
pfName.replace("cell", "point"); pfName.replace("cell", "point");
const GeometricField<Type, pointPatchField, pointMesh>& pointMotion = const PointField<Type>& pointMotion =
this->db().objectRegistry::template this->db().objectRegistry::template
lookupObject<GeometricField<Type, pointPatchField, pointMesh>> lookupObject<PointField<Type>>
(pfName); (pfName);
forAll(p, i) forAll(p, i)

View File

@ -163,7 +163,7 @@ bool Foam::AveragingMethod<Type>::write(const bool write) const
mesh_, mesh_,
dimensioned<Type>("zero", dimless, Zero) dimensioned<Type>("zero", dimless, Zero)
); );
GeometricField<TypeGrad, fvPatchField, volMesh> cellGrad GeometricField<GradType, fvPatchField, volMesh> cellGrad
( (
IOobject IOobject
( (
@ -172,9 +172,9 @@ bool Foam::AveragingMethod<Type>::write(const bool write) const
mesh_ mesh_
), ),
mesh_, mesh_,
dimensioned<TypeGrad>("zero", dimless, Zero) dimensioned<GradType>("zero", dimless, Zero)
); );
GeometricField<Type, pointPatchField, pointMesh> pointValue PointField<Type> pointValue
( (
IOobject IOobject
( (
@ -185,7 +185,7 @@ bool Foam::AveragingMethod<Type>::write(const bool write) const
pointMesh_, pointMesh_,
dimensioned<Type>("zero", dimless, Zero) dimensioned<Type>("zero", dimless, Zero)
); );
GeometricField<TypeGrad, pointPatchField, pointMesh> pointGrad PointField<GradType> pointGrad
( (
IOobject IOobject
( (
@ -194,7 +194,7 @@ bool Foam::AveragingMethod<Type>::write(const bool write) const
mesh_ mesh_
), ),
pointMesh_, pointMesh_,
dimensioned<TypeGrad>("zero", dimless, Zero) dimensioned<GradType>("zero", dimless, Zero)
); );
// Barycentric coordinates of the tet vertices // Barycentric coordinates of the tet vertices

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -62,7 +62,7 @@ protected:
//- Protected typedefs //- Protected typedefs
//- Gradient type //- Gradient type
typedef typename outerProduct<vector, Type>::type TypeGrad; typedef typename outerProduct<vector, Type>::type GradType;
//- Protected data //- Protected data
@ -149,7 +149,7 @@ public:
) const = 0; ) const = 0;
//- Interpolate gradient //- Interpolate gradient
virtual TypeGrad interpolateGrad virtual GradType interpolateGrad
( (
const barycentric& coordinates, const barycentric& coordinates,
const tetIndices& tetIs const tetIndices& tetIs

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -112,7 +112,7 @@ Type Foam::AveragingMethods::Basic<Type>::interpolate
template<class Type> template<class Type>
typename Foam::AveragingMethods::Basic<Type>::TypeGrad typename Foam::AveragingMethods::Basic<Type>::GradType
Foam::AveragingMethods::Basic<Type>::interpolateGrad Foam::AveragingMethods::Basic<Type>::interpolateGrad
( (
const barycentric& coordinates, const barycentric& coordinates,

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -67,7 +67,7 @@ public:
// Public Typedefs // Public Typedefs
//- Gradient type //- Gradient type
typedef typename AveragingMethod<Type>::TypeGrad TypeGrad; typedef typename AveragingMethod<Type>::GradType GradType;
private: private:
@ -78,7 +78,7 @@ private:
Field<Type>& data_; Field<Type>& data_;
//- Gradient field //- Gradient field
Field<TypeGrad> dataGrad_; Field<GradType> dataGrad_;
// Private Member Functions // Private Member Functions
@ -138,7 +138,7 @@ public:
) const; ) const;
//- Interpolate gradient //- Interpolate gradient
TypeGrad interpolateGrad GradType interpolateGrad
( (
const barycentric& coordinates, const barycentric& coordinates,
const tetIndices& tetIs const tetIndices& tetIs
@ -148,7 +148,7 @@ public:
tmp<Field<Type>> primitiveField() const; tmp<Field<Type>> primitiveField() const;
//- Return an internal field of the gradient //- Return an internal field of the gradient
tmp<Field<TypeGrad>> internalFieldGrad() const; tmp<Field<GradType>> internalFieldGrad() const;
}; };

View File

@ -159,7 +159,7 @@ Type Foam::AveragingMethods::Dual<Type>::interpolate
template<class Type> template<class Type>
typename Foam::AveragingMethods::Dual<Type>::TypeGrad typename Foam::AveragingMethods::Dual<Type>::GradType
Foam::AveragingMethods::Dual<Type>::interpolateGrad Foam::AveragingMethods::Dual<Type>::interpolateGrad
( (
const barycentric& coordinates, const barycentric& coordinates,
@ -185,7 +185,7 @@ Foam::AveragingMethods::Dual<Type>::interpolateGrad
const vector t( - T.T().x() - T.T().y() - T.T().z()); const vector t( - T.T().x() - T.T().y() - T.T().z());
const TypeGrad S const GradType S
( (
dataDual_[triIs[0]], dataDual_[triIs[0]],
dataDual_[triIs[1]], dataDual_[triIs[1]],

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -71,7 +71,7 @@ public:
// Public Typedefs // Public Typedefs
//- Gradient type //- Gradient type
typedef typename AveragingMethod<Type>::TypeGrad TypeGrad; typedef typename AveragingMethod<Type>::GradType GradType;
private: private:
@ -154,7 +154,7 @@ public:
) const; ) const;
//- Interpolate gradient //- Interpolate gradient
TypeGrad interpolateGrad GradType interpolateGrad
( (
const barycentric& coordinates, const barycentric& coordinates,
const tetIndices& tetIs const tetIndices& tetIs
@ -168,7 +168,7 @@ public:
tmp<Field<Type>> primitiveField() const; tmp<Field<Type>> primitiveField() const;
//- Return an internal field of the gradient //- Return an internal field of the gradient
tmp<Field<TypeGrad>> internalFieldGrad() const; tmp<Field<GradType>> internalFieldGrad() const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -143,7 +143,7 @@ void Foam::AveragingMethods::Moment<Type>::add
+ coordinates[3]*this->mesh_.points()[triIs[2]]; + coordinates[3]*this->mesh_.points()[triIs[2]];
const Type v = value/this->mesh_.V()[celli]; const Type v = value/this->mesh_.V()[celli];
const TypeGrad dv = transform_[celli] & (v*delta/scale_[celli]); const GradType dv = transform_[celli] & (v*delta/scale_[celli]);
data_[celli] += v; data_[celli] += v;
dataX_[celli] += v + dv.x(); dataX_[celli] += v + dv.x();
@ -171,7 +171,7 @@ Type Foam::AveragingMethods::Moment<Type>::interpolate
return return
data_[celli] data_[celli]
+ ( + (
TypeGrad GradType
( (
dataX_[celli] - data_[celli], dataX_[celli] - data_[celli],
dataY_[celli] - data_[celli], dataY_[celli] - data_[celli],
@ -183,7 +183,7 @@ Type Foam::AveragingMethods::Moment<Type>::interpolate
template<class Type> template<class Type>
typename Foam::AveragingMethods::Moment<Type>::TypeGrad typename Foam::AveragingMethods::Moment<Type>::GradType
Foam::AveragingMethods::Moment<Type>::interpolateGrad Foam::AveragingMethods::Moment<Type>::interpolateGrad
( (
const barycentric& coordinates, const barycentric& coordinates,
@ -193,7 +193,7 @@ Foam::AveragingMethods::Moment<Type>::interpolateGrad
const label celli(tetIs.cell()); const label celli(tetIs.cell());
return return
TypeGrad GradType
( (
dataX_[celli] - data_[celli], dataX_[celli] - data_[celli],
dataY_[celli] - data_[celli], dataY_[celli] - data_[celli],

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -68,7 +68,7 @@ public:
// Public Typedefs // Public Typedefs
//- Gradient type //- Gradient type
typedef typename AveragingMethod<Type>::TypeGrad TypeGrad; typedef typename AveragingMethod<Type>::GradType GradType;
private: private:
@ -151,7 +151,7 @@ public:
) const; ) const;
//- Interpolate gradient //- Interpolate gradient
TypeGrad interpolateGrad GradType interpolateGrad
( (
const barycentric& coordinates, const barycentric& coordinates,
const tetIndices& tetIs const tetIndices& tetIs
@ -161,7 +161,7 @@ public:
tmp<Field<Type>> primitiveField() const; tmp<Field<Type>> primitiveField() const;
//- Return an internal field of the gradient //- Return an internal field of the gradient
tmp<Field<TypeGrad>> internalFieldGrad() const; tmp<Field<GradType>> internalFieldGrad() const;
}; };

View File

@ -52,7 +52,7 @@ Foam::sampledSurfaces::sampledIsoSurfaceSurface::interpolateField
if (isA<interpolationVolPointInterpolation<Type>>(interpolator)) if (isA<interpolationVolPointInterpolation<Type>>(interpolator))
{ {
const GeometricField<Type, pointPatchField, pointMesh>& pField = const PointField<Type>& pField =
refCast<const interpolationVolPointInterpolation<Type>> refCast<const interpolationVolPointInterpolation<Type>>
(interpolator).psip(); (interpolator).psip();