polyTopoChange: Removed most unnecessary setAction clutter
This commit is contained in:
@ -54,8 +54,6 @@ Description
|
|||||||
#include "cellSet.H"
|
#include "cellSet.H"
|
||||||
#include "syncTools.H"
|
#include "syncTools.H"
|
||||||
#include "polyTopoChange.H"
|
#include "polyTopoChange.H"
|
||||||
#include "polyModifyFace.H"
|
|
||||||
#include "polyAddFace.H"
|
|
||||||
#include "regionSplit.H"
|
#include "regionSplit.H"
|
||||||
#include "Tuple2.H"
|
#include "Tuple2.H"
|
||||||
#include "cyclicFvPatch.H"
|
#include "cyclicFvPatch.H"
|
||||||
@ -81,9 +79,7 @@ void modifyOrAddFace
|
|||||||
if (!modifiedFace[facei])
|
if (!modifiedFace[facei])
|
||||||
{
|
{
|
||||||
// First usage of face. Modify.
|
// First usage of face. Modify.
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
f, // modified face
|
f, // modified face
|
||||||
facei, // label of face
|
facei, // label of face
|
||||||
@ -91,19 +87,15 @@ void modifyOrAddFace
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
flipFaceFlux, // face flip
|
flipFaceFlux, // face flip
|
||||||
newPatchi, // patch for face
|
newPatchi, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
modifiedFace[facei] = 1;
|
modifiedFace[facei] = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Second or more usage of face. Add.
|
// Second or more usage of face. Add.
|
||||||
meshMod.setAction
|
meshMod.addFace
|
||||||
(
|
|
||||||
polyAddFace
|
|
||||||
(
|
(
|
||||||
f, // modified face
|
f, // modified face
|
||||||
own, // owner
|
own, // owner
|
||||||
@ -115,7 +107,6 @@ void modifyOrAddFace
|
|||||||
newPatchi, // patch for face
|
newPatchi, // patch for face
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -477,9 +468,7 @@ void createBaffles
|
|||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
||||||
}
|
}
|
||||||
|
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
f, // modified face
|
f, // modified face
|
||||||
facei, // label of face
|
facei, // label of face
|
||||||
@ -487,10 +476,8 @@ void createBaffles
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
wantedPatch[facei], // patch for face
|
wantedPatch[facei], // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (mesh.isInternalFace(facei))
|
if (mesh.isInternalFace(facei))
|
||||||
@ -504,9 +491,7 @@ void createBaffles
|
|||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
||||||
}
|
}
|
||||||
|
|
||||||
meshMod.setAction
|
meshMod.addFace
|
||||||
(
|
|
||||||
polyAddFace
|
|
||||||
(
|
(
|
||||||
f.reverseFace(), // modified face
|
f.reverseFace(), // modified face
|
||||||
mesh.faceNeighbour()[facei],// owner
|
mesh.faceNeighbour()[facei],// owner
|
||||||
@ -518,7 +503,6 @@ void createBaffles
|
|||||||
wantedPatch[facei], // patch for face
|
wantedPatch[facei], // patch for face
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,8 +49,6 @@ Description
|
|||||||
#include "argList.H"
|
#include "argList.H"
|
||||||
#include "Time.H"
|
#include "Time.H"
|
||||||
#include "polyTopoChange.H"
|
#include "polyTopoChange.H"
|
||||||
#include "polyModifyFace.H"
|
|
||||||
#include "polyAddFace.H"
|
|
||||||
#include "combineFaces.H"
|
#include "combineFaces.H"
|
||||||
#include "removePoints.H"
|
#include "removePoints.H"
|
||||||
#include "meshCheck.H"
|
#include "meshCheck.H"
|
||||||
@ -218,9 +216,7 @@ label mergePatchFaces
|
|||||||
<< " to vertices " << setFaceVerts[0] << endl;
|
<< " to vertices " << setFaceVerts[0] << endl;
|
||||||
|
|
||||||
// Modify the master face.
|
// Modify the master face.
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
setFaceVerts[0], // original face
|
setFaceVerts[0], // original face
|
||||||
newMasterI, // label of face
|
newMasterI, // label of face
|
||||||
@ -228,10 +224,8 @@ label mergePatchFaces
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchID, // patch for face
|
patchID, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -241,9 +235,7 @@ label mergePatchFaces
|
|||||||
Pout<< "Restoring removed face " << setFaces[i]
|
Pout<< "Restoring removed face " << setFaces[i]
|
||||||
<< " with vertices " << setFaceVerts[i] << endl;
|
<< " with vertices " << setFaceVerts[i] << endl;
|
||||||
|
|
||||||
meshMod.setAction
|
meshMod.addFace
|
||||||
(
|
|
||||||
polyAddFace
|
|
||||||
(
|
(
|
||||||
setFaceVerts[i], // vertices
|
setFaceVerts[i], // vertices
|
||||||
own, // owner,
|
own, // owner,
|
||||||
@ -255,7 +247,6 @@ label mergePatchFaces
|
|||||||
patchID, // patchID,
|
patchID, // patchID,
|
||||||
zoneID, // zoneID,
|
zoneID, // zoneID,
|
||||||
zoneFlip // zoneFlip
|
zoneFlip // zoneFlip
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,8 +40,6 @@ Description
|
|||||||
#include "argList.H"
|
#include "argList.H"
|
||||||
#include "Time.H"
|
#include "Time.H"
|
||||||
#include "polyTopoChange.H"
|
#include "polyTopoChange.H"
|
||||||
#include "polyModifyFace.H"
|
|
||||||
#include "polyAddFace.H"
|
|
||||||
#include "ReadFields.H"
|
#include "ReadFields.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "surfaceFields.H"
|
#include "surfaceFields.H"
|
||||||
@ -148,9 +146,7 @@ void modifyOrAddFace
|
|||||||
if (!modifiedFace[facei])
|
if (!modifiedFace[facei])
|
||||||
{
|
{
|
||||||
// First usage of face. Modify.
|
// First usage of face. Modify.
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
f, // modified face
|
f, // modified face
|
||||||
facei, // label of face
|
facei, // label of face
|
||||||
@ -158,10 +154,8 @@ void modifyOrAddFace
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
flipFaceFlux, // face flip
|
flipFaceFlux, // face flip
|
||||||
newPatchi, // patch for face
|
newPatchi, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
modifiedFace[facei] = 1;
|
modifiedFace[facei] = 1;
|
||||||
@ -169,9 +163,7 @@ void modifyOrAddFace
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Second usage of face. Add.
|
// Second usage of face. Add.
|
||||||
meshMod.setAction
|
meshMod.addFace
|
||||||
(
|
|
||||||
polyAddFace
|
|
||||||
(
|
(
|
||||||
f, // modified face
|
f, // modified face
|
||||||
own, // owner
|
own, // owner
|
||||||
@ -183,7 +175,6 @@ void modifyOrAddFace
|
|||||||
newPatchi, // patch for face
|
newPatchi, // patch for face
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -46,7 +46,6 @@ Description
|
|||||||
#include "meshTools.H"
|
#include "meshTools.H"
|
||||||
#include "faceSet.H"
|
#include "faceSet.H"
|
||||||
#include "polyTopoChange.H"
|
#include "polyTopoChange.H"
|
||||||
#include "polyModifyFace.H"
|
|
||||||
#include "wordReList.H"
|
#include "wordReList.H"
|
||||||
#include "systemDict.H"
|
#include "systemDict.H"
|
||||||
|
|
||||||
@ -73,9 +72,7 @@ void changePatchID
|
|||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(faceID)];
|
zoneFlip = fZone.flipMap()[fZone.whichFace(faceID)];
|
||||||
}
|
}
|
||||||
|
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
mesh.faces()[faceID], // face
|
mesh.faces()[faceID], // face
|
||||||
faceID, // face ID
|
faceID, // face ID
|
||||||
@ -83,10 +80,8 @@ void changePatchID
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // flip flux
|
false, // flip flux
|
||||||
patchID, // patch ID
|
patchID, // patch ID
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone ID
|
zoneID, // zone ID
|
||||||
zoneFlip // zone flip
|
zoneFlip // zone flip
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -37,8 +37,6 @@ Description
|
|||||||
#include "pointSet.H"
|
#include "pointSet.H"
|
||||||
#include "meshTools.H"
|
#include "meshTools.H"
|
||||||
#include "polyTopoChange.H"
|
#include "polyTopoChange.H"
|
||||||
#include "polyRemoveFace.H"
|
|
||||||
#include "polyModifyFace.H"
|
|
||||||
#include "indirectPrimitivePatch.H"
|
#include "indirectPrimitivePatch.H"
|
||||||
#include "processorPolyPatch.H"
|
#include "processorPolyPatch.H"
|
||||||
#include "localPointRegion.H"
|
#include "localPointRegion.H"
|
||||||
@ -118,10 +116,8 @@ void mergeDuplicateBoundaryFaces
|
|||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(face0)];
|
zoneFlip = fZone.flipMap()[fZone.whichFace(face0)];
|
||||||
}
|
}
|
||||||
|
|
||||||
meshMod.setAction(polyRemoveFace(face1));
|
meshMod.removeFace(face1, -1);
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
faces[face0], // modified face
|
faces[face0], // modified face
|
||||||
face0, // label of face being modified
|
face0, // label of face being modified
|
||||||
@ -129,10 +125,8 @@ void mergeDuplicateBoundaryFaces
|
|||||||
own1, // neighbour
|
own1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
-1, // patch for face
|
-1, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -147,10 +141,8 @@ void mergeDuplicateBoundaryFaces
|
|||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(face1)];
|
zoneFlip = fZone.flipMap()[fZone.whichFace(face1)];
|
||||||
}
|
}
|
||||||
|
|
||||||
meshMod.setAction(polyRemoveFace(face0));
|
meshMod.removeFace(face0, -1);
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
faces[face1], // modified face
|
faces[face1], // modified face
|
||||||
face1, // label of face being modified
|
face1, // label of face being modified
|
||||||
@ -158,10 +150,8 @@ void mergeDuplicateBoundaryFaces
|
|||||||
own0, // neighbour
|
own0, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
-1, // patch for face
|
-1, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,9 +26,6 @@ License
|
|||||||
#include "mergePolyMesh.H"
|
#include "mergePolyMesh.H"
|
||||||
#include "Time.H"
|
#include "Time.H"
|
||||||
#include "polyTopoChangeMap.H"
|
#include "polyTopoChangeMap.H"
|
||||||
#include "polyAddPoint.H"
|
|
||||||
#include "polyAddCell.H"
|
|
||||||
#include "polyAddFace.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -217,16 +214,12 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
|
|||||||
zoneID = pointZoneIndices[zoneID];
|
zoneID = pointZoneIndices[zoneID];
|
||||||
}
|
}
|
||||||
|
|
||||||
renumberPoints[pointi] =
|
renumberPoints[pointi] = meshMod_.addPoint
|
||||||
meshMod_.setAction
|
|
||||||
(
|
|
||||||
polyAddPoint
|
|
||||||
(
|
(
|
||||||
p[pointi], // Point to add
|
p[pointi], // Point to add
|
||||||
-1, // Master point (straight addition)
|
-1, // Master point (straight addition)
|
||||||
zoneID, // Zone for point
|
zoneID, // Zone for point
|
||||||
pointi < m.nPoints() // Is in cell?
|
pointi < m.nPoints() // Is in cell?
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,17 +247,13 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
|
|||||||
zoneID = cellZoneIndices[zoneID];
|
zoneID = cellZoneIndices[zoneID];
|
||||||
}
|
}
|
||||||
|
|
||||||
renumberCells[celli] =
|
renumberCells[celli] = meshMod_.addCell
|
||||||
meshMod_.setAction
|
|
||||||
(
|
|
||||||
polyAddCell
|
|
||||||
(
|
(
|
||||||
-1, // Master point
|
-1, // Master point
|
||||||
-1, // Master edge
|
-1, // Master edge
|
||||||
-1, // Master face
|
-1, // Master face
|
||||||
-1, // Master cell
|
-1, // Master cell
|
||||||
zoneID // Zone for cell
|
zoneID // Zone for cell
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -359,10 +348,7 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
|
|||||||
newZone = faceZoneIndices[newZone];
|
newZone = faceZoneIndices[newZone];
|
||||||
}
|
}
|
||||||
|
|
||||||
renumberFaces[facei] =
|
renumberFaces[facei] = meshMod_.addFace
|
||||||
meshMod_.setAction
|
|
||||||
(
|
|
||||||
polyAddFace
|
|
||||||
(
|
(
|
||||||
newFace,
|
newFace,
|
||||||
newOwn,
|
newOwn,
|
||||||
@ -374,7 +360,6 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
|
|||||||
newPatch,
|
newPatch,
|
||||||
newZone,
|
newZone,
|
||||||
newZoneFlip
|
newZoneFlip
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -43,8 +43,6 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of classes
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class mergePolyMesh Declaration
|
Class mergePolyMesh Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|||||||
@ -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-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -136,9 +136,7 @@ bool repatchFace
|
|||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
||||||
}
|
}
|
||||||
|
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
mesh.faces()[facei],// modified face
|
mesh.faces()[facei],// modified face
|
||||||
facei, // label of face being modified
|
facei, // label of face being modified
|
||||||
@ -146,10 +144,8 @@ bool repatchFace
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchID, // patch for face
|
patchID, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
changed = true;
|
changed = true;
|
||||||
|
|||||||
@ -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-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -27,10 +27,6 @@ License
|
|||||||
#include "polyTopoChange.H"
|
#include "polyTopoChange.H"
|
||||||
#include "meshTools.H"
|
#include "meshTools.H"
|
||||||
#include "polyTopoChangeMap.H"
|
#include "polyTopoChangeMap.H"
|
||||||
#include "polyAddPoint.H"
|
|
||||||
#include "polyAddFace.H"
|
|
||||||
#include "polyModifyFace.H"
|
|
||||||
#include "polyAddCell.H"
|
|
||||||
#include "labelPair.H"
|
#include "labelPair.H"
|
||||||
#include "indirectPrimitivePatch.H"
|
#include "indirectPrimitivePatch.H"
|
||||||
#include "distributionMap.H"
|
#include "distributionMap.H"
|
||||||
|
|||||||
@ -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-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -26,11 +26,6 @@ License
|
|||||||
#include "boundaryCutter.H"
|
#include "boundaryCutter.H"
|
||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
#include "polyTopoChange.H"
|
#include "polyTopoChange.H"
|
||||||
#include "polyAddCell.H"
|
|
||||||
#include "polyAddFace.H"
|
|
||||||
#include "polyAddPoint.H"
|
|
||||||
#include "polyModifyFace.H"
|
|
||||||
#include "polyModifyPoint.H"
|
|
||||||
#include "polyTopoChangeMap.H"
|
#include "polyTopoChangeMap.H"
|
||||||
#include "meshTools.H"
|
#include "meshTools.H"
|
||||||
|
|
||||||
@ -157,9 +152,7 @@ void Foam::boundaryCutter::addFace
|
|||||||
|
|
||||||
if (!modifiedFace)
|
if (!modifiedFace)
|
||||||
{
|
{
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
newFace, // face
|
newFace, // face
|
||||||
facei,
|
facei,
|
||||||
@ -167,19 +160,15 @@ void Foam::boundaryCutter::addFace
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // flux flip
|
false, // flux flip
|
||||||
patchID, // patch for face
|
patchID, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face zone flip
|
zoneFlip // face zone flip
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
modifiedFace = true;
|
modifiedFace = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
meshMod.setAction
|
meshMod.addFace
|
||||||
(
|
|
||||||
polyAddFace
|
|
||||||
(
|
(
|
||||||
newFace, // face
|
newFace, // face
|
||||||
own, // owner
|
own, // owner
|
||||||
@ -191,7 +180,6 @@ void Foam::boundaryCutter::addFace
|
|||||||
patchID, // patch for face
|
patchID, // patch for face
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face zone flip
|
zoneFlip // face zone flip
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -307,7 +295,7 @@ bool Foam::boundaryCutter::splitFace
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Have we already modified existing face (first face gets done
|
// Have we already modified existing face (first face gets done
|
||||||
// as modification; all following ones as polyAddFace)
|
// as modification; all following ones as addFace)
|
||||||
bool modifiedFace = false;
|
bool modifiedFace = false;
|
||||||
|
|
||||||
// Example face:
|
// Example face:
|
||||||
@ -425,16 +413,12 @@ void Foam::boundaryCutter::setRefinement
|
|||||||
|
|
||||||
forAllConstIter(Map<point>, pointToPos, iter)
|
forAllConstIter(Map<point>, pointToPos, iter)
|
||||||
{
|
{
|
||||||
meshMod.setAction
|
meshMod.modifyPoint
|
||||||
(
|
|
||||||
polyModifyPoint
|
|
||||||
(
|
(
|
||||||
iter.key(), // point
|
iter.key(), // point
|
||||||
iter(), // position
|
iter(), // position
|
||||||
false, // no zone
|
|
||||||
-1, // zone for point
|
-1, // zone for point
|
||||||
true // supports a cell
|
true // supports a cell
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -460,16 +444,12 @@ void Foam::boundaryCutter::setRefinement
|
|||||||
// point on feature to move to
|
// point on feature to move to
|
||||||
const point& featurePoint = cuts[cutI];
|
const point& featurePoint = cuts[cutI];
|
||||||
|
|
||||||
label addedPointi =
|
label addedPointi = meshMod.addPoint
|
||||||
meshMod.setAction
|
|
||||||
(
|
|
||||||
polyAddPoint
|
|
||||||
(
|
(
|
||||||
featurePoint, // point
|
featurePoint, // point
|
||||||
e.start(), // master point
|
e.start(), // master point
|
||||||
-1, // zone for point
|
-1, // zone for point
|
||||||
true // supports a cell
|
true // supports a cell
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<labelList>::iterator fnd = edgeToAddedPoints.find(edgeI);
|
Map<labelList>::iterator fnd = edgeToAddedPoints.find(edgeI);
|
||||||
@ -523,16 +503,12 @@ void Foam::boundaryCutter::setRefinement
|
|||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
label addedPointi =
|
label addedPointi = meshMod.addPoint
|
||||||
meshMod.setAction
|
|
||||||
(
|
|
||||||
polyAddPoint
|
|
||||||
(
|
(
|
||||||
iter(), // point
|
iter(), // point
|
||||||
f[0], // master point
|
f[0], // master point
|
||||||
-1, // zone for point
|
-1, // zone for point
|
||||||
true // supports a cell
|
true // supports a cell
|
||||||
)
|
|
||||||
);
|
);
|
||||||
faceAddedPoint_.insert(facei, addedPointi);
|
faceAddedPoint_.insert(facei, addedPointi);
|
||||||
|
|
||||||
@ -586,9 +562,7 @@ void Foam::boundaryCutter::setRefinement
|
|||||||
if (fp == 0)
|
if (fp == 0)
|
||||||
{
|
{
|
||||||
// Modify the existing face.
|
// Modify the existing face.
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
tri, // face
|
tri, // face
|
||||||
facei,
|
facei,
|
||||||
@ -596,18 +570,14 @@ void Foam::boundaryCutter::setRefinement
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // flux flip
|
false, // flux flip
|
||||||
patchID, // patch for face
|
patchID, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face zone flip
|
zoneFlip // face zone flip
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Add additional faces
|
// Add additional faces
|
||||||
meshMod.setAction
|
meshMod.addFace
|
||||||
(
|
|
||||||
polyAddFace
|
|
||||||
(
|
(
|
||||||
tri, // face
|
tri, // face
|
||||||
own, // owner
|
own, // owner
|
||||||
@ -619,7 +589,6 @@ void Foam::boundaryCutter::setRefinement
|
|||||||
patchID, // patch for face
|
patchID, // patch for face
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face zone flip
|
zoneFlip // face zone flip
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -689,9 +658,7 @@ void Foam::boundaryCutter::setRefinement
|
|||||||
|
|
||||||
|
|
||||||
// Modify the existing face.
|
// Modify the existing face.
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
face(newVerts.shrink()), // face
|
face(newVerts.shrink()), // face
|
||||||
facei,
|
facei,
|
||||||
@ -699,10 +666,8 @@ void Foam::boundaryCutter::setRefinement
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // flux flip
|
false, // flux flip
|
||||||
patchID, // patch for face
|
patchID, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face zone flip
|
zoneFlip // face zone flip
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -721,9 +686,7 @@ void Foam::boundaryCutter::setRefinement
|
|||||||
newVerts.append(newFace[fp0]);
|
newVerts.append(newFace[fp0]);
|
||||||
|
|
||||||
// Add additional face
|
// Add additional face
|
||||||
meshMod.setAction
|
meshMod.addFace
|
||||||
(
|
|
||||||
polyAddFace
|
|
||||||
(
|
(
|
||||||
face(newVerts.shrink()), // face
|
face(newVerts.shrink()), // face
|
||||||
own, // owner
|
own, // owner
|
||||||
@ -735,7 +698,6 @@ void Foam::boundaryCutter::setRefinement
|
|||||||
patchID, // patch for face
|
patchID, // patch for face
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face zone flip
|
zoneFlip // face zone flip
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
faceUptodate[facei] = true;
|
faceUptodate[facei] = true;
|
||||||
@ -797,9 +759,7 @@ void Foam::boundaryCutter::setRefinement
|
|||||||
label patchID, zoneID, zoneFlip;
|
label patchID, zoneID, zoneFlip;
|
||||||
getFaceInfo(facei, patchID, zoneID, zoneFlip);
|
getFaceInfo(facei, patchID, zoneID, zoneFlip);
|
||||||
|
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
newFace, // modified face
|
newFace, // modified face
|
||||||
facei, // label of face being modified
|
facei, // label of face being modified
|
||||||
@ -807,10 +767,8 @@ void Foam::boundaryCutter::setRefinement
|
|||||||
nei, // neighbour
|
nei, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchID, // patch for face
|
patchID, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
faceUptodate[facei] = true;
|
faceUptodate[facei] = true;
|
||||||
|
|||||||
@ -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-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -26,11 +26,6 @@ License
|
|||||||
#include "meshCutAndRemove.H"
|
#include "meshCutAndRemove.H"
|
||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
#include "polyTopoChange.H"
|
#include "polyTopoChange.H"
|
||||||
#include "polyAddFace.H"
|
|
||||||
#include "polyAddPoint.H"
|
|
||||||
#include "polyRemovePoint.H"
|
|
||||||
#include "polyRemoveFace.H"
|
|
||||||
#include "polyModifyFace.H"
|
|
||||||
#include "cellCuts.H"
|
#include "cellCuts.H"
|
||||||
#include "polyTopoChangeMap.H"
|
#include "polyTopoChangeMap.H"
|
||||||
#include "meshTools.H"
|
#include "meshTools.H"
|
||||||
@ -266,9 +261,7 @@ void Foam::meshCutAndRemove::addFace
|
|||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
meshMod.setAction
|
meshMod.addFace
|
||||||
(
|
|
||||||
polyAddFace
|
|
||||||
(
|
(
|
||||||
newFace, // face
|
newFace, // face
|
||||||
own, // owner
|
own, // owner
|
||||||
@ -280,7 +273,6 @@ void Foam::meshCutAndRemove::addFace
|
|||||||
patchID, // patch for face
|
patchID, // patch for face
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face zone flip
|
zoneFlip // face zone flip
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -298,9 +290,7 @@ void Foam::meshCutAndRemove::addFace
|
|||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
meshMod.setAction
|
meshMod.addFace
|
||||||
(
|
|
||||||
polyAddFace
|
|
||||||
(
|
(
|
||||||
newFace.reverseFace(), // face
|
newFace.reverseFace(), // face
|
||||||
nei, // owner
|
nei, // owner
|
||||||
@ -312,7 +302,6 @@ void Foam::meshCutAndRemove::addFace
|
|||||||
patchID, // patch for face
|
patchID, // patch for face
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face zone flip
|
zoneFlip // face zone flip
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -359,9 +348,7 @@ void Foam::meshCutAndRemove::modFace
|
|||||||
|
|
||||||
if ((nei == -1) || (own != -1 && own < nei))
|
if ((nei == -1) || (own != -1 && own < nei))
|
||||||
{
|
{
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
newFace, // modified face
|
newFace, // modified face
|
||||||
facei, // label of face being modified
|
facei, // label of face being modified
|
||||||
@ -369,17 +356,13 @@ void Foam::meshCutAndRemove::modFace
|
|||||||
nei, // neighbour
|
nei, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchID, // patch for face
|
patchID, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
newFace.reverseFace(), // modified face
|
newFace.reverseFace(), // modified face
|
||||||
facei, // label of face being modified
|
facei, // label of face being modified
|
||||||
@ -387,10 +370,8 @@ void Foam::meshCutAndRemove::modFace
|
|||||||
own, // neighbour
|
own, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchID, // patch for face
|
patchID, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -632,16 +613,12 @@ void Foam::meshCutAndRemove::setRefinement
|
|||||||
|
|
||||||
point newPt = weight*v1 + (1.0-weight)*v0;
|
point newPt = weight*v1 + (1.0-weight)*v0;
|
||||||
|
|
||||||
label addedPointi =
|
label addedPointi = meshMod.addPoint
|
||||||
meshMod.setAction
|
|
||||||
(
|
|
||||||
polyAddPoint
|
|
||||||
(
|
(
|
||||||
newPt, // point
|
newPt, // point
|
||||||
masterPointi, // master point
|
masterPointi, // master point
|
||||||
-1, // zone for point
|
-1, // zone for point
|
||||||
true // supports a cell
|
true // supports a cell
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Store on (hash of) edge.
|
// Store on (hash of) edge.
|
||||||
@ -752,7 +729,7 @@ void Foam::meshCutAndRemove::setRefinement
|
|||||||
{
|
{
|
||||||
if (!usedPoint[pointi])
|
if (!usedPoint[pointi])
|
||||||
{
|
{
|
||||||
meshMod.setAction(polyRemovePoint(pointi));
|
meshMod.removePoint(pointi, -1);
|
||||||
|
|
||||||
if (debug & 2)
|
if (debug & 2)
|
||||||
{
|
{
|
||||||
@ -792,10 +769,7 @@ void Foam::meshCutAndRemove::setRefinement
|
|||||||
// Pick any anchor point on cell
|
// Pick any anchor point on cell
|
||||||
label masterPointi = findPatchFacePoint(newFace, exposedPatchi);
|
label masterPointi = findPatchFacePoint(newFace, exposedPatchi);
|
||||||
|
|
||||||
label addedFacei =
|
label addedFacei = meshMod.addFace
|
||||||
meshMod.setAction
|
|
||||||
(
|
|
||||||
polyAddFace
|
|
||||||
(
|
(
|
||||||
newFace, // face
|
newFace, // face
|
||||||
celli, // owner
|
celli, // owner
|
||||||
@ -807,7 +781,6 @@ void Foam::meshCutAndRemove::setRefinement
|
|||||||
cutPatch[celli], // patch for face
|
cutPatch[celli], // patch for face
|
||||||
-1, // zone for face
|
-1, // zone for face
|
||||||
false // face zone flip
|
false // face zone flip
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
addedFaces_.insert(celli, addedFacei);
|
addedFaces_.insert(celli, addedFacei);
|
||||||
@ -1140,7 +1113,7 @@ void Foam::meshCutAndRemove::setRefinement
|
|||||||
|
|
||||||
if (f0Own == -1 && f0Nei == -1 && !modifiedFacei)
|
if (f0Own == -1 && f0Nei == -1 && !modifiedFacei)
|
||||||
{
|
{
|
||||||
meshMod.setAction(polyRemoveFace(facei));
|
meshMod.removeFace(facei, -1);
|
||||||
|
|
||||||
if (debug & 2)
|
if (debug & 2)
|
||||||
{
|
{
|
||||||
@ -1182,7 +1155,7 @@ void Foam::meshCutAndRemove::setRefinement
|
|||||||
|
|
||||||
if (own == -1 && nei == -1)
|
if (own == -1 && nei == -1)
|
||||||
{
|
{
|
||||||
meshMod.setAction(polyRemoveFace(facei));
|
meshMod.removeFace(facei, -1);
|
||||||
|
|
||||||
if (debug & 2)
|
if (debug & 2)
|
||||||
{
|
{
|
||||||
@ -1237,7 +1210,7 @@ void Foam::meshCutAndRemove::setRefinement
|
|||||||
|
|
||||||
if (own == -1 && nei == -1)
|
if (own == -1 && nei == -1)
|
||||||
{
|
{
|
||||||
meshMod.setAction(polyRemoveFace(facei));
|
meshMod.removeFace(facei, -1);
|
||||||
|
|
||||||
if (debug & 2)
|
if (debug & 2)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -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-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -29,10 +29,6 @@ License
|
|||||||
#include "cellCuts.H"
|
#include "cellCuts.H"
|
||||||
#include "polyTopoChangeMap.H"
|
#include "polyTopoChangeMap.H"
|
||||||
#include "meshTools.H"
|
#include "meshTools.H"
|
||||||
#include "polyModifyFace.H"
|
|
||||||
#include "polyAddPoint.H"
|
|
||||||
#include "polyAddFace.H"
|
|
||||||
#include "polyAddCell.H"
|
|
||||||
#include "syncTools.H"
|
#include "syncTools.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -221,9 +217,7 @@ void Foam::meshCutter::addFace
|
|||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
meshMod.setAction
|
meshMod.addFace
|
||||||
(
|
|
||||||
polyAddFace
|
|
||||||
(
|
(
|
||||||
newFace, // face
|
newFace, // face
|
||||||
own, // owner
|
own, // owner
|
||||||
@ -235,7 +229,6 @@ void Foam::meshCutter::addFace
|
|||||||
patchID, // patch for face
|
patchID, // patch for face
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face zone flip
|
zoneFlip // face zone flip
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -252,9 +245,7 @@ void Foam::meshCutter::addFace
|
|||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
meshMod.setAction
|
meshMod.addFace
|
||||||
(
|
|
||||||
polyAddFace
|
|
||||||
(
|
(
|
||||||
newFace.reverseFace(), // face
|
newFace.reverseFace(), // face
|
||||||
nei, // owner
|
nei, // owner
|
||||||
@ -266,7 +257,6 @@ void Foam::meshCutter::addFace
|
|||||||
patchID, // patch for face
|
patchID, // patch for face
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face zone flip
|
zoneFlip // face zone flip
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -309,9 +299,7 @@ void Foam::meshCutter::modFace
|
|||||||
|
|
||||||
if ((nei == -1) || (own < nei))
|
if ((nei == -1) || (own < nei))
|
||||||
{
|
{
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
newFace, // modified face
|
newFace, // modified face
|
||||||
facei, // label of face being modified
|
facei, // label of face being modified
|
||||||
@ -319,17 +307,13 @@ void Foam::meshCutter::modFace
|
|||||||
nei, // neighbour
|
nei, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchID, // patch for face
|
patchID, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
newFace.reverseFace(), // modified face
|
newFace.reverseFace(), // modified face
|
||||||
facei, // label of face being modified
|
facei, // label of face being modified
|
||||||
@ -337,10 +321,8 @@ void Foam::meshCutter::modFace
|
|||||||
own, // neighbour
|
own, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchID, // patch for face
|
patchID, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -599,16 +581,12 @@ void Foam::meshCutter::setRefinement
|
|||||||
|
|
||||||
point newPt = weight*v1 + (1.0-weight)*v0;
|
point newPt = weight*v1 + (1.0-weight)*v0;
|
||||||
|
|
||||||
label addedPointi =
|
label addedPointi = meshMod.addPoint
|
||||||
meshMod.setAction
|
|
||||||
(
|
|
||||||
polyAddPoint
|
|
||||||
(
|
(
|
||||||
newPt, // point
|
newPt, // point
|
||||||
masterPointi, // master point
|
masterPointi, // master point
|
||||||
-1, // zone for point
|
-1, // zone for point
|
||||||
true // supports a cell
|
true // supports a cell
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Store on (hash of) edge.
|
// Store on (hash of) edge.
|
||||||
@ -633,17 +611,13 @@ void Foam::meshCutter::setRefinement
|
|||||||
if (cellLoops[celli].size())
|
if (cellLoops[celli].size())
|
||||||
{
|
{
|
||||||
// Add a cell to the existing cell
|
// Add a cell to the existing cell
|
||||||
label addedCelli =
|
label addedCelli = meshMod.addCell
|
||||||
meshMod.setAction
|
|
||||||
(
|
|
||||||
polyAddCell
|
|
||||||
(
|
(
|
||||||
-1, // master point
|
-1, // master point
|
||||||
-1, // master edge
|
-1, // master edge
|
||||||
-1, // master face
|
-1, // master face
|
||||||
celli, // master cell
|
celli, // master cell
|
||||||
mesh().cellZones().whichZone(celli) // zone for cell
|
mesh().cellZones().whichZone(celli) // zone for cell
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
addedCells_.insert(celli, addedCelli);
|
addedCells_.insert(celli, addedCelli);
|
||||||
@ -676,9 +650,7 @@ void Foam::meshCutter::setRefinement
|
|||||||
label masterPointi = findInternalFacePoint(anchorPts[celli]);
|
label masterPointi = findInternalFacePoint(anchorPts[celli]);
|
||||||
|
|
||||||
label addedFacei =
|
label addedFacei =
|
||||||
meshMod.setAction
|
meshMod.addFace
|
||||||
(
|
|
||||||
polyAddFace
|
|
||||||
(
|
(
|
||||||
newFace, // face
|
newFace, // face
|
||||||
celli, // owner
|
celli, // owner
|
||||||
@ -690,7 +662,6 @@ void Foam::meshCutter::setRefinement
|
|||||||
-1, // patch for face
|
-1, // patch for face
|
||||||
-1, // zone for face
|
-1, // zone for face
|
||||||
false // face zone flip
|
false // face zone flip
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
addedFaces_.insert(celli, addedFacei);
|
addedFaces_.insert(celli, addedFacei);
|
||||||
|
|||||||
@ -1,197 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::polyAddCell
|
|
||||||
|
|
||||||
Description
|
|
||||||
Class containing data for cell addition.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef polyAddCell_H
|
|
||||||
#define polyAddCell_H
|
|
||||||
|
|
||||||
#include "label.H"
|
|
||||||
#include "topoAction.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class polyAddCell Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class polyAddCell
|
|
||||||
:
|
|
||||||
public topoAction
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Master point ID for cells blown up from points
|
|
||||||
label masterPointID_;
|
|
||||||
|
|
||||||
//- Master edge ID for cells blown up from edges
|
|
||||||
label masterEdgeID_;
|
|
||||||
|
|
||||||
//- Master face ID for cells blown up from faces
|
|
||||||
label masterFaceID_;
|
|
||||||
|
|
||||||
//- Master cell ID for cells blown up from cells
|
|
||||||
label masterCellID_;
|
|
||||||
|
|
||||||
//- Cell zone ID
|
|
||||||
label zoneID_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Static Data Members
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("addCell");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct null. Used for constructing lists
|
|
||||||
polyAddCell()
|
|
||||||
:
|
|
||||||
masterPointID_(-1),
|
|
||||||
masterEdgeID_(-1),
|
|
||||||
masterFaceID_(-1),
|
|
||||||
masterCellID_(-1),
|
|
||||||
zoneID_(-1)
|
|
||||||
{}
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
polyAddCell
|
|
||||||
(
|
|
||||||
const label masterPointID,
|
|
||||||
const label masterEdgeID,
|
|
||||||
const label masterFaceID,
|
|
||||||
const label masterCellID,
|
|
||||||
const label zoneID
|
|
||||||
)
|
|
||||||
:
|
|
||||||
masterPointID_(masterPointID),
|
|
||||||
masterEdgeID_(masterEdgeID),
|
|
||||||
masterFaceID_(masterFaceID),
|
|
||||||
masterCellID_(masterCellID),
|
|
||||||
zoneID_(zoneID)
|
|
||||||
{}
|
|
||||||
|
|
||||||
//- Construct and return a clone
|
|
||||||
virtual autoPtr<topoAction> clone() const
|
|
||||||
{
|
|
||||||
return autoPtr<topoAction>(new polyAddCell(*this));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Default Destructor
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Is the cell mastered by a point
|
|
||||||
bool isPointMaster() const
|
|
||||||
{
|
|
||||||
return masterPointID_ >= 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Is the cell mastered by an edge
|
|
||||||
bool isEdgeMaster() const
|
|
||||||
{
|
|
||||||
return masterEdgeID_ >= 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Is the cell mastered by another face
|
|
||||||
bool isFaceMaster() const
|
|
||||||
{
|
|
||||||
return masterFaceID_ >= 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Is the cell mastered by another cell
|
|
||||||
bool isCellMaster() const
|
|
||||||
{
|
|
||||||
return masterCellID_ >= 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Is the cell appended with no master
|
|
||||||
bool appended() const
|
|
||||||
{
|
|
||||||
return
|
|
||||||
!isPointMaster() && !isEdgeMaster()
|
|
||||||
&& !isFaceMaster() && !isCellMaster();
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return master point ID
|
|
||||||
label masterPointID() const
|
|
||||||
{
|
|
||||||
return masterPointID_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return master edge ID
|
|
||||||
label masterEdgeID() const
|
|
||||||
{
|
|
||||||
return masterEdgeID_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return master face ID
|
|
||||||
label masterFaceID() const
|
|
||||||
{
|
|
||||||
return masterFaceID_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return master cell ID
|
|
||||||
label masterCellID() const
|
|
||||||
{
|
|
||||||
return masterCellID_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Does the cell belong to a zone?
|
|
||||||
bool isInZone() const
|
|
||||||
{
|
|
||||||
return zoneID_ >= 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Cell zone ID
|
|
||||||
label zoneID() const
|
|
||||||
{
|
|
||||||
return zoneID_;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -29,10 +29,6 @@ License
|
|||||||
#include "meshTools.H"
|
#include "meshTools.H"
|
||||||
#include "polyTopoChangeMap.H"
|
#include "polyTopoChangeMap.H"
|
||||||
#include "syncTools.H"
|
#include "syncTools.H"
|
||||||
#include "polyAddPoint.H"
|
|
||||||
#include "polyAddFace.H"
|
|
||||||
#include "polyModifyFace.H"
|
|
||||||
#include "polyAddCell.H"
|
|
||||||
#include "globalIndex.H"
|
#include "globalIndex.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -329,9 +325,7 @@ Foam::label Foam::addPatchCellLayer::addSideFace
|
|||||||
// << " patch:" << newPatchID
|
// << " patch:" << newPatchID
|
||||||
// << endl;
|
// << endl;
|
||||||
|
|
||||||
addedFacei = meshMod.setAction
|
addedFacei = meshMod.addFace
|
||||||
(
|
|
||||||
polyAddFace
|
|
||||||
(
|
(
|
||||||
newFace, // face
|
newFace, // face
|
||||||
addedCells[ownFacei][layerOwn], // owner
|
addedCells[ownFacei][layerOwn], // owner
|
||||||
@ -343,7 +337,6 @@ Foam::label Foam::addPatchCellLayer::addSideFace
|
|||||||
newPatchID, // patch for face
|
newPatchID, // patch for face
|
||||||
zoneI, // zone for face
|
zoneI, // zone for face
|
||||||
flip // face zone flip
|
flip // face zone flip
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -395,9 +388,7 @@ Foam::label Foam::addPatchCellLayer::addSideFace
|
|||||||
layerOwn = layerI;
|
layerOwn = layerI;
|
||||||
}
|
}
|
||||||
|
|
||||||
addedFacei = meshMod.setAction
|
addedFacei = meshMod.addFace
|
||||||
(
|
|
||||||
polyAddFace
|
|
||||||
(
|
(
|
||||||
newFace, // face
|
newFace, // face
|
||||||
addedCells[ownFacei][layerOwn], // owner
|
addedCells[ownFacei][layerOwn], // owner
|
||||||
@ -409,7 +400,6 @@ Foam::label Foam::addPatchCellLayer::addSideFace
|
|||||||
-1, // patch for face
|
-1, // patch for face
|
||||||
zoneI, // zone for face
|
zoneI, // zone for face
|
||||||
flip // face zone flip
|
flip // face zone flip
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Pout<< "Added internal face:" << newFace
|
// Pout<< "Added internal face:" << newFace
|
||||||
@ -1091,15 +1081,12 @@ void Foam::addPatchCellLayer::setRefinement
|
|||||||
{
|
{
|
||||||
label meshPointi = meshPoints[patchPointi];
|
label meshPointi = meshPoints[patchPointi];
|
||||||
label zoneI = mesh_.pointZones().whichZone(meshPointi);
|
label zoneI = mesh_.pointZones().whichZone(meshPointi);
|
||||||
copiedPatchPoints[patchPointi] = meshMod.setAction
|
copiedPatchPoints[patchPointi] = meshMod.addPoint
|
||||||
(
|
|
||||||
polyAddPoint
|
|
||||||
(
|
(
|
||||||
mesh_.points()[meshPointi], // point
|
mesh_.points()[meshPointi], // point
|
||||||
-1, // master point
|
-1, // master point
|
||||||
zoneI, // zone for point
|
zoneI, // zone for point
|
||||||
true // supports a cell
|
true // supports a cell
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1123,15 +1110,12 @@ void Foam::addPatchCellLayer::setRefinement
|
|||||||
{
|
{
|
||||||
pt += disp;
|
pt += disp;
|
||||||
|
|
||||||
label addedVertI = meshMod.setAction
|
label addedVertI = meshMod.addPoint
|
||||||
(
|
|
||||||
polyAddPoint
|
|
||||||
(
|
(
|
||||||
pt, // point
|
pt, // point
|
||||||
(addToMesh_ ? meshPointi : -1), // master point
|
(addToMesh_ ? meshPointi : -1), // master point
|
||||||
zoneI, // zone for point
|
zoneI, // zone for point
|
||||||
true // supports a cell
|
true // supports a cell
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
addedPoints_[patchPointi][i] = addedVertI;
|
addedPoints_[patchPointi][i] = addedVertI;
|
||||||
@ -1165,9 +1149,7 @@ void Foam::addPatchCellLayer::setRefinement
|
|||||||
{
|
{
|
||||||
// Note: add from cell (owner of patch face) or from face?
|
// Note: add from cell (owner of patch face) or from face?
|
||||||
// for now add from cell so we can map easily.
|
// for now add from cell so we can map easily.
|
||||||
addedCells[patchFacei][i] = meshMod.setAction
|
addedCells[patchFacei][i] = meshMod.addCell
|
||||||
(
|
|
||||||
polyAddCell
|
|
||||||
(
|
(
|
||||||
-1, // master point
|
-1, // master point
|
||||||
-1, // master edge
|
-1, // master edge
|
||||||
@ -1175,7 +1157,6 @@ void Foam::addPatchCellLayer::setRefinement
|
|||||||
(addToMesh_ ? mesh_.faceOwner()[meshFacei] : -1),
|
(addToMesh_ ? mesh_.faceOwner()[meshFacei] : -1),
|
||||||
// master
|
// master
|
||||||
ownZoneI // zone for cell
|
ownZoneI // zone for cell
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1255,9 +1236,7 @@ void Foam::addPatchCellLayer::setRefinement
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
layerFaces_[patchFacei][i+1] = meshMod.setAction
|
layerFaces_[patchFacei][i+1] = meshMod.addFace
|
||||||
(
|
|
||||||
polyAddFace
|
|
||||||
(
|
(
|
||||||
newFace, // face
|
newFace, // face
|
||||||
addedCells[patchFacei][i], // owner
|
addedCells[patchFacei][i], // owner
|
||||||
@ -1269,7 +1248,6 @@ void Foam::addPatchCellLayer::setRefinement
|
|||||||
patchi, // patch for face
|
patchi, // patch for face
|
||||||
zoneI, // zone for face
|
zoneI, // zone for face
|
||||||
flip // face zone flip
|
flip // face zone flip
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1289,9 +1267,7 @@ void Foam::addPatchCellLayer::setRefinement
|
|||||||
|
|
||||||
layerFaces_[patchFacei][0] = meshFacei;
|
layerFaces_[patchFacei][0] = meshFacei;
|
||||||
|
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
pp[patchFacei], // modified face
|
pp[patchFacei], // modified face
|
||||||
meshFacei, // label of face
|
meshFacei, // label of face
|
||||||
@ -1299,10 +1275,8 @@ void Foam::addPatchCellLayer::setRefinement
|
|||||||
addedCells[patchFacei][0], // neighbour
|
addedCells[patchFacei][0], // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
-1, // patch for face
|
-1, // patch for face
|
||||||
true, // false, // remove from zone
|
|
||||||
-1, // zoneI, // zone for face
|
-1, // zoneI, // zone for face
|
||||||
false // face flip in zone
|
false // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1331,9 +1305,7 @@ void Foam::addPatchCellLayer::setRefinement
|
|||||||
f[fp] = copiedPatchPoints[f[fp]];
|
f[fp] = copiedPatchPoints[f[fp]];
|
||||||
}
|
}
|
||||||
|
|
||||||
layerFaces_[patchFacei][0] = meshMod.setAction
|
layerFaces_[patchFacei][0] = meshMod.addFace
|
||||||
(
|
|
||||||
polyAddFace
|
|
||||||
(
|
(
|
||||||
f, // modified face
|
f, // modified face
|
||||||
addedCells[patchFacei][0], // owner
|
addedCells[patchFacei][0], // owner
|
||||||
@ -1345,7 +1317,6 @@ void Foam::addPatchCellLayer::setRefinement
|
|||||||
exposedPatchID[patchFacei], // patch for face
|
exposedPatchID[patchFacei], // patch for face
|
||||||
zoneI, // zone for face
|
zoneI, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,11 +26,6 @@ License
|
|||||||
#include "combineFaces.H"
|
#include "combineFaces.H"
|
||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
#include "polyTopoChange.H"
|
#include "polyTopoChange.H"
|
||||||
#include "polyRemoveFace.H"
|
|
||||||
#include "polyAddFace.H"
|
|
||||||
#include "polyModifyFace.H"
|
|
||||||
#include "polyRemovePoint.H"
|
|
||||||
#include "polyAddPoint.H"
|
|
||||||
#include "syncTools.H"
|
#include "syncTools.H"
|
||||||
#include "meshTools.H"
|
#include "meshTools.H"
|
||||||
|
|
||||||
@ -662,9 +657,7 @@ void Foam::combineFaces::setRefinement
|
|||||||
|
|
||||||
label patchi = mesh_.boundaryMesh().whichPatch(masterFacei);
|
label patchi = mesh_.boundaryMesh().whichPatch(masterFacei);
|
||||||
|
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
outsideFace, // modified face
|
outsideFace, // modified face
|
||||||
masterFacei, // label of face being modified
|
masterFacei, // label of face being modified
|
||||||
@ -672,10 +665,8 @@ void Foam::combineFaces::setRefinement
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchi, // patch for face
|
patchi, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -684,7 +675,7 @@ void Foam::combineFaces::setRefinement
|
|||||||
|
|
||||||
for (label i = 1; i < setFaces.size(); i++)
|
for (label i = 1; i < setFaces.size(); i++)
|
||||||
{
|
{
|
||||||
meshMod.setAction(polyRemoveFace(setFaces[i]));
|
meshMod.removeFace(setFaces[i], -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -725,7 +716,7 @@ void Foam::combineFaces::setRefinement
|
|||||||
{
|
{
|
||||||
if (nPointFaces[pointi] == 0)
|
if (nPointFaces[pointi] == 0)
|
||||||
{
|
{
|
||||||
meshMod.setAction(polyRemovePoint(pointi));
|
meshMod.removePoint(pointi, -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -751,7 +742,7 @@ void Foam::combineFaces::setRefinement
|
|||||||
{
|
{
|
||||||
if (nPointFaces[pointi] == 0)
|
if (nPointFaces[pointi] == 0)
|
||||||
{
|
{
|
||||||
meshMod.setAction(polyRemovePoint(pointi));
|
meshMod.removePoint(pointi, -1);
|
||||||
|
|
||||||
savedPointLabels_[n] = pointi;
|
savedPointLabels_[n] = pointi;
|
||||||
savedPoints_[n] = mesh_.points()[pointi];
|
savedPoints_[n] = mesh_.points()[pointi];
|
||||||
@ -909,15 +900,12 @@ void Foam::combineFaces::setUnrefinement
|
|||||||
if (addedPoints[localI] == -1)
|
if (addedPoints[localI] == -1)
|
||||||
{
|
{
|
||||||
// First occurrence of saved point. Reintroduce point
|
// First occurrence of saved point. Reintroduce point
|
||||||
addedPoints[localI] = meshMod.setAction
|
addedPoints[localI] = meshMod.addPoint
|
||||||
(
|
|
||||||
polyAddPoint
|
|
||||||
(
|
(
|
||||||
savedPoints_[localI], // point
|
savedPoints_[localI], // point
|
||||||
-1, // master point
|
-1, // master point
|
||||||
-1, // zone for point
|
-1, // zone for point
|
||||||
true // supports a cell
|
true // supports a cell
|
||||||
)
|
|
||||||
);
|
);
|
||||||
restoredPoints.insert
|
restoredPoints.insert
|
||||||
(
|
(
|
||||||
@ -957,9 +945,7 @@ void Foam::combineFaces::setUnrefinement
|
|||||||
// << " to vertices " << faces[0] << endl;
|
// << " to vertices " << faces[0] << endl;
|
||||||
|
|
||||||
// Modify the master face.
|
// Modify the master face.
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
faces[0], // original face
|
faces[0], // original face
|
||||||
masterFacei, // label of face
|
masterFacei, // label of face
|
||||||
@ -967,10 +953,8 @@ void Foam::combineFaces::setUnrefinement
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchi, // patch for face
|
patchi, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
restoredFaces.insert(masterFacei, masterFacei);
|
restoredFaces.insert(masterFacei, masterFacei);
|
||||||
|
|
||||||
@ -980,9 +964,7 @@ void Foam::combineFaces::setUnrefinement
|
|||||||
// Pout<< "Restoring removed face with vertices " << faces[i]
|
// Pout<< "Restoring removed face with vertices " << faces[i]
|
||||||
// << endl;
|
// << endl;
|
||||||
|
|
||||||
label facei = meshMod.setAction
|
label facei = meshMod.addFace
|
||||||
(
|
|
||||||
polyAddFace
|
|
||||||
(
|
(
|
||||||
faces[i], // vertices
|
faces[i], // vertices
|
||||||
own, // owner,
|
own, // owner,
|
||||||
@ -994,7 +976,6 @@ void Foam::combineFaces::setUnrefinement
|
|||||||
patchi, // patchID,
|
patchi, // patchID,
|
||||||
zoneID, // zoneID,
|
zoneID, // zoneID,
|
||||||
zoneFlip // zoneFlip
|
zoneFlip // zoneFlip
|
||||||
)
|
|
||||||
);
|
);
|
||||||
restoredFaces.insert(facei, masterFacei);
|
restoredFaces.insert(facei, masterFacei);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,8 +26,6 @@ License
|
|||||||
#include "duplicatePoints.H"
|
#include "duplicatePoints.H"
|
||||||
#include "localPointRegion.H"
|
#include "localPointRegion.H"
|
||||||
#include "polyTopoChange.H"
|
#include "polyTopoChange.H"
|
||||||
#include "polyAddPoint.H"
|
|
||||||
#include "polyModifyFace.H"
|
|
||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
#include "OFstream.H"
|
#include "OFstream.H"
|
||||||
#include "meshTools.H"
|
#include "meshTools.H"
|
||||||
|
|||||||
@ -28,10 +28,6 @@ License
|
|||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
#include "polyTopoChange.H"
|
#include "polyTopoChange.H"
|
||||||
#include "meshTools.H"
|
#include "meshTools.H"
|
||||||
#include "polyAddFace.H"
|
|
||||||
#include "polyAddPoint.H"
|
|
||||||
#include "polyAddCell.H"
|
|
||||||
#include "polyModifyFace.H"
|
|
||||||
#include "syncTools.H"
|
#include "syncTools.H"
|
||||||
#include "faceSet.H"
|
#include "faceSet.H"
|
||||||
#include "cellSet.H"
|
#include "cellSet.H"
|
||||||
@ -140,9 +136,7 @@ Foam::label Foam::hexRef8::addFace
|
|||||||
if ((nei == -1) || (own < nei))
|
if ((nei == -1) || (own < nei))
|
||||||
{
|
{
|
||||||
// Ordering ok.
|
// Ordering ok.
|
||||||
newFacei = meshMod.setAction
|
newFacei = meshMod.addFace
|
||||||
(
|
|
||||||
polyAddFace
|
|
||||||
(
|
(
|
||||||
newFace, // face
|
newFace, // face
|
||||||
own, // owner
|
own, // owner
|
||||||
@ -154,15 +148,12 @@ Foam::label Foam::hexRef8::addFace
|
|||||||
patchID, // patch for face
|
patchID, // patch for face
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face zone flip
|
zoneFlip // face zone flip
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Reverse owner/neighbour
|
// Reverse owner/neighbour
|
||||||
newFacei = meshMod.setAction
|
newFacei = meshMod.addFace
|
||||||
(
|
|
||||||
polyAddFace
|
|
||||||
(
|
(
|
||||||
newFace.reverseFace(), // face
|
newFace.reverseFace(), // face
|
||||||
nei, // owner
|
nei, // owner
|
||||||
@ -174,7 +165,6 @@ Foam::label Foam::hexRef8::addFace
|
|||||||
patchID, // patch for face
|
patchID, // patch for face
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face zone flip
|
zoneFlip // face zone flip
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return newFacei;
|
return newFacei;
|
||||||
@ -193,9 +183,7 @@ Foam::label Foam::hexRef8::addInternalFace
|
|||||||
{
|
{
|
||||||
if (mesh_.isInternalFace(meshFacei))
|
if (mesh_.isInternalFace(meshFacei))
|
||||||
{
|
{
|
||||||
return meshMod.setAction
|
return meshMod.addFace
|
||||||
(
|
|
||||||
polyAddFace
|
|
||||||
(
|
(
|
||||||
newFace, // face
|
newFace, // face
|
||||||
own, // owner
|
own, // owner
|
||||||
@ -207,7 +195,6 @@ Foam::label Foam::hexRef8::addInternalFace
|
|||||||
-1, // patch for face
|
-1, // patch for face
|
||||||
-1, // zone for face
|
-1, // zone for face
|
||||||
false // face zone flip
|
false // face zone flip
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -221,9 +208,7 @@ Foam::label Foam::hexRef8::addInternalFace
|
|||||||
|
|
||||||
// For now create out of nothing
|
// For now create out of nothing
|
||||||
|
|
||||||
return meshMod.setAction
|
return meshMod.addFace
|
||||||
(
|
|
||||||
polyAddFace
|
|
||||||
(
|
(
|
||||||
newFace, // face
|
newFace, // face
|
||||||
own, // owner
|
own, // owner
|
||||||
@ -235,7 +220,6 @@ Foam::label Foam::hexRef8::addInternalFace
|
|||||||
-1, // patch for face
|
-1, // patch for face
|
||||||
-1, // zone for face
|
-1, // zone for face
|
||||||
false // face zone flip
|
false // face zone flip
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -256,9 +240,7 @@ Foam::label Foam::hexRef8::addInternalFace
|
|||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
//
|
//
|
||||||
// return meshMod.setAction
|
// return meshMod.addFace
|
||||||
//(
|
|
||||||
// polyAddFace
|
|
||||||
// (
|
// (
|
||||||
// newFace, // face
|
// newFace, // face
|
||||||
// own, // owner
|
// own, // owner
|
||||||
@ -270,7 +252,6 @@ Foam::label Foam::hexRef8::addInternalFace
|
|||||||
// -1, // patch for face
|
// -1, // patch for face
|
||||||
// -1, // zone for face
|
// -1, // zone for face
|
||||||
// false // face zone flip
|
// false // face zone flip
|
||||||
// )
|
|
||||||
// );
|
// );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -301,9 +282,7 @@ void Foam::hexRef8::modFace
|
|||||||
{
|
{
|
||||||
if ((nei == -1) || (own < nei))
|
if ((nei == -1) || (own < nei))
|
||||||
{
|
{
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
newFace, // modified face
|
newFace, // modified face
|
||||||
facei, // label of face being modified
|
facei, // label of face being modified
|
||||||
@ -311,17 +290,13 @@ void Foam::hexRef8::modFace
|
|||||||
nei, // neighbour
|
nei, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchID, // patch for face
|
patchID, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
newFace.reverseFace(), // modified face
|
newFace.reverseFace(), // modified face
|
||||||
facei, // label of face being modified
|
facei, // label of face being modified
|
||||||
@ -329,10 +304,8 @@ void Foam::hexRef8::modFace
|
|||||||
own, // neighbour
|
own, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchID, // patch for face
|
patchID, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3245,15 +3218,12 @@ Foam::labelListList Foam::hexRef8::setRefinement
|
|||||||
|
|
||||||
label anchorPointi = mesh_.faces()[mesh_.cells()[celli][0]][0];
|
label anchorPointi = mesh_.faces()[mesh_.cells()[celli][0]][0];
|
||||||
|
|
||||||
cellMidPoint[celli] = meshMod.setAction
|
cellMidPoint[celli] = meshMod.addPoint
|
||||||
(
|
|
||||||
polyAddPoint
|
|
||||||
(
|
(
|
||||||
mesh_.cellCentres()[celli], // point
|
mesh_.cellCentres()[celli], // point
|
||||||
anchorPointi, // master point
|
anchorPointi, // master point
|
||||||
-1, // zone for point
|
-1, // zone for point
|
||||||
true // supports a cell
|
true // supports a cell
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
newPointLevel(cellMidPoint[celli]) = cellLevel_[celli]+1;
|
newPointLevel(cellMidPoint[celli]) = cellLevel_[celli]+1;
|
||||||
@ -3371,15 +3341,12 @@ Foam::labelListList Foam::hexRef8::setRefinement
|
|||||||
|
|
||||||
const edge& e = mesh_.edges()[edgeI];
|
const edge& e = mesh_.edges()[edgeI];
|
||||||
|
|
||||||
edgeMidPoint[edgeI] = meshMod.setAction
|
edgeMidPoint[edgeI] = meshMod.addPoint
|
||||||
(
|
|
||||||
polyAddPoint
|
|
||||||
(
|
(
|
||||||
edgeMids[edgeI], // point
|
edgeMids[edgeI], // point
|
||||||
e[0], // master point
|
e[0], // master point
|
||||||
-1, // zone for point
|
-1, // zone for point
|
||||||
true // supports a cell
|
true // supports a cell
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
newPointLevel(edgeMidPoint[edgeI]) =
|
newPointLevel(edgeMidPoint[edgeI]) =
|
||||||
@ -3556,9 +3523,7 @@ Foam::labelListList Foam::hexRef8::setRefinement
|
|||||||
|
|
||||||
const face& f = mesh_.faces()[facei];
|
const face& f = mesh_.faces()[facei];
|
||||||
|
|
||||||
faceMidPoint[facei] = meshMod.setAction
|
faceMidPoint[facei] = meshMod.addPoint
|
||||||
(
|
|
||||||
polyAddPoint
|
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
facei < mesh_.nInternalFaces()
|
facei < mesh_.nInternalFaces()
|
||||||
@ -3568,7 +3533,6 @@ Foam::labelListList Foam::hexRef8::setRefinement
|
|||||||
f[0], // master point
|
f[0], // master point
|
||||||
-1, // zone for point
|
-1, // zone for point
|
||||||
true // supports a cell
|
true // supports a cell
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Determine the level of the corner points and midpoint will
|
// Determine the level of the corner points and midpoint will
|
||||||
@ -3721,16 +3685,13 @@ Foam::labelListList Foam::hexRef8::setRefinement
|
|||||||
|
|
||||||
for (label i = 1; i < 8; i++)
|
for (label i = 1; i < 8; i++)
|
||||||
{
|
{
|
||||||
cAdded[i] = meshMod.setAction
|
cAdded[i] = meshMod.addCell
|
||||||
(
|
|
||||||
polyAddCell
|
|
||||||
(
|
(
|
||||||
-1, // master point
|
-1, // master point
|
||||||
-1, // master edge
|
-1, // master edge
|
||||||
-1, // master face
|
-1, // master face
|
||||||
celli, // master cell
|
celli, // master cell
|
||||||
mesh_.cellZones().whichZone(celli) // zone for cell
|
mesh_.cellZones().whichZone(celli) // zone for cell
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
newCellLevel(cAdded[i]) = cellLevel_[celli]+1;
|
newCellLevel(cAdded[i]) = cellLevel_[celli]+1;
|
||||||
|
|||||||
@ -1,138 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::polyModifyCell
|
|
||||||
|
|
||||||
Description
|
|
||||||
Class describing modification of a cell.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef polyModifyCell_H
|
|
||||||
#define polyModifyCell_H
|
|
||||||
|
|
||||||
#include "label.H"
|
|
||||||
#include "topoAction.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class polyModifyCell Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class polyModifyCell
|
|
||||||
:
|
|
||||||
public topoAction
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Cell ID
|
|
||||||
label cellID_;
|
|
||||||
|
|
||||||
//- Remove from current zone
|
|
||||||
bool removeFromZone_;
|
|
||||||
|
|
||||||
//- New zone ID
|
|
||||||
label zoneID_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Static Data Members
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("modifyCell");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct null. Used only for list construction
|
|
||||||
polyModifyCell()
|
|
||||||
:
|
|
||||||
cellID_(-1),
|
|
||||||
removeFromZone_(false),
|
|
||||||
zoneID_(-1)
|
|
||||||
{}
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
polyModifyCell
|
|
||||||
(
|
|
||||||
const label cellID,
|
|
||||||
const bool removeFromZone,
|
|
||||||
const label newZoneID
|
|
||||||
)
|
|
||||||
:
|
|
||||||
cellID_(cellID),
|
|
||||||
removeFromZone_(removeFromZone),
|
|
||||||
zoneID_(newZoneID)
|
|
||||||
{}
|
|
||||||
|
|
||||||
//- Construct and return a clone
|
|
||||||
virtual autoPtr<topoAction> clone() const
|
|
||||||
{
|
|
||||||
return autoPtr<topoAction>(new polyModifyCell(*this));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Default Destructor
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Cell ID
|
|
||||||
label cellID() const
|
|
||||||
{
|
|
||||||
return cellID_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Does the cell belong to a zone?
|
|
||||||
bool isInZone() const
|
|
||||||
{
|
|
||||||
return zoneID_ >= 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool removeFromZone() const
|
|
||||||
{
|
|
||||||
return removeFromZone_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Cell zone ID
|
|
||||||
label zoneID() const
|
|
||||||
{
|
|
||||||
return zoneID_;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -32,9 +32,6 @@ License
|
|||||||
#include "polyAddFace.H"
|
#include "polyAddFace.H"
|
||||||
#include "polyModifyFace.H"
|
#include "polyModifyFace.H"
|
||||||
#include "polyRemoveFace.H"
|
#include "polyRemoveFace.H"
|
||||||
#include "polyAddCell.H"
|
|
||||||
#include "polyModifyCell.H"
|
|
||||||
#include "polyRemoveCell.H"
|
|
||||||
#include "objectMap.H"
|
#include "objectMap.H"
|
||||||
#include "processorPolyPatch.H"
|
#include "processorPolyPatch.H"
|
||||||
#include "fvMesh.H"
|
#include "fvMesh.H"
|
||||||
@ -2573,42 +2570,6 @@ Foam::label Foam::polyTopoChange::setAction(const topoAction& action)
|
|||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else if (isType<polyAddCell>(action))
|
|
||||||
{
|
|
||||||
const polyAddCell& pac = refCast<const polyAddCell>(action);
|
|
||||||
|
|
||||||
return addCell
|
|
||||||
(
|
|
||||||
pac.masterPointID(),
|
|
||||||
pac.masterEdgeID(),
|
|
||||||
pac.masterFaceID(),
|
|
||||||
pac.masterCellID(),
|
|
||||||
pac.zoneID()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else if (isType<polyModifyCell>(action))
|
|
||||||
{
|
|
||||||
const polyModifyCell& pmc = refCast<const polyModifyCell>(action);
|
|
||||||
|
|
||||||
if (pmc.removeFromZone())
|
|
||||||
{
|
|
||||||
modifyCell(pmc.cellID(), -1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
modifyCell(pmc.cellID(), pmc.zoneID());
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
else if (isType<polyRemoveCell>(action))
|
|
||||||
{
|
|
||||||
const polyRemoveCell& prc = refCast<const polyRemoveCell>(action);
|
|
||||||
|
|
||||||
removeCell(prc.cellID(), prc.mergeCellID());
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
|
|||||||
@ -26,10 +26,6 @@ License
|
|||||||
#include "removeCells.H"
|
#include "removeCells.H"
|
||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
#include "polyTopoChange.H"
|
#include "polyTopoChange.H"
|
||||||
#include "polyRemoveCell.H"
|
|
||||||
#include "polyRemoveFace.H"
|
|
||||||
#include "polyModifyFace.H"
|
|
||||||
#include "polyRemovePoint.H"
|
|
||||||
#include "syncTools.H"
|
#include "syncTools.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -238,7 +234,7 @@ void Foam::removeCells::setRefinement
|
|||||||
// Pout<< "Removing cell " << celli
|
// Pout<< "Removing cell " << celli
|
||||||
// << " cc:" << mesh_.cellCentres()[celli] << endl;
|
// << " cc:" << mesh_.cellCentres()[celli] << endl;
|
||||||
|
|
||||||
meshMod.setAction(polyRemoveCell(celli));
|
meshMod.removeCell(celli, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -279,7 +275,7 @@ void Foam::removeCells::setRefinement
|
|||||||
// Pout<< "Removing internal face " << facei
|
// Pout<< "Removing internal face " << facei
|
||||||
// << " fc:" << mesh_.faceCentres()[facei] << endl;
|
// << " fc:" << mesh_.faceCentres()[facei] << endl;
|
||||||
|
|
||||||
meshMod.setAction(polyRemoveFace(facei));
|
meshMod.removeFace(facei, -1);
|
||||||
uncount(f, nFacesUsingPoint);
|
uncount(f, nFacesUsingPoint);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -310,9 +306,7 @@ void Foam::removeCells::setRefinement
|
|||||||
// << " fc:" << mesh_.faceCentres()[facei]
|
// << " fc:" << mesh_.faceCentres()[facei]
|
||||||
// << " into patch " << newPatchID[facei] << endl;
|
// << " into patch " << newPatchID[facei] << endl;
|
||||||
|
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
f.reverseFace(), // modified face
|
f.reverseFace(), // modified face
|
||||||
facei, // label of face being modified
|
facei, // label of face being modified
|
||||||
@ -320,10 +314,8 @@ void Foam::removeCells::setRefinement
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
true, // face flip
|
true, // face flip
|
||||||
newPatchID[facei], // patch for face
|
newPatchID[facei], // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -352,9 +344,7 @@ void Foam::removeCells::setRefinement
|
|||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
||||||
}
|
}
|
||||||
|
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
f, // modified face
|
f, // modified face
|
||||||
facei, // label of face being modified
|
facei, // label of face being modified
|
||||||
@ -362,10 +352,8 @@ void Foam::removeCells::setRefinement
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
newPatchID[facei], // patch for face
|
newPatchID[facei], // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -395,9 +383,7 @@ void Foam::removeCells::setRefinement
|
|||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
||||||
}
|
}
|
||||||
|
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
faces[facei], // modified face
|
faces[facei], // modified face
|
||||||
facei, // label of face
|
facei, // label of face
|
||||||
@ -405,10 +391,8 @@ void Foam::removeCells::setRefinement
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
newPatchID[facei], // patch for face
|
newPatchID[facei], // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if (removedCell[faceOwner[facei]])
|
else if (removedCell[faceOwner[facei]])
|
||||||
@ -418,7 +402,7 @@ void Foam::removeCells::setRefinement
|
|||||||
// << " fc:" << mesh_.faceCentres()[facei]
|
// << " fc:" << mesh_.faceCentres()[facei]
|
||||||
// << endl;
|
// << endl;
|
||||||
|
|
||||||
meshMod.setAction(polyRemoveFace(facei));
|
meshMod.removeFace(facei, -1);
|
||||||
uncount(faces[facei], nFacesUsingPoint);
|
uncount(faces[facei], nFacesUsingPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -446,7 +430,7 @@ void Foam::removeCells::setRefinement
|
|||||||
// << " fc:" << mesh_.faceCentres()[facei]
|
// << " fc:" << mesh_.faceCentres()[facei]
|
||||||
// << endl;
|
// << endl;
|
||||||
|
|
||||||
meshMod.setAction(polyRemoveFace(facei));
|
meshMod.removeFace(facei, -1);
|
||||||
uncount(faces[facei], nFacesUsingPoint);
|
uncount(faces[facei], nFacesUsingPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -466,7 +450,7 @@ void Foam::removeCells::setRefinement
|
|||||||
// Pout<< "Removing unused point " << pointi
|
// Pout<< "Removing unused point " << pointi
|
||||||
// << " at:" << mesh_.points()[pointi] << endl;
|
// << " at:" << mesh_.points()[pointi] << endl;
|
||||||
|
|
||||||
meshMod.setAction(polyRemovePoint(pointi));
|
meshMod.removePoint(pointi, -1);
|
||||||
}
|
}
|
||||||
else if (nFacesUsingPoint[pointi] == 1)
|
else if (nFacesUsingPoint[pointi] == 1)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -27,10 +27,6 @@ License
|
|||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
#include "polyTopoChange.H"
|
#include "polyTopoChange.H"
|
||||||
#include "meshTools.H"
|
#include "meshTools.H"
|
||||||
#include "polyModifyFace.H"
|
|
||||||
#include "polyRemoveFace.H"
|
|
||||||
#include "polyRemoveCell.H"
|
|
||||||
#include "polyRemovePoint.H"
|
|
||||||
#include "syncTools.H"
|
#include "syncTools.H"
|
||||||
#include "OFstream.H"
|
#include "OFstream.H"
|
||||||
#include "indirectPrimitivePatch.H"
|
#include "indirectPrimitivePatch.H"
|
||||||
@ -405,7 +401,7 @@ void Foam::removeFaces::mergeFaces
|
|||||||
{
|
{
|
||||||
// Pout<< "Removing face " << faceLabels[patchFacei] << endl;
|
// Pout<< "Removing face " << faceLabels[patchFacei] << endl;
|
||||||
|
|
||||||
meshMod.setAction(polyRemoveFace(faceLabels[patchFacei], facei));
|
meshMod.removeFace(faceLabels[patchFacei], facei);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -503,9 +499,7 @@ void Foam::removeFaces::modFace
|
|||||||
// << endl;
|
// << endl;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
f, // modified face
|
f, // modified face
|
||||||
masterFaceID, // label of face being modified
|
masterFaceID, // label of face being modified
|
||||||
@ -513,10 +507,8 @@ void Foam::removeFaces::modFace
|
|||||||
nei, // neighbour
|
nei, // neighbour
|
||||||
flipFaceFlux, // face flip
|
flipFaceFlux, // face flip
|
||||||
newPatchID, // patch for face
|
newPatchID, // patch for face
|
||||||
removeFromZone, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -536,9 +528,7 @@ void Foam::removeFaces::modFace
|
|||||||
// << endl;
|
// << endl;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
f.reverseFace(),// modified face
|
f.reverseFace(),// modified face
|
||||||
masterFaceID, // label of face being modified
|
masterFaceID, // label of face being modified
|
||||||
@ -546,10 +536,8 @@ void Foam::removeFaces::modFace
|
|||||||
own, // neighbour
|
own, // neighbour
|
||||||
flipFaceFlux, // face flip
|
flipFaceFlux, // face flip
|
||||||
newPatchID, // patch for face
|
newPatchID, // patch for face
|
||||||
removeFromZone, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1368,7 +1356,7 @@ void Foam::removeFaces::setRefinement
|
|||||||
{
|
{
|
||||||
affectedFace[facei] = false;
|
affectedFace[facei] = false;
|
||||||
|
|
||||||
meshMod.setAction(polyRemoveFace(facei, -1));
|
meshMod.removeFace(facei, -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1378,7 +1366,7 @@ void Foam::removeFaces::setRefinement
|
|||||||
{
|
{
|
||||||
label pointi = iter.key();
|
label pointi = iter.key();
|
||||||
|
|
||||||
meshMod.setAction(polyRemovePoint(pointi, -1));
|
meshMod.removePoint(pointi, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1389,7 +1377,7 @@ void Foam::removeFaces::setRefinement
|
|||||||
|
|
||||||
if (region != -1 && (celli != cellRegionMaster[region]))
|
if (region != -1 && (celli != cellRegionMaster[region]))
|
||||||
{
|
{
|
||||||
meshMod.setAction(polyRemoveCell(celli, cellRegionMaster[region]));
|
meshMod.removeCell(celli, cellRegionMaster[region]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,117 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::polyRemoveCell
|
|
||||||
|
|
||||||
Description
|
|
||||||
Class containing data for cell removal.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef polyRemoveCell_H
|
|
||||||
#define polyRemoveCell_H
|
|
||||||
|
|
||||||
#include "label.H"
|
|
||||||
#include "topoAction.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class polyRemoveCell Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class polyRemoveCell
|
|
||||||
:
|
|
||||||
public topoAction
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Cell ID
|
|
||||||
label cellID_;
|
|
||||||
|
|
||||||
//- Merge cell ID or -1
|
|
||||||
label mergeCellID_;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Static Data Members
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("removeCell");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct null. Used for constructing lists
|
|
||||||
polyRemoveCell()
|
|
||||||
:
|
|
||||||
cellID_(-1),
|
|
||||||
mergeCellID_(-1)
|
|
||||||
{}
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
polyRemoveCell(const label cellID, const label mergeCellID = -1)
|
|
||||||
:
|
|
||||||
cellID_(cellID),
|
|
||||||
mergeCellID_(mergeCellID)
|
|
||||||
{}
|
|
||||||
|
|
||||||
//- Construct and return a clone
|
|
||||||
virtual autoPtr<topoAction> clone() const
|
|
||||||
{
|
|
||||||
return autoPtr<topoAction>(new polyRemoveCell(*this));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Default Destructor
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Return cell ID
|
|
||||||
label cellID() const
|
|
||||||
{
|
|
||||||
return cellID_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return cell ID
|
|
||||||
label mergeCellID() const
|
|
||||||
{
|
|
||||||
return mergeCellID_;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -28,9 +28,6 @@ License
|
|||||||
#include "PstreamReduceOps.H"
|
#include "PstreamReduceOps.H"
|
||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
#include "polyTopoChange.H"
|
#include "polyTopoChange.H"
|
||||||
#include "polyRemovePoint.H"
|
|
||||||
#include "polyAddPoint.H"
|
|
||||||
#include "polyModifyFace.H"
|
|
||||||
#include "syncTools.H"
|
#include "syncTools.H"
|
||||||
#include "faceSet.H"
|
#include "faceSet.H"
|
||||||
#include "dummyTransform.H"
|
#include "dummyTransform.H"
|
||||||
@ -108,9 +105,7 @@ void Foam::removePoints::modifyFace
|
|||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
||||||
}
|
}
|
||||||
|
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
newFace, // modified face
|
newFace, // modified face
|
||||||
facei, // label of face being modified
|
facei, // label of face being modified
|
||||||
@ -118,10 +113,8 @@ void Foam::removePoints::modifyFace
|
|||||||
neighbour, // neighbour
|
neighbour, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchi, // patch for face
|
patchi, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -338,7 +331,7 @@ void Foam::removePoints::setRefinement
|
|||||||
pointToSaved.insert(pointi, nDeleted);
|
pointToSaved.insert(pointi, nDeleted);
|
||||||
savedPoints_[nDeleted++] = mesh_.points()[pointi];
|
savedPoints_[nDeleted++] = mesh_.points()[pointi];
|
||||||
}
|
}
|
||||||
meshMod.setAction(polyRemovePoint(pointi));
|
meshMod.removePoint(pointi, -1);
|
||||||
|
|
||||||
// Store faces affected
|
// Store faces affected
|
||||||
const labelList& pFaces = mesh_.pointFaces()[pointi];
|
const labelList& pFaces = mesh_.pointFaces()[pointi];
|
||||||
@ -796,15 +789,12 @@ void Foam::removePoints::setUnrefinement
|
|||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
addedPoints[localI] = meshMod.setAction
|
addedPoints[localI] = meshMod.addPoint
|
||||||
(
|
|
||||||
polyAddPoint
|
|
||||||
(
|
(
|
||||||
savedPoints_[localI], // point
|
savedPoints_[localI], // point
|
||||||
-1, // master point
|
-1, // master point
|
||||||
-1, // zone for point
|
-1, // zone for point
|
||||||
true // supports a cell
|
true // supports a cell
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Mark the restored points so they are not restored again.
|
// Mark the restored points so they are not restored again.
|
||||||
|
|||||||
@ -26,13 +26,10 @@ License
|
|||||||
#include "topoAction.H"
|
#include "topoAction.H"
|
||||||
#include "polyAddPoint.H"
|
#include "polyAddPoint.H"
|
||||||
#include "polyAddFace.H"
|
#include "polyAddFace.H"
|
||||||
#include "polyAddCell.H"
|
|
||||||
#include "polyModifyPoint.H"
|
#include "polyModifyPoint.H"
|
||||||
#include "polyModifyFace.H"
|
#include "polyModifyFace.H"
|
||||||
#include "polyModifyCell.H"
|
|
||||||
#include "polyRemovePoint.H"
|
#include "polyRemovePoint.H"
|
||||||
#include "polyRemoveFace.H"
|
#include "polyRemoveFace.H"
|
||||||
#include "polyRemoveCell.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -47,10 +44,6 @@ namespace Foam
|
|||||||
defineTypeNameAndDebug(polyAddFace, 0);
|
defineTypeNameAndDebug(polyAddFace, 0);
|
||||||
defineTypeNameAndDebug(polyModifyFace, 0);
|
defineTypeNameAndDebug(polyModifyFace, 0);
|
||||||
defineTypeNameAndDebug(polyRemoveFace, 0);
|
defineTypeNameAndDebug(polyRemoveFace, 0);
|
||||||
|
|
||||||
defineTypeNameAndDebug(polyAddCell, 0);
|
|
||||||
defineTypeNameAndDebug(polyModifyCell, 0);
|
|
||||||
defineTypeNameAndDebug(polyRemoveCell, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -28,9 +28,6 @@ License
|
|||||||
#include "primitiveMesh.H"
|
#include "primitiveMesh.H"
|
||||||
#include "polyTopoChange.H"
|
#include "polyTopoChange.H"
|
||||||
#include "polyTopoChanger.H"
|
#include "polyTopoChanger.H"
|
||||||
#include "polyRemovePoint.H"
|
|
||||||
#include "polyRemoveFace.H"
|
|
||||||
#include "polyModifyFace.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -87,7 +84,7 @@ void Foam::attachDetach::attachInterface
|
|||||||
// << " currently at:" << ref.points()[removedPoints[pointi]]
|
// << " currently at:" << ref.points()[removedPoints[pointi]]
|
||||||
// << endl;
|
// << endl;
|
||||||
|
|
||||||
ref.setAction(polyRemovePoint(removedPoints[pointi]));
|
ref.removePoint(removedPoints[pointi], -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pout<< "Points to be mapped: " << removedPoints << endl;
|
// Pout<< "Points to be mapped: " << removedPoints << endl;
|
||||||
@ -103,7 +100,7 @@ void Foam::attachDetach::attachInterface
|
|||||||
// ref.faces()[i + slavePatchStart]
|
// ref.faces()[i + slavePatchStart]
|
||||||
// )
|
// )
|
||||||
// << endl;
|
// << endl;
|
||||||
ref.setAction(polyRemoveFace(i + slavePatchStart));
|
ref.removeFace(i + slavePatchStart, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Modify the faces from the master patch
|
// Modify the faces from the master patch
|
||||||
@ -118,9 +115,7 @@ void Foam::attachDetach::attachInterface
|
|||||||
// turning. Modify it to become internal
|
// turning. Modify it to become internal
|
||||||
if (masterFaceCells[facei] < slaveFaceCells[facei])
|
if (masterFaceCells[facei] < slaveFaceCells[facei])
|
||||||
{
|
{
|
||||||
ref.setAction
|
ref.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
faces[masterPatchStart + facei], // modified face
|
faces[masterPatchStart + facei], // modified face
|
||||||
masterPatchStart + facei, // label of face being modified
|
masterPatchStart + facei, // label of face being modified
|
||||||
@ -128,18 +123,14 @@ void Foam::attachDetach::attachInterface
|
|||||||
slaveFaceCells[facei], // neighbour
|
slaveFaceCells[facei], // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
-1, // patch for face
|
-1, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
faceZoneID_.index(), // zone for face
|
faceZoneID_.index(), // zone for face
|
||||||
mfFlip[facei] // face flip in zone
|
mfFlip[facei] // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Flip required
|
// Flip required
|
||||||
ref.setAction
|
ref.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
faces[masterPatchStart + facei].reverseFace(), // mod face
|
faces[masterPatchStart + facei].reverseFace(), // mod face
|
||||||
masterPatchStart + facei, // label of face being modified
|
masterPatchStart + facei, // label of face being modified
|
||||||
@ -147,10 +138,8 @@ void Foam::attachDetach::attachInterface
|
|||||||
masterFaceCells[facei], // neighbour
|
masterFaceCells[facei], // neighbour
|
||||||
true, // face flip
|
true, // face flip
|
||||||
-1, // patch for face
|
-1, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
faceZoneID_.index(), // zone for face
|
faceZoneID_.index(), // zone for face
|
||||||
!mfFlip[facei] // face flip in zone
|
!mfFlip[facei] // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -236,9 +225,7 @@ void Foam::attachDetach::attachInterface
|
|||||||
|
|
||||||
|
|
||||||
// Modify the face
|
// Modify the face
|
||||||
ref.setAction
|
ref.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
newFace, // modified face
|
newFace, // modified face
|
||||||
curFaceID, // label of face being modified
|
curFaceID, // label of face being modified
|
||||||
@ -246,10 +233,8 @@ void Foam::attachDetach::attachInterface
|
|||||||
neiCell, // neighbour
|
neiCell, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchID, // patch for face
|
patchID, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
modifiedFaceZone, // zone for face
|
modifiedFaceZone, // zone for face
|
||||||
modifiedFaceZoneFlip // face flip in zone
|
modifiedFaceZoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -28,9 +28,6 @@ License
|
|||||||
#include "primitiveMesh.H"
|
#include "primitiveMesh.H"
|
||||||
#include "polyTopoChange.H"
|
#include "polyTopoChange.H"
|
||||||
#include "polyTopoChanger.H"
|
#include "polyTopoChanger.H"
|
||||||
#include "polyAddPoint.H"
|
|
||||||
#include "polyModifyFace.H"
|
|
||||||
#include "polyAddFace.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -151,16 +148,12 @@ void Foam::attachDetach::detachInterface
|
|||||||
{
|
{
|
||||||
if (addedPoints[pointi] < 0)
|
if (addedPoints[pointi] < 0)
|
||||||
{
|
{
|
||||||
addedPoints[pointi] =
|
addedPoints[pointi] = ref.addPoint
|
||||||
ref.setAction
|
|
||||||
(
|
|
||||||
polyAddPoint
|
|
||||||
(
|
(
|
||||||
points[mp[pointi]], // point
|
points[mp[pointi]], // point
|
||||||
mp[pointi], // master point
|
mp[pointi], // master point
|
||||||
-1, // zone ID
|
-1, // zone ID
|
||||||
true // supports a cell
|
true // supports a cell
|
||||||
)
|
|
||||||
);
|
);
|
||||||
// Pout<< "Adding point " << addedPoints[pointi]
|
// Pout<< "Adding point " << addedPoints[pointi]
|
||||||
// << " coord1:" << points[mp[pointi]]
|
// << " coord1:" << points[mp[pointi]]
|
||||||
@ -196,9 +189,7 @@ void Foam::attachDetach::detachInterface
|
|||||||
if (mfFlip[facei])
|
if (mfFlip[facei])
|
||||||
{
|
{
|
||||||
// Face needs to be flipped for the master patch
|
// Face needs to be flipped for the master patch
|
||||||
ref.setAction
|
ref.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
faces[curFaceID].reverseFace(), // modified face
|
faces[curFaceID].reverseFace(), // modified face
|
||||||
curFaceID, // label of face being modified
|
curFaceID, // label of face being modified
|
||||||
@ -206,17 +197,13 @@ void Foam::attachDetach::detachInterface
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
true, // face flip
|
true, // face flip
|
||||||
masterPatchID_.index(), // patch for face
|
masterPatchID_.index(), // patch for face
|
||||||
false, // remove from zone
|
|
||||||
faceZoneID_.index(), // zone for face
|
faceZoneID_.index(), // zone for face
|
||||||
!mfFlip[facei] // face flip in zone
|
!mfFlip[facei] // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Add renumbered face into the slave patch
|
// Add renumbered face into the slave patch
|
||||||
// label addedFacei =
|
// label addedFacei =
|
||||||
ref.setAction
|
ref.addFace
|
||||||
(
|
|
||||||
polyAddFace
|
|
||||||
(
|
(
|
||||||
newFace, // face
|
newFace, // face
|
||||||
own[curFaceID], // owner
|
own[curFaceID], // owner
|
||||||
@ -228,7 +215,6 @@ void Foam::attachDetach::detachInterface
|
|||||||
slavePatchID_.index(), // patch to add the face to
|
slavePatchID_.index(), // patch to add the face to
|
||||||
-1, // zone for face
|
-1, // zone for face
|
||||||
false // zone flip
|
false // zone flip
|
||||||
)
|
|
||||||
);
|
);
|
||||||
//{
|
//{
|
||||||
// pointField newPts(ref.points());
|
// pointField newPts(ref.points());
|
||||||
@ -243,9 +229,7 @@ void Foam::attachDetach::detachInterface
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// No flip
|
// No flip
|
||||||
ref.setAction
|
ref.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
faces[curFaceID], // modified face
|
faces[curFaceID], // modified face
|
||||||
curFaceID, // label of face being modified
|
curFaceID, // label of face being modified
|
||||||
@ -253,17 +237,13 @@ void Foam::attachDetach::detachInterface
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
masterPatchID_.index(), // patch for face
|
masterPatchID_.index(), // patch for face
|
||||||
false, // remove from zone
|
|
||||||
faceZoneID_.index(), // zone for face
|
faceZoneID_.index(), // zone for face
|
||||||
mfFlip[facei] // face flip in zone
|
mfFlip[facei] // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Add renumbered face into the slave patch
|
// Add renumbered face into the slave patch
|
||||||
// label addedFacei =
|
// label addedFacei =
|
||||||
ref.setAction
|
ref.addFace
|
||||||
(
|
|
||||||
polyAddFace
|
|
||||||
(
|
(
|
||||||
newFace, // face
|
newFace, // face
|
||||||
nei[curFaceID], // owner
|
nei[curFaceID], // owner
|
||||||
@ -275,7 +255,6 @@ void Foam::attachDetach::detachInterface
|
|||||||
slavePatchID_.index(), // patch to add the face to
|
slavePatchID_.index(), // patch to add the face to
|
||||||
-1, // zone for face
|
-1, // zone for face
|
||||||
false // face flip in zone
|
false // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
//{
|
//{
|
||||||
// pointField newPts(ref.points());
|
// pointField newPts(ref.points());
|
||||||
@ -423,9 +402,7 @@ void Foam::attachDetach::detachInterface
|
|||||||
{
|
{
|
||||||
if (mesh.isInternalFace(curFaceID))
|
if (mesh.isInternalFace(curFaceID))
|
||||||
{
|
{
|
||||||
ref.setAction
|
ref.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
newFace, // face
|
newFace, // face
|
||||||
curFaceID, // master face
|
curFaceID, // master face
|
||||||
@ -433,10 +410,8 @@ void Foam::attachDetach::detachInterface
|
|||||||
nei[curFaceID], // neighbour
|
nei[curFaceID], // neighbour
|
||||||
false, // flip flux
|
false, // flip flux
|
||||||
-1, // patch for face
|
-1, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
-1, // zone for face
|
-1, // zone for face
|
||||||
false // face zone flip
|
false // face zone flip
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Pout<< "modifying stick-out face. Internal Old face: "
|
// Pout<< "modifying stick-out face. Internal Old face: "
|
||||||
@ -448,9 +423,7 @@ void Foam::attachDetach::detachInterface
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ref.setAction
|
ref.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
newFace, // face
|
newFace, // face
|
||||||
curFaceID, // master face
|
curFaceID, // master face
|
||||||
@ -458,10 +431,8 @@ void Foam::attachDetach::detachInterface
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // flip flux
|
false, // flip flux
|
||||||
mesh.boundaryMesh().whichPatch(curFaceID), // patch
|
mesh.boundaryMesh().whichPatch(curFaceID), // patch
|
||||||
false, // remove from zone
|
|
||||||
-1, // zone for face
|
-1, // zone for face
|
||||||
false // face zone flip
|
false // face zone flip
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Pout<< "modifying stick-out face. Boundary Old face: "
|
// Pout<< "modifying stick-out face. Boundary Old face: "
|
||||||
|
|||||||
@ -28,10 +28,6 @@ License
|
|||||||
#include "faceSet.H"
|
#include "faceSet.H"
|
||||||
#include "polyTopoChange.H"
|
#include "polyTopoChange.H"
|
||||||
#include "meshTools.H"
|
#include "meshTools.H"
|
||||||
#include "polyModifyFace.H"
|
|
||||||
#include "polyModifyCell.H"
|
|
||||||
#include "polyAddFace.H"
|
|
||||||
#include "polyRemoveFace.H"
|
|
||||||
#include "localPointRegion.H"
|
#include "localPointRegion.H"
|
||||||
#include "duplicatePoints.H"
|
#include "duplicatePoints.H"
|
||||||
#include "regionSplit.H"
|
#include "regionSplit.H"
|
||||||
@ -63,9 +59,7 @@ Foam::label Foam::meshRefinement::createBaffle
|
|||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
||||||
}
|
}
|
||||||
|
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
f, // modified face
|
f, // modified face
|
||||||
facei, // label of face
|
facei, // label of face
|
||||||
@ -73,10 +67,8 @@ Foam::label Foam::meshRefinement::createBaffle
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
ownPatch, // patch for face
|
ownPatch, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -98,9 +90,7 @@ Foam::label Foam::meshRefinement::createBaffle
|
|||||||
reverseFlip = !zoneFlip;
|
reverseFlip = !zoneFlip;
|
||||||
}
|
}
|
||||||
|
|
||||||
dupFacei = meshMod.setAction
|
dupFacei = meshMod.addFace
|
||||||
(
|
|
||||||
polyAddFace
|
|
||||||
(
|
(
|
||||||
f.reverseFace(), // modified face
|
f.reverseFace(), // modified face
|
||||||
mesh_.faceNeighbour()[facei],// owner
|
mesh_.faceNeighbour()[facei],// owner
|
||||||
@ -112,7 +102,6 @@ Foam::label Foam::meshRefinement::createBaffle
|
|||||||
nbrPatch, // patch for face
|
nbrPatch, // patch for face
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
reverseFlip // face flip in zone
|
reverseFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return dupFacei;
|
return dupFacei;
|
||||||
@ -860,10 +849,8 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::mergeBaffles
|
|||||||
|
|
||||||
const label nei = (face1 < 0 ? -1 : own1);
|
const label nei = (face1 < 0 ? -1 : own1);
|
||||||
|
|
||||||
meshMod.setAction(polyRemoveFace(face1));
|
meshMod.removeFace(face1, -1);
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
faces[face0], // modified face
|
faces[face0], // modified face
|
||||||
face0, // label of face being modified
|
face0, // label of face being modified
|
||||||
@ -871,10 +858,8 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::mergeBaffles
|
|||||||
nei, // neighbour
|
nei, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
-1, // patch for face
|
-1, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -889,10 +874,8 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::mergeBaffles
|
|||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(face1)];
|
zoneFlip = fZone.flipMap()[fZone.whichFace(face1)];
|
||||||
}
|
}
|
||||||
|
|
||||||
meshMod.setAction(polyRemoveFace(face0));
|
meshMod.removeFace(face0, -1);
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
faces[face1], // modified face
|
faces[face1], // modified face
|
||||||
face1, // label of face being modified
|
face1, // label of face being modified
|
||||||
@ -900,10 +883,8 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::mergeBaffles
|
|||||||
own0, // neighbour
|
own0, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
-1, // patch for face
|
-1, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3242,9 +3223,7 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::zonify
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
mesh_.faces()[facei], // modified face
|
mesh_.faces()[facei], // modified face
|
||||||
facei, // label of face
|
facei, // label of face
|
||||||
@ -3252,10 +3231,8 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::zonify
|
|||||||
faceNeighbour[facei], // neighbour
|
faceNeighbour[facei], // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
-1, // patch for face
|
-1, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
faceZoneI, // zone for face
|
faceZoneI, // zone for face
|
||||||
flip // face flip in zone
|
flip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3293,9 +3270,7 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::zonify
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
meshMod.setAction
|
meshMod.modifyFace
|
||||||
(
|
|
||||||
polyModifyFace
|
|
||||||
(
|
(
|
||||||
mesh_.faces()[facei], // modified face
|
mesh_.faces()[facei], // modified face
|
||||||
facei, // label of face
|
facei, // label of face
|
||||||
@ -3303,10 +3278,8 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::zonify
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchi, // patch for face
|
patchi, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
faceZoneI, // zone for face
|
faceZoneI, // zone for face
|
||||||
flip // face flip in zone
|
flip // face flip in zone
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
facei++;
|
facei++;
|
||||||
@ -3323,15 +3296,7 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::zonify
|
|||||||
|
|
||||||
if (zonei >= 0)
|
if (zonei >= 0)
|
||||||
{
|
{
|
||||||
meshMod.setAction
|
meshMod.modifyCell(celli, zonei);
|
||||||
(
|
|
||||||
polyModifyCell
|
|
||||||
(
|
|
||||||
celli,
|
|
||||||
false, // removeFromZone
|
|
||||||
zonei
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user