polyPatch: Removed unnecessary constructors and clone functions

Poly patches should not hold non-uniform physical data that needs
mapping on mesh changes (decomposition, reconstruction, topology change,
etc ...). They should only hold uniform data that can be user-specified,
or non-uniform data that can be constructed on the fly from the poly
mesh.

With the recent changes to mappedPatchBase and extrudeToRegionMesh, this
has now been consistenly enforced, and a number of incomplete
implementations of poly patch mapping have therefore been removed.
This commit is contained in:
Will Bainbridge
2022-08-11 15:15:43 +01:00
parent 381e0921f8
commit 8c13ec4a8a
46 changed files with 171 additions and 1444 deletions

View File

@ -1032,7 +1032,6 @@ labelList addRegionPatches
// << " between regions " << e // << " between regions " << e
// << " trying to add patches " << names << endl; // << " trying to add patches " << names << endl;
mappedWallPolyPatch patch1 mappedWallPolyPatch patch1
( (
names[0], names[0],
@ -1042,7 +1041,6 @@ labelList addRegionPatches
regionNames[e[1]], // sampleRegion regionNames[e[1]], // sampleRegion
mappedPatchBase::NEARESTPATCHFACE, mappedPatchBase::NEARESTPATCHFACE,
names[1], // samplePatch names[1], // samplePatch
point::zero, // offset
mesh.boundaryMesh() mesh.boundaryMesh()
); );
@ -1064,7 +1062,6 @@ labelList addRegionPatches
regionNames[e[0]], // sampleRegion regionNames[e[0]], // sampleRegion
mappedPatchBase::NEARESTPATCHFACE, mappedPatchBase::NEARESTPATCHFACE,
names[0], names[0],
point::zero, // offset
mesh.boundaryMesh() mesh.boundaryMesh()
); );
fvMeshTools::addPatch fvMeshTools::addPatch

View File

@ -581,21 +581,6 @@ Foam::coupledPolyPatch::coupledPolyPatch
{} {}
Foam::coupledPolyPatch::coupledPolyPatch
(
const coupledPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
)
:
polyPatch(pp, bm, index, mapAddressing, newStart),
matchTolerance_(pp.matchTolerance_),
ownToOwnOrderDataPtr_(nullptr)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::coupledPolyPatch::~coupledPolyPatch() Foam::coupledPolyPatch::~coupledPolyPatch()

View File

@ -244,16 +244,6 @@ public:
const label newStart const label newStart
); );
//- Construct given the original patch and a map
coupledPolyPatch
(
const coupledPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
);
//- Destructor //- Destructor
virtual ~coupledPolyPatch(); virtual ~coupledPolyPatch();

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
@ -95,21 +95,6 @@ Foam::genericPolyPatch::genericPolyPatch
{} {}
Foam::genericPolyPatch::genericPolyPatch
(
const genericPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
)
:
polyPatch(pp, bm, index, mapAddressing, newStart),
actualTypeName_(pp.actualTypeName_),
dict_(pp.dict_)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::genericPolyPatch::~genericPolyPatch() Foam::genericPolyPatch::~genericPolyPatch()

View File

@ -107,16 +107,6 @@ public:
const label newStart const label newStart
); );
//- Construct given the original patch and a map
genericPolyPatch
(
const genericPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{ {
@ -139,22 +129,6 @@ public:
); );
} }
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new genericPolyPatch(*this, bm, index, mapAddressing, newStart)
);
}
//- Destructor //- Destructor
~genericPolyPatch(); ~genericPolyPatch();

View File

@ -281,28 +281,6 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
} }
Foam::cyclicPolyPatch::cyclicPolyPatch
(
const cyclicPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
)
:
coupledPolyPatch(pp, bm, index, mapAddressing, newStart),
cyclicTransform(pp),
nbrPatchName_(pp.nbrPatchName_),
coupleGroup_(pp.coupleGroup_),
nbrPatchID_(-1),
coupledPointsPtr_(nullptr),
coupledEdgesPtr_(nullptr),
ownToNbrOrderDataPtr_(nullptr),
ownToNbrCyclicOrderDataPtr_(nullptr),
ownToNbrDebugOrderDataPtr_(nullptr)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::cyclicPolyPatch::~cyclicPolyPatch() Foam::cyclicPolyPatch::~cyclicPolyPatch()

View File

@ -206,16 +206,6 @@ public:
const word& nbrPatchName const word& nbrPatchName
); );
//- Construct given the original patch and a map
cyclicPolyPatch
(
const cyclicPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{ {
@ -246,22 +236,6 @@ public:
); );
} }
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new cyclicPolyPatch(*this, bm, index, mapAddressing, newStart)
);
}
//- Destructor //- Destructor
virtual ~cyclicPolyPatch(); virtual ~cyclicPolyPatch();

View File

@ -112,19 +112,6 @@ public:
cyclicPolyPatch(pp, bm, index, newSize, newStart, nbrPatchName) cyclicPolyPatch(pp, bm, index, newSize, newStart, nbrPatchName)
{} {}
//- Construct given the original patch and a map
cyclicSlipPolyPatch
(
const cyclicPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
)
:
cyclicPolyPatch(pp, bm, index, mapAddressing, newStart)
{}
//- Construct and return a clone, resetting the boundary mesh //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{ {
@ -155,29 +142,6 @@ public:
); );
} }
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new cyclicSlipPolyPatch
(
*this,
bm,
index,
mapAddressing,
newStart
)
);
}
//- Destructor //- Destructor
virtual ~cyclicSlipPolyPatch() virtual ~cyclicSlipPolyPatch()

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
@ -88,17 +88,4 @@ Foam::emptyPolyPatch::emptyPolyPatch
{} {}
Foam::emptyPolyPatch::emptyPolyPatch
(
const emptyPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
)
:
polyPatch(pp, bm, index, mapAddressing, newStart)
{}
// ************************************************************************* // // ************************************************************************* //

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
@ -93,16 +93,6 @@ public:
const label newStart const label newStart
); );
//- Construct given the original patch and a map
emptyPolyPatch
(
const emptyPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{ {
@ -124,22 +114,6 @@ public:
new emptyPolyPatch(*this, bm, index, newSize, newStart) new emptyPolyPatch(*this, bm, index, newSize, newStart)
); );
} }
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new emptyPolyPatch(*this, bm, index, mapAddressing, newStart)
);
}
}; };

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) 2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -88,17 +88,4 @@ Foam::internalPolyPatch::internalPolyPatch
{} {}
Foam::internalPolyPatch::internalPolyPatch
(
const internalPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
)
:
polyPatch(pp, bm, index, mapAddressing, newStart)
{}
// ************************************************************************* // // ************************************************************************* //

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) 2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -96,16 +96,6 @@ public:
const label newStart const label newStart
); );
//- Construct given the original patch and a map
internalPolyPatch
(
const internalPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{ {
@ -127,22 +117,6 @@ public:
new internalPolyPatch(*this, bm, index, newSize, newStart) new internalPolyPatch(*this, bm, index, newSize, newStart)
); );
} }
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new internalPolyPatch(*this, bm, index, mapAddressing, newStart)
);
}
}; };

View File

@ -146,24 +146,6 @@ Foam::processorPolyPatch::processorPolyPatch
{} {}
Foam::processorPolyPatch::processorPolyPatch
(
const processorPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
)
:
coupledPolyPatch(pp, bm, index, mapAddressing, newStart),
myProcNo_(pp.myProcNo_),
neighbProcNo_(pp.neighbProcNo_),
neighbFaceCentres_(),
neighbFaceAreas_(),
neighbFaceCellCentres_()
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::processorPolyPatch::~processorPolyPatch() Foam::processorPolyPatch::~processorPolyPatch()

View File

@ -162,16 +162,6 @@ public:
const label newStart const label newStart
); );
//- Construct given the original patch and a map
processorPolyPatch
(
const processorPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{ {
@ -201,29 +191,6 @@ public:
); );
} }
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new processorPolyPatch
(
*this,
bm,
index,
mapAddressing,
newStart
)
);
}
//- Destructor //- Destructor
virtual ~processorPolyPatch(); virtual ~processorPolyPatch();

View File

@ -143,22 +143,6 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
{} {}
Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
(
const processorCyclicPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
)
:
processorPolyPatch(pp, bm, index, mapAddressing, newStart),
referPatchName_(pp.referPatchName()),
tag_(-1),
referPatchID_(-1)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::processorCyclicPolyPatch::~processorCyclicPolyPatch() Foam::processorCyclicPolyPatch::~processorCyclicPolyPatch()

View File

@ -170,16 +170,6 @@ public:
const label newStart const label newStart
); );
//- Construct given the original patch and a map
processorCyclicPolyPatch
(
const processorCyclicPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{ {
@ -209,29 +199,6 @@ public:
); );
} }
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new processorCyclicPolyPatch
(
*this,
bm,
index,
mapAddressing,
newStart
)
);
}
// Destructor // Destructor
virtual ~processorCyclicPolyPatch(); virtual ~processorCyclicPolyPatch();

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
@ -88,17 +88,4 @@ Foam::symmetryPolyPatch::symmetryPolyPatch
{} {}
Foam::symmetryPolyPatch::symmetryPolyPatch
(
const symmetryPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
)
:
polyPatch(pp, bm, index, mapAddressing, newStart)
{}
// ************************************************************************* // // ************************************************************************* //

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
@ -96,16 +96,6 @@ public:
const label newStart const label newStart
); );
//- Construct given the original patch and a map
symmetryPolyPatch
(
const symmetryPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{ {
@ -127,22 +117,6 @@ public:
new symmetryPolyPatch(*this, bm, index, newSize, newStart) new symmetryPolyPatch(*this, bm, index, newSize, newStart)
); );
} }
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new symmetryPolyPatch(*this, bm, index, mapAddressing, newStart)
);
}
}; };

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-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -136,18 +136,4 @@ Foam::symmetryPlanePolyPatch::symmetryPlanePolyPatch
{} {}
Foam::symmetryPlanePolyPatch::symmetryPlanePolyPatch
(
const symmetryPlanePolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
)
:
polyPatch(pp, bm, index, mapAddressing, newStart),
n_(pp.n_)
{}
// ************************************************************************* // // ************************************************************************* //

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
@ -111,16 +111,6 @@ public:
const label newStart const label newStart
); );
//- Construct given the original patch and a map
symmetryPlanePolyPatch
(
const symmetryPlanePolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{ {
@ -143,29 +133,6 @@ public:
); );
} }
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new symmetryPlanePolyPatch
(
*this,
bm,
index,
mapAddressing,
newStart
)
);
}
// Member Functions // Member Functions

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
@ -203,23 +203,4 @@ Foam::wedgePolyPatch::wedgePolyPatch
{} {}
Foam::wedgePolyPatch::wedgePolyPatch
(
const wedgePolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
)
:
polyPatch(pp, bm, index, mapAddressing, newStart),
axis_(pp.axis_),
centreNormal_(pp.centreNormal_),
n_(pp.n_),
cosAngle_(pp.cosAngle_),
faceT_(pp.faceT_),
cellT_(pp.cellT_)
{}
// ************************************************************************* // // ************************************************************************* //

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
@ -122,16 +122,6 @@ public:
const label newStart const label newStart
); );
//- Construct given the original patch and a map
wedgePolyPatch
(
const wedgePolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{ {
@ -154,22 +144,6 @@ public:
); );
} }
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new wedgePolyPatch(*this, bm, index, mapAddressing, newStart)
);
}
// Member Functions // Member Functions

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
@ -100,17 +100,4 @@ Foam::wallPolyPatch::wallPolyPatch
{} {}
Foam::wallPolyPatch::wallPolyPatch
(
const wallPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
)
:
polyPatch(pp, bm, index, mapAddressing, newStart)
{}
// ************************************************************************* // // ************************************************************************* //

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
@ -93,16 +93,6 @@ public:
const label newStart const label newStart
); );
//- Construct given the original patch and a map
wallPolyPatch
(
const wallPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{ {
@ -124,22 +114,6 @@ public:
new wallPolyPatch(*this, bm, index, newSize, newStart) new wallPolyPatch(*this, bm, index, newSize, newStart)
); );
} }
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new wallPolyPatch(*this, bm, index, mapAddressing, newStart)
);
}
}; };

View File

@ -214,33 +214,6 @@ Foam::polyPatch::polyPatch
{} {}
Foam::polyPatch::polyPatch
(
const polyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
)
:
patchIdentifier(pp, index),
primitivePatch
(
faceSubList
(
bm.mesh().faces(),
mapAddressing.size(),
newStart
),
bm.mesh().points()
),
start_(newStart),
boundaryMesh_(bm),
faceCellsPtr_(nullptr),
mePtr_(nullptr)
{}
Foam::polyPatch::polyPatch(const polyPatch& p) Foam::polyPatch::polyPatch(const polyPatch& p)
: :
patchIdentifier(p), patchIdentifier(p),

View File

@ -209,16 +209,6 @@ public:
const label newStart const label newStart
); );
//- Construct given the original patch and a map
polyPatch
(
const polyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
);
//- Copy constructor //- Copy constructor
polyPatch(const polyPatch&); polyPatch(const polyPatch&);
@ -244,22 +234,6 @@ public:
); );
} }
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new polyPatch(*this, bm, index, mapAddressing, newStart)
);
}
// Selectors // Selectors

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) 2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -88,17 +88,4 @@ Foam::mergedCyclicPolyPatch::mergedCyclicPolyPatch
{} {}
Foam::mergedCyclicPolyPatch::mergedCyclicPolyPatch
(
const mergedCyclicPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
)
:
polyPatch(pp, bm, index, mapAddressing, newStart)
{}
// ************************************************************************* // // ************************************************************************* //

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) 2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -102,16 +102,6 @@ public:
const label newStart const label newStart
); );
//- Construct given the original patch and a map
mergedCyclicPolyPatch
(
const mergedCyclicPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{ {
@ -133,29 +123,6 @@ public:
new mergedCyclicPolyPatch(*this, bm, index, newSize, newStart) new mergedCyclicPolyPatch(*this, bm, index, newSize, newStart)
); );
} }
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new mergedCyclicPolyPatch
(
*this,
bm,
index,
mapAddressing,
newStart
)
);
}
}; };

View File

@ -374,31 +374,6 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
} }
Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
(
const cyclicAMIPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
)
:
coupledPolyPatch(pp, bm, index, mapAddressing, newStart),
cyclicTransform(pp),
nbrPatchName_(pp.nbrPatchName_),
coupleGroup_(pp.coupleGroup_),
nbrPatchID_(-1),
AMIs_(),
AMITransforms_(),
AMIReverse_(pp.AMIReverse_),
AMIRequireMatch_(pp.AMIRequireMatch_),
AMILowWeightCorrection_(pp.AMILowWeightCorrection_),
AMIMethod_(pp.AMIMethod_),
surfPtr_(nullptr),
surfDict_(pp.surfDict_)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::cyclicAMIPolyPatch::~cyclicAMIPolyPatch() Foam::cyclicAMIPolyPatch::~cyclicAMIPolyPatch()

View File

@ -175,17 +175,6 @@ public:
const word& nbrPatchName const word& nbrPatchName
); );
//- Construct given the original patch and a map
cyclicAMIPolyPatch
(
const cyclicAMIPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{ {
@ -216,29 +205,6 @@ public:
); );
} }
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new cyclicAMIPolyPatch
(
*this,
bm,
index,
mapAddressing,
newStart
)
);
}
//- Destructor //- Destructor
virtual ~cyclicAMIPolyPatch(); virtual ~cyclicAMIPolyPatch();

View File

@ -149,20 +149,6 @@ Foam::mappedExtrudedWallPolyPatch::mappedExtrudedWallPolyPatch
{} {}
Foam::mappedExtrudedWallPolyPatch::mappedExtrudedWallPolyPatch
(
const mappedExtrudedWallPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
)
:
mappedWallPolyPatch(pp, bm, index, mapAddressing, newStart),
bottomPatch_(pp.bottomPatch_)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::mappedExtrudedWallPolyPatch::~mappedExtrudedWallPolyPatch() Foam::mappedExtrudedWallPolyPatch::~mappedExtrudedWallPolyPatch()

View File

@ -135,16 +135,6 @@ public:
const label newStart const label newStart
); );
//- Construct given the original patch and a map
mappedExtrudedWallPolyPatch
(
const mappedExtrudedWallPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{ {
@ -177,29 +167,6 @@ public:
); );
} }
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new mappedExtrudedWallPolyPatch
(
*this,
bm,
index,
mapAddressing,
newStart
)
);
}
//- Destructor //- Destructor
virtual ~mappedExtrudedWallPolyPatch(); virtual ~mappedExtrudedWallPolyPatch();

View File

@ -65,9 +65,9 @@ namespace Foam
3 3
>::names[] = >::names[] =
{ {
"uniform", "none",
"nonuniform", "normal",
"normal" "direction"
}; };
} }
@ -81,6 +81,41 @@ const Foam::NamedEnum<Foam::mappedPatchBase::offsetMode, 3>
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::mappedPatchBase::offsetMode Foam::mappedPatchBase::readOffsetMode
(
const dictionary& dict
) const
{
if (dict.found("offsetMode"))
{
return offsetModeNames_.read(dict.lookup("offsetMode"));
}
else
{
const bool haveDistance = dict.found("distance");
const bool haveOffset = dict.found("offset");
if (haveDistance && haveOffset)
{
// Error. Demand "offsetMode" setting to disambiguate.
return offsetModeNames_.read(dict.lookup("offsetMode"));
}
else if (haveDistance)
{
return NORMAL;
}
else if (haveOffset)
{
return DIRECTION;
}
else
{
return NONE;
}
}
}
void Foam::mappedPatchBase::findSamples void Foam::mappedPatchBase::findSamples
( (
const globalIndex& patchGlobalIndex, const globalIndex& patchGlobalIndex,
@ -362,7 +397,6 @@ void Foam::mappedPatchBase::calcMapping() const
<< "Mapping already calculated" << exit(FatalError); << "Mapping already calculated" << exit(FatalError);
} }
/*
// Do a sanity check. Am I sampling my own patch? This only makes sense if // Do a sanity check. Am I sampling my own patch? This only makes sense if
// the position is transformed. // the position is transformed.
if if
@ -370,16 +404,15 @@ void Foam::mappedPatchBase::calcMapping() const
mode_ == NEARESTPATCHFACE mode_ == NEARESTPATCHFACE
&& sampleRegion() == patch_.boundaryMesh().mesh().name() && sampleRegion() == patch_.boundaryMesh().mesh().name()
&& samplePatch() == patch_.name() && samplePatch() == patch_.name()
&& !transform_.transformsPosition() && offsetMode_ == NONE
) )
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Patch " << patch_.name() << " is sampling itself with no " << "Patch " << patch_.name() << " is sampling itself with no "
<< "transformation. The patch face values are undefined." << "offset. The patch face values are undefined."
<< exit(FatalError); << exit(FatalError);
} }
*/
const globalIndex patchGlobalIndex(patch_.size()); const globalIndex patchGlobalIndex(patch_.size());
@ -587,12 +620,11 @@ Foam::mappedPatchBase::mappedPatchBase
sampleRegion_(patch_.boundaryMesh().mesh().name()), sampleRegion_(patch_.boundaryMesh().mesh().name()),
sameRegion_(sampleRegion_ == patch_.boundaryMesh().mesh().name()), sameRegion_(sampleRegion_ == patch_.boundaryMesh().mesh().name()),
mode_(NEARESTPATCHFACE), mode_(NEARESTPATCHFACE),
samplePatch_(""), samplePatch_(word::null),
coupleGroup_(), coupleGroup_(),
offsetMode_(UNIFORM), offsetMode_(NONE),
offset_(Zero), distance_(NaN),
offsets_(pp.size(), offset_), offset_(vector::uniform(NaN)),
distance_(0),
mapPtr_(nullptr), mapPtr_(nullptr),
mapIndices_(), mapIndices_(),
AMIPtr_(nullptr), AMIPtr_(nullptr),
@ -607,8 +639,7 @@ Foam::mappedPatchBase::mappedPatchBase
const polyPatch& pp, const polyPatch& pp,
const word& sampleRegion, const word& sampleRegion,
const sampleMode mode, const sampleMode mode,
const word& samplePatch, const word& samplePatch
const vectorField& offsets
) )
: :
patch_(pp), patch_(pp),
@ -617,66 +648,9 @@ Foam::mappedPatchBase::mappedPatchBase
mode_(mode), mode_(mode),
samplePatch_(samplePatch), samplePatch_(samplePatch),
coupleGroup_(), coupleGroup_(),
offsetMode_(NONUNIFORM), offsetMode_(NONE),
offset_(Zero), distance_(NaN),
offsets_(offsets), offset_(vector::uniform(NaN)),
distance_(0),
mapPtr_(nullptr),
mapIndices_(),
AMIPtr_(nullptr),
AMIReverse_(false),
surfPtr_(nullptr),
surfDict_(fileName("surface"))
{}
Foam::mappedPatchBase::mappedPatchBase
(
const polyPatch& pp,
const word& sampleRegion,
const sampleMode mode,
const word& samplePatch,
const vector& offset
)
:
patch_(pp),
sampleRegion_(sampleRegion),
sameRegion_(sampleRegion_ == patch_.boundaryMesh().mesh().name()),
mode_(mode),
samplePatch_(samplePatch),
coupleGroup_(),
offsetMode_(UNIFORM),
offset_(offset),
offsets_(0),
distance_(0),
mapPtr_(nullptr),
mapIndices_(),
AMIPtr_(nullptr),
AMIReverse_(false),
surfPtr_(nullptr),
surfDict_(fileName("surface"))
{}
Foam::mappedPatchBase::mappedPatchBase
(
const polyPatch& pp,
const word& sampleRegion,
const sampleMode mode,
const word& samplePatch,
const scalar distance
)
:
patch_(pp),
sampleRegion_(sampleRegion),
sameRegion_(sampleRegion_ == patch_.boundaryMesh().mesh().name()),
mode_(mode),
samplePatch_(samplePatch),
coupleGroup_(),
offsetMode_(NORMAL),
offset_(Zero),
offsets_(0),
distance_(distance),
mapPtr_(nullptr), mapPtr_(nullptr),
mapIndices_(), mapIndices_(),
AMIPtr_(nullptr), AMIPtr_(nullptr),
@ -693,15 +667,24 @@ Foam::mappedPatchBase::mappedPatchBase
) )
: :
patch_(pp), patch_(pp),
sampleRegion_(dict.lookupOrDefault<word>("sampleRegion", "")), sampleRegion_(dict.lookupOrDefault<word>("sampleRegion", word::null)),
sameRegion_(sampleRegion_ == patch_.boundaryMesh().mesh().name()), sameRegion_(sampleRegion_ == patch_.boundaryMesh().mesh().name()),
mode_(sampleModeNames_.read(dict.lookup("sampleMode"))), mode_(sampleModeNames_.read(dict.lookup("sampleMode"))),
samplePatch_(dict.lookupOrDefault<word>("samplePatch", "")), samplePatch_(dict.lookupOrDefault<word>("samplePatch", word::null)),
coupleGroup_(dict), coupleGroup_(dict),
offsetMode_(UNIFORM), offsetMode_(readOffsetMode(dict)),
offset_(Zero), distance_
offsets_(0), (
distance_(0.0), offsetMode_ == NORMAL
? dict.lookup<scalar>("distance")
: NaN
),
offset_
(
offsetMode_ == DIRECTION
? dict.lookup<vector>("offset")
: vector::uniform(NaN)
),
mapPtr_(nullptr), mapPtr_(nullptr),
mapIndices_(), mapIndices_(),
AMIPtr_(nullptr), AMIPtr_(nullptr),
@ -709,57 +692,11 @@ Foam::mappedPatchBase::mappedPatchBase
surfPtr_(nullptr), surfPtr_(nullptr),
surfDict_(dict.subOrEmptyDict("surface")) surfDict_(dict.subOrEmptyDict("surface"))
{ {
if (!coupleGroup_.valid()) if (!coupleGroup_.valid() && sampleRegion_.empty())
{ {
if (sampleRegion_.empty()) // If no coupleGroup and no sampleRegion then assume the local region
{ sampleRegion_ = patch_.boundaryMesh().mesh().name();
// If no coupleGroup and no sampleRegion assume local region sameRegion_ = true;
sampleRegion_ = patch_.boundaryMesh().mesh().name();
sameRegion_ = true;
}
}
if (dict.found("offsetMode"))
{
offsetMode_ = offsetModeNames_.read(dict.lookup("offsetMode"));
switch(offsetMode_)
{
case UNIFORM:
{
offset_ = point(dict.lookup("offset"));
}
break;
case NONUNIFORM:
{
offsets_ = readListOrField("offsets", dict, patch_.size());
}
break;
case NORMAL:
{
distance_ = dict.lookup<scalar>("distance");
}
break;
}
}
else if (dict.found("offset"))
{
offsetMode_ = UNIFORM;
offset_ = point(dict.lookup("offset"));
}
else if (dict.found("offsets"))
{
offsetMode_ = NONUNIFORM;
offsets_ = readListOrField("offsets", dict, patch_.size());
}
else if (mode_ != NEARESTPATCHFACE && mode_ != NEARESTPATCHFACEAMI)
{
FatalIOErrorInFunction(dict)
<< "Please supply the offsetMode as one of "
<< NamedEnum<offsetMode, 3>::words()
<< exit(FatalIOError);
} }
} }
@ -777,40 +714,8 @@ Foam::mappedPatchBase::mappedPatchBase
samplePatch_(mpb.samplePatch_), samplePatch_(mpb.samplePatch_),
coupleGroup_(mpb.coupleGroup_), coupleGroup_(mpb.coupleGroup_),
offsetMode_(mpb.offsetMode_), offsetMode_(mpb.offsetMode_),
offset_(mpb.offset_),
offsets_(mpb.offsets_),
distance_(mpb.distance_), distance_(mpb.distance_),
mapPtr_(nullptr),
mapIndices_(),
AMIPtr_(nullptr),
AMIReverse_(mpb.AMIReverse_),
surfPtr_(nullptr),
surfDict_(mpb.surfDict_)
{}
Foam::mappedPatchBase::mappedPatchBase
(
const polyPatch& pp,
const mappedPatchBase& mpb,
const labelUList& mapAddressing
)
:
patch_(pp),
sampleRegion_(mpb.sampleRegion_),
sameRegion_(mpb.sameRegion_),
mode_(mpb.mode_),
samplePatch_(mpb.samplePatch_),
coupleGroup_(mpb.coupleGroup_),
offsetMode_(mpb.offsetMode_),
offset_(mpb.offset_), offset_(mpb.offset_),
offsets_
(
offsetMode_ == NONUNIFORM
? vectorField(mpb.offsets_, mapAddressing)
: vectorField(0)
),
distance_(mpb.distance_),
mapPtr_(nullptr), mapPtr_(nullptr),
mapIndices_(), mapIndices_(),
AMIPtr_(nullptr), AMIPtr_(nullptr),
@ -918,21 +823,14 @@ Foam::tmp<Foam::pointField> Foam::mappedPatchBase::samplePoints() const
// Apply offset to get sample points // Apply offset to get sample points
switch (offsetMode_) switch (offsetMode_)
{ {
case UNIFORM: case NONE:
{
result += offset_;
break; break;
}
case NONUNIFORM:
{
result += offsets_;
break;
}
case NORMAL: case NORMAL:
{
result += distance_*patch_.faceNormals(); result += distance_*patch_.faceNormals();
break; break;
} case DIRECTION:
result += offset_;
break;
} }
return tresult; return tresult;
@ -961,50 +859,31 @@ void Foam::mappedPatchBase::write(Ostream& os) const
} }
coupleGroup_.write(os); coupleGroup_.write(os);
if writeEntry(os, "offsetMode", offsetModeNames_[offsetMode_]);
(
offsetMode_ == UNIFORM
&& offset_ == vector::zero
&& (mode_ == NEARESTPATCHFACE || mode_ == NEARESTPATCHFACEAMI)
)
{
// Collocated mode. No need to write offset data
}
else
{
writeEntry(os, "offsetMode", offsetModeNames_[offsetMode_]);
switch (offsetMode_) switch (offsetMode_)
{
case NONE:
break;
case NORMAL:
writeEntry(os, "distance", distance_);
break;
case DIRECTION:
writeEntry(os, "offset", offset_);
break;
}
if (mode_ == NEARESTPATCHFACEAMI)
{
if (AMIReverse_)
{ {
case UNIFORM: writeEntry(os, "flipNormals", AMIReverse_);
{
writeEntry(os, "offset", offset_);
break;
}
case NONUNIFORM:
{
writeEntry(os, "offsets", offsets_);
break;
}
case NORMAL:
{
writeEntry(os, "distance", distance_);
break;
}
} }
if (mode_ == NEARESTPATCHFACEAMI) if (!surfDict_.empty())
{ {
if (AMIReverse_) writeKeyword(os, surfDict_.dictName());
{ os << surfDict_;
writeEntry(os, "flipNormals", AMIReverse_);
}
if (!surfDict_.empty())
{
writeKeyword(os, surfDict_.dictName());
os << surfDict_;
}
} }
} }
} }

View File

@ -28,42 +28,44 @@ Description
Determines a mapping between patch face centres and mesh cell or face Determines a mapping between patch face centres and mesh cell or face
centres and processors they're on. centres and processors they're on.
If constructed from dictionary: Example:
\verbatim \verbatim
// Region to sample (default is region0) // What to sample
sampleRegion region0; // - nearestCell : cell containing the sampling point
// What to sample:
// - nearestCell : sample cell containing point
// - nearestOnlyCell : nearest sample cell (even if not containing
// point)
// - nearestPatchFace : nearest face on selected patch // - nearestPatchFace : nearest face on selected patch
// - nearestPatchFaceAMI : nearest face on selected patch // - nearestPatchFaceAMI : AMI interpolation from selected patch
- patches need not conform
- uses AMI interpolation
// - nearestFace : nearest boundary face on any patch // - nearestFace : nearest boundary face on any patch
sampleMode nearestCell; sampleMode nearestCell;
// If sampleMode is nearestPatchFace : patch to find faces of // Region to sample from
sampleRegion region0;
// If sampleMode is nearestPatchFace* : The patch to sample from
samplePatch movingWall; samplePatch movingWall;
// If sampleMode is nearestPatchFace : specify patchgroup to find // If sampleMode is nearestPatchFace* : Couple group to specify the
// samplePatch and sampleRegion (if not provided) // sample region and patch
// (alternative to specifying
// sampleRegion and samplePatch
// directly)
coupleGroup baffleGroup; coupleGroup baffleGroup;
// How to supply offset (w.r.t. my patch face centres): // How to offset the patch face centres to the sampling locations
// - uniform : single offset vector // - none : no offset
// - nonuniform : per-face offset vector // - normal : distance along the patch face normals
// - normal : using supplied distance and face normal // - direction : specified offset vector
offsetMode uniform; offsetMode direction;
// According to offsetMode (see above) supply one of // If offsetMode is normal : The normal distance to offset
// offset, offsets or distance distance 1;
offset (1 0 0);
// If offsetMode is direction : The offset vector
offset (1 0 0);
\endverbatim \endverbatim
Note: if offsetMode is \c normal it uses outwards pointing normals. So Note that patch normals point outward, so if offsetMode is \c normal then a
supply a negative distance if sampling inside the domain. negative distance will be required in order to sample value from inside the
domain.
SourceFiles SourceFiles
mappedPatchBase.C mappedPatchBase.C
@ -109,9 +111,9 @@ public:
//- How to project face centres //- How to project face centres
enum offsetMode enum offsetMode
{ {
UNIFORM, // single offset vector NONE, // do not offset
NONUNIFORM, // per-face offset vector NORMAL, // offset a distance in the face-normal direction
NORMAL // use face normal + distance DIRECTION // offset with a specified vector
}; };
static const NamedEnum<sampleMode, 4> sampleModeNames_; static const NamedEnum<sampleMode, 4> sampleModeNames_;
@ -141,18 +143,15 @@ protected:
//- PatchGroup (if in sampleMode NEARESTPATCH*) //- PatchGroup (if in sampleMode NEARESTPATCH*)
const coupleGroupIdentifier coupleGroup_; const coupleGroupIdentifier coupleGroup_;
//- How to obtain samples //- How to offset the patch face centres to the sampling locations
offsetMode offsetMode_; offsetMode offsetMode_;
//- Offset vector (uniform) //- Offset distance
vector offset_;
//- Offset vector (nonuniform)
vectorField offsets_;
//- Offset distance (normal)
scalar distance_; scalar distance_;
//- Offset vector
vector offset_;
// Derived information // Derived information
@ -180,6 +179,9 @@ protected:
// Protected Member Functions // Protected Member Functions
//- Read the offset mode from a dictionary
offsetMode readOffsetMode(const dictionary& dict) const;
//- Find cells/faces containing samples //- Find cells/faces containing samples
void findSamples void findSamples
( (
@ -217,34 +219,13 @@ public:
//- Construct from patch //- Construct from patch
mappedPatchBase(const polyPatch&); mappedPatchBase(const polyPatch&);
//- Construct with offsetMode=non-uniform //- Construct with no offset
mappedPatchBase mappedPatchBase
( (
const polyPatch& pp, const polyPatch& pp,
const word& sampleRegion, const word& sampleRegion,
const sampleMode sampleMode, const sampleMode sampleMode,
const word& samplePatch, const word& samplePatch
const vectorField& offsets
);
//- Construct from offsetMode=uniform
mappedPatchBase
(
const polyPatch& pp,
const word& sampleRegion,
const sampleMode sampleMode,
const word& samplePatch,
const vector& offset
);
//- Construct from offsetMode=normal and distance
mappedPatchBase
(
const polyPatch& pp,
const word& sampleRegion,
const sampleMode sampleMode,
const word& samplePatch,
const scalar distance
); );
//- Construct from dictionary //- Construct from dictionary
@ -253,14 +234,6 @@ public:
//- Construct as copy, resetting patch //- Construct as copy, resetting patch
mappedPatchBase(const polyPatch&, const mappedPatchBase&); mappedPatchBase(const polyPatch&, const mappedPatchBase&);
//- Construct as copy, resetting patch, map original data
mappedPatchBase
(
const polyPatch&,
const mappedPatchBase&,
const labelUList& mapAddressing
);
//- Destructor //- Destructor
virtual ~mappedPatchBase(); virtual ~mappedPatchBase();

View File

@ -60,56 +60,6 @@ Foam::mappedPolyPatch::mappedPolyPatch
} }
Foam::mappedPolyPatch::mappedPolyPatch
(
const word& name,
const label size,
const label start,
const label index,
const word& sampleRegion,
const mappedPatchBase::sampleMode mode,
const word& samplePatch,
const vectorField& offset,
const polyBoundaryMesh& bm
)
:
polyPatch(name, size, start, index, bm, typeName),
mappedPatchBase
(
static_cast<const polyPatch&>(*this),
sampleRegion,
mode,
samplePatch,
offset
)
{}
Foam::mappedPolyPatch::mappedPolyPatch
(
const word& name,
const label size,
const label start,
const label index,
const word& sampleRegion,
const mappedPatchBase::sampleMode mode,
const word& samplePatch,
const vector& offset,
const polyBoundaryMesh& bm
)
:
polyPatch(name, size, start, index, bm, typeName),
mappedPatchBase
(
static_cast<const polyPatch&>(*this),
sampleRegion,
mode,
samplePatch,
offset
)
{}
Foam::mappedPolyPatch::mappedPolyPatch Foam::mappedPolyPatch::mappedPolyPatch
( (
const word& name, const word& name,
@ -155,20 +105,6 @@ Foam::mappedPolyPatch::mappedPolyPatch
{} {}
Foam::mappedPolyPatch::mappedPolyPatch
(
const mappedPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
)
:
polyPatch(pp, bm, index, mapAddressing, newStart),
mappedPatchBase(*this, pp, mapAddressing)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::mappedPolyPatch::~mappedPolyPatch() Foam::mappedPolyPatch::~mappedPolyPatch()

View File

@ -97,34 +97,6 @@ public:
const word& patchType const word& patchType
); );
//- Construct from components
mappedPolyPatch
(
const word& name,
const label size,
const label start,
const label index,
const word& sampleRegion,
const mappedPatchBase::sampleMode mode,
const word& samplePatch,
const vectorField& offset,
const polyBoundaryMesh& bm
);
//- Construct from components. Uniform offset.
mappedPolyPatch
(
const word& name,
const label size,
const label start,
const label index,
const word& sampleRegion,
const mappedPatchBase::sampleMode mode,
const word& samplePatch,
const vector& offset,
const polyBoundaryMesh& bm
);
//- Construct from dictionary //- Construct from dictionary
mappedPolyPatch mappedPolyPatch
( (
@ -153,16 +125,6 @@ public:
const label newStart const label newStart
); );
//- Construct given the original patch and a map
mappedPolyPatch
(
const mappedPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{ {
@ -185,29 +147,6 @@ public:
); );
} }
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new mappedPolyPatch
(
*this,
bm,
index,
mapAddressing,
newStart
)
);
}
//- Destructor //- Destructor
virtual ~mappedPolyPatch(); virtual ~mappedPolyPatch();

View File

@ -75,44 +75,11 @@ Foam::mappedWallPolyPatch::mappedWallPolyPatch
const word& sampleRegion, const word& sampleRegion,
const mappedPatchBase::sampleMode mode, const mappedPatchBase::sampleMode mode,
const word& samplePatch, const word& samplePatch,
const vectorField& offset,
const polyBoundaryMesh& bm const polyBoundaryMesh& bm
) )
: :
wallPolyPatch(name, size, start, index, bm, typeName), wallPolyPatch(name, size, start, index, bm, typeName),
mappedPatchBase mappedPatchBase(*this, sampleRegion, mode, samplePatch)
(
static_cast<const polyPatch&>(*this),
sampleRegion,
mode,
samplePatch,
offset
)
{}
Foam::mappedWallPolyPatch::mappedWallPolyPatch
(
const word& name,
const label size,
const label start,
const label index,
const word& sampleRegion,
const mappedPatchBase::sampleMode mode,
const word& samplePatch,
const vector& offset,
const polyBoundaryMesh& bm
)
:
wallPolyPatch(name, size, start, index, bm, typeName),
mappedPatchBase
(
static_cast<const polyPatch&>(*this),
sampleRegion,
mode,
samplePatch,
offset
)
{} {}
@ -161,20 +128,6 @@ Foam::mappedWallPolyPatch::mappedWallPolyPatch
{} {}
Foam::mappedWallPolyPatch::mappedWallPolyPatch
(
const mappedWallPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
)
:
wallPolyPatch(pp, bm, index, mapAddressing, newStart),
mappedPatchBase(*this, pp, mapAddressing)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::mappedWallPolyPatch::~mappedWallPolyPatch() Foam::mappedWallPolyPatch::~mappedWallPolyPatch()

View File

@ -107,21 +107,6 @@ public:
const word& sampleRegion, const word& sampleRegion,
const mappedPatchBase::sampleMode mode, const mappedPatchBase::sampleMode mode,
const word& samplePatch, const word& samplePatch,
const vectorField& offset,
const polyBoundaryMesh& bm
);
//- Construct from components. Uniform offset.
mappedWallPolyPatch
(
const word& name,
const label size,
const label start,
const label index,
const word& sampleRegion,
const mappedPatchBase::sampleMode mode,
const word& samplePatch,
const vector& offset,
const polyBoundaryMesh& bm const polyBoundaryMesh& bm
); );
@ -153,16 +138,6 @@ public:
const label newStart const label newStart
); );
//- Construct given the original patch and a map
mappedWallPolyPatch
(
const mappedWallPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{ {
@ -192,29 +167,6 @@ public:
); );
} }
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new mappedWallPolyPatch
(
*this,
bm,
index,
mapAddressing,
newStart
)
);
}
//- Destructor //- Destructor
virtual ~mappedWallPolyPatch(); virtual ~mappedWallPolyPatch();

View File

@ -220,24 +220,6 @@ Foam::nonConformalCyclicPolyPatch::nonConformalCyclicPolyPatch
{} {}
Foam::nonConformalCyclicPolyPatch::nonConformalCyclicPolyPatch
(
const nonConformalCyclicPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
)
:
cyclicPolyPatch(pp, bm, index, mapAddressing, newStart),
nonConformalCoupledPolyPatch(*this, pp),
intersectionIsValid_(false),
intersection_(false),
raysIsValid_(false),
rays_(false)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::nonConformalCyclicPolyPatch::~nonConformalCyclicPolyPatch() Foam::nonConformalCyclicPolyPatch::~nonConformalCyclicPolyPatch()

View File

@ -162,16 +162,6 @@ public:
const word& origPatchName const word& origPatchName
); );
//- Construct given the original patch and a map
nonConformalCyclicPolyPatch
(
const nonConformalCyclicPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{ {
@ -206,29 +196,6 @@ public:
); );
} }
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new nonConformalCyclicPolyPatch
(
*this,
bm,
index,
mapAddressing,
newStart
)
);
}
//- Destructor //- Destructor
virtual ~nonConformalCyclicPolyPatch(); virtual ~nonConformalCyclicPolyPatch();

View File

@ -132,20 +132,6 @@ Foam::nonConformalErrorPolyPatch::nonConformalErrorPolyPatch
{} {}
Foam::nonConformalErrorPolyPatch::nonConformalErrorPolyPatch
(
const nonConformalErrorPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
)
:
polyPatch(pp, bm, index, mapAddressing, newStart),
nonConformalPolyPatch(*this, pp)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::nonConformalErrorPolyPatch::~nonConformalErrorPolyPatch() Foam::nonConformalErrorPolyPatch::~nonConformalErrorPolyPatch()

View File

@ -132,16 +132,6 @@ public:
const word& origPatchName const word& origPatchName
); );
//- Construct given the original patch and a map
nonConformalErrorPolyPatch
(
const nonConformalErrorPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{ {
@ -175,29 +165,6 @@ public:
); );
} }
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new nonConformalErrorPolyPatch
(
*this,
bm,
index,
mapAddressing,
newStart
)
);
}
//- Destructor //- Destructor
virtual ~nonConformalErrorPolyPatch(); virtual ~nonConformalErrorPolyPatch();

View File

@ -135,21 +135,6 @@ nonConformalProcessorCyclicPolyPatch
{} {}
Foam::nonConformalProcessorCyclicPolyPatch::
nonConformalProcessorCyclicPolyPatch
(
const nonConformalProcessorCyclicPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
)
:
processorCyclicPolyPatch(pp, bm, index, mapAddressing, newStart),
nonConformalCoupledPolyPatch(*this, pp)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::nonConformalProcessorCyclicPolyPatch:: Foam::nonConformalProcessorCyclicPolyPatch::

View File

@ -117,16 +117,6 @@ public:
const label newStart const label newStart
); );
//- Construct given the original patch and a map
nonConformalProcessorCyclicPolyPatch
(
const nonConformalProcessorCyclicPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{ {
@ -159,29 +149,6 @@ public:
); );
} }
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new nonConformalProcessorCyclicPolyPatch
(
*this,
bm,
index,
mapAddressing,
newStart
)
);
}
// Destructor // Destructor
virtual ~nonConformalProcessorCyclicPolyPatch(); virtual ~nonConformalProcessorCyclicPolyPatch();

View File

@ -806,7 +806,7 @@ void Foam::domainDecomposition::decompose()
label nPatches = 0; label nPatches = 0;
// Map existing non-proc patches // Copy existing non-proc patches
forAll(curPatchSizes, patchi) forAll(curPatchSizes, patchi)
{ {
const polyPatch& meshPatch = meshPatches[patchi]; const polyPatch& meshPatch = meshPatches[patchi];
@ -816,12 +816,7 @@ void Foam::domainDecomposition::decompose()
( (
procMesh.boundaryMesh(), procMesh.boundaryMesh(),
nPatches, nPatches,
SubList<label> curPatchSizes[patchi],
(
curFaceLabels,
curPatchSizes[patchi],
curPatchStarts[patchi]
) - 1 - meshPatch.start(),
curPatchStarts[patchi] curPatchStarts[patchi]
).ptr(); ).ptr();

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
@ -32,7 +32,6 @@ namespace Foam
{ {
namespace sampledSurfaces namespace sampledSurfaces
{ {
defineTypeNameAndDebug(patchInternalField, 0); defineTypeNameAndDebug(patchInternalField, 0);
addToRunTimeSelectionTable(sampledSurface, patchInternalField, word); addToRunTimeSelectionTable(sampledSurface, patchInternalField, word);
} }
@ -51,79 +50,32 @@ Foam::sampledSurfaces::patchInternalField::patchInternalField
patch(name, mesh, dict), patch(name, mesh, dict),
mappers_(patchIDs().size()) mappers_(patchIDs().size())
{ {
mappedPatchBase::offsetMode mode = mappedPatchBase::NORMAL; dictionary mappersDict(dict);
if (dict.found("offsetMode"))
// Add the sample mode (i.e., nearest cell)
mappersDict.add
(
"sampleMode",
mappedPatchBase::sampleModeNames_[mappedPatchBase::NEARESTCELL]
);
// Negate the distance so that we sample cells inside the patch
if (dict.found("distance"))
{ {
mode = mappedPatchBase::offsetModeNames_.read mappersDict.set("distance", -mappersDict.lookup<scalar>("distance"));
(
dict.lookup("offsetMode")
);
} }
switch (mode) forAll(patchIDs(), i)
{ {
case mappedPatchBase::NORMAL: mappers_.set
{ (
const scalar distance = dict.lookup<scalar>("distance"); i,
forAll(patchIDs(), i) new mappedPatchBase
{ (
mappers_.set mesh.boundaryMesh()[patchIDs()[i]],
( mappersDict
i, )
new mappedPatchBase );
(
mesh.boundaryMesh()[patchIDs()[i]],
mesh.name(), // sampleRegion
mappedPatchBase::NEARESTCELL, // sampleMode
word::null, // samplePatch
-distance // sample inside my domain
)
);
}
}
break;
case mappedPatchBase::UNIFORM:
{
const point offset(dict.lookup("offset"));
forAll(patchIDs(), i)
{
mappers_.set
(
i,
new mappedPatchBase
(
mesh.boundaryMesh()[patchIDs()[i]],
mesh.name(), // sampleRegion
mappedPatchBase::NEARESTCELL, // sampleMode
word::null, // samplePatch
offset // sample inside my domain
)
);
}
}
break;
case mappedPatchBase::NONUNIFORM:
{
const pointField offsets(dict.lookup("offsets"));
forAll(patchIDs(), i)
{
mappers_.set
(
i,
new mappedPatchBase
(
mesh.boundaryMesh()[patchIDs()[i]],
mesh.name(), // sampleRegion
mappedPatchBase::NEARESTCELL, // sampleMode
word::null, // samplePatch
offsets // sample inside my domain
)
);
}
}
break;
} }
} }