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 "syncTools.H"
#include "polyTopoChange.H"
#include "polyModifyFace.H"
#include "polyAddFace.H"
#include "regionSplit.H"
#include "Tuple2.H"
#include "cyclicFvPatch.H"
@ -81,41 +79,34 @@ void modifyOrAddFace
if (!modifiedFace[facei])
{
// First usage of face. Modify.
meshMod.setAction
meshMod.modifyFace
(
polyModifyFace
(
f, // modified face
facei, // label of face
own, // owner
-1, // neighbour
flipFaceFlux, // face flip
newPatchi, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
f, // modified face
facei, // label of face
own, // owner
-1, // neighbour
flipFaceFlux, // face flip
newPatchi, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
);
modifiedFace[facei] = 1;
}
else
{
// Second or more usage of face. Add.
meshMod.setAction
meshMod.addFace
(
polyAddFace
(
f, // modified face
own, // owner
-1, // neighbour
-1, // master point
-1, // master edge
facei, // master face
flipFaceFlux, // face flip
newPatchi, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
)
f, // modified face
own, // owner
-1, // neighbour
-1, // master point
-1, // master edge
facei, // master face
flipFaceFlux, // face flip
newPatchi, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
);
}
}
@ -477,20 +468,16 @@ void createBaffles
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
meshMod.setAction
meshMod.modifyFace
(
polyModifyFace
(
f, // modified face
facei, // label of face
mesh.faceOwner()[facei], // owner
-1, // neighbour
false, // face flip
wantedPatch[facei], // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
f, // modified face
facei, // label of face
mesh.faceOwner()[facei], // owner
-1, // neighbour
false, // face flip
wantedPatch[facei], // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
);
if (mesh.isInternalFace(facei))
@ -504,21 +491,18 @@ void createBaffles
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
meshMod.setAction
meshMod.addFace
(
polyAddFace
(
f.reverseFace(), // modified face
mesh.faceNeighbour()[facei],// owner
-1, // neighbour
-1, // masterPointID
-1, // masterEdgeID
facei, // masterFaceID,
false, // face flip
wantedPatch[facei], // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
)
f.reverseFace(), // modified face
mesh.faceNeighbour()[facei],// owner
-1, // neighbour
-1, // masterPointID
-1, // masterEdgeID
facei, // masterFaceID,
false, // face flip
wantedPatch[facei], // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
);
}
}

View File

@ -49,8 +49,6 @@ Description
#include "argList.H"
#include "Time.H"
#include "polyTopoChange.H"
#include "polyModifyFace.H"
#include "polyAddFace.H"
#include "combineFaces.H"
#include "removePoints.H"
#include "meshCheck.H"
@ -218,20 +216,16 @@ label mergePatchFaces
<< " to vertices " << setFaceVerts[0] << endl;
// Modify the master face.
meshMod.setAction
meshMod.modifyFace
(
polyModifyFace
(
setFaceVerts[0], // original face
newMasterI, // label of face
own, // owner
-1, // neighbour
false, // face flip
patchID, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
setFaceVerts[0], // original face
newMasterI, // label of face
own, // owner
-1, // neighbour
false, // face flip
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
);
@ -241,21 +235,18 @@ label mergePatchFaces
Pout<< "Restoring removed face " << setFaces[i]
<< " with vertices " << setFaceVerts[i] << endl;
meshMod.setAction
meshMod.addFace
(
polyAddFace
(
setFaceVerts[i], // vertices
own, // owner,
-1, // neighbour,
-1, // masterPointID,
-1, // masterEdgeID,
newMasterI, // masterFaceID,
false, // flipFaceFlux,
patchID, // patchID,
zoneID, // zoneID,
zoneFlip // zoneFlip
)
setFaceVerts[i], // vertices
own, // owner,
-1, // neighbour,
-1, // masterPointID,
-1, // masterEdgeID,
newMasterI, // masterFaceID,
false, // flipFaceFlux,
patchID, // patchID,
zoneID, // zoneID,
zoneFlip // zoneFlip
);
}
}

View File

@ -40,8 +40,6 @@ Description
#include "argList.H"
#include "Time.H"
#include "polyTopoChange.H"
#include "polyModifyFace.H"
#include "polyAddFace.H"
#include "ReadFields.H"
#include "volFields.H"
#include "surfaceFields.H"
@ -148,20 +146,16 @@ void modifyOrAddFace
if (!modifiedFace[facei])
{
// First usage of face. Modify.
meshMod.setAction
meshMod.modifyFace
(
polyModifyFace
(
f, // modified face
facei, // label of face
own, // owner
-1, // neighbour
flipFaceFlux, // face flip
newPatchi, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
f, // modified face
facei, // label of face
own, // owner
-1, // neighbour
flipFaceFlux, // face flip
newPatchi, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
);
modifiedFace[facei] = 1;
@ -169,21 +163,18 @@ void modifyOrAddFace
else
{
// Second usage of face. Add.
meshMod.setAction
meshMod.addFace
(
polyAddFace
(
f, // modified face
own, // owner
-1, // neighbour
-1, // master point
-1, // master edge
facei, // master face
flipFaceFlux, // face flip
newPatchi, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
)
f, // modified face
own, // owner
-1, // neighbour
-1, // master point
-1, // master edge
facei, // master face
flipFaceFlux, // face flip
newPatchi, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
);
}
}

View File

@ -46,7 +46,6 @@ Description
#include "meshTools.H"
#include "faceSet.H"
#include "polyTopoChange.H"
#include "polyModifyFace.H"
#include "wordReList.H"
#include "systemDict.H"
@ -73,20 +72,16 @@ void changePatchID
zoneFlip = fZone.flipMap()[fZone.whichFace(faceID)];
}
meshMod.setAction
meshMod.modifyFace
(
polyModifyFace
(
mesh.faces()[faceID], // face
faceID, // face ID
mesh.faceOwner()[faceID], // owner
-1, // neighbour
false, // flip flux
patchID, // patch ID
false, // remove from zone
zoneID, // zone ID
zoneFlip // zone flip
)
mesh.faces()[faceID], // face
faceID, // face ID
mesh.faceOwner()[faceID], // owner
-1, // neighbour
false, // flip flux
patchID, // patch ID
zoneID, // zone ID
zoneFlip // zone flip
);
}

View File

@ -37,8 +37,6 @@ Description
#include "pointSet.H"
#include "meshTools.H"
#include "polyTopoChange.H"
#include "polyRemoveFace.H"
#include "polyModifyFace.H"
#include "indirectPrimitivePatch.H"
#include "processorPolyPatch.H"
#include "localPointRegion.H"
@ -118,21 +116,17 @@ void mergeDuplicateBoundaryFaces
zoneFlip = fZone.flipMap()[fZone.whichFace(face0)];
}
meshMod.setAction(polyRemoveFace(face1));
meshMod.setAction
meshMod.removeFace(face1, -1);
meshMod.modifyFace
(
polyModifyFace
(
faces[face0], // modified face
face0, // label of face being modified
own0, // owner
own1, // neighbour
false, // face flip
-1, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
faces[face0], // modified face
face0, // label of face being modified
own0, // owner
own1, // neighbour
false, // face flip
-1, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
);
}
else
@ -147,21 +141,17 @@ void mergeDuplicateBoundaryFaces
zoneFlip = fZone.flipMap()[fZone.whichFace(face1)];
}
meshMod.setAction(polyRemoveFace(face0));
meshMod.setAction
meshMod.removeFace(face0, -1);
meshMod.modifyFace
(
polyModifyFace
(
faces[face1], // modified face
face1, // label of face being modified
own1, // owner
own0, // neighbour
false, // face flip
-1, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
faces[face1], // modified face
face1, // label of face being modified
own1, // owner
own0, // neighbour
false, // face flip
-1, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
);
}
}

View File

@ -26,9 +26,6 @@ License
#include "mergePolyMesh.H"
#include "Time.H"
#include "polyTopoChangeMap.H"
#include "polyAddPoint.H"
#include "polyAddCell.H"
#include "polyAddFace.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -217,17 +214,13 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
zoneID = pointZoneIndices[zoneID];
}
renumberPoints[pointi] =
meshMod_.setAction
(
polyAddPoint
(
p[pointi], // Point to add
-1, // Master point (straight addition)
zoneID, // Zone for point
pointi < m.nPoints() // Is in cell?
)
);
renumberPoints[pointi] = meshMod_.addPoint
(
p[pointi], // Point to add
-1, // Master point (straight addition)
zoneID, // Zone for point
pointi < m.nPoints() // Is in cell?
);
}
// Add cells
@ -254,18 +247,14 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
zoneID = cellZoneIndices[zoneID];
}
renumberCells[celli] =
meshMod_.setAction
(
polyAddCell
(
-1, // Master point
-1, // Master edge
-1, // Master face
-1, // Master cell
zoneID // Zone for cell
)
);
renumberCells[celli] = meshMod_.addCell
(
-1, // Master point
-1, // Master edge
-1, // Master face
-1, // Master cell
zoneID // Zone for cell
);
}
// Add faces
@ -359,23 +348,19 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
newZone = faceZoneIndices[newZone];
}
renumberFaces[facei] =
meshMod_.setAction
(
polyAddFace
(
newFace,
newOwn,
newNei,
-1,
-1,
-1,
false,
newPatch,
newZone,
newZoneFlip
)
);
renumberFaces[facei] = meshMod_.addFace
(
newFace,
newOwn,
newNei,
-1,
-1,
-1,
false,
newPatch,
newZone,
newZoneFlip
);
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -43,8 +43,6 @@ SourceFiles
namespace Foam
{
// Forward declaration of classes
/*---------------------------------------------------------------------------*\
Class mergePolyMesh Declaration
\*---------------------------------------------------------------------------*/

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -27,10 +27,6 @@ License
#include "polyTopoChange.H"
#include "meshTools.H"
#include "polyTopoChangeMap.H"
#include "polyAddPoint.H"
#include "polyAddFace.H"
#include "polyModifyFace.H"
#include "polyAddCell.H"
#include "labelPair.H"
#include "indirectPrimitivePatch.H"
#include "distributionMap.H"

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,11 +26,6 @@ License
#include "boundaryCutter.H"
#include "polyMesh.H"
#include "polyTopoChange.H"
#include "polyAddCell.H"
#include "polyAddFace.H"
#include "polyAddPoint.H"
#include "polyModifyFace.H"
#include "polyModifyPoint.H"
#include "polyTopoChangeMap.H"
#include "meshTools.H"
@ -157,41 +152,34 @@ void Foam::boundaryCutter::addFace
if (!modifiedFace)
{
meshMod.setAction
meshMod.modifyFace
(
polyModifyFace
(
newFace, // face
facei,
own, // owner
-1, // neighbour
false, // flux flip
patchID, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face zone flip
)
newFace, // face
facei,
own, // owner
-1, // neighbour
false, // flux flip
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
);
modifiedFace = true;
}
else
{
meshMod.setAction
meshMod.addFace
(
polyAddFace
(
newFace, // face
own, // owner
-1, // neighbour
masterPoint, // master point
-1, // master edge
-1, // master face for addition
false, // flux flip
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
)
newFace, // face
own, // owner
-1, // neighbour
masterPoint, // master point
-1, // master edge
-1, // master face for addition
false, // flux flip
patchID, // patch for face
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
// as modification; all following ones as polyAddFace)
// as modification; all following ones as addFace)
bool modifiedFace = false;
// Example face:
@ -425,16 +413,12 @@ void Foam::boundaryCutter::setRefinement
forAllConstIter(Map<point>, pointToPos, iter)
{
meshMod.setAction
meshMod.modifyPoint
(
polyModifyPoint
(
iter.key(), // point
iter(), // position
false, // no zone
-1, // zone for point
true // supports a cell
)
iter.key(), // point
iter(), // position
-1, // zone for point
true // supports a cell
);
}
@ -460,17 +444,13 @@ void Foam::boundaryCutter::setRefinement
// point on feature to move to
const point& featurePoint = cuts[cutI];
label addedPointi =
meshMod.setAction
(
polyAddPoint
(
featurePoint, // point
e.start(), // master point
-1, // zone for point
true // supports a cell
)
);
label addedPointi = meshMod.addPoint
(
featurePoint, // point
e.start(), // master point
-1, // zone for point
true // supports a cell
);
Map<labelList>::iterator fnd = edgeToAddedPoints.find(edgeI);
@ -523,17 +503,13 @@ void Foam::boundaryCutter::setRefinement
<< abort(FatalError);
}
label addedPointi =
meshMod.setAction
(
polyAddPoint
(
iter(), // point
f[0], // master point
-1, // zone for point
true // supports a cell
)
);
label addedPointi = meshMod.addPoint
(
iter(), // point
f[0], // master point
-1, // zone for point
true // supports a cell
);
faceAddedPoint_.insert(facei, addedPointi);
if (debug)
@ -586,40 +562,33 @@ void Foam::boundaryCutter::setRefinement
if (fp == 0)
{
// Modify the existing face.
meshMod.setAction
meshMod.modifyFace
(
polyModifyFace
(
tri, // face
facei,
own, // owner
-1, // neighbour
false, // flux flip
patchID, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face zone flip
)
tri, // face
facei,
own, // owner
-1, // neighbour
false, // flux flip
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
);
}
else
{
// Add additional faces
meshMod.setAction
meshMod.addFace
(
polyAddFace
(
tri, // face
own, // owner
-1, // neighbour
masterPoint, // master point
-1, // master edge
-1, // master face for addition
false, // flux flip
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
)
tri, // face
own, // owner
-1, // neighbour
masterPoint, // master point
-1, // master edge
-1, // master face for addition
false, // flux flip
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
);
}
}
@ -689,20 +658,16 @@ void Foam::boundaryCutter::setRefinement
// Modify the existing face.
meshMod.setAction
meshMod.modifyFace
(
polyModifyFace
(
face(newVerts.shrink()), // face
facei,
own, // owner
-1, // neighbour
false, // flux flip
patchID, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face zone flip
)
face(newVerts.shrink()), // face
facei,
own, // owner
-1, // neighbour
false, // flux flip
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
);
@ -721,21 +686,18 @@ void Foam::boundaryCutter::setRefinement
newVerts.append(newFace[fp0]);
// Add additional face
meshMod.setAction
meshMod.addFace
(
polyAddFace
(
face(newVerts.shrink()), // face
own, // owner
-1, // neighbour
masterPoint, // master point
-1, // master edge
-1, // master face for addition
false, // flux flip
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
)
face(newVerts.shrink()), // face
own, // owner
-1, // neighbour
masterPoint, // master point
-1, // master edge
-1, // master face for addition
false, // flux flip
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
);
faceUptodate[facei] = true;
@ -797,20 +759,16 @@ void Foam::boundaryCutter::setRefinement
label patchID, zoneID, zoneFlip;
getFaceInfo(facei, patchID, zoneID, zoneFlip);
meshMod.setAction
meshMod.modifyFace
(
polyModifyFace
(
newFace, // modified face
facei, // label of face being modified
own, // owner
nei, // neighbour
false, // face flip
patchID, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
newFace, // modified face
facei, // label of face being modified
own, // owner
nei, // neighbour
false, // face flip
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
);
faceUptodate[facei] = true;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,11 +26,6 @@ License
#include "meshCutAndRemove.H"
#include "polyMesh.H"
#include "polyTopoChange.H"
#include "polyAddFace.H"
#include "polyAddPoint.H"
#include "polyRemovePoint.H"
#include "polyRemoveFace.H"
#include "polyModifyFace.H"
#include "cellCuts.H"
#include "polyTopoChangeMap.H"
#include "meshTools.H"
@ -266,21 +261,18 @@ void Foam::meshCutAndRemove::addFace
<< endl;
}
meshMod.setAction
meshMod.addFace
(
polyAddFace
(
newFace, // face
own, // owner
nei, // neighbour
masterPointi, // master point
-1, // master edge
-1, // master face for addition
false, // flux flip
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
)
newFace, // face
own, // owner
nei, // neighbour
masterPointi, // master point
-1, // master edge
-1, // master face for addition
false, // flux flip
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
);
}
else
@ -298,21 +290,18 @@ void Foam::meshCutAndRemove::addFace
<< endl;
}
meshMod.setAction
meshMod.addFace
(
polyAddFace
(
newFace.reverseFace(), // face
nei, // owner
own, // neighbour
masterPointi, // master point
-1, // master edge
-1, // master face for addition
false, // flux flip
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
)
newFace.reverseFace(), // face
nei, // owner
own, // neighbour
masterPointi, // master point
-1, // master edge
-1, // master face for addition
false, // flux flip
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
);
}
}
@ -359,38 +348,30 @@ void Foam::meshCutAndRemove::modFace
if ((nei == -1) || (own != -1 && own < nei))
{
meshMod.setAction
meshMod.modifyFace
(
polyModifyFace
(
newFace, // modified face
facei, // label of face being modified
own, // owner
nei, // neighbour
false, // face flip
patchID, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
newFace, // modified face
facei, // label of face being modified
own, // owner
nei, // neighbour
false, // face flip
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
);
}
else
{
meshMod.setAction
meshMod.modifyFace
(
polyModifyFace
(
newFace.reverseFace(), // modified face
facei, // label of face being modified
nei, // owner
own, // neighbour
false, // face flip
patchID, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
newFace.reverseFace(), // modified face
facei, // label of face being modified
nei, // owner
own, // neighbour
false, // face flip
patchID, // patch for face
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;
label addedPointi =
meshMod.setAction
(
polyAddPoint
(
newPt, // point
masterPointi, // master point
-1, // zone for point
true // supports a cell
)
);
label addedPointi = meshMod.addPoint
(
newPt, // point
masterPointi, // master point
-1, // zone for point
true // supports a cell
);
// Store on (hash of) edge.
addedPoints_.insert(e, addedPointi);
@ -752,7 +729,7 @@ void Foam::meshCutAndRemove::setRefinement
{
if (!usedPoint[pointi])
{
meshMod.setAction(polyRemovePoint(pointi));
meshMod.removePoint(pointi, -1);
if (debug & 2)
{
@ -792,23 +769,19 @@ void Foam::meshCutAndRemove::setRefinement
// Pick any anchor point on cell
label masterPointi = findPatchFacePoint(newFace, exposedPatchi);
label addedFacei =
meshMod.setAction
(
polyAddFace
(
newFace, // face
celli, // owner
-1, // neighbour
masterPointi, // master point
-1, // master edge
-1, // master face for addition
false, // flux flip
cutPatch[celli], // patch for face
-1, // zone for face
false // face zone flip
)
);
label addedFacei = meshMod.addFace
(
newFace, // face
celli, // owner
-1, // neighbour
masterPointi, // master point
-1, // master edge
-1, // master face for addition
false, // flux flip
cutPatch[celli], // patch for face
-1, // zone for face
false // face zone flip
);
addedFaces_.insert(celli, addedFacei);
@ -1140,7 +1113,7 @@ void Foam::meshCutAndRemove::setRefinement
if (f0Own == -1 && f0Nei == -1 && !modifiedFacei)
{
meshMod.setAction(polyRemoveFace(facei));
meshMod.removeFace(facei, -1);
if (debug & 2)
{
@ -1182,7 +1155,7 @@ void Foam::meshCutAndRemove::setRefinement
if (own == -1 && nei == -1)
{
meshMod.setAction(polyRemoveFace(facei));
meshMod.removeFace(facei, -1);
if (debug & 2)
{
@ -1237,7 +1210,7 @@ void Foam::meshCutAndRemove::setRefinement
if (own == -1 && nei == -1)
{
meshMod.setAction(polyRemoveFace(facei));
meshMod.removeFace(facei, -1);
if (debug & 2)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -29,10 +29,6 @@ License
#include "cellCuts.H"
#include "polyTopoChangeMap.H"
#include "meshTools.H"
#include "polyModifyFace.H"
#include "polyAddPoint.H"
#include "polyAddFace.H"
#include "polyAddCell.H"
#include "syncTools.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -221,21 +217,18 @@ void Foam::meshCutter::addFace
<< endl;
}
meshMod.setAction
meshMod.addFace
(
polyAddFace
(
newFace, // face
own, // owner
nei, // neighbour
-1, // master point
-1, // master edge
facei, // master face for addition
false, // flux flip
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
)
newFace, // face
own, // owner
nei, // neighbour
-1, // master point
-1, // master edge
facei, // master face for addition
false, // flux flip
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
);
}
else
@ -252,21 +245,18 @@ void Foam::meshCutter::addFace
<< endl;
}
meshMod.setAction
meshMod.addFace
(
polyAddFace
(
newFace.reverseFace(), // face
nei, // owner
own, // neighbour
-1, // master point
-1, // master edge
facei, // master face for addition
false, // flux flip
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
)
newFace.reverseFace(), // face
nei, // owner
own, // neighbour
-1, // master point
-1, // master edge
facei, // master face for addition
false, // flux flip
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
);
}
}
@ -309,38 +299,30 @@ void Foam::meshCutter::modFace
if ((nei == -1) || (own < nei))
{
meshMod.setAction
meshMod.modifyFace
(
polyModifyFace
(
newFace, // modified face
facei, // label of face being modified
own, // owner
nei, // neighbour
false, // face flip
patchID, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
newFace, // modified face
facei, // label of face being modified
own, // owner
nei, // neighbour
false, // face flip
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
);
}
else
{
meshMod.setAction
meshMod.modifyFace
(
polyModifyFace
(
newFace.reverseFace(), // modified face
facei, // label of face being modified
nei, // owner
own, // neighbour
false, // face flip
patchID, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
newFace.reverseFace(), // modified face
facei, // label of face being modified
nei, // owner
own, // neighbour
false, // face flip
patchID, // patch for face
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;
label addedPointi =
meshMod.setAction
(
polyAddPoint
(
newPt, // point
masterPointi, // master point
-1, // zone for point
true // supports a cell
)
);
label addedPointi = meshMod.addPoint
(
newPt, // point
masterPointi, // master point
-1, // zone for point
true // supports a cell
);
// Store on (hash of) edge.
addedPoints_.insert(e, addedPointi);
@ -633,18 +611,14 @@ void Foam::meshCutter::setRefinement
if (cellLoops[celli].size())
{
// Add a cell to the existing cell
label addedCelli =
meshMod.setAction
(
polyAddCell
(
-1, // master point
-1, // master edge
-1, // master face
celli, // master cell
mesh().cellZones().whichZone(celli) // zone for cell
)
);
label addedCelli = meshMod.addCell
(
-1, // master point
-1, // master edge
-1, // master face
celli, // master cell
mesh().cellZones().whichZone(celli) // zone for cell
);
addedCells_.insert(celli, addedCelli);
@ -676,22 +650,19 @@ void Foam::meshCutter::setRefinement
label masterPointi = findInternalFacePoint(anchorPts[celli]);
label addedFacei =
meshMod.setAction
(
polyAddFace
(
newFace, // face
celli, // owner
addedCells_[celli], // neighbour
masterPointi, // master point
-1, // master edge
-1, // master face for addition
false, // flux flip
-1, // patch for face
-1, // zone for face
false // face zone flip
)
);
meshMod.addFace
(
newFace, // face
celli, // owner
addedCells_[celli], // neighbour
masterPointi, // master point
-1, // master edge
-1, // master face for addition
false, // flux flip
-1, // patch for face
-1, // zone for face
false // face zone flip
);
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 "polyTopoChangeMap.H"
#include "syncTools.H"
#include "polyAddPoint.H"
#include "polyAddFace.H"
#include "polyModifyFace.H"
#include "polyAddCell.H"
#include "globalIndex.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -329,21 +325,18 @@ Foam::label Foam::addPatchCellLayer::addSideFace
// << " patch:" << newPatchID
// << endl;
addedFacei = meshMod.setAction
addedFacei = meshMod.addFace
(
polyAddFace
(
newFace, // face
addedCells[ownFacei][layerOwn], // owner
-1, // neighbour
-1, // master point
inflateEdgeI, // master edge
inflateFacei, // master face
false, // flux flip
newPatchID, // patch for face
zoneI, // zone for face
flip // face zone flip
)
newFace, // face
addedCells[ownFacei][layerOwn], // owner
-1, // neighbour
-1, // master point
inflateEdgeI, // master edge
inflateFacei, // master face
false, // flux flip
newPatchID, // patch for face
zoneI, // zone for face
flip // face zone flip
);
}
else
@ -395,21 +388,18 @@ Foam::label Foam::addPatchCellLayer::addSideFace
layerOwn = layerI;
}
addedFacei = meshMod.setAction
addedFacei = meshMod.addFace
(
polyAddFace
(
newFace, // face
addedCells[ownFacei][layerOwn], // owner
addedCells[nbrFacei][layerNbr], // neighbour
-1, // master point
inflateEdgeI, // master edge
-1, // master face
false, // flux flip
-1, // patch for face
zoneI, // zone for face
flip // face zone flip
)
newFace, // face
addedCells[ownFacei][layerOwn], // owner
addedCells[nbrFacei][layerNbr], // neighbour
-1, // master point
inflateEdgeI, // master edge
-1, // master face
false, // flux flip
-1, // patch for face
zoneI, // zone for face
flip // face zone flip
);
// Pout<< "Added internal face:" << newFace
@ -1091,15 +1081,12 @@ void Foam::addPatchCellLayer::setRefinement
{
label meshPointi = meshPoints[patchPointi];
label zoneI = mesh_.pointZones().whichZone(meshPointi);
copiedPatchPoints[patchPointi] = meshMod.setAction
copiedPatchPoints[patchPointi] = meshMod.addPoint
(
polyAddPoint
(
mesh_.points()[meshPointi], // point
-1, // master point
zoneI, // zone for point
true // supports a cell
)
mesh_.points()[meshPointi], // point
-1, // master point
zoneI, // zone for point
true // supports a cell
);
}
}
@ -1123,15 +1110,12 @@ void Foam::addPatchCellLayer::setRefinement
{
pt += disp;
label addedVertI = meshMod.setAction
label addedVertI = meshMod.addPoint
(
polyAddPoint
(
pt, // point
(addToMesh_ ? meshPointi : -1), // master point
zoneI, // zone for point
true // supports a cell
)
pt, // point
(addToMesh_ ? meshPointi : -1), // master point
zoneI, // zone for point
true // supports a cell
);
addedPoints_[patchPointi][i] = addedVertI;
@ -1165,17 +1149,14 @@ void Foam::addPatchCellLayer::setRefinement
{
// Note: add from cell (owner of patch face) or from face?
// 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 face
(addToMesh_ ? mesh_.faceOwner()[meshFacei] : -1),
// master
ownZoneI // zone for cell
)
-1, // master point
-1, // master edge
-1, // master face
(addToMesh_ ? mesh_.faceOwner()[meshFacei] : -1),
// 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
nei, // neighbour
-1, // master point
-1, // master edge
(addToMesh_ ? meshFacei : -1), // master face
false, // flux flip
patchi, // patch for face
zoneI, // zone for face
flip // face zone flip
)
newFace, // face
addedCells[patchFacei][i], // owner
nei, // neighbour
-1, // master point
-1, // master edge
(addToMesh_ ? meshFacei : -1), // master face
false, // flux flip
patchi, // patch for face
zoneI, // zone for face
flip // face zone flip
);
}
}
@ -1289,20 +1267,16 @@ void Foam::addPatchCellLayer::setRefinement
layerFaces_[patchFacei][0] = meshFacei;
meshMod.setAction
meshMod.modifyFace
(
polyModifyFace
(
pp[patchFacei], // modified face
meshFacei, // label of face
mesh_.faceOwner()[meshFacei], // owner
addedCells[patchFacei][0], // neighbour
false, // face flip
-1, // patch for face
true, // false, // remove from zone
-1, // zoneI, // zone for face
false // face flip in zone
)
pp[patchFacei], // modified face
meshFacei, // label of face
mesh_.faceOwner()[meshFacei], // owner
addedCells[patchFacei][0], // neighbour
false, // face flip
-1, // patch for face
-1, // zoneI, // zone for face
false // face flip in zone
);
}
}
@ -1331,21 +1305,18 @@ void Foam::addPatchCellLayer::setRefinement
f[fp] = copiedPatchPoints[f[fp]];
}
layerFaces_[patchFacei][0] = meshMod.setAction
layerFaces_[patchFacei][0] = meshMod.addFace
(
polyAddFace
(
f, // modified face
addedCells[patchFacei][0], // owner
-1, // neighbour
-1, // masterPoint
-1, // masterEdge
-1, // masterFace
true, // face flip
exposedPatchID[patchFacei], // patch for face
zoneI, // zone for face
zoneFlip // face flip in zone
)
f, // modified face
addedCells[patchFacei][0], // owner
-1, // neighbour
-1, // masterPoint
-1, // masterEdge
-1, // masterFace
true, // face flip
exposedPatchID[patchFacei], // patch for face
zoneI, // zone for face
zoneFlip // face flip in zone
);
}
}

View File

@ -26,11 +26,6 @@ License
#include "combineFaces.H"
#include "polyMesh.H"
#include "polyTopoChange.H"
#include "polyRemoveFace.H"
#include "polyAddFace.H"
#include "polyModifyFace.H"
#include "polyRemovePoint.H"
#include "polyAddPoint.H"
#include "syncTools.H"
#include "meshTools.H"
@ -662,20 +657,16 @@ void Foam::combineFaces::setRefinement
label patchi = mesh_.boundaryMesh().whichPatch(masterFacei);
meshMod.setAction
meshMod.modifyFace
(
polyModifyFace
(
outsideFace, // modified face
masterFacei, // label of face being modified
mesh_.faceOwner()[masterFacei], // owner
-1, // neighbour
false, // face flip
patchi, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
outsideFace, // modified face
masterFacei, // label of face being modified
mesh_.faceOwner()[masterFacei], // owner
-1, // neighbour
false, // face flip
patchi, // patch for face
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++)
{
meshMod.setAction(polyRemoveFace(setFaces[i]));
meshMod.removeFace(setFaces[i], -1);
}
@ -725,7 +716,7 @@ void Foam::combineFaces::setRefinement
{
if (nPointFaces[pointi] == 0)
{
meshMod.setAction(polyRemovePoint(pointi));
meshMod.removePoint(pointi, -1);
}
}
}
@ -751,7 +742,7 @@ void Foam::combineFaces::setRefinement
{
if (nPointFaces[pointi] == 0)
{
meshMod.setAction(polyRemovePoint(pointi));
meshMod.removePoint(pointi, -1);
savedPointLabels_[n] = pointi;
savedPoints_[n] = mesh_.points()[pointi];
@ -909,15 +900,12 @@ void Foam::combineFaces::setUnrefinement
if (addedPoints[localI] == -1)
{
// First occurrence of saved point. Reintroduce point
addedPoints[localI] = meshMod.setAction
addedPoints[localI] = meshMod.addPoint
(
polyAddPoint
(
savedPoints_[localI], // point
-1, // master point
-1, // zone for point
true // supports a cell
)
savedPoints_[localI], // point
-1, // master point
-1, // zone for point
true // supports a cell
);
restoredPoints.insert
(
@ -957,20 +945,16 @@ void Foam::combineFaces::setUnrefinement
// << " to vertices " << faces[0] << endl;
// Modify the master face.
meshMod.setAction
meshMod.modifyFace
(
polyModifyFace
(
faces[0], // original face
masterFacei, // label of face
own, // owner
-1, // neighbour
false, // face flip
patchi, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
faces[0], // original face
masterFacei, // label of face
own, // owner
-1, // neighbour
false, // face flip
patchi, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
);
restoredFaces.insert(masterFacei, masterFacei);
@ -980,21 +964,18 @@ void Foam::combineFaces::setUnrefinement
// Pout<< "Restoring removed face with vertices " << faces[i]
// << endl;
label facei = meshMod.setAction
label facei = meshMod.addFace
(
polyAddFace
(
faces[i], // vertices
own, // owner,
-1, // neighbour,
-1, // masterPointID,
-1, // masterEdgeID,
masterFacei, // masterFaceID,
false, // flipFaceFlux,
patchi, // patchID,
zoneID, // zoneID,
zoneFlip // zoneFlip
)
faces[i], // vertices
own, // owner,
-1, // neighbour,
-1, // masterPointID,
-1, // masterEdgeID,
masterFacei, // masterFaceID,
false, // flipFaceFlux,
patchi, // patchID,
zoneID, // zoneID,
zoneFlip // zoneFlip
);
restoredFaces.insert(facei, masterFacei);
}

View File

@ -26,8 +26,6 @@ License
#include "duplicatePoints.H"
#include "localPointRegion.H"
#include "polyTopoChange.H"
#include "polyAddPoint.H"
#include "polyModifyFace.H"
#include "polyMesh.H"
#include "OFstream.H"
#include "meshTools.H"

View File

@ -28,10 +28,6 @@ License
#include "polyMesh.H"
#include "polyTopoChange.H"
#include "meshTools.H"
#include "polyAddFace.H"
#include "polyAddPoint.H"
#include "polyAddCell.H"
#include "polyModifyFace.H"
#include "syncTools.H"
#include "faceSet.H"
#include "cellSet.H"
@ -140,41 +136,35 @@ Foam::label Foam::hexRef8::addFace
if ((nei == -1) || (own < nei))
{
// Ordering ok.
newFacei = meshMod.setAction
newFacei = meshMod.addFace
(
polyAddFace
(
newFace, // face
own, // owner
nei, // neighbour
-1, // master point
-1, // master edge
facei, // master face for addition
false, // flux flip
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
)
newFace, // face
own, // owner
nei, // neighbour
-1, // master point
-1, // master edge
facei, // master face for addition
false, // flux flip
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
);
}
else
{
// Reverse owner/neighbour
newFacei = meshMod.setAction
newFacei = meshMod.addFace
(
polyAddFace
(
newFace.reverseFace(), // face
nei, // owner
own, // neighbour
-1, // master point
-1, // master edge
facei, // master face for addition
false, // flux flip
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
)
newFace.reverseFace(), // face
nei, // owner
own, // neighbour
-1, // master point
-1, // master edge
facei, // master face for addition
false, // flux flip
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
);
}
return newFacei;
@ -193,21 +183,18 @@ Foam::label Foam::hexRef8::addInternalFace
{
if (mesh_.isInternalFace(meshFacei))
{
return meshMod.setAction
return meshMod.addFace
(
polyAddFace
(
newFace, // face
own, // owner
nei, // neighbour
-1, // master point
-1, // master edge
meshFacei, // master face for addition
false, // flux flip
-1, // patch for face
-1, // zone for face
false // face zone flip
)
newFace, // face
own, // owner
nei, // neighbour
-1, // master point
-1, // master edge
meshFacei, // master face for addition
false, // flux flip
-1, // patch for face
-1, // zone for face
false // face zone flip
);
}
else
@ -221,21 +208,18 @@ Foam::label Foam::hexRef8::addInternalFace
// For now create out of nothing
return meshMod.setAction
return meshMod.addFace
(
polyAddFace
(
newFace, // face
own, // owner
nei, // neighbour
-1, // master point
-1, // master edge
-1, // master face for addition
false, // flux flip
-1, // patch for face
-1, // zone for face
false // face zone flip
)
newFace, // face
own, // owner
nei, // neighbour
-1, // master point
-1, // master edge
-1, // master face for addition
false, // flux flip
-1, // patch for face
-1, // zone for face
false // face zone flip
);
@ -256,22 +240,19 @@ Foam::label Foam::hexRef8::addInternalFace
// }
//}
//
// return meshMod.setAction
//(
// polyAddFace
// (
// newFace, // face
// own, // owner
// nei, // neighbour
// masterPointi, // master point
// -1, // master edge
// -1, // master face for addition
// false, // flux flip
// -1, // patch for face
// -1, // zone for face
// false // face zone flip
// )
//);
// return meshMod.addFace
// (
// newFace, // face
// own, // owner
// nei, // neighbour
// masterPointi, // master point
// -1, // master edge
// -1, // master face for addition
// false, // flux flip
// -1, // patch for face
// -1, // zone for face
// false // face zone flip
// );
}
}
@ -301,38 +282,30 @@ void Foam::hexRef8::modFace
{
if ((nei == -1) || (own < nei))
{
meshMod.setAction
meshMod.modifyFace
(
polyModifyFace
(
newFace, // modified face
facei, // label of face being modified
own, // owner
nei, // neighbour
false, // face flip
patchID, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
newFace, // modified face
facei, // label of face being modified
own, // owner
nei, // neighbour
false, // face flip
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
);
}
else
{
meshMod.setAction
meshMod.modifyFace
(
polyModifyFace
(
newFace.reverseFace(), // modified face
facei, // label of face being modified
nei, // owner
own, // neighbour
false, // face flip
patchID, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
newFace.reverseFace(), // modified face
facei, // label of face being modified
nei, // owner
own, // neighbour
false, // face flip
patchID, // patch for face
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];
cellMidPoint[celli] = meshMod.setAction
cellMidPoint[celli] = meshMod.addPoint
(
polyAddPoint
(
mesh_.cellCentres()[celli], // point
anchorPointi, // master point
-1, // zone for point
true // supports a cell
)
mesh_.cellCentres()[celli], // point
anchorPointi, // master point
-1, // zone for point
true // supports a cell
);
newPointLevel(cellMidPoint[celli]) = cellLevel_[celli]+1;
@ -3371,15 +3341,12 @@ Foam::labelListList Foam::hexRef8::setRefinement
const edge& e = mesh_.edges()[edgeI];
edgeMidPoint[edgeI] = meshMod.setAction
edgeMidPoint[edgeI] = meshMod.addPoint
(
polyAddPoint
(
edgeMids[edgeI], // point
e[0], // master point
-1, // zone for point
true // supports a cell
)
edgeMids[edgeI], // point
e[0], // master point
-1, // zone for point
true // supports a cell
);
newPointLevel(edgeMidPoint[edgeI]) =
@ -3556,19 +3523,16 @@ Foam::labelListList Foam::hexRef8::setRefinement
const face& f = mesh_.faces()[facei];
faceMidPoint[facei] = meshMod.setAction
faceMidPoint[facei] = meshMod.addPoint
(
polyAddPoint
(
(
facei < mesh_.nInternalFaces()
? mesh_.faceCentres()[facei]
: bFaceMids[facei-mesh_.nInternalFaces()]
), // point
f[0], // master point
-1, // zone for point
true // supports a cell
)
facei < mesh_.nInternalFaces()
? mesh_.faceCentres()[facei]
: bFaceMids[facei-mesh_.nInternalFaces()]
), // point
f[0], // master point
-1, // zone for point
true // supports a cell
);
// 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++)
{
cAdded[i] = meshMod.setAction
cAdded[i] = meshMod.addCell
(
polyAddCell
(
-1, // master point
-1, // master edge
-1, // master face
celli, // master cell
mesh_.cellZones().whichZone(celli) // zone for cell
)
-1, // master point
-1, // master edge
-1, // master face
celli, // master cell
mesh_.cellZones().whichZone(celli) // zone for cell
);
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 "polyModifyFace.H"
#include "polyRemoveFace.H"
#include "polyAddCell.H"
#include "polyModifyCell.H"
#include "polyRemoveCell.H"
#include "objectMap.H"
#include "processorPolyPatch.H"
#include "fvMesh.H"
@ -2573,42 +2570,6 @@ Foam::label Foam::polyTopoChange::setAction(const topoAction& action)
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
{
FatalErrorInFunction

View File

@ -26,10 +26,6 @@ License
#include "removeCells.H"
#include "polyMesh.H"
#include "polyTopoChange.H"
#include "polyRemoveCell.H"
#include "polyRemoveFace.H"
#include "polyModifyFace.H"
#include "polyRemovePoint.H"
#include "syncTools.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -238,7 +234,7 @@ void Foam::removeCells::setRefinement
// Pout<< "Removing cell " << celli
// << " 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
// << " fc:" << mesh_.faceCentres()[facei] << endl;
meshMod.setAction(polyRemoveFace(facei));
meshMod.removeFace(facei, -1);
uncount(f, nFacesUsingPoint);
}
else
@ -310,20 +306,16 @@ void Foam::removeCells::setRefinement
// << " fc:" << mesh_.faceCentres()[facei]
// << " into patch " << newPatchID[facei] << endl;
meshMod.setAction
meshMod.modifyFace
(
polyModifyFace
(
f.reverseFace(), // modified face
facei, // label of face being modified
nei, // owner
-1, // neighbour
true, // face flip
newPatchID[facei], // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
f.reverseFace(), // modified face
facei, // label of face being modified
nei, // owner
-1, // neighbour
true, // face flip
newPatchID[facei], // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
);
}
}
@ -352,20 +344,16 @@ void Foam::removeCells::setRefinement
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
meshMod.setAction
meshMod.modifyFace
(
polyModifyFace
(
f, // modified face
facei, // label of face being modified
own, // owner
-1, // neighbour
false, // face flip
newPatchID[facei], // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
f, // modified face
facei, // label of face being modified
own, // owner
-1, // neighbour
false, // face flip
newPatchID[facei], // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
);
}
}
@ -395,20 +383,16 @@ void Foam::removeCells::setRefinement
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
meshMod.setAction
meshMod.modifyFace
(
polyModifyFace
(
faces[facei], // modified face
facei, // label of face
faceOwner[facei], // owner
-1, // neighbour
false, // face flip
newPatchID[facei], // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
faces[facei], // modified face
facei, // label of face
faceOwner[facei], // owner
-1, // neighbour
false, // face flip
newPatchID[facei], // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
);
}
else if (removedCell[faceOwner[facei]])
@ -418,7 +402,7 @@ void Foam::removeCells::setRefinement
// << " fc:" << mesh_.faceCentres()[facei]
// << endl;
meshMod.setAction(polyRemoveFace(facei));
meshMod.removeFace(facei, -1);
uncount(faces[facei], nFacesUsingPoint);
}
@ -446,7 +430,7 @@ void Foam::removeCells::setRefinement
// << " fc:" << mesh_.faceCentres()[facei]
// << endl;
meshMod.setAction(polyRemoveFace(facei));
meshMod.removeFace(facei, -1);
uncount(faces[facei], nFacesUsingPoint);
}
@ -466,7 +450,7 @@ void Foam::removeCells::setRefinement
// Pout<< "Removing unused point " << pointi
// << " at:" << mesh_.points()[pointi] << endl;
meshMod.setAction(polyRemovePoint(pointi));
meshMod.removePoint(pointi, -1);
}
else if (nFacesUsingPoint[pointi] == 1)
{

View File

@ -27,10 +27,6 @@ License
#include "polyMesh.H"
#include "polyTopoChange.H"
#include "meshTools.H"
#include "polyModifyFace.H"
#include "polyRemoveFace.H"
#include "polyRemoveCell.H"
#include "polyRemovePoint.H"
#include "syncTools.H"
#include "OFstream.H"
#include "indirectPrimitivePatch.H"
@ -405,7 +401,7 @@ void Foam::removeFaces::mergeFaces
{
// 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;
// }
meshMod.setAction
meshMod.modifyFace
(
polyModifyFace
(
f, // modified face
masterFaceID, // label of face being modified
own, // owner
nei, // neighbour
flipFaceFlux, // face flip
newPatchID, // patch for face
removeFromZone, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
f, // modified face
masterFaceID, // label of face being modified
own, // owner
nei, // neighbour
flipFaceFlux, // face flip
newPatchID, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
);
}
else
@ -536,20 +528,16 @@ void Foam::removeFaces::modFace
// << endl;
// }
meshMod.setAction
meshMod.modifyFace
(
polyModifyFace
(
f.reverseFace(),// modified face
masterFaceID, // label of face being modified
nei, // owner
own, // neighbour
flipFaceFlux, // face flip
newPatchID, // patch for face
removeFromZone, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
f.reverseFace(),// modified face
masterFaceID, // label of face being modified
nei, // owner
own, // neighbour
flipFaceFlux, // face flip
newPatchID, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
);
}
}
@ -1368,7 +1356,7 @@ void Foam::removeFaces::setRefinement
{
affectedFace[facei] = false;
meshMod.setAction(polyRemoveFace(facei, -1));
meshMod.removeFace(facei, -1);
}
}
@ -1378,7 +1366,7 @@ void Foam::removeFaces::setRefinement
{
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]))
{
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 "polyMesh.H"
#include "polyTopoChange.H"
#include "polyRemovePoint.H"
#include "polyAddPoint.H"
#include "polyModifyFace.H"
#include "syncTools.H"
#include "faceSet.H"
#include "dummyTransform.H"
@ -108,20 +105,16 @@ void Foam::removePoints::modifyFace
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
meshMod.setAction
meshMod.modifyFace
(
polyModifyFace
(
newFace, // modified face
facei, // label of face being modified
owner, // owner
neighbour, // neighbour
false, // face flip
patchi, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
newFace, // modified face
facei, // label of face being modified
owner, // owner
neighbour, // neighbour
false, // face flip
patchi, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
);
}
@ -338,7 +331,7 @@ void Foam::removePoints::setRefinement
pointToSaved.insert(pointi, nDeleted);
savedPoints_[nDeleted++] = mesh_.points()[pointi];
}
meshMod.setAction(polyRemovePoint(pointi));
meshMod.removePoint(pointi, -1);
// Store faces affected
const labelList& pFaces = mesh_.pointFaces()[pointi];
@ -796,15 +789,12 @@ void Foam::removePoints::setUnrefinement
<< abort(FatalError);
}
addedPoints[localI] = meshMod.setAction
addedPoints[localI] = meshMod.addPoint
(
polyAddPoint
(
savedPoints_[localI], // point
-1, // master point
-1, // zone for point
true // supports a cell
)
savedPoints_[localI], // point
-1, // master point
-1, // zone for point
true // supports a cell
);
// Mark the restored points so they are not restored again.

View File

@ -26,13 +26,10 @@ License
#include "topoAction.H"
#include "polyAddPoint.H"
#include "polyAddFace.H"
#include "polyAddCell.H"
#include "polyModifyPoint.H"
#include "polyModifyFace.H"
#include "polyModifyCell.H"
#include "polyRemovePoint.H"
#include "polyRemoveFace.H"
#include "polyRemoveCell.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -47,10 +44,6 @@ namespace Foam
defineTypeNameAndDebug(polyAddFace, 0);
defineTypeNameAndDebug(polyModifyFace, 0);
defineTypeNameAndDebug(polyRemoveFace, 0);
defineTypeNameAndDebug(polyAddCell, 0);
defineTypeNameAndDebug(polyModifyCell, 0);
defineTypeNameAndDebug(polyRemoveCell, 0);
}

View File

@ -28,9 +28,6 @@ License
#include "primitiveMesh.H"
#include "polyTopoChange.H"
#include "polyTopoChanger.H"
#include "polyRemovePoint.H"
#include "polyRemoveFace.H"
#include "polyModifyFace.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -87,7 +84,7 @@ void Foam::attachDetach::attachInterface
// << " currently at:" << ref.points()[removedPoints[pointi]]
// << endl;
ref.setAction(polyRemovePoint(removedPoints[pointi]));
ref.removePoint(removedPoints[pointi], -1);
}
// Pout<< "Points to be mapped: " << removedPoints << endl;
@ -103,7 +100,7 @@ void Foam::attachDetach::attachInterface
// ref.faces()[i + slavePatchStart]
// )
// << endl;
ref.setAction(polyRemoveFace(i + slavePatchStart));
ref.removeFace(i + slavePatchStart, -1);
}
// Modify the faces from the master patch
@ -118,39 +115,31 @@ void Foam::attachDetach::attachInterface
// turning. Modify it to become internal
if (masterFaceCells[facei] < slaveFaceCells[facei])
{
ref.setAction
ref.modifyFace
(
polyModifyFace
(
faces[masterPatchStart + facei], // modified face
masterPatchStart + facei, // label of face being modified
masterFaceCells[facei], // owner
slaveFaceCells[facei], // neighbour
false, // face flip
-1, // patch for face
false, // remove from zone
faceZoneID_.index(), // zone for face
mfFlip[facei] // face flip in zone
)
faces[masterPatchStart + facei], // modified face
masterPatchStart + facei, // label of face being modified
masterFaceCells[facei], // owner
slaveFaceCells[facei], // neighbour
false, // face flip
-1, // patch for face
faceZoneID_.index(), // zone for face
mfFlip[facei] // face flip in zone
);
}
else
{
// Flip required
ref.setAction
ref.modifyFace
(
polyModifyFace
(
faces[masterPatchStart + facei].reverseFace(), // mod face
masterPatchStart + facei, // label of face being modified
slaveFaceCells[facei], // owner
masterFaceCells[facei], // neighbour
true, // face flip
-1, // patch for face
false, // remove from zone
faceZoneID_.index(), // zone for face
!mfFlip[facei] // face flip in zone
)
faces[masterPatchStart + facei].reverseFace(), // mod face
masterPatchStart + facei, // label of face being modified
slaveFaceCells[facei], // owner
masterFaceCells[facei], // neighbour
true, // face flip
-1, // patch for face
faceZoneID_.index(), // zone for face
!mfFlip[facei] // face flip in zone
);
}
}
@ -236,20 +225,16 @@ void Foam::attachDetach::attachInterface
// Modify the face
ref.setAction
ref.modifyFace
(
polyModifyFace
(
newFace, // modified face
curFaceID, // label of face being modified
own[curFaceID], // owner
neiCell, // neighbour
false, // face flip
patchID, // patch for face
false, // remove from zone
modifiedFaceZone, // zone for face
modifiedFaceZoneFlip // face flip in zone
)
newFace, // modified face
curFaceID, // label of face being modified
own[curFaceID], // owner
neiCell, // neighbour
false, // face flip
patchID, // patch for face
modifiedFaceZone, // zone for face
modifiedFaceZoneFlip // face flip in zone
);
}

View File

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

View File

@ -28,10 +28,6 @@ License
#include "faceSet.H"
#include "polyTopoChange.H"
#include "meshTools.H"
#include "polyModifyFace.H"
#include "polyModifyCell.H"
#include "polyAddFace.H"
#include "polyRemoveFace.H"
#include "localPointRegion.H"
#include "duplicatePoints.H"
#include "regionSplit.H"
@ -63,20 +59,16 @@ Foam::label Foam::meshRefinement::createBaffle
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
meshMod.setAction
meshMod.modifyFace
(
polyModifyFace
(
f, // modified face
facei, // label of face
mesh_.faceOwner()[facei], // owner
-1, // neighbour
false, // face flip
ownPatch, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
f, // modified face
facei, // label of face
mesh_.faceOwner()[facei], // owner
-1, // neighbour
false, // face flip
ownPatch, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
);
@ -98,21 +90,18 @@ Foam::label Foam::meshRefinement::createBaffle
reverseFlip = !zoneFlip;
}
dupFacei = meshMod.setAction
dupFacei = meshMod.addFace
(
polyAddFace
(
f.reverseFace(), // modified face
mesh_.faceNeighbour()[facei],// owner
-1, // neighbour
-1, // masterPointID
-1, // masterEdgeID
facei, // masterFaceID,
true, // face flip
nbrPatch, // patch for face
zoneID, // zone for face
reverseFlip // face flip in zone
)
f.reverseFace(), // modified face
mesh_.faceNeighbour()[facei],// owner
-1, // neighbour
-1, // masterPointID
-1, // masterEdgeID
facei, // masterFaceID,
true, // face flip
nbrPatch, // patch for face
zoneID, // zone for face
reverseFlip // face flip in zone
);
}
return dupFacei;
@ -860,21 +849,17 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::mergeBaffles
const label nei = (face1 < 0 ? -1 : own1);
meshMod.setAction(polyRemoveFace(face1));
meshMod.setAction
meshMod.removeFace(face1, -1);
meshMod.modifyFace
(
polyModifyFace
(
faces[face0], // modified face
face0, // label of face being modified
own0, // owner
nei, // neighbour
false, // face flip
-1, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
faces[face0], // modified face
face0, // label of face being modified
own0, // owner
nei, // neighbour
false, // face flip
-1, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
);
}
else
@ -889,21 +874,17 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::mergeBaffles
zoneFlip = fZone.flipMap()[fZone.whichFace(face1)];
}
meshMod.setAction(polyRemoveFace(face0));
meshMod.setAction
meshMod.removeFace(face0, -1);
meshMod.modifyFace
(
polyModifyFace
(
faces[face1], // modified face
face1, // label of face being modified
own1, // owner
own0, // neighbour
false, // face flip
-1, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
faces[face1], // modified face
face1, // label of face being modified
own1, // owner
own0, // neighbour
false, // face flip
-1, // patch for face
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
faceOwner[facei], // owner
faceNeighbour[facei], // neighbour
false, // face flip
-1, // patch for face
false, // remove from zone
faceZoneI, // zone for face
flip // face flip in zone
)
mesh_.faces()[facei], // modified face
facei, // label of face
faceOwner[facei], // owner
faceNeighbour[facei], // neighbour
false, // face flip
-1, // patch for face
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
faceOwner[facei], // owner
-1, // neighbour
false, // face flip
patchi, // patch for face
false, // remove from zone
faceZoneI, // zone for face
flip // face flip in zone
)
mesh_.faces()[facei], // modified face
facei, // label of face
faceOwner[facei], // owner
-1, // neighbour
false, // face flip
patchi, // patch for face
faceZoneI, // zone for face
flip // face flip in zone
);
}
facei++;
@ -3323,15 +3296,7 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::zonify
if (zonei >= 0)
{
meshMod.setAction
(
polyModifyCell
(
celli,
false, // removeFromZone
zonei
)
);
meshMod.modifyCell(celli, zonei);
}
}