polyTopoChange: Removed most unnecessary setAction clutter

This commit is contained in:
Henry Weller
2023-12-13 15:33:45 +00:00
parent f1a70fab7e
commit 826fa2db61
27 changed files with 801 additions and 1677 deletions

View File

@ -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,41 +79,34 @@ 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
( facei, // label of face
f, // modified face own, // owner
facei, // label of face -1, // neighbour
own, // owner flipFaceFlux, // face flip
-1, // neighbour newPatchi, // patch for face
flipFaceFlux, // face flip zoneID, // zone for face
newPatchi, // patch for face zoneFlip // face flip in zone
false, // remove from zone
zoneID, // zone for face
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
( own, // owner
f, // modified face -1, // neighbour
own, // owner -1, // master point
-1, // neighbour -1, // master edge
-1, // master point facei, // master face
-1, // master edge flipFaceFlux, // face flip
facei, // master face newPatchi, // patch for face
flipFaceFlux, // face flip zoneID, // zone for face
newPatchi, // patch for face zoneFlip // face flip in zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
); );
} }
} }
@ -477,20 +468,16 @@ void createBaffles
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)]; zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
} }
meshMod.setAction meshMod.modifyFace
( (
polyModifyFace f, // modified face
( facei, // label of face
f, // modified face mesh.faceOwner()[facei], // owner
facei, // label of face -1, // neighbour
mesh.faceOwner()[facei], // owner false, // face flip
-1, // neighbour wantedPatch[facei], // patch for face
false, // face flip zoneID, // zone for face
wantedPatch[facei], // patch for face zoneFlip // face flip in zone
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
); );
if (mesh.isInternalFace(facei)) if (mesh.isInternalFace(facei))
@ -504,21 +491,18 @@ void createBaffles
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)]; zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
} }
meshMod.setAction meshMod.addFace
( (
polyAddFace f.reverseFace(), // modified face
( mesh.faceNeighbour()[facei],// owner
f.reverseFace(), // modified face -1, // neighbour
mesh.faceNeighbour()[facei],// owner -1, // masterPointID
-1, // neighbour -1, // masterEdgeID
-1, // masterPointID facei, // masterFaceID,
-1, // masterEdgeID false, // face flip
facei, // masterFaceID, wantedPatch[facei], // patch for face
false, // face flip zoneID, // zone for face
wantedPatch[facei], // patch for face zoneFlip // face flip in zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
); );
} }
} }

View File

@ -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,20 +216,16 @@ 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
( newMasterI, // label of face
setFaceVerts[0], // original face own, // owner
newMasterI, // label of face -1, // neighbour
own, // owner false, // face flip
-1, // neighbour patchID, // patch for face
false, // face flip zoneID, // zone for face
patchID, // patch for face zoneFlip // face flip in zone
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
); );
@ -241,21 +235,18 @@ 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
( own, // owner,
setFaceVerts[i], // vertices -1, // neighbour,
own, // owner, -1, // masterPointID,
-1, // neighbour, -1, // masterEdgeID,
-1, // masterPointID, newMasterI, // masterFaceID,
-1, // masterEdgeID, false, // flipFaceFlux,
newMasterI, // masterFaceID, patchID, // patchID,
false, // flipFaceFlux, zoneID, // zoneID,
patchID, // patchID, zoneFlip // zoneFlip
zoneID, // zoneID,
zoneFlip // zoneFlip
)
); );
} }
} }

View File

@ -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,20 +146,16 @@ 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
( facei, // label of face
f, // modified face own, // owner
facei, // label of face -1, // neighbour
own, // owner flipFaceFlux, // face flip
-1, // neighbour newPatchi, // patch for face
flipFaceFlux, // face flip zoneID, // zone for face
newPatchi, // patch for face zoneFlip // face flip in zone
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
); );
modifiedFace[facei] = 1; modifiedFace[facei] = 1;
@ -169,21 +163,18 @@ void modifyOrAddFace
else else
{ {
// Second usage of face. Add. // Second usage of face. Add.
meshMod.setAction meshMod.addFace
( (
polyAddFace f, // modified face
( own, // owner
f, // modified face -1, // neighbour
own, // owner -1, // master point
-1, // neighbour -1, // master edge
-1, // master point facei, // master face
-1, // master edge flipFaceFlux, // face flip
facei, // master face newPatchi, // patch for face
flipFaceFlux, // face flip zoneID, // zone for face
newPatchi, // patch for face zoneFlip // face flip in zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
); );
} }
} }

View File

@ -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,20 +72,16 @@ void changePatchID
zoneFlip = fZone.flipMap()[fZone.whichFace(faceID)]; zoneFlip = fZone.flipMap()[fZone.whichFace(faceID)];
} }
meshMod.setAction meshMod.modifyFace
( (
polyModifyFace mesh.faces()[faceID], // face
( faceID, // face ID
mesh.faces()[faceID], // face mesh.faceOwner()[faceID], // owner
faceID, // face ID -1, // neighbour
mesh.faceOwner()[faceID], // owner false, // flip flux
-1, // neighbour patchID, // patch ID
false, // flip flux zoneID, // zone ID
patchID, // patch ID zoneFlip // zone flip
false, // remove from zone
zoneID, // zone ID
zoneFlip // zone flip
)
); );
} }

View File

@ -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,21 +116,17 @@ 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
( face0, // label of face being modified
faces[face0], // modified face own0, // owner
face0, // label of face being modified own1, // neighbour
own0, // owner false, // face flip
own1, // neighbour -1, // patch for face
false, // face flip zoneID, // zone for face
-1, // patch for face zoneFlip // face flip in zone
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
); );
} }
else else
@ -147,21 +141,17 @@ 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
( face1, // label of face being modified
faces[face1], // modified face own1, // owner
face1, // label of face being modified own0, // neighbour
own1, // owner false, // face flip
own0, // neighbour -1, // patch for face
false, // face flip zoneID, // zone for face
-1, // patch for face zoneFlip // face flip in zone
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
); );
} }
} }

View File

@ -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,17 +214,13 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
zoneID = pointZoneIndices[zoneID]; zoneID = pointZoneIndices[zoneID];
} }
renumberPoints[pointi] = renumberPoints[pointi] = meshMod_.addPoint
meshMod_.setAction (
( p[pointi], // Point to add
polyAddPoint -1, // Master point (straight addition)
( zoneID, // Zone for point
p[pointi], // Point to add pointi < m.nPoints() // Is in cell?
-1, // Master point (straight addition) );
zoneID, // Zone for point
pointi < m.nPoints() // Is in cell?
)
);
} }
// Add cells // Add cells
@ -254,18 +247,14 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
zoneID = cellZoneIndices[zoneID]; zoneID = cellZoneIndices[zoneID];
} }
renumberCells[celli] = renumberCells[celli] = meshMod_.addCell
meshMod_.setAction (
( -1, // Master point
polyAddCell -1, // Master edge
( -1, // Master face
-1, // Master point -1, // Master cell
-1, // Master edge zoneID // Zone for cell
-1, // Master face );
-1, // Master cell
zoneID // Zone for cell
)
);
} }
// Add faces // Add faces
@ -359,23 +348,19 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
newZone = faceZoneIndices[newZone]; newZone = faceZoneIndices[newZone];
} }
renumberFaces[facei] = renumberFaces[facei] = meshMod_.addFace
meshMod_.setAction (
( newFace,
polyAddFace newOwn,
( newNei,
newFace, -1,
newOwn, -1,
newNei, -1,
-1, false,
-1, newPatch,
-1, newZone,
false, newZoneFlip
newPatch, );
newZone,
newZoneFlip
)
);
} }
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-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
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -136,20 +136,16 @@ bool repatchFace
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)]; zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
} }
meshMod.setAction meshMod.modifyFace
( (
polyModifyFace mesh.faces()[facei],// modified face
( facei, // label of face being modified
mesh.faces()[facei],// modified face own, // owner
facei, // label of face being modified -1, // neighbour
own, // owner false, // face flip
-1, // neighbour patchID, // patch for face
false, // face flip zoneID, // zone for face
patchID, // patch for face zoneFlip // face flip in zone
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
); );
changed = true; changed = true;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-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"

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-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,41 +152,34 @@ void Foam::boundaryCutter::addFace
if (!modifiedFace) if (!modifiedFace)
{ {
meshMod.setAction meshMod.modifyFace
( (
polyModifyFace newFace, // face
( facei,
newFace, // face own, // owner
facei, -1, // neighbour
own, // owner false, // flux flip
-1, // neighbour patchID, // patch for face
false, // flux flip zoneID, // zone for face
patchID, // patch for face zoneFlip // face zone flip
false, // remove from zone
zoneID, // zone for face
zoneFlip // face zone flip
)
); );
modifiedFace = true; modifiedFace = true;
} }
else else
{ {
meshMod.setAction meshMod.addFace
( (
polyAddFace newFace, // face
( own, // owner
newFace, // face -1, // neighbour
own, // owner masterPoint, // master point
-1, // neighbour -1, // master edge
masterPoint, // master point -1, // master face for addition
-1, // master edge false, // flux flip
-1, // master face for addition patchID, // patch for face
false, // flux flip zoneID, // zone for face
patchID, // patch for face zoneFlip // face zone flip
zoneID, // zone for face
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(), // position
iter.key(), // point -1, // zone for point
iter(), // position true // supports a cell
false, // no zone
-1, // zone for point
true // supports a cell
)
); );
} }
@ -460,17 +444,13 @@ 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 (
( featurePoint, // point
polyAddPoint e.start(), // master point
( -1, // zone for point
featurePoint, // point true // supports a cell
e.start(), // master point );
-1, // zone for point
true // supports a cell
)
);
Map<labelList>::iterator fnd = edgeToAddedPoints.find(edgeI); Map<labelList>::iterator fnd = edgeToAddedPoints.find(edgeI);
@ -523,17 +503,13 @@ void Foam::boundaryCutter::setRefinement
<< abort(FatalError); << abort(FatalError);
} }
label addedPointi = label addedPointi = meshMod.addPoint
meshMod.setAction (
( iter(), // point
polyAddPoint f[0], // master point
( -1, // zone for point
iter(), // point true // supports a cell
f[0], // master point );
-1, // zone for point
true // supports a cell
)
);
faceAddedPoint_.insert(facei, addedPointi); faceAddedPoint_.insert(facei, addedPointi);
if (debug) if (debug)
@ -586,40 +562,33 @@ 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
( facei,
tri, // face own, // owner
facei, -1, // neighbour
own, // owner false, // flux flip
-1, // neighbour patchID, // patch for face
false, // flux flip zoneID, // zone for face
patchID, // patch for face zoneFlip // face zone flip
false, // remove from zone
zoneID, // zone for face
zoneFlip // face zone flip
)
); );
} }
else else
{ {
// Add additional faces // Add additional faces
meshMod.setAction meshMod.addFace
( (
polyAddFace tri, // face
( own, // owner
tri, // face -1, // neighbour
own, // owner masterPoint, // master point
-1, // neighbour -1, // master edge
masterPoint, // master point -1, // master face for addition
-1, // master edge false, // flux flip
-1, // master face for addition patchID, // patch for face
false, // flux flip zoneID, // zone for face
patchID, // patch for face zoneFlip // face zone flip
zoneID, // zone for face
zoneFlip // face zone flip
)
); );
} }
} }
@ -689,20 +658,16 @@ void Foam::boundaryCutter::setRefinement
// Modify the existing face. // Modify the existing face.
meshMod.setAction meshMod.modifyFace
( (
polyModifyFace face(newVerts.shrink()), // face
( facei,
face(newVerts.shrink()), // face own, // owner
facei, -1, // neighbour
own, // owner false, // flux flip
-1, // neighbour patchID, // patch for face
false, // flux flip zoneID, // zone for face
patchID, // patch for face zoneFlip // face zone flip
false, // remove from zone
zoneID, // zone for face
zoneFlip // face zone flip
)
); );
@ -721,21 +686,18 @@ 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
( own, // owner
face(newVerts.shrink()), // face -1, // neighbour
own, // owner masterPoint, // master point
-1, // neighbour -1, // master edge
masterPoint, // master point -1, // master face for addition
-1, // master edge false, // flux flip
-1, // master face for addition patchID, // patch for face
false, // flux flip zoneID, // zone for face
patchID, // patch for face zoneFlip // face zone flip
zoneID, // zone for face
zoneFlip // face zone flip
)
); );
faceUptodate[facei] = true; faceUptodate[facei] = true;
@ -797,20 +759,16 @@ 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
( facei, // label of face being modified
newFace, // modified face own, // owner
facei, // label of face being modified nei, // neighbour
own, // owner false, // face flip
nei, // neighbour patchID, // patch for face
false, // face flip zoneID, // zone for face
patchID, // patch for face zoneFlip // face flip in zone
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
); );
faceUptodate[facei] = true; faceUptodate[facei] = true;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-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,21 +261,18 @@ void Foam::meshCutAndRemove::addFace
<< endl; << endl;
} }
meshMod.setAction meshMod.addFace
( (
polyAddFace newFace, // face
( own, // owner
newFace, // face nei, // neighbour
own, // owner masterPointi, // master point
nei, // neighbour -1, // master edge
masterPointi, // master point -1, // master face for addition
-1, // master edge false, // flux flip
-1, // master face for addition patchID, // patch for face
false, // flux flip zoneID, // zone for face
patchID, // patch for face zoneFlip // face zone flip
zoneID, // zone for face
zoneFlip // face zone flip
)
); );
} }
else else
@ -298,21 +290,18 @@ void Foam::meshCutAndRemove::addFace
<< endl; << endl;
} }
meshMod.setAction meshMod.addFace
( (
polyAddFace newFace.reverseFace(), // face
( nei, // owner
newFace.reverseFace(), // face own, // neighbour
nei, // owner masterPointi, // master point
own, // neighbour -1, // master edge
masterPointi, // master point -1, // master face for addition
-1, // master edge false, // flux flip
-1, // master face for addition patchID, // patch for face
false, // flux flip zoneID, // zone for face
patchID, // patch for face zoneFlip // face zone flip
zoneID, // zone for face
zoneFlip // face zone flip
)
); );
} }
} }
@ -359,38 +348,30 @@ 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
( facei, // label of face being modified
newFace, // modified face own, // owner
facei, // label of face being modified nei, // neighbour
own, // owner false, // face flip
nei, // neighbour patchID, // patch for face
false, // face flip zoneID, // zone for face
patchID, // patch for face zoneFlip // face flip in zone
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
); );
} }
else else
{ {
meshMod.setAction meshMod.modifyFace
( (
polyModifyFace newFace.reverseFace(), // modified face
( facei, // label of face being modified
newFace.reverseFace(), // modified face nei, // owner
facei, // label of face being modified own, // neighbour
nei, // owner false, // face flip
own, // neighbour patchID, // patch for face
false, // face flip zoneID, // zone for face
patchID, // patch for face zoneFlip // face flip in zone
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
); );
} }
} }
@ -632,17 +613,13 @@ 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 (
( newPt, // point
polyAddPoint masterPointi, // master point
( -1, // zone for point
newPt, // point true // supports a cell
masterPointi, // master point );
-1, // zone for point
true // supports a cell
)
);
// Store on (hash of) edge. // Store on (hash of) edge.
addedPoints_.insert(e, addedPointi); addedPoints_.insert(e, addedPointi);
@ -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,23 +769,19 @@ 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 (
( newFace, // face
polyAddFace celli, // owner
( -1, // neighbour
newFace, // face masterPointi, // master point
celli, // owner -1, // master edge
-1, // neighbour -1, // master face for addition
masterPointi, // master point false, // flux flip
-1, // master edge cutPatch[celli], // patch for face
-1, // master face for addition -1, // zone for face
false, // flux flip false // face zone flip
cutPatch[celli], // patch for face );
-1, // zone for face
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)
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-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,21 +217,18 @@ void Foam::meshCutter::addFace
<< endl; << endl;
} }
meshMod.setAction meshMod.addFace
( (
polyAddFace newFace, // face
( own, // owner
newFace, // face nei, // neighbour
own, // owner -1, // master point
nei, // neighbour -1, // master edge
-1, // master point facei, // master face for addition
-1, // master edge false, // flux flip
facei, // master face for addition patchID, // patch for face
false, // flux flip zoneID, // zone for face
patchID, // patch for face zoneFlip // face zone flip
zoneID, // zone for face
zoneFlip // face zone flip
)
); );
} }
else else
@ -252,21 +245,18 @@ void Foam::meshCutter::addFace
<< endl; << endl;
} }
meshMod.setAction meshMod.addFace
( (
polyAddFace newFace.reverseFace(), // face
( nei, // owner
newFace.reverseFace(), // face own, // neighbour
nei, // owner -1, // master point
own, // neighbour -1, // master edge
-1, // master point facei, // master face for addition
-1, // master edge false, // flux flip
facei, // master face for addition patchID, // patch for face
false, // flux flip zoneID, // zone for face
patchID, // patch for face zoneFlip // face zone flip
zoneID, // zone for face
zoneFlip // face zone flip
)
); );
} }
} }
@ -309,38 +299,30 @@ void Foam::meshCutter::modFace
if ((nei == -1) || (own < nei)) if ((nei == -1) || (own < nei))
{ {
meshMod.setAction meshMod.modifyFace
( (
polyModifyFace newFace, // modified face
( facei, // label of face being modified
newFace, // modified face own, // owner
facei, // label of face being modified nei, // neighbour
own, // owner false, // face flip
nei, // neighbour patchID, // patch for face
false, // face flip zoneID, // zone for face
patchID, // patch for face zoneFlip // face flip in zone
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
); );
} }
else else
{ {
meshMod.setAction meshMod.modifyFace
( (
polyModifyFace newFace.reverseFace(), // modified face
( facei, // label of face being modified
newFace.reverseFace(), // modified face nei, // owner
facei, // label of face being modified own, // neighbour
nei, // owner false, // face flip
own, // neighbour patchID, // patch for face
false, // face flip zoneID, // zone for face
patchID, // patch for face zoneFlip // face flip in zone
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
); );
} }
} }
@ -599,17 +581,13 @@ 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 (
( newPt, // point
polyAddPoint masterPointi, // master point
( -1, // zone for point
newPt, // point true // supports a cell
masterPointi, // master point );
-1, // zone for point
true // supports a cell
)
);
// Store on (hash of) edge. // Store on (hash of) edge.
addedPoints_.insert(e, addedPointi); addedPoints_.insert(e, addedPointi);
@ -633,18 +611,14 @@ 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 (
( -1, // master point
polyAddCell -1, // master edge
( -1, // master face
-1, // master point celli, // master cell
-1, // master edge mesh().cellZones().whichZone(celli) // zone for cell
-1, // master face );
celli, // master cell
mesh().cellZones().whichZone(celli) // zone for cell
)
);
addedCells_.insert(celli, addedCelli); addedCells_.insert(celli, addedCelli);
@ -676,22 +650,19 @@ 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
( celli, // owner
newFace, // face addedCells_[celli], // neighbour
celli, // owner masterPointi, // master point
addedCells_[celli], // neighbour -1, // master edge
masterPointi, // master point -1, // master face for addition
-1, // master edge false, // flux flip
-1, // master face for addition -1, // patch for face
false, // flux flip -1, // zone for face
-1, // patch for face false // face zone flip
-1, // zone for face );
false // face zone flip
)
);
addedFaces_.insert(celli, addedFacei); addedFaces_.insert(celli, addedFacei);

View File

@ -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
// ************************************************************************* //

View File

@ -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,21 +325,18 @@ Foam::label Foam::addPatchCellLayer::addSideFace
// << " patch:" << newPatchID // << " patch:" << newPatchID
// << endl; // << endl;
addedFacei = meshMod.setAction addedFacei = meshMod.addFace
( (
polyAddFace newFace, // face
( addedCells[ownFacei][layerOwn], // owner
newFace, // face -1, // neighbour
addedCells[ownFacei][layerOwn], // owner -1, // master point
-1, // neighbour inflateEdgeI, // master edge
-1, // master point inflateFacei, // master face
inflateEdgeI, // master edge false, // flux flip
inflateFacei, // master face newPatchID, // patch for face
false, // flux flip zoneI, // zone for face
newPatchID, // patch for face flip // face zone flip
zoneI, // zone for face
flip // face zone flip
)
); );
} }
else else
@ -395,21 +388,18 @@ Foam::label Foam::addPatchCellLayer::addSideFace
layerOwn = layerI; layerOwn = layerI;
} }
addedFacei = meshMod.setAction addedFacei = meshMod.addFace
( (
polyAddFace newFace, // face
( addedCells[ownFacei][layerOwn], // owner
newFace, // face addedCells[nbrFacei][layerNbr], // neighbour
addedCells[ownFacei][layerOwn], // owner -1, // master point
addedCells[nbrFacei][layerNbr], // neighbour inflateEdgeI, // master edge
-1, // master point -1, // master face
inflateEdgeI, // master edge false, // flux flip
-1, // master face -1, // patch for face
false, // flux flip zoneI, // zone for face
-1, // patch for face flip // face zone flip
zoneI, // zone for face
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
( -1, // master point
mesh_.points()[meshPointi], // point zoneI, // zone for point
-1, // master point true // supports a cell
zoneI, // zone for point
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
( (addToMesh_ ? meshPointi : -1), // master point
pt, // point zoneI, // zone for point
(addToMesh_ ? meshPointi : -1), // master point true // supports a cell
zoneI, // zone for point
true // supports a cell
)
); );
addedPoints_[patchPointi][i] = addedVertI; addedPoints_[patchPointi][i] = addedVertI;
@ -1165,17 +1149,14 @@ 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 edge
-1, // master point -1, // master face
-1, // master edge (addToMesh_ ? mesh_.faceOwner()[meshFacei] : -1),
-1, // master face // master
(addToMesh_ ? mesh_.faceOwner()[meshFacei] : -1), ownZoneI // zone for cell
// master
ownZoneI // zone for cell
)
); );
} }
} }
@ -1255,21 +1236,18 @@ void Foam::addPatchCellLayer::setRefinement
} }
layerFaces_[patchFacei][i+1] = meshMod.setAction layerFaces_[patchFacei][i+1] = meshMod.addFace
( (
polyAddFace newFace, // face
( addedCells[patchFacei][i], // owner
newFace, // face nei, // neighbour
addedCells[patchFacei][i], // owner -1, // master point
nei, // neighbour -1, // master edge
-1, // master point (addToMesh_ ? meshFacei : -1), // master face
-1, // master edge false, // flux flip
(addToMesh_ ? meshFacei : -1), // master face patchi, // patch for face
false, // flux flip zoneI, // zone for face
patchi, // patch for face flip // face zone flip
zoneI, // zone for face
flip // face zone flip
)
); );
} }
} }
@ -1289,20 +1267,16 @@ void Foam::addPatchCellLayer::setRefinement
layerFaces_[patchFacei][0] = meshFacei; layerFaces_[patchFacei][0] = meshFacei;
meshMod.setAction meshMod.modifyFace
( (
polyModifyFace pp[patchFacei], // modified face
( meshFacei, // label of face
pp[patchFacei], // modified face mesh_.faceOwner()[meshFacei], // owner
meshFacei, // label of face addedCells[patchFacei][0], // neighbour
mesh_.faceOwner()[meshFacei], // owner false, // face flip
addedCells[patchFacei][0], // neighbour -1, // patch for face
false, // face flip -1, // zoneI, // zone for face
-1, // patch for face false // face flip in zone
true, // false, // remove from zone
-1, // zoneI, // zone for face
false // face flip in zone
)
); );
} }
} }
@ -1331,21 +1305,18 @@ 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
( addedCells[patchFacei][0], // owner
f, // modified face -1, // neighbour
addedCells[patchFacei][0], // owner -1, // masterPoint
-1, // neighbour -1, // masterEdge
-1, // masterPoint -1, // masterFace
-1, // masterEdge true, // face flip
-1, // masterFace exposedPatchID[patchFacei], // patch for face
true, // face flip zoneI, // zone for face
exposedPatchID[patchFacei], // patch for face zoneFlip // face flip in zone
zoneI, // zone for face
zoneFlip // face flip in zone
)
); );
} }
} }

View File

@ -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,20 +657,16 @@ void Foam::combineFaces::setRefinement
label patchi = mesh_.boundaryMesh().whichPatch(masterFacei); label patchi = mesh_.boundaryMesh().whichPatch(masterFacei);
meshMod.setAction meshMod.modifyFace
( (
polyModifyFace outsideFace, // modified face
( masterFacei, // label of face being modified
outsideFace, // modified face mesh_.faceOwner()[masterFacei], // owner
masterFacei, // label of face being modified -1, // neighbour
mesh_.faceOwner()[masterFacei], // owner false, // face flip
-1, // neighbour patchi, // patch for face
false, // face flip zoneID, // zone for face
patchi, // patch for face zoneFlip // face flip in zone
false, // remove from zone
zoneID, // zone for face
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
( -1, // master point
savedPoints_[localI], // point -1, // zone for point
-1, // master point true // supports a cell
-1, // zone for point
true // supports a cell
)
); );
restoredPoints.insert restoredPoints.insert
( (
@ -957,20 +945,16 @@ 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
( masterFacei, // label of face
faces[0], // original face own, // owner
masterFacei, // label of face -1, // neighbour
own, // owner false, // face flip
-1, // neighbour patchi, // patch for face
false, // face flip zoneID, // zone for face
patchi, // patch for face zoneFlip // face flip in zone
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
); );
restoredFaces.insert(masterFacei, masterFacei); restoredFaces.insert(masterFacei, masterFacei);
@ -980,21 +964,18 @@ 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
( own, // owner,
faces[i], // vertices -1, // neighbour,
own, // owner, -1, // masterPointID,
-1, // neighbour, -1, // masterEdgeID,
-1, // masterPointID, masterFacei, // masterFaceID,
-1, // masterEdgeID, false, // flipFaceFlux,
masterFacei, // masterFaceID, patchi, // patchID,
false, // flipFaceFlux, zoneID, // zoneID,
patchi, // patchID, zoneFlip // zoneFlip
zoneID, // zoneID,
zoneFlip // zoneFlip
)
); );
restoredFaces.insert(facei, masterFacei); restoredFaces.insert(facei, masterFacei);
} }

View File

@ -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"

View File

@ -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,41 +136,35 @@ 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
( own, // owner
newFace, // face nei, // neighbour
own, // owner -1, // master point
nei, // neighbour -1, // master edge
-1, // master point facei, // master face for addition
-1, // master edge false, // flux flip
facei, // master face for addition patchID, // patch for face
false, // flux flip zoneID, // zone for face
patchID, // patch for face zoneFlip // face zone flip
zoneID, // zone for face
zoneFlip // face zone flip
)
); );
} }
else else
{ {
// Reverse owner/neighbour // Reverse owner/neighbour
newFacei = meshMod.setAction newFacei = meshMod.addFace
( (
polyAddFace newFace.reverseFace(), // face
( nei, // owner
newFace.reverseFace(), // face own, // neighbour
nei, // owner -1, // master point
own, // neighbour -1, // master edge
-1, // master point facei, // master face for addition
-1, // master edge false, // flux flip
facei, // master face for addition patchID, // patch for face
false, // flux flip zoneID, // zone for face
patchID, // patch for face zoneFlip // face zone flip
zoneID, // zone for face
zoneFlip // face zone flip
)
); );
} }
return newFacei; return newFacei;
@ -193,21 +183,18 @@ Foam::label Foam::hexRef8::addInternalFace
{ {
if (mesh_.isInternalFace(meshFacei)) if (mesh_.isInternalFace(meshFacei))
{ {
return meshMod.setAction return meshMod.addFace
( (
polyAddFace newFace, // face
( own, // owner
newFace, // face nei, // neighbour
own, // owner -1, // master point
nei, // neighbour -1, // master edge
-1, // master point meshFacei, // master face for addition
-1, // master edge false, // flux flip
meshFacei, // master face for addition -1, // patch for face
false, // flux flip -1, // zone for face
-1, // patch for face false // face zone flip
-1, // zone for face
false // face zone flip
)
); );
} }
else else
@ -221,21 +208,18 @@ 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
( own, // owner
newFace, // face nei, // neighbour
own, // owner -1, // master point
nei, // neighbour -1, // master edge
-1, // master point -1, // master face for addition
-1, // master edge false, // flux flip
-1, // master face for addition -1, // patch for face
false, // flux flip -1, // zone for face
-1, // patch for face false // face zone flip
-1, // zone for face
false // face zone flip
)
); );
@ -256,22 +240,19 @@ Foam::label Foam::hexRef8::addInternalFace
// } // }
//} //}
// //
// return meshMod.setAction // return meshMod.addFace
//( // (
// polyAddFace // newFace, // face
// ( // own, // owner
// newFace, // face // nei, // neighbour
// own, // owner // masterPointi, // master point
// nei, // neighbour // -1, // master edge
// masterPointi, // master point // -1, // master face for addition
// -1, // master edge // false, // flux flip
// -1, // master face for addition // -1, // patch for face
// false, // flux flip // -1, // zone for face
// -1, // patch for face // false // face zone flip
// -1, // zone for face // );
// false // face zone flip
// )
//);
} }
} }
@ -301,38 +282,30 @@ void Foam::hexRef8::modFace
{ {
if ((nei == -1) || (own < nei)) if ((nei == -1) || (own < nei))
{ {
meshMod.setAction meshMod.modifyFace
( (
polyModifyFace newFace, // modified face
( facei, // label of face being modified
newFace, // modified face own, // owner
facei, // label of face being modified nei, // neighbour
own, // owner false, // face flip
nei, // neighbour patchID, // patch for face
false, // face flip zoneID, // zone for face
patchID, // patch for face zoneFlip // face flip in zone
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
); );
} }
else else
{ {
meshMod.setAction meshMod.modifyFace
( (
polyModifyFace newFace.reverseFace(), // modified face
( facei, // label of face being modified
newFace.reverseFace(), // modified face nei, // owner
facei, // label of face being modified own, // neighbour
nei, // owner false, // face flip
own, // neighbour patchID, // patch for face
false, // face flip zoneID, // zone for face
patchID, // patch for face zoneFlip // face flip in zone
false, // remove from zone
zoneID, // zone for face
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
( anchorPointi, // master point
mesh_.cellCentres()[celli], // point -1, // zone for point
anchorPointi, // master point true // supports a cell
-1, // zone for point
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
( e[0], // master point
edgeMids[edgeI], // point -1, // zone for point
e[0], // master point true // supports a cell
-1, // zone for point
true // supports a cell
)
); );
newPointLevel(edgeMidPoint[edgeI]) = newPointLevel(edgeMidPoint[edgeI]) =
@ -3556,19 +3523,16 @@ 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() ? mesh_.faceCentres()[facei]
? mesh_.faceCentres()[facei] : bFaceMids[facei-mesh_.nInternalFaces()]
: bFaceMids[facei-mesh_.nInternalFaces()] ), // point
), // 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
)
); );
// 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 edge
-1, // master point -1, // master face
-1, // master edge celli, // master cell
-1, // master face mesh_.cellZones().whichZone(celli) // zone for cell
celli, // master cell
mesh_.cellZones().whichZone(celli) // zone for cell
)
); );
newCellLevel(cAdded[i]) = cellLevel_[celli]+1; newCellLevel(cAdded[i]) = cellLevel_[celli]+1;

View File

@ -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
// ************************************************************************* //

View File

@ -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

View File

@ -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,20 +306,16 @@ 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
( facei, // label of face being modified
f.reverseFace(), // modified face nei, // owner
facei, // label of face being modified -1, // neighbour
nei, // owner true, // face flip
-1, // neighbour newPatchID[facei], // patch for face
true, // face flip zoneID, // zone for face
newPatchID[facei], // patch for face zoneFlip // face flip in zone
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
); );
} }
} }
@ -352,20 +344,16 @@ void Foam::removeCells::setRefinement
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)]; zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
} }
meshMod.setAction meshMod.modifyFace
( (
polyModifyFace f, // modified face
( facei, // label of face being modified
f, // modified face own, // owner
facei, // label of face being modified -1, // neighbour
own, // owner false, // face flip
-1, // neighbour newPatchID[facei], // patch for face
false, // face flip zoneID, // zone for face
newPatchID[facei], // patch for face zoneFlip // face flip in zone
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
); );
} }
} }
@ -395,20 +383,16 @@ 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
( facei, // label of face
faces[facei], // modified face faceOwner[facei], // owner
facei, // label of face -1, // neighbour
faceOwner[facei], // owner false, // face flip
-1, // neighbour newPatchID[facei], // patch for face
false, // face flip zoneID, // zone for face
newPatchID[facei], // patch for face zoneFlip // face flip in zone
false, // remove from zone
zoneID, // zone for face
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)
{ {

View File

@ -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,20 +499,16 @@ void Foam::removeFaces::modFace
// << endl; // << endl;
// } // }
meshMod.setAction meshMod.modifyFace
( (
polyModifyFace f, // modified face
( masterFaceID, // label of face being modified
f, // modified face own, // owner
masterFaceID, // label of face being modified nei, // neighbour
own, // owner flipFaceFlux, // face flip
nei, // neighbour newPatchID, // patch for face
flipFaceFlux, // face flip zoneID, // zone for face
newPatchID, // patch for face zoneFlip // face flip in zone
removeFromZone, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
); );
} }
else else
@ -536,20 +528,16 @@ void Foam::removeFaces::modFace
// << endl; // << endl;
// } // }
meshMod.setAction meshMod.modifyFace
( (
polyModifyFace f.reverseFace(),// modified face
( masterFaceID, // label of face being modified
f.reverseFace(),// modified face nei, // owner
masterFaceID, // label of face being modified own, // neighbour
nei, // owner flipFaceFlux, // face flip
own, // neighbour newPatchID, // patch for face
flipFaceFlux, // face flip zoneID, // zone for face
newPatchID, // patch for face zoneFlip // face flip in zone
removeFromZone, // remove from zone
zoneID, // zone for face
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]);
} }
} }

View File

@ -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
// ************************************************************************* //

View File

@ -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,20 +105,16 @@ void Foam::removePoints::modifyFace
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)]; zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
} }
meshMod.setAction meshMod.modifyFace
( (
polyModifyFace newFace, // modified face
( facei, // label of face being modified
newFace, // modified face owner, // owner
facei, // label of face being modified neighbour, // neighbour
owner, // owner false, // face flip
neighbour, // neighbour patchi, // patch for face
false, // face flip zoneID, // zone for face
patchi, // patch for face zoneFlip // face flip in zone
false, // remove from zone
zoneID, // zone for face
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
( -1, // master point
savedPoints_[localI], // point -1, // zone for point
-1, // master point true // supports a cell
-1, // zone for point
true // supports a cell
)
); );
// Mark the restored points so they are not restored again. // Mark the restored points so they are not restored again.

View File

@ -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);
} }

View File

@ -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,39 +115,31 @@ 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
( masterPatchStart + facei, // label of face being modified
faces[masterPatchStart + facei], // modified face masterFaceCells[facei], // owner
masterPatchStart + facei, // label of face being modified slaveFaceCells[facei], // neighbour
masterFaceCells[facei], // owner false, // face flip
slaveFaceCells[facei], // neighbour -1, // patch for face
false, // face flip faceZoneID_.index(), // zone for face
-1, // patch for face mfFlip[facei] // face flip in zone
false, // remove from zone
faceZoneID_.index(), // zone for face
mfFlip[facei] // face flip in zone
)
); );
} }
else else
{ {
// Flip required // Flip required
ref.setAction ref.modifyFace
( (
polyModifyFace faces[masterPatchStart + facei].reverseFace(), // mod face
( masterPatchStart + facei, // label of face being modified
faces[masterPatchStart + facei].reverseFace(), // mod face slaveFaceCells[facei], // owner
masterPatchStart + facei, // label of face being modified masterFaceCells[facei], // neighbour
slaveFaceCells[facei], // owner true, // face flip
masterFaceCells[facei], // neighbour -1, // patch for face
true, // face flip faceZoneID_.index(), // zone for face
-1, // patch for face !mfFlip[facei] // face flip in zone
false, // remove from zone
faceZoneID_.index(), // zone for face
!mfFlip[facei] // face flip in zone
)
); );
} }
} }
@ -236,20 +225,16 @@ void Foam::attachDetach::attachInterface
// Modify the face // Modify the face
ref.setAction ref.modifyFace
( (
polyModifyFace newFace, // modified face
( curFaceID, // label of face being modified
newFace, // modified face own[curFaceID], // owner
curFaceID, // label of face being modified neiCell, // neighbour
own[curFaceID], // owner false, // face flip
neiCell, // neighbour patchID, // patch for face
false, // face flip modifiedFaceZone, // zone for face
patchID, // patch for face modifiedFaceZoneFlip // face flip in zone
false, // remove from zone
modifiedFaceZone, // zone for face
modifiedFaceZoneFlip // face flip in zone
)
); );
} }

View File

@ -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,17 +148,13 @@ void Foam::attachDetach::detachInterface
{ {
if (addedPoints[pointi] < 0) if (addedPoints[pointi] < 0)
{ {
addedPoints[pointi] = addedPoints[pointi] = ref.addPoint
ref.setAction (
( points[mp[pointi]], // point
polyAddPoint mp[pointi], // master point
( -1, // zone ID
points[mp[pointi]], // point true // supports a cell
mp[pointi], // master point );
-1, // zone ID
true // supports a cell
)
);
// Pout<< "Adding point " << addedPoints[pointi] // Pout<< "Adding point " << addedPoints[pointi]
// << " coord1:" << points[mp[pointi]] // << " coord1:" << points[mp[pointi]]
// << " coord2:" << masterFaceLayer.localPoints()[pointi] // << " coord2:" << masterFaceLayer.localPoints()[pointi]
@ -196,39 +189,32 @@ 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
( curFaceID, // label of face being modified
faces[curFaceID].reverseFace(), // modified face nei[curFaceID], // owner
curFaceID, // label of face being modified -1, // neighbour
nei[curFaceID], // owner true, // face flip
-1, // neighbour masterPatchID_.index(), // patch for face
true, // face flip faceZoneID_.index(), // zone for face
masterPatchID_.index(), // patch for face !mfFlip[facei] // face flip in zone
false, // remove from zone
faceZoneID_.index(), // zone for face
!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
( own[curFaceID], // owner
newFace, // face -1, // neighbour
own[curFaceID], // owner -1, // master point
-1, // neighbour -1, // master edge
-1, // master point curFaceID, // master face
-1, // master edge false, // flip flux
curFaceID, // master face slavePatchID_.index(), // patch to add the face to
false, // flip flux -1, // zone for face
slavePatchID_.index(), // patch to add the face to false // zone flip
-1, // zone for face
false // zone flip
)
); );
//{ //{
// pointField newPts(ref.points()); // pointField newPts(ref.points());
@ -243,39 +229,32 @@ void Foam::attachDetach::detachInterface
else else
{ {
// No flip // No flip
ref.setAction ref.modifyFace
( (
polyModifyFace faces[curFaceID], // modified face
( curFaceID, // label of face being modified
faces[curFaceID], // modified face own[curFaceID], // owner
curFaceID, // label of face being modified -1, // neighbour
own[curFaceID], // owner false, // face flip
-1, // neighbour masterPatchID_.index(), // patch for face
false, // face flip faceZoneID_.index(), // zone for face
masterPatchID_.index(), // patch for face mfFlip[facei] // face flip in zone
false, // remove from zone
faceZoneID_.index(), // zone for face
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
( nei[curFaceID], // owner
newFace, // face -1, // neighbour
nei[curFaceID], // owner -1, // master point
-1, // neighbour -1, // master edge
-1, // master point curFaceID, // master face
-1, // master edge true, // flip flux
curFaceID, // master face slavePatchID_.index(), // patch to add the face to
true, // flip flux -1, // zone for face
slavePatchID_.index(), // patch to add the face to false // face flip in zone
-1, // zone for face
false // face flip in zone
)
); );
//{ //{
// pointField newPts(ref.points()); // pointField newPts(ref.points());
@ -423,20 +402,16 @@ void Foam::attachDetach::detachInterface
{ {
if (mesh.isInternalFace(curFaceID)) if (mesh.isInternalFace(curFaceID))
{ {
ref.setAction ref.modifyFace
( (
polyModifyFace newFace, // face
( curFaceID, // master face
newFace, // face own[curFaceID], // owner
curFaceID, // master face nei[curFaceID], // neighbour
own[curFaceID], // owner false, // flip flux
nei[curFaceID], // neighbour -1, // patch for face
false, // flip flux -1, // zone for face
-1, // patch for face false // face zone flip
false, // remove from zone
-1, // zone for face
false // face zone flip
)
); );
// Pout<< "modifying stick-out face. Internal Old face: " // Pout<< "modifying stick-out face. Internal Old face: "
@ -448,20 +423,16 @@ void Foam::attachDetach::detachInterface
} }
else else
{ {
ref.setAction ref.modifyFace
( (
polyModifyFace newFace, // face
( curFaceID, // master face
newFace, // face own[curFaceID], // owner
curFaceID, // master face -1, // neighbour
own[curFaceID], // owner false, // flip flux
-1, // neighbour mesh.boundaryMesh().whichPatch(curFaceID), // patch
false, // flip flux -1, // zone for face
mesh.boundaryMesh().whichPatch(curFaceID), // patch false // face zone flip
false, // remove from zone
-1, // zone for face
false // face zone flip
)
); );
// Pout<< "modifying stick-out face. Boundary Old face: " // Pout<< "modifying stick-out face. Boundary Old face: "

View File

@ -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,20 +59,16 @@ 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
( facei, // label of face
f, // modified face mesh_.faceOwner()[facei], // owner
facei, // label of face -1, // neighbour
mesh_.faceOwner()[facei], // owner false, // face flip
-1, // neighbour ownPatch, // patch for face
false, // face flip zoneID, // zone for face
ownPatch, // patch for face zoneFlip // face flip in zone
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
); );
@ -98,21 +90,18 @@ Foam::label Foam::meshRefinement::createBaffle
reverseFlip = !zoneFlip; reverseFlip = !zoneFlip;
} }
dupFacei = meshMod.setAction dupFacei = meshMod.addFace
( (
polyAddFace f.reverseFace(), // modified face
( mesh_.faceNeighbour()[facei],// owner
f.reverseFace(), // modified face -1, // neighbour
mesh_.faceNeighbour()[facei],// owner -1, // masterPointID
-1, // neighbour -1, // masterEdgeID
-1, // masterPointID facei, // masterFaceID,
-1, // masterEdgeID true, // face flip
facei, // masterFaceID, nbrPatch, // patch for face
true, // face flip zoneID, // zone for face
nbrPatch, // patch for face reverseFlip // face flip in zone
zoneID, // zone for face
reverseFlip // face flip in zone
)
); );
} }
return dupFacei; return dupFacei;
@ -860,21 +849,17 @@ 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
( face0, // label of face being modified
faces[face0], // modified face own0, // owner
face0, // label of face being modified nei, // neighbour
own0, // owner false, // face flip
nei, // neighbour -1, // patch for face
false, // face flip zoneID, // zone for face
-1, // patch for face zoneFlip // face flip in zone
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
); );
} }
else else
@ -889,21 +874,17 @@ 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
( face1, // label of face being modified
faces[face1], // modified face own1, // owner
face1, // label of face being modified own0, // neighbour
own1, // owner false, // face flip
own0, // neighbour -1, // patch for face
false, // face flip zoneID, // zone for face
-1, // patch for face zoneFlip // face flip in zone
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
); );
} }
} }
@ -3242,20 +3223,16 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::zonify
); );
} }
meshMod.setAction meshMod.modifyFace
( (
polyModifyFace mesh_.faces()[facei], // modified face
( facei, // label of face
mesh_.faces()[facei], // modified face faceOwner[facei], // owner
facei, // label of face faceNeighbour[facei], // neighbour
faceOwner[facei], // owner false, // face flip
faceNeighbour[facei], // neighbour -1, // patch for face
false, // face flip faceZoneI, // zone for face
-1, // patch for face flip // face flip in zone
false, // remove from zone
faceZoneI, // zone for face
flip // face flip in zone
)
); );
} }
} }
@ -3293,20 +3270,16 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::zonify
); );
} }
meshMod.setAction meshMod.modifyFace
( (
polyModifyFace mesh_.faces()[facei], // modified face
( facei, // label of face
mesh_.faces()[facei], // modified face faceOwner[facei], // owner
facei, // label of face -1, // neighbour
faceOwner[facei], // owner false, // face flip
-1, // neighbour patchi, // patch for face
false, // face flip faceZoneI, // zone for face
patchi, // patch for face flip // face flip in zone
false, // remove from zone
faceZoneI, // zone for face
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
)
);
} }
} }