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,9 +79,7 @@ void modifyOrAddFace
if (!modifiedFace[facei])
{
// First usage of face. Modify.
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
f, // modified face
facei, // label of face
@ -91,19 +87,15 @@ void modifyOrAddFace
-1, // neighbour
flipFaceFlux, // face flip
newPatchi, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
modifiedFace[facei] = 1;
}
else
{
// Second or more usage of face. Add.
meshMod.setAction
(
polyAddFace
meshMod.addFace
(
f, // modified face
own, // owner
@ -115,7 +107,6 @@ void modifyOrAddFace
newPatchi, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
}
}
@ -477,9 +468,7 @@ void createBaffles
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
f, // modified face
facei, // label of face
@ -487,10 +476,8 @@ void createBaffles
-1, // neighbour
false, // face flip
wantedPatch[facei], // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
if (mesh.isInternalFace(facei))
@ -504,9 +491,7 @@ void createBaffles
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
meshMod.setAction
(
polyAddFace
meshMod.addFace
(
f.reverseFace(), // modified face
mesh.faceNeighbour()[facei],// owner
@ -518,7 +503,6 @@ void createBaffles
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,9 +216,7 @@ label mergePatchFaces
<< " to vertices " << setFaceVerts[0] << endl;
// Modify the master face.
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
setFaceVerts[0], // original face
newMasterI, // label of face
@ -228,10 +224,8 @@ label mergePatchFaces
-1, // neighbour
false, // face flip
patchID, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
@ -241,9 +235,7 @@ label mergePatchFaces
Pout<< "Restoring removed face " << setFaces[i]
<< " with vertices " << setFaceVerts[i] << endl;
meshMod.setAction
(
polyAddFace
meshMod.addFace
(
setFaceVerts[i], // vertices
own, // owner,
@ -255,7 +247,6 @@ label mergePatchFaces
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,9 +146,7 @@ void modifyOrAddFace
if (!modifiedFace[facei])
{
// First usage of face. Modify.
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
f, // modified face
facei, // label of face
@ -158,10 +154,8 @@ void modifyOrAddFace
-1, // neighbour
flipFaceFlux, // face flip
newPatchi, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
modifiedFace[facei] = 1;
@ -169,9 +163,7 @@ void modifyOrAddFace
else
{
// Second usage of face. Add.
meshMod.setAction
(
polyAddFace
meshMod.addFace
(
f, // modified face
own, // owner
@ -183,7 +175,6 @@ void modifyOrAddFace
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,9 +72,7 @@ void changePatchID
zoneFlip = fZone.flipMap()[fZone.whichFace(faceID)];
}
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
mesh.faces()[faceID], // face
faceID, // face ID
@ -83,10 +80,8 @@ void changePatchID
-1, // neighbour
false, // flip flux
patchID, // patch ID
false, // remove from zone
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,10 +116,8 @@ void mergeDuplicateBoundaryFaces
zoneFlip = fZone.flipMap()[fZone.whichFace(face0)];
}
meshMod.setAction(polyRemoveFace(face1));
meshMod.setAction
(
polyModifyFace
meshMod.removeFace(face1, -1);
meshMod.modifyFace
(
faces[face0], // modified face
face0, // label of face being modified
@ -129,10 +125,8 @@ void mergeDuplicateBoundaryFaces
own1, // neighbour
false, // face flip
-1, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
}
else
@ -147,10 +141,8 @@ void mergeDuplicateBoundaryFaces
zoneFlip = fZone.flipMap()[fZone.whichFace(face1)];
}
meshMod.setAction(polyRemoveFace(face0));
meshMod.setAction
(
polyModifyFace
meshMod.removeFace(face0, -1);
meshMod.modifyFace
(
faces[face1], // modified face
face1, // label of face being modified
@ -158,10 +150,8 @@ void mergeDuplicateBoundaryFaces
own0, // neighbour
false, // face flip
-1, // patch for face
false, // remove from zone
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,16 +214,12 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
zoneID = pointZoneIndices[zoneID];
}
renumberPoints[pointi] =
meshMod_.setAction
(
polyAddPoint
renumberPoints[pointi] = meshMod_.addPoint
(
p[pointi], // Point to add
-1, // Master point (straight addition)
zoneID, // Zone for point
pointi < m.nPoints() // Is in cell?
)
);
}
@ -254,17 +247,13 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
zoneID = cellZoneIndices[zoneID];
}
renumberCells[celli] =
meshMod_.setAction
(
polyAddCell
renumberCells[celli] = meshMod_.addCell
(
-1, // Master point
-1, // Master edge
-1, // Master face
-1, // Master cell
zoneID // Zone for cell
)
);
}
@ -359,10 +348,7 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
newZone = faceZoneIndices[newZone];
}
renumberFaces[facei] =
meshMod_.setAction
(
polyAddFace
renumberFaces[facei] = meshMod_.addFace
(
newFace,
newOwn,
@ -374,7 +360,6 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
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,9 +136,7 @@ bool repatchFace
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
mesh.faces()[facei],// modified face
facei, // label of face being modified
@ -146,10 +144,8 @@ bool repatchFace
-1, // neighbour
false, // face flip
patchID, // patch for face
false, // remove from zone
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,9 +152,7 @@ void Foam::boundaryCutter::addFace
if (!modifiedFace)
{
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
newFace, // face
facei,
@ -167,19 +160,15 @@ void Foam::boundaryCutter::addFace
-1, // neighbour
false, // flux flip
patchID, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face zone flip
)
);
modifiedFace = true;
}
else
{
meshMod.setAction
(
polyAddFace
meshMod.addFace
(
newFace, // face
own, // owner
@ -191,7 +180,6 @@ void Foam::boundaryCutter::addFace
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
(
polyModifyPoint
meshMod.modifyPoint
(
iter.key(), // point
iter(), // position
false, // no zone
-1, // zone for point
true // supports a cell
)
);
}
@ -460,16 +444,12 @@ void Foam::boundaryCutter::setRefinement
// point on feature to move to
const point& featurePoint = cuts[cutI];
label addedPointi =
meshMod.setAction
(
polyAddPoint
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,16 +503,12 @@ void Foam::boundaryCutter::setRefinement
<< abort(FatalError);
}
label addedPointi =
meshMod.setAction
(
polyAddPoint
label addedPointi = meshMod.addPoint
(
iter(), // point
f[0], // master point
-1, // zone for point
true // supports a cell
)
);
faceAddedPoint_.insert(facei, addedPointi);
@ -586,9 +562,7 @@ void Foam::boundaryCutter::setRefinement
if (fp == 0)
{
// Modify the existing face.
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
tri, // face
facei,
@ -596,18 +570,14 @@ void Foam::boundaryCutter::setRefinement
-1, // neighbour
false, // flux flip
patchID, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face zone flip
)
);
}
else
{
// Add additional faces
meshMod.setAction
(
polyAddFace
meshMod.addFace
(
tri, // face
own, // owner
@ -619,7 +589,6 @@ void Foam::boundaryCutter::setRefinement
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
)
);
}
}
@ -689,9 +658,7 @@ void Foam::boundaryCutter::setRefinement
// Modify the existing face.
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
face(newVerts.shrink()), // face
facei,
@ -699,10 +666,8 @@ void Foam::boundaryCutter::setRefinement
-1, // neighbour
false, // flux flip
patchID, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face zone flip
)
);
@ -721,9 +686,7 @@ void Foam::boundaryCutter::setRefinement
newVerts.append(newFace[fp0]);
// Add additional face
meshMod.setAction
(
polyAddFace
meshMod.addFace
(
face(newVerts.shrink()), // face
own, // owner
@ -735,7 +698,6 @@ void Foam::boundaryCutter::setRefinement
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
)
);
faceUptodate[facei] = true;
@ -797,9 +759,7 @@ void Foam::boundaryCutter::setRefinement
label patchID, zoneID, zoneFlip;
getFaceInfo(facei, patchID, zoneID, zoneFlip);
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
newFace, // modified face
facei, // label of face being modified
@ -807,10 +767,8 @@ void Foam::boundaryCutter::setRefinement
nei, // neighbour
false, // face flip
patchID, // patch for face
false, // remove from zone
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,9 +261,7 @@ void Foam::meshCutAndRemove::addFace
<< endl;
}
meshMod.setAction
(
polyAddFace
meshMod.addFace
(
newFace, // face
own, // owner
@ -280,7 +273,6 @@ void Foam::meshCutAndRemove::addFace
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
)
);
}
else
@ -298,9 +290,7 @@ void Foam::meshCutAndRemove::addFace
<< endl;
}
meshMod.setAction
(
polyAddFace
meshMod.addFace
(
newFace.reverseFace(), // face
nei, // owner
@ -312,7 +302,6 @@ void Foam::meshCutAndRemove::addFace
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
)
);
}
}
@ -359,9 +348,7 @@ void Foam::meshCutAndRemove::modFace
if ((nei == -1) || (own != -1 && own < nei))
{
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
newFace, // modified face
facei, // label of face being modified
@ -369,17 +356,13 @@ void Foam::meshCutAndRemove::modFace
nei, // neighbour
false, // face flip
patchID, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
}
else
{
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
newFace.reverseFace(), // modified face
facei, // label of face being modified
@ -387,10 +370,8 @@ void Foam::meshCutAndRemove::modFace
own, // neighbour
false, // face flip
patchID, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
}
}
@ -632,16 +613,12 @@ void Foam::meshCutAndRemove::setRefinement
point newPt = weight*v1 + (1.0-weight)*v0;
label addedPointi =
meshMod.setAction
(
polyAddPoint
label addedPointi = meshMod.addPoint
(
newPt, // point
masterPointi, // master point
-1, // zone for point
true // supports a cell
)
);
// Store on (hash of) edge.
@ -752,7 +729,7 @@ void Foam::meshCutAndRemove::setRefinement
{
if (!usedPoint[pointi])
{
meshMod.setAction(polyRemovePoint(pointi));
meshMod.removePoint(pointi, -1);
if (debug & 2)
{
@ -792,10 +769,7 @@ void Foam::meshCutAndRemove::setRefinement
// Pick any anchor point on cell
label masterPointi = findPatchFacePoint(newFace, exposedPatchi);
label addedFacei =
meshMod.setAction
(
polyAddFace
label addedFacei = meshMod.addFace
(
newFace, // face
celli, // owner
@ -807,7 +781,6 @@ void Foam::meshCutAndRemove::setRefinement
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,9 +217,7 @@ void Foam::meshCutter::addFace
<< endl;
}
meshMod.setAction
(
polyAddFace
meshMod.addFace
(
newFace, // face
own, // owner
@ -235,7 +229,6 @@ void Foam::meshCutter::addFace
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
)
);
}
else
@ -252,9 +245,7 @@ void Foam::meshCutter::addFace
<< endl;
}
meshMod.setAction
(
polyAddFace
meshMod.addFace
(
newFace.reverseFace(), // face
nei, // owner
@ -266,7 +257,6 @@ void Foam::meshCutter::addFace
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
)
);
}
}
@ -309,9 +299,7 @@ void Foam::meshCutter::modFace
if ((nei == -1) || (own < nei))
{
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
newFace, // modified face
facei, // label of face being modified
@ -319,17 +307,13 @@ void Foam::meshCutter::modFace
nei, // neighbour
false, // face flip
patchID, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
}
else
{
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
newFace.reverseFace(), // modified face
facei, // label of face being modified
@ -337,10 +321,8 @@ void Foam::meshCutter::modFace
own, // neighbour
false, // face flip
patchID, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
}
}
@ -599,16 +581,12 @@ void Foam::meshCutter::setRefinement
point newPt = weight*v1 + (1.0-weight)*v0;
label addedPointi =
meshMod.setAction
(
polyAddPoint
label addedPointi = meshMod.addPoint
(
newPt, // point
masterPointi, // master point
-1, // zone for point
true // supports a cell
)
);
// Store on (hash of) edge.
@ -633,17 +611,13 @@ void Foam::meshCutter::setRefinement
if (cellLoops[celli].size())
{
// Add a cell to the existing cell
label addedCelli =
meshMod.setAction
(
polyAddCell
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,9 +650,7 @@ void Foam::meshCutter::setRefinement
label masterPointi = findInternalFacePoint(anchorPts[celli]);
label addedFacei =
meshMod.setAction
(
polyAddFace
meshMod.addFace
(
newFace, // face
celli, // owner
@ -690,7 +662,6 @@ void Foam::meshCutter::setRefinement
-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,9 +325,7 @@ Foam::label Foam::addPatchCellLayer::addSideFace
// << " patch:" << newPatchID
// << endl;
addedFacei = meshMod.setAction
(
polyAddFace
addedFacei = meshMod.addFace
(
newFace, // face
addedCells[ownFacei][layerOwn], // owner
@ -343,7 +337,6 @@ Foam::label Foam::addPatchCellLayer::addSideFace
newPatchID, // patch for face
zoneI, // zone for face
flip // face zone flip
)
);
}
else
@ -395,9 +388,7 @@ Foam::label Foam::addPatchCellLayer::addSideFace
layerOwn = layerI;
}
addedFacei = meshMod.setAction
(
polyAddFace
addedFacei = meshMod.addFace
(
newFace, // face
addedCells[ownFacei][layerOwn], // owner
@ -409,7 +400,6 @@ Foam::label Foam::addPatchCellLayer::addSideFace
-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
(
polyAddPoint
copiedPatchPoints[patchPointi] = meshMod.addPoint
(
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
(
polyAddPoint
label addedVertI = meshMod.addPoint
(
pt, // point
(addToMesh_ ? meshPointi : -1), // master point
zoneI, // zone for point
true // supports a cell
)
);
addedPoints_[patchPointi][i] = addedVertI;
@ -1165,9 +1149,7 @@ 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
(
polyAddCell
addedCells[patchFacei][i] = meshMod.addCell
(
-1, // master point
-1, // master edge
@ -1175,7 +1157,6 @@ void Foam::addPatchCellLayer::setRefinement
(addToMesh_ ? mesh_.faceOwner()[meshFacei] : -1),
// master
ownZoneI // zone for cell
)
);
}
}
@ -1255,9 +1236,7 @@ void Foam::addPatchCellLayer::setRefinement
}
layerFaces_[patchFacei][i+1] = meshMod.setAction
(
polyAddFace
layerFaces_[patchFacei][i+1] = meshMod.addFace
(
newFace, // face
addedCells[patchFacei][i], // owner
@ -1269,7 +1248,6 @@ void Foam::addPatchCellLayer::setRefinement
patchi, // patch for face
zoneI, // zone for face
flip // face zone flip
)
);
}
}
@ -1289,9 +1267,7 @@ void Foam::addPatchCellLayer::setRefinement
layerFaces_[patchFacei][0] = meshFacei;
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
pp[patchFacei], // modified face
meshFacei, // label of face
@ -1299,10 +1275,8 @@ void Foam::addPatchCellLayer::setRefinement
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
)
);
}
}
@ -1331,9 +1305,7 @@ void Foam::addPatchCellLayer::setRefinement
f[fp] = copiedPatchPoints[f[fp]];
}
layerFaces_[patchFacei][0] = meshMod.setAction
(
polyAddFace
layerFaces_[patchFacei][0] = meshMod.addFace
(
f, // modified face
addedCells[patchFacei][0], // owner
@ -1345,7 +1317,6 @@ void Foam::addPatchCellLayer::setRefinement
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,9 +657,7 @@ void Foam::combineFaces::setRefinement
label patchi = mesh_.boundaryMesh().whichPatch(masterFacei);
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
outsideFace, // modified face
masterFacei, // label of face being modified
@ -672,10 +665,8 @@ void Foam::combineFaces::setRefinement
-1, // neighbour
false, // face flip
patchi, // patch for face
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++)
{
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
(
polyAddPoint
addedPoints[localI] = meshMod.addPoint
(
savedPoints_[localI], // point
-1, // master point
-1, // zone for point
true // supports a cell
)
);
restoredPoints.insert
(
@ -957,9 +945,7 @@ void Foam::combineFaces::setUnrefinement
// << " to vertices " << faces[0] << endl;
// Modify the master face.
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
faces[0], // original face
masterFacei, // label of face
@ -967,10 +953,8 @@ void Foam::combineFaces::setUnrefinement
-1, // neighbour
false, // face flip
patchi, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
restoredFaces.insert(masterFacei, masterFacei);
@ -980,9 +964,7 @@ void Foam::combineFaces::setUnrefinement
// Pout<< "Restoring removed face with vertices " << faces[i]
// << endl;
label facei = meshMod.setAction
(
polyAddFace
label facei = meshMod.addFace
(
faces[i], // vertices
own, // owner,
@ -994,7 +976,6 @@ void Foam::combineFaces::setUnrefinement
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,9 +136,7 @@ Foam::label Foam::hexRef8::addFace
if ((nei == -1) || (own < nei))
{
// Ordering ok.
newFacei = meshMod.setAction
(
polyAddFace
newFacei = meshMod.addFace
(
newFace, // face
own, // owner
@ -154,15 +148,12 @@ Foam::label Foam::hexRef8::addFace
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
)
);
}
else
{
// Reverse owner/neighbour
newFacei = meshMod.setAction
(
polyAddFace
newFacei = meshMod.addFace
(
newFace.reverseFace(), // face
nei, // owner
@ -174,7 +165,6 @@ Foam::label Foam::hexRef8::addFace
patchID, // patch for face
zoneID, // zone for face
zoneFlip // face zone flip
)
);
}
return newFacei;
@ -193,9 +183,7 @@ Foam::label Foam::hexRef8::addInternalFace
{
if (mesh_.isInternalFace(meshFacei))
{
return meshMod.setAction
(
polyAddFace
return meshMod.addFace
(
newFace, // face
own, // owner
@ -207,7 +195,6 @@ Foam::label Foam::hexRef8::addInternalFace
-1, // patch for face
-1, // zone for face
false // face zone flip
)
);
}
else
@ -221,9 +208,7 @@ Foam::label Foam::hexRef8::addInternalFace
// For now create out of nothing
return meshMod.setAction
(
polyAddFace
return meshMod.addFace
(
newFace, // face
own, // owner
@ -235,7 +220,6 @@ Foam::label Foam::hexRef8::addInternalFace
-1, // patch for face
-1, // zone for face
false // face zone flip
)
);
@ -256,9 +240,7 @@ Foam::label Foam::hexRef8::addInternalFace
// }
//}
//
// return meshMod.setAction
//(
// polyAddFace
// return meshMod.addFace
// (
// newFace, // face
// own, // owner
@ -270,7 +252,6 @@ Foam::label Foam::hexRef8::addInternalFace
// -1, // patch for face
// -1, // zone for face
// false // face zone flip
// )
// );
}
}
@ -301,9 +282,7 @@ void Foam::hexRef8::modFace
{
if ((nei == -1) || (own < nei))
{
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
newFace, // modified face
facei, // label of face being modified
@ -311,17 +290,13 @@ void Foam::hexRef8::modFace
nei, // neighbour
false, // face flip
patchID, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
}
else
{
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
newFace.reverseFace(), // modified face
facei, // label of face being modified
@ -329,10 +304,8 @@ void Foam::hexRef8::modFace
own, // neighbour
false, // face flip
patchID, // patch for face
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];
cellMidPoint[celli] = meshMod.setAction
(
polyAddPoint
cellMidPoint[celli] = meshMod.addPoint
(
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
(
polyAddPoint
edgeMidPoint[edgeI] = meshMod.addPoint
(
edgeMids[edgeI], // point
e[0], // master point
-1, // zone for point
true // supports a cell
)
);
newPointLevel(edgeMidPoint[edgeI]) =
@ -3556,9 +3523,7 @@ Foam::labelListList Foam::hexRef8::setRefinement
const face& f = mesh_.faces()[facei];
faceMidPoint[facei] = meshMod.setAction
(
polyAddPoint
faceMidPoint[facei] = meshMod.addPoint
(
(
facei < mesh_.nInternalFaces()
@ -3568,7 +3533,6 @@ Foam::labelListList Foam::hexRef8::setRefinement
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
(
polyAddCell
cAdded[i] = meshMod.addCell
(
-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,9 +306,7 @@ void Foam::removeCells::setRefinement
// << " fc:" << mesh_.faceCentres()[facei]
// << " into patch " << newPatchID[facei] << endl;
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
f.reverseFace(), // modified face
facei, // label of face being modified
@ -320,10 +314,8 @@ void Foam::removeCells::setRefinement
-1, // neighbour
true, // face flip
newPatchID[facei], // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
}
}
@ -352,9 +344,7 @@ void Foam::removeCells::setRefinement
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
f, // modified face
facei, // label of face being modified
@ -362,10 +352,8 @@ void Foam::removeCells::setRefinement
-1, // neighbour
false, // face flip
newPatchID[facei], // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
}
}
@ -395,9 +383,7 @@ void Foam::removeCells::setRefinement
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
faces[facei], // modified face
facei, // label of face
@ -405,10 +391,8 @@ void Foam::removeCells::setRefinement
-1, // neighbour
false, // face flip
newPatchID[facei], // patch for face
false, // remove from zone
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,9 +499,7 @@ void Foam::removeFaces::modFace
// << endl;
// }
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
f, // modified face
masterFaceID, // label of face being modified
@ -513,10 +507,8 @@ void Foam::removeFaces::modFace
nei, // neighbour
flipFaceFlux, // face flip
newPatchID, // patch for face
removeFromZone, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
}
else
@ -536,9 +528,7 @@ void Foam::removeFaces::modFace
// << endl;
// }
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
f.reverseFace(),// modified face
masterFaceID, // label of face being modified
@ -546,10 +536,8 @@ void Foam::removeFaces::modFace
own, // neighbour
flipFaceFlux, // face flip
newPatchID, // patch for face
removeFromZone, // remove from zone
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,9 +105,7 @@ void Foam::removePoints::modifyFace
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
newFace, // modified face
facei, // label of face being modified
@ -118,10 +113,8 @@ void Foam::removePoints::modifyFace
neighbour, // neighbour
false, // face flip
patchi, // patch for face
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);
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
(
polyAddPoint
addedPoints[localI] = meshMod.addPoint
(
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,9 +115,7 @@ void Foam::attachDetach::attachInterface
// turning. Modify it to become internal
if (masterFaceCells[facei] < slaveFaceCells[facei])
{
ref.setAction
(
polyModifyFace
ref.modifyFace
(
faces[masterPatchStart + facei], // modified face
masterPatchStart + facei, // label of face being modified
@ -128,18 +123,14 @@ void Foam::attachDetach::attachInterface
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
)
);
}
else
{
// Flip required
ref.setAction
(
polyModifyFace
ref.modifyFace
(
faces[masterPatchStart + facei].reverseFace(), // mod face
masterPatchStart + facei, // label of face being modified
@ -147,10 +138,8 @@ void Foam::attachDetach::attachInterface
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
)
);
}
}
@ -236,9 +225,7 @@ void Foam::attachDetach::attachInterface
// Modify the face
ref.setAction
(
polyModifyFace
ref.modifyFace
(
newFace, // modified face
curFaceID, // label of face being modified
@ -246,10 +233,8 @@ void Foam::attachDetach::attachInterface
neiCell, // neighbour
false, // face flip
patchID, // patch for face
false, // remove from zone
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,16 +148,12 @@ void Foam::attachDetach::detachInterface
{
if (addedPoints[pointi] < 0)
{
addedPoints[pointi] =
ref.setAction
(
polyAddPoint
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]]
@ -196,9 +189,7 @@ void Foam::attachDetach::detachInterface
if (mfFlip[facei])
{
// Face needs to be flipped for the master patch
ref.setAction
(
polyModifyFace
ref.modifyFace
(
faces[curFaceID].reverseFace(), // modified face
curFaceID, // label of face being modified
@ -206,17 +197,13 @@ void Foam::attachDetach::detachInterface
-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
)
);
// Add renumbered face into the slave patch
// label addedFacei =
ref.setAction
(
polyAddFace
ref.addFace
(
newFace, // face
own[curFaceID], // owner
@ -228,7 +215,6 @@ void Foam::attachDetach::detachInterface
slavePatchID_.index(), // patch to add the face to
-1, // zone for face
false // zone flip
)
);
//{
// pointField newPts(ref.points());
@ -243,9 +229,7 @@ void Foam::attachDetach::detachInterface
else
{
// No flip
ref.setAction
(
polyModifyFace
ref.modifyFace
(
faces[curFaceID], // modified face
curFaceID, // label of face being modified
@ -253,17 +237,13 @@ void Foam::attachDetach::detachInterface
-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
)
);
// Add renumbered face into the slave patch
// label addedFacei =
ref.setAction
(
polyAddFace
ref.addFace
(
newFace, // face
nei[curFaceID], // owner
@ -275,7 +255,6 @@ void Foam::attachDetach::detachInterface
slavePatchID_.index(), // patch to add the face to
-1, // zone for face
false // face flip in zone
)
);
//{
// pointField newPts(ref.points());
@ -423,9 +402,7 @@ void Foam::attachDetach::detachInterface
{
if (mesh.isInternalFace(curFaceID))
{
ref.setAction
(
polyModifyFace
ref.modifyFace
(
newFace, // face
curFaceID, // master face
@ -433,10 +410,8 @@ void Foam::attachDetach::detachInterface
nei[curFaceID], // neighbour
false, // flip flux
-1, // patch for face
false, // remove from zone
-1, // zone for face
false // face zone flip
)
);
// Pout<< "modifying stick-out face. Internal Old face: "
@ -448,9 +423,7 @@ void Foam::attachDetach::detachInterface
}
else
{
ref.setAction
(
polyModifyFace
ref.modifyFace
(
newFace, // face
curFaceID, // master face
@ -458,10 +431,8 @@ void Foam::attachDetach::detachInterface
-1, // neighbour
false, // flip flux
mesh.boundaryMesh().whichPatch(curFaceID), // patch
false, // remove from zone
-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,9 +59,7 @@ Foam::label Foam::meshRefinement::createBaffle
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
f, // modified face
facei, // label of face
@ -73,10 +67,8 @@ Foam::label Foam::meshRefinement::createBaffle
-1, // neighbour
false, // face flip
ownPatch, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
@ -98,9 +90,7 @@ Foam::label Foam::meshRefinement::createBaffle
reverseFlip = !zoneFlip;
}
dupFacei = meshMod.setAction
(
polyAddFace
dupFacei = meshMod.addFace
(
f.reverseFace(), // modified face
mesh_.faceNeighbour()[facei],// owner
@ -112,7 +102,6 @@ Foam::label Foam::meshRefinement::createBaffle
nbrPatch, // patch for face
zoneID, // zone for face
reverseFlip // face flip in zone
)
);
}
return dupFacei;
@ -860,10 +849,8 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::mergeBaffles
const label nei = (face1 < 0 ? -1 : own1);
meshMod.setAction(polyRemoveFace(face1));
meshMod.setAction
(
polyModifyFace
meshMod.removeFace(face1, -1);
meshMod.modifyFace
(
faces[face0], // modified face
face0, // label of face being modified
@ -871,10 +858,8 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::mergeBaffles
nei, // neighbour
false, // face flip
-1, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
}
else
@ -889,10 +874,8 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::mergeBaffles
zoneFlip = fZone.flipMap()[fZone.whichFace(face1)];
}
meshMod.setAction(polyRemoveFace(face0));
meshMod.setAction
(
polyModifyFace
meshMod.removeFace(face0, -1);
meshMod.modifyFace
(
faces[face1], // modified face
face1, // label of face being modified
@ -900,10 +883,8 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::mergeBaffles
own0, // neighbour
false, // face flip
-1, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
}
}
@ -3242,9 +3223,7 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::zonify
);
}
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
mesh_.faces()[facei], // modified face
facei, // label of face
@ -3252,10 +3231,8 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::zonify
faceNeighbour[facei], // neighbour
false, // face flip
-1, // patch for face
false, // remove from zone
faceZoneI, // zone for face
flip // face flip in zone
)
);
}
}
@ -3293,9 +3270,7 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::zonify
);
}
meshMod.setAction
(
polyModifyFace
meshMod.modifyFace
(
mesh_.faces()[facei], // modified face
facei, // label of face
@ -3303,10 +3278,8 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::zonify
-1, // neighbour
false, // face flip
patchi, // patch for face
false, // remove from zone
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);
}
}