polyTopoChange: Removed restrictive faceZone functionality
Now faceZones are handled directly by the applications and the new faceZone::topoChange function so that any face can now be in any number of zones, significantly increasing the flexibility and usefulness of faceZones. This completes the generalisation of cellZone, faceZone and pointZone to support multiple zones for each cell, face or point respectively. Next step will be to make zones polymorphic and run-time selectable so that they can alter during the run and adapt to moving meshes for example.
This commit is contained in:
@ -70,8 +70,6 @@ void modifyOrAddFace
|
|||||||
const label own,
|
const label own,
|
||||||
const bool flipFaceFlux,
|
const bool flipFaceFlux,
|
||||||
const label newPatchi,
|
const label newPatchi,
|
||||||
const label zoneID,
|
|
||||||
const bool zoneFlip,
|
|
||||||
|
|
||||||
PackedBoolList& modifiedFace
|
PackedBoolList& modifiedFace
|
||||||
)
|
)
|
||||||
@ -86,9 +84,7 @@ void modifyOrAddFace
|
|||||||
own, // owner
|
own, // owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
flipFaceFlux, // face flip
|
flipFaceFlux, // face flip
|
||||||
newPatchi, // patch for face
|
newPatchi // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
modifiedFace[facei] = 1;
|
modifiedFace[facei] = 1;
|
||||||
}
|
}
|
||||||
@ -102,9 +98,7 @@ void modifyOrAddFace
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
facei, // master face
|
facei, // master face
|
||||||
flipFaceFlux, // face flip
|
flipFaceFlux, // face flip
|
||||||
newPatchi, // patch for face
|
newPatchi // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -308,21 +302,11 @@ void createCoupledBaffles
|
|||||||
PackedBoolList& modifiedFace
|
PackedBoolList& modifiedFace
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const meshFaceZones& faceZones = mesh.faceZones();
|
|
||||||
|
|
||||||
forAll(coupledWantedPatch, facei)
|
forAll(coupledWantedPatch, facei)
|
||||||
{
|
{
|
||||||
if (coupledWantedPatch[facei] != -1)
|
if (coupledWantedPatch[facei] != -1)
|
||||||
{
|
{
|
||||||
const face& f = mesh.faces()[facei];
|
const face& f = mesh.faces()[facei];
|
||||||
label zoneID = faceZones.whichZone(facei);
|
|
||||||
bool zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = faceZones[zoneID];
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Use owner side of face
|
// Use owner side of face
|
||||||
modifyOrAddFace
|
modifyOrAddFace
|
||||||
@ -333,21 +317,11 @@ void createCoupledBaffles
|
|||||||
mesh.faceOwner()[facei], // owner
|
mesh.faceOwner()[facei], // owner
|
||||||
false, // face flip
|
false, // face flip
|
||||||
coupledWantedPatch[facei], // patch for face
|
coupledWantedPatch[facei], // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip, // face flip in zone
|
|
||||||
modifiedFace // modify or add status
|
modifiedFace // modify or add status
|
||||||
);
|
);
|
||||||
|
|
||||||
if (mesh.isInternalFace(facei))
|
if (mesh.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
label zoneID = faceZones.whichZone(facei);
|
|
||||||
bool zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = faceZones[zoneID];
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
|
||||||
}
|
|
||||||
// Use neighbour side of face
|
// Use neighbour side of face
|
||||||
modifyOrAddFace
|
modifyOrAddFace
|
||||||
(
|
(
|
||||||
@ -357,8 +331,6 @@ void createCoupledBaffles
|
|||||||
mesh.faceNeighbour()[facei],// owner
|
mesh.faceNeighbour()[facei],// owner
|
||||||
false, // face flip
|
false, // face flip
|
||||||
coupledWantedPatch[facei], // patch for face
|
coupledWantedPatch[facei], // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip, // face flip in zone
|
|
||||||
modifiedFace // modify or add status
|
modifiedFace // modify or add status
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -376,23 +348,12 @@ void createCyclicCoupledBaffles
|
|||||||
PackedBoolList& modifiedFace
|
PackedBoolList& modifiedFace
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const meshFaceZones& faceZones = mesh.faceZones();
|
|
||||||
|
|
||||||
forAll(cyclicMasterPatch, facei)
|
forAll(cyclicMasterPatch, facei)
|
||||||
{
|
{
|
||||||
if (cyclicMasterPatch[facei] != -1)
|
if (cyclicMasterPatch[facei] != -1)
|
||||||
{
|
{
|
||||||
const face& f = mesh.faces()[facei];
|
const face& f = mesh.faces()[facei];
|
||||||
|
|
||||||
label zoneID = faceZones.whichZone(facei);
|
|
||||||
bool zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = faceZones[zoneID];
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
|
||||||
}
|
|
||||||
|
|
||||||
modifyOrAddFace
|
modifyOrAddFace
|
||||||
(
|
(
|
||||||
meshMod,
|
meshMod,
|
||||||
@ -401,8 +362,6 @@ void createCyclicCoupledBaffles
|
|||||||
mesh.faceNeighbour()[facei], // owner
|
mesh.faceNeighbour()[facei], // owner
|
||||||
false, // face flip
|
false, // face flip
|
||||||
cyclicMasterPatch[facei], // patch for face
|
cyclicMasterPatch[facei], // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip, // face flip in zone
|
|
||||||
modifiedFace // modify or add
|
modifiedFace // modify or add
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -415,15 +374,7 @@ void createCyclicCoupledBaffles
|
|||||||
const face& f = mesh.faces()[facei];
|
const face& f = mesh.faces()[facei];
|
||||||
if (mesh.isInternalFace(facei))
|
if (mesh.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
label zoneID = faceZones.whichZone(facei);
|
// Use owner side of face
|
||||||
bool zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = faceZones[zoneID];
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
|
||||||
}
|
|
||||||
// Use owner side of face
|
|
||||||
modifyOrAddFace
|
modifyOrAddFace
|
||||||
(
|
(
|
||||||
meshMod,
|
meshMod,
|
||||||
@ -432,8 +383,6 @@ void createCyclicCoupledBaffles
|
|||||||
mesh.faceOwner()[facei], // owner
|
mesh.faceOwner()[facei], // owner
|
||||||
false, // face flip
|
false, // face flip
|
||||||
cyclicSlavePatch[facei], // patch for face
|
cyclicSlavePatch[facei], // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip, // face flip in zone
|
|
||||||
modifiedFace // modify or add status
|
modifiedFace // modify or add status
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -449,23 +398,12 @@ void createBaffles
|
|||||||
polyTopoChange& meshMod
|
polyTopoChange& meshMod
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const meshFaceZones& faceZones = mesh.faceZones();
|
|
||||||
Info << "faceZone:createBaffle " << faceZones << endl;
|
|
||||||
forAll(wantedPatch, facei)
|
forAll(wantedPatch, facei)
|
||||||
{
|
{
|
||||||
if (wantedPatch[facei] != -1)
|
if (wantedPatch[facei] != -1)
|
||||||
{
|
{
|
||||||
const face& f = mesh.faces()[facei];
|
const face& f = mesh.faces()[facei];
|
||||||
|
|
||||||
label zoneID = faceZones.whichZone(facei);
|
|
||||||
bool zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = faceZones[zoneID];
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
|
||||||
}
|
|
||||||
|
|
||||||
meshMod.modifyFace
|
meshMod.modifyFace
|
||||||
(
|
(
|
||||||
f, // modified face
|
f, // modified face
|
||||||
@ -473,22 +411,11 @@ void createBaffles
|
|||||||
mesh.faceOwner()[facei], // owner
|
mesh.faceOwner()[facei], // owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
wantedPatch[facei], // patch for face
|
wantedPatch[facei] // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (mesh.isInternalFace(facei))
|
if (mesh.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
label zoneID = faceZones.whichZone(facei);
|
|
||||||
bool zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = faceZones[zoneID];
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
|
||||||
}
|
|
||||||
|
|
||||||
meshMod.addFace
|
meshMod.addFace
|
||||||
(
|
(
|
||||||
f.reverseFace(), // modified face
|
f.reverseFace(), // modified face
|
||||||
@ -496,9 +423,7 @@ void createBaffles
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
facei, // masterFaceID,
|
facei, // masterFaceID,
|
||||||
false, // face flip
|
false, // face flip
|
||||||
wantedPatch[facei], // patch for face
|
wantedPatch[facei] // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -191,13 +191,6 @@ label mergePatchFaces
|
|||||||
// Restore. Get face properties.
|
// Restore. Get face properties.
|
||||||
|
|
||||||
label own = mesh.faceOwner()[newMasterI];
|
label own = mesh.faceOwner()[newMasterI];
|
||||||
label zoneID = mesh.faceZones().whichZone(newMasterI);
|
|
||||||
bool zoneFlip = false;
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = mesh.faceZones()[zoneID];
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(newMasterI)];
|
|
||||||
}
|
|
||||||
label patchID = mesh.boundaryMesh().whichPatch(newMasterI);
|
label patchID = mesh.boundaryMesh().whichPatch(newMasterI);
|
||||||
|
|
||||||
Pout<< "Restoring new master face " << newMasterI
|
Pout<< "Restoring new master face " << newMasterI
|
||||||
@ -211,12 +204,9 @@ label mergePatchFaces
|
|||||||
own, // owner
|
own, // owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchID, // patch for face
|
patchID // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// Add the previously removed faces
|
// Add the previously removed faces
|
||||||
for (label i = 1; i < setFaces.size(); i++)
|
for (label i = 1; i < setFaces.size(); i++)
|
||||||
{
|
{
|
||||||
@ -230,9 +220,7 @@ label mergePatchFaces
|
|||||||
-1, // neighbour,
|
-1, // neighbour,
|
||||||
newMasterI, // masterFaceID,
|
newMasterI, // masterFaceID,
|
||||||
false, // flipFaceFlux,
|
false, // flipFaceFlux,
|
||||||
patchID, // patchID,
|
patchID // patchID,
|
||||||
zoneID, // zoneID,
|
|
||||||
zoneFlip // zoneFlip
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1296,9 +1296,7 @@ int main(int argc, char *argv[])
|
|||||||
neighbour[facei],
|
neighbour[facei],
|
||||||
facei, // masterFace
|
facei, // masterFace
|
||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
-1, // patchID
|
-1 // patchID
|
||||||
faceZonei, // zoneID
|
|
||||||
fm[facei] // zoneFlip
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1345,9 +1343,7 @@ int main(int argc, char *argv[])
|
|||||||
-1,
|
-1,
|
||||||
facei, // masterFace
|
facei, // masterFace
|
||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
patchi, // patchID
|
patchi // patchID
|
||||||
-1, // zoneID
|
|
||||||
false // zoneFlip
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// For baffles create the opposite face
|
// For baffles create the opposite face
|
||||||
@ -1360,9 +1356,7 @@ int main(int argc, char *argv[])
|
|||||||
-1,
|
-1,
|
||||||
facei, // masterFace
|
facei, // masterFace
|
||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
patchi, // patchID
|
patchi // patchID
|
||||||
-1, // zoneID
|
|
||||||
false // zoneFlip
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1408,9 +1402,7 @@ int main(int argc, char *argv[])
|
|||||||
neighbour[facei],
|
neighbour[facei],
|
||||||
facei, // masterFace
|
facei, // masterFace
|
||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
-1, // patchID
|
-1 // patchID
|
||||||
-1, // zoneID
|
|
||||||
false // zoneFlip
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1459,6 +1451,27 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add the face zones as required
|
||||||
|
forAll(faceZoneIDs, faceZonei)
|
||||||
|
{
|
||||||
|
const label cgi = faceZoneIDs[faceZonei];
|
||||||
|
|
||||||
|
mesh.faceZones()[faceZonei].resetAddressing
|
||||||
|
(
|
||||||
|
identityMap
|
||||||
|
(
|
||||||
|
faceGroupStartIndex[cgi],
|
||||||
|
faceGroupEndIndex[cgi] + 1 - faceGroupStartIndex[cgi]
|
||||||
|
),
|
||||||
|
boolList::subList
|
||||||
|
(
|
||||||
|
fm,
|
||||||
|
faceGroupEndIndex[cgi] + 1 - faceGroupStartIndex[cgi],
|
||||||
|
faceGroupStartIndex[cgi]
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
mesh.setInstance(runTime.constant());
|
mesh.setInstance(runTime.constant());
|
||||||
|
|
||||||
// Set the precision of the points data to 10
|
// Set the precision of the points data to 10
|
||||||
|
|||||||
@ -224,14 +224,6 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
|
|
||||||
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
|
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
|
||||||
{
|
{
|
||||||
label zoneID = mesh_.faceZones().whichZone(facei);
|
|
||||||
bool zoneFlip = false;
|
|
||||||
if (zoneID != -1)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = mesh_.faceZones()[zoneID];
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
|
||||||
}
|
|
||||||
|
|
||||||
face newFace(4);
|
face newFace(4);
|
||||||
const face& f = faces[facei];
|
const face& f = faces[facei];
|
||||||
newFace[0] = f[0] + currentLayerOffset;
|
newFace[0] = f[0] + currentLayerOffset;
|
||||||
@ -246,11 +238,9 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
newFace,
|
newFace,
|
||||||
mesh_.faceOwner()[facei] + offset, // own
|
mesh_.faceOwner()[facei] + offset, // own
|
||||||
mesh_.faceNeighbour()[facei] + offset, // nei
|
mesh_.faceNeighbour()[facei] + offset, // nei
|
||||||
nFaces++, // masterFaceID
|
nFaces++, // masterFaceID
|
||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
-1, // patchID
|
-1 // patchID
|
||||||
zoneID, // zoneID
|
|
||||||
zoneFlip // zoneFlip
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -276,14 +266,6 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
|
|
||||||
for (label facei = startFacei; facei < endFacei; facei++)
|
for (label facei = startFacei; facei < endFacei; facei++)
|
||||||
{
|
{
|
||||||
label zoneID = mesh_.faceZones().whichZone(facei);
|
|
||||||
bool zoneFlip = false;
|
|
||||||
if (zoneID != -1)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = mesh_.faceZones()[zoneID];
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
|
||||||
}
|
|
||||||
|
|
||||||
face newFace(4);
|
face newFace(4);
|
||||||
const face& f = faces[facei];
|
const face& f = faces[facei];
|
||||||
newFace[0] = f[0] + currentLayerOffset;
|
newFace[0] = f[0] + currentLayerOffset;
|
||||||
@ -300,9 +282,7 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
-1, // nei
|
-1, // nei
|
||||||
nFaces++, // masterFaceID
|
nFaces++, // masterFaceID
|
||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
patchi, // patchID
|
patchi // patchID
|
||||||
zoneID, // zoneID
|
|
||||||
zoneFlip // zoneFlip
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -393,9 +373,7 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
nei, // nei
|
nei, // nei
|
||||||
nFaces++, // masterFaceID
|
nFaces++, // masterFaceID
|
||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
-1, // patchID
|
-1 // patchID
|
||||||
-1, // zoneID
|
|
||||||
false // zoneFlip
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -472,9 +450,7 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
-1, // nei
|
-1, // nei
|
||||||
nFaces++, // masterFaceID
|
nFaces++, // masterFaceID
|
||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
backPatchi_, // patchID
|
backPatchi_ // patchID
|
||||||
-1, // zoneID
|
|
||||||
false // zoneFlip
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -500,9 +476,7 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
-1, // nei
|
-1, // nei
|
||||||
nFaces++, // masterFaceID
|
nFaces++, // masterFaceID
|
||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
frontPatchi_, // patchID
|
frontPatchi_ // patchID
|
||||||
-1, // zoneID
|
|
||||||
false // zoneFlip
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
|
|||||||
@ -425,14 +425,6 @@ int main(int argc, char *argv[])
|
|||||||
nei = mesh.faceNeighbour()[patchFacei];
|
nei = mesh.faceNeighbour()[patchFacei];
|
||||||
}
|
}
|
||||||
|
|
||||||
label zoneI = mesh.faceZones().whichZone(patchFacei);
|
|
||||||
bool zoneFlip = false;
|
|
||||||
if (zoneI != -1)
|
|
||||||
{
|
|
||||||
label index = mesh.faceZones()[zoneI].whichFace(patchFacei);
|
|
||||||
zoneFlip = mesh.faceZones()[zoneI].flipMap()[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
meshMod.modifyFace
|
meshMod.modifyFace
|
||||||
(
|
(
|
||||||
mesh.faces()[patchFacei].reverseFace(), // modified face
|
mesh.faces()[patchFacei].reverseFace(), // modified face
|
||||||
@ -440,9 +432,7 @@ int main(int argc, char *argv[])
|
|||||||
own, // owner
|
own, // owner
|
||||||
nei, // neighbour
|
nei, // neighbour
|
||||||
true, // face flip
|
true, // face flip
|
||||||
patchi, // patch for face
|
patchi // patch for face
|
||||||
zoneI, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -968,30 +958,11 @@ int main(int argc, char *argv[])
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const word cutZoneName("originalCutFaceZone");
|
|
||||||
|
|
||||||
List<faceZone*> fz
|
|
||||||
(
|
|
||||||
1,
|
|
||||||
new faceZone
|
|
||||||
(
|
|
||||||
cutZoneName,
|
|
||||||
frontPatchFaces,
|
|
||||||
boolList(frontPatchFaces.size(), false),
|
|
||||||
mesh.faceZones()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
mesh.addZones(List<pointZone*>(0), fz, List<cellZone*>(0));
|
|
||||||
|
|
||||||
// Add the perfect interface mesh modifier
|
// Add the perfect interface mesh modifier
|
||||||
perfectInterface perfectStitcher
|
perfectInterface perfectStitcher
|
||||||
(
|
(
|
||||||
"couple",
|
"couple",
|
||||||
mesh,
|
mesh,
|
||||||
cutZoneName,
|
|
||||||
word::null, // dummy patch name
|
word::null, // dummy patch name
|
||||||
word::null // dummy patch name
|
word::null // dummy patch name
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1896,9 +1896,7 @@ int main(int argc, char *argv[])
|
|||||||
mesh.faceOwner()[meshFacei],// owner
|
mesh.faceOwner()[meshFacei],// owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
interMeshBottomPatch[zonei],// patch for face
|
interMeshBottomPatch[zonei] // patch for face
|
||||||
zoneMeshZoneID[zonei], // zone for face
|
|
||||||
false // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if (mesh.isInternalFace(meshFacei))
|
else if (mesh.isInternalFace(meshFacei))
|
||||||
@ -1910,9 +1908,7 @@ int main(int argc, char *argv[])
|
|||||||
mesh.faceNeighbour()[meshFacei],// owner
|
mesh.faceNeighbour()[meshFacei],// owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
true, // face flip
|
true, // face flip
|
||||||
interMeshBottomPatch[zonei], // patch for face
|
interMeshBottomPatch[zonei] // patch for face
|
||||||
zoneMeshZoneID[zonei], // zone for face
|
|
||||||
true // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1935,9 +1931,7 @@ int main(int argc, char *argv[])
|
|||||||
mesh.faceOwner()[meshFacei],// owner
|
mesh.faceOwner()[meshFacei],// owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
interMeshTopPatch[zonei], // patch for face
|
interMeshTopPatch[zonei] // patch for face
|
||||||
zoneMeshZoneID[zonei], // zone for face
|
|
||||||
false // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if (mesh.isInternalFace(meshFacei))
|
else if (mesh.isInternalFace(meshFacei))
|
||||||
@ -1949,9 +1943,7 @@ int main(int argc, char *argv[])
|
|||||||
mesh.faceNeighbour()[meshFacei],// owner
|
mesh.faceNeighbour()[meshFacei],// owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
true, // face flip
|
true, // face flip
|
||||||
interMeshTopPatch[zonei], // patch for face
|
interMeshTopPatch[zonei] // patch for face
|
||||||
zoneMeshZoneID[zonei], // zone for face
|
|
||||||
true // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1973,9 +1965,7 @@ int main(int argc, char *argv[])
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
meshFacei, // master face
|
meshFacei, // master face
|
||||||
true, // flip flux
|
true, // flip flux
|
||||||
interMeshTopPatch[zonei], // patch for face
|
interMeshTopPatch[zonei] // patch for face
|
||||||
-1, // zone for face
|
|
||||||
false // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1988,9 +1978,7 @@ int main(int argc, char *argv[])
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
meshFacei, // master face
|
meshFacei, // master face
|
||||||
false, // flip flux
|
false, // flip flux
|
||||||
interMeshTopPatch[zonei], // patch for face
|
interMeshTopPatch[zonei] // patch for face
|
||||||
-1, // zone for face
|
|
||||||
false // zone flip
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -138,8 +138,6 @@ void modifyOrAddFace
|
|||||||
const label own,
|
const label own,
|
||||||
const bool flipFaceFlux,
|
const bool flipFaceFlux,
|
||||||
const label newPatchi,
|
const label newPatchi,
|
||||||
const label zoneID,
|
|
||||||
const bool zoneFlip,
|
|
||||||
PackedBoolList& modifiedFace
|
PackedBoolList& modifiedFace
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -153,9 +151,7 @@ void modifyOrAddFace
|
|||||||
own, // owner
|
own, // owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
flipFaceFlux, // face flip
|
flipFaceFlux, // face flip
|
||||||
newPatchi, // patch for face
|
newPatchi // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
|
|
||||||
modifiedFace[facei] = 1;
|
modifiedFace[facei] = 1;
|
||||||
@ -170,9 +166,7 @@ void modifyOrAddFace
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
facei, // master face
|
facei, // master face
|
||||||
flipFaceFlux, // face flip
|
flipFaceFlux, // face flip
|
||||||
newPatchi, // patch for face
|
newPatchi // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -183,7 +177,6 @@ label createFaces
|
|||||||
const bool internalFacesOnly,
|
const bool internalFacesOnly,
|
||||||
const fvMesh& mesh,
|
const fvMesh& mesh,
|
||||||
const faceZone& fZone,
|
const faceZone& fZone,
|
||||||
const label fZonei,
|
|
||||||
const label newOwnerPatchi,
|
const label newOwnerPatchi,
|
||||||
const label newNeighbourPatchi,
|
const label newNeighbourPatchi,
|
||||||
polyTopoChange& meshMod,
|
polyTopoChange& meshMod,
|
||||||
@ -212,8 +205,6 @@ label createFaces
|
|||||||
mesh.faceOwner()[facei],// owner
|
mesh.faceOwner()[facei],// owner
|
||||||
false, // face flip
|
false, // face flip
|
||||||
newOwnerPatchi, // patch for face
|
newOwnerPatchi, // patch for face
|
||||||
fZonei, // zone for face
|
|
||||||
false, // face flip in zone
|
|
||||||
modifiedFace // modify or add status
|
modifiedFace // modify or add status
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -231,8 +222,6 @@ label createFaces
|
|||||||
mesh.faceNeighbour()[facei],// owner
|
mesh.faceNeighbour()[facei],// owner
|
||||||
true, // face flip
|
true, // face flip
|
||||||
newOwnerPatchi, // patch for face
|
newOwnerPatchi, // patch for face
|
||||||
fZonei, // zone for face
|
|
||||||
false, // face flip in zone
|
|
||||||
modifiedFace // modify or add status
|
modifiedFace // modify or add status
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -259,8 +248,6 @@ label createFaces
|
|||||||
mesh.faceNeighbour()[facei], // owner
|
mesh.faceNeighbour()[facei], // owner
|
||||||
true, // face flip
|
true, // face flip
|
||||||
newNeighbourPatchi, // patch for face
|
newNeighbourPatchi, // patch for face
|
||||||
fZonei, // zone for face
|
|
||||||
true, // face flip in zone
|
|
||||||
modifiedFace // modify or add
|
modifiedFace // modify or add
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -275,8 +262,6 @@ label createFaces
|
|||||||
mesh.faceOwner()[facei],// owner
|
mesh.faceOwner()[facei],// owner
|
||||||
false, // face flip
|
false, // face flip
|
||||||
newNeighbourPatchi, // patch for face
|
newNeighbourPatchi, // patch for face
|
||||||
fZonei, // zone for face
|
|
||||||
true, // face flip in zone
|
|
||||||
modifiedFace // modify or add status
|
modifiedFace // modify or add status
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -323,8 +308,6 @@ label createFaces
|
|||||||
mesh.faceOwner()[facei], // owner
|
mesh.faceOwner()[facei], // owner
|
||||||
false, // face flip
|
false, // face flip
|
||||||
newPp.index(), // patch for face
|
newPp.index(), // patch for face
|
||||||
fZonei, // zone for face
|
|
||||||
fZone.flipMap()[zoneFacei], // face flip in zone
|
|
||||||
modifiedFace // modify or add
|
modifiedFace // modify or add
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -632,7 +615,6 @@ int main(int argc, char *argv[])
|
|||||||
internalFacesOnly,
|
internalFacesOnly,
|
||||||
mesh,
|
mesh,
|
||||||
fZone,
|
fZone,
|
||||||
fZonei,
|
|
||||||
newPatchIDs[0],
|
newPatchIDs[0],
|
||||||
newPatchIDs[1],
|
newPatchIDs[1],
|
||||||
meshMod,
|
meshMod,
|
||||||
|
|||||||
@ -61,17 +61,6 @@ void changePatchID
|
|||||||
polyTopoChange& meshMod
|
polyTopoChange& meshMod
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const label zoneID = mesh.faceZones().whichZone(faceID);
|
|
||||||
|
|
||||||
bool zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = mesh.faceZones()[zoneID];
|
|
||||||
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(faceID)];
|
|
||||||
}
|
|
||||||
|
|
||||||
meshMod.modifyFace
|
meshMod.modifyFace
|
||||||
(
|
(
|
||||||
mesh.faces()[faceID], // face
|
mesh.faces()[faceID], // face
|
||||||
@ -79,9 +68,7 @@ void changePatchID
|
|||||||
mesh.faceOwner()[faceID], // owner
|
mesh.faceOwner()[faceID], // owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // flip flux
|
false, // flip flux
|
||||||
patchID, // patch ID
|
patchID // patch ID
|
||||||
zoneID, // zone ID
|
|
||||||
zoneFlip // zone flip
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -88,7 +88,6 @@ void mergeDuplicateBoundaryFaces
|
|||||||
|
|
||||||
const faceList& faces = mesh.faces();
|
const faceList& faces = mesh.faces();
|
||||||
const labelList& faceOwner = mesh.faceOwner();
|
const labelList& faceOwner = mesh.faceOwner();
|
||||||
const meshFaceZones& faceZones = mesh.faceZones();
|
|
||||||
|
|
||||||
forAll(duplicates, bFacei)
|
forAll(duplicates, bFacei)
|
||||||
{
|
{
|
||||||
@ -107,14 +106,6 @@ void mergeDuplicateBoundaryFaces
|
|||||||
if (own0 < own1)
|
if (own0 < own1)
|
||||||
{
|
{
|
||||||
// Use face0 as the new internal face.
|
// Use face0 as the new internal face.
|
||||||
label zoneID = faceZones.whichZone(face0);
|
|
||||||
bool zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = faceZones[zoneID];
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(face0)];
|
|
||||||
}
|
|
||||||
|
|
||||||
meshMod.removeFace(face1, -1);
|
meshMod.removeFace(face1, -1);
|
||||||
meshMod.modifyFace
|
meshMod.modifyFace
|
||||||
@ -124,22 +115,12 @@ void mergeDuplicateBoundaryFaces
|
|||||||
own0, // owner
|
own0, // owner
|
||||||
own1, // neighbour
|
own1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
-1, // patch for face
|
-1 // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Use face1 as the new internal face.
|
// Use face1 as the new internal face.
|
||||||
label zoneID = faceZones.whichZone(face1);
|
|
||||||
bool zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = faceZones[zoneID];
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(face1)];
|
|
||||||
}
|
|
||||||
|
|
||||||
meshMod.removeFace(face0, -1);
|
meshMod.removeFace(face0, -1);
|
||||||
meshMod.modifyFace
|
meshMod.modifyFace
|
||||||
@ -149,9 +130,7 @@ void mergeDuplicateBoundaryFaces
|
|||||||
own1, // owner
|
own1, // owner
|
||||||
own0, // neighbour
|
own0, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
-1, // patch for face
|
-1 // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -162,11 +162,14 @@ Foam::mergePolyMesh::mergePolyMesh(polyMesh& mesh)
|
|||||||
{
|
{
|
||||||
faceZoneNames_.setCapacity(2*curFaceZoneNames.size());
|
faceZoneNames_.setCapacity(2*curFaceZoneNames.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(curFaceZoneNames, zonei)
|
forAll(curFaceZoneNames, zonei)
|
||||||
{
|
{
|
||||||
faceZoneNames_.append(curFaceZoneNames[zonei]);
|
faceZoneNames_.append(curFaceZoneNames[zonei]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
faceZonesAddedFaces_.setSize(faceZoneNames_.size());
|
||||||
|
|
||||||
// Cell zones
|
// Cell zones
|
||||||
wordList curCellZoneNames = mesh_.cellZones().names();
|
wordList curCellZoneNames = mesh_.cellZones().names();
|
||||||
|
|
||||||
@ -278,8 +281,7 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
|
|||||||
const labelList& own = m.faceOwner();
|
const labelList& own = m.faceOwner();
|
||||||
const labelList& nei = m.faceNeighbour();
|
const labelList& nei = m.faceNeighbour();
|
||||||
|
|
||||||
label newOwn, newNei, newPatch, newZone;
|
label newOwn, newNei, newPatch;
|
||||||
bool newZoneFlip;
|
|
||||||
|
|
||||||
forAll(f, facei)
|
forAll(f, facei)
|
||||||
{
|
{
|
||||||
@ -326,18 +328,6 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
|
|||||||
newNei = renumberCells[newNei];
|
newNei = renumberCells[newNei];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
newZone = fz.whichZone(facei);
|
|
||||||
newZoneFlip = false;
|
|
||||||
|
|
||||||
if (newZone >= 0)
|
|
||||||
{
|
|
||||||
newZoneFlip = fz[newZone].flipMap()[fz[newZone].whichFace(facei)];
|
|
||||||
|
|
||||||
// Grab the new zone
|
|
||||||
newZone = faceZoneIndices[newZone];
|
|
||||||
}
|
|
||||||
|
|
||||||
renumberFaces[facei] = meshMod_.addFace
|
renumberFaces[facei] = meshMod_.addFace
|
||||||
(
|
(
|
||||||
newFace,
|
newFace,
|
||||||
@ -345,10 +335,18 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
|
|||||||
newNei,
|
newNei,
|
||||||
-1,
|
-1,
|
||||||
false,
|
false,
|
||||||
newPatch,
|
newPatch
|
||||||
newZone,
|
|
||||||
newZoneFlip
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const labelList zones(fz.whichZones(facei));
|
||||||
|
forAll(zones, zonei)
|
||||||
|
{
|
||||||
|
const faceZone& fzi = fz[zones[zonei]];
|
||||||
|
const bool flip = fzi.flipMap()[fzi.whichFace(facei)];
|
||||||
|
|
||||||
|
faceZonesAddedFaces_[faceZoneIndices[zonei]]
|
||||||
|
.insert(renumberFaces[facei], flip);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -506,6 +504,12 @@ void Foam::mergePolyMesh::merge()
|
|||||||
mesh_.pointZones()[zonei].insert(pointZonesAddedPoints_[zonei]);
|
mesh_.pointZones()[zonei].insert(pointZonesAddedPoints_[zonei]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add the new faces to the faceZones in the merged mesh
|
||||||
|
forAll(faceZonesAddedFaces_, zonei)
|
||||||
|
{
|
||||||
|
mesh_.faceZones()[zonei].insert(faceZonesAddedFaces_[zonei]);
|
||||||
|
}
|
||||||
|
|
||||||
// Add the new cells to the cellZones in the merged mesh
|
// Add the new cells to the cellZones in the merged mesh
|
||||||
forAll(cellZonesAddedCells_, zonei)
|
forAll(cellZonesAddedCells_, zonei)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -72,6 +72,9 @@ class mergePolyMesh
|
|||||||
//- Face zone names
|
//- Face zone names
|
||||||
DynamicList<word> faceZoneNames_;
|
DynamicList<word> faceZoneNames_;
|
||||||
|
|
||||||
|
//- Zones of the added faces
|
||||||
|
List<Map<bool>> faceZonesAddedFaces_;
|
||||||
|
|
||||||
//- Cell zone names
|
//- Cell zone names
|
||||||
DynamicList<word> cellZoneNames_;
|
DynamicList<word> cellZoneNames_;
|
||||||
|
|
||||||
|
|||||||
@ -187,9 +187,7 @@ Foam::label Foam::meshDualiser::addInternalFace
|
|||||||
dualCell1, // nei
|
dualCell1, // nei
|
||||||
masterFacei, // masterFaceID
|
masterFacei, // masterFaceID
|
||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
-1, // patchID
|
-1 // patchID
|
||||||
-1, // zoneID
|
|
||||||
false // zoneFlip
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// pointField dualPoints(meshMod.points());
|
// pointField dualPoints(meshMod.points());
|
||||||
@ -212,9 +210,7 @@ Foam::label Foam::meshDualiser::addInternalFace
|
|||||||
dualCell0, // nei
|
dualCell0, // nei
|
||||||
masterFacei, // masterFaceID
|
masterFacei, // masterFaceID
|
||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
-1, // patchID
|
-1 // patchID
|
||||||
-1, // zoneID
|
|
||||||
false // zoneFlip
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// pointField dualPoints(meshMod.points());
|
// pointField dualPoints(meshMod.points());
|
||||||
@ -253,9 +249,7 @@ Foam::label Foam::meshDualiser::addBoundaryFace
|
|||||||
-1, // nei
|
-1, // nei
|
||||||
masterFacei, // masterFaceID
|
masterFacei, // masterFaceID
|
||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
patchi, // patchID
|
patchi // patchID
|
||||||
-1, // zoneID
|
|
||||||
false // zoneFlip
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// pointField dualPoints(meshMod.points());
|
// pointField dualPoints(meshMod.points());
|
||||||
|
|||||||
@ -293,6 +293,41 @@ void addToInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
label whichZone
|
||||||
|
(
|
||||||
|
const polyMesh& mesh,
|
||||||
|
const bool useFaceZones,
|
||||||
|
const label facei
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (useFaceZones)
|
||||||
|
{
|
||||||
|
const labelList zones(mesh.faceZones().whichZones(facei));
|
||||||
|
|
||||||
|
if (zones.size() == 0)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
else if (zones.size() == 1)
|
||||||
|
{
|
||||||
|
return zones[0];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "Face " << facei << " is in more than one zone " << zones
|
||||||
|
<< exit(FatalError);
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Get region-region interface name and sizes.
|
// Get region-region interface name and sizes.
|
||||||
// Returns interfaces as straight list for looping in identical order.
|
// Returns interfaces as straight list for looping in identical order.
|
||||||
void getInterfaceSizes
|
void getInterfaceSizes
|
||||||
@ -326,7 +361,7 @@ void getInterfaceSizes
|
|||||||
addToInterface
|
addToInterface
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
(useFaceZones ? mesh.faceZones().whichZone(facei) : -1),
|
whichZone(mesh, useFaceZones, facei),
|
||||||
ownRegion,
|
ownRegion,
|
||||||
neiRegion,
|
neiRegion,
|
||||||
regionsToSize
|
regionsToSize
|
||||||
@ -358,7 +393,7 @@ void getInterfaceSizes
|
|||||||
addToInterface
|
addToInterface
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
(useFaceZones ? mesh.faceZones().whichZone(facei) : -1),
|
whichZone(mesh, useFaceZones, facei),
|
||||||
ownRegion,
|
ownRegion,
|
||||||
neiRegion,
|
neiRegion,
|
||||||
regionsToSize
|
regionsToSize
|
||||||
@ -517,11 +552,7 @@ void getInterfaceSizes
|
|||||||
|
|
||||||
if (ownRegion != neiRegion)
|
if (ownRegion != neiRegion)
|
||||||
{
|
{
|
||||||
label zoneID = -1;
|
const label zoneID = whichZone(mesh, useFaceZones, facei);
|
||||||
if (useFaceZones)
|
|
||||||
{
|
|
||||||
zoneID = mesh.faceZones().whichZone(facei);
|
|
||||||
}
|
|
||||||
|
|
||||||
edge interface
|
edge interface
|
||||||
(
|
(
|
||||||
@ -540,11 +571,7 @@ void getInterfaceSizes
|
|||||||
|
|
||||||
if (ownRegion != neiRegion)
|
if (ownRegion != neiRegion)
|
||||||
{
|
{
|
||||||
label zoneID = -1;
|
const label zoneID = whichZone(mesh, useFaceZones, facei);
|
||||||
if (useFaceZones)
|
|
||||||
{
|
|
||||||
zoneID = mesh.faceZones().whichZone(facei);
|
|
||||||
}
|
|
||||||
|
|
||||||
edge interface
|
edge interface
|
||||||
(
|
(
|
||||||
|
|||||||
@ -116,24 +116,13 @@ bool repatchFace
|
|||||||
if (nearest[bFacei] != -1)
|
if (nearest[bFacei] != -1)
|
||||||
{
|
{
|
||||||
// Use boundary mesh one.
|
// Use boundary mesh one.
|
||||||
label rMeshPatchID = rMesh.whichPatch(nearest[bFacei]);
|
const label rMeshPatchID = rMesh.whichPatch(nearest[bFacei]);
|
||||||
|
|
||||||
label patchID = surfToMeshPatch[rMeshPatchID];
|
const label patchID = surfToMeshPatch[rMeshPatchID];
|
||||||
|
|
||||||
if (patchID != mesh.boundaryMesh().whichPatch(facei))
|
if (patchID != mesh.boundaryMesh().whichPatch(facei))
|
||||||
{
|
{
|
||||||
label own = mesh.faceOwner()[facei];
|
const label own = mesh.faceOwner()[facei];
|
||||||
|
|
||||||
label zoneID = mesh.faceZones().whichZone(facei);
|
|
||||||
|
|
||||||
bool zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = mesh.faceZones()[zoneID];
|
|
||||||
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
|
||||||
}
|
|
||||||
|
|
||||||
meshMod.modifyFace
|
meshMod.modifyFace
|
||||||
(
|
(
|
||||||
@ -142,9 +131,7 @@ bool repatchFace
|
|||||||
own, // owner
|
own, // owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchID, // patch for face
|
patchID // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
|
|
||||||
changed = true;
|
changed = true;
|
||||||
@ -154,6 +141,7 @@ bool repatchFace
|
|||||||
{
|
{
|
||||||
changed = false;
|
changed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -158,6 +158,21 @@ Foam::MeshZones<ZoneType, MeshType>::~MeshZones()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class ZoneType, class MeshType>
|
||||||
|
bool Foam::MeshZones<ZoneType, MeshType>::found(const label objectIndex) const
|
||||||
|
{
|
||||||
|
forAll(*this, zi)
|
||||||
|
{
|
||||||
|
if (this->operator[](zi).localIndex(objectIndex) != -1)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class ZoneType, class MeshType>
|
template<class ZoneType, class MeshType>
|
||||||
Foam::labelList Foam::MeshZones<ZoneType, MeshType>::whichZones
|
Foam::labelList Foam::MeshZones<ZoneType, MeshType>::whichZones
|
||||||
(
|
(
|
||||||
@ -178,26 +193,6 @@ Foam::labelList Foam::MeshZones<ZoneType, MeshType>::whichZones
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class ZoneType, class MeshType>
|
|
||||||
Foam::label Foam::MeshZones<ZoneType, MeshType>::whichZone
|
|
||||||
(
|
|
||||||
const label objectIndex
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
label zoneIndex = -1;
|
|
||||||
|
|
||||||
forAll(*this, zi)
|
|
||||||
{
|
|
||||||
if (this->operator[](zi).localIndex(objectIndex) != -1)
|
|
||||||
{
|
|
||||||
zoneIndex = zi;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return zoneIndex;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class ZoneType, class MeshType>
|
template<class ZoneType, class MeshType>
|
||||||
Foam::boolList Foam::MeshZones<ZoneType, MeshType>::zonesFlipFace
|
Foam::boolList Foam::MeshZones<ZoneType, MeshType>::zonesFlipFace
|
||||||
(
|
(
|
||||||
|
|||||||
@ -127,14 +127,12 @@ public:
|
|||||||
return mesh_;
|
return mesh_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Return true if objectIndex is in any zone
|
||||||
|
bool found(const label objectIndex) const;
|
||||||
|
|
||||||
//- Given a global object index, return the list of zones it is in
|
//- Given a global object index, return the list of zones it is in
|
||||||
labelList whichZones(const label objectIndex) const;
|
labelList whichZones(const label objectIndex) const;
|
||||||
|
|
||||||
//- Given a global object index, return the zone it is in.
|
|
||||||
// If object does not belong to any zones, return -1
|
|
||||||
// *** This will be replaced by whichZones
|
|
||||||
label whichZone(const label objectIndex) const;
|
|
||||||
|
|
||||||
//- Return the list of flips for the facei
|
//- Return the list of flips for the facei
|
||||||
// for each of the face zones in faceiZones
|
// for each of the face zones in faceiZones
|
||||||
boolList zonesFlipFace
|
boolList zonesFlipFace
|
||||||
|
|||||||
@ -179,19 +179,18 @@ void Foam::faceZone::checkAddressing() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::faceZone::reset(const Map<bool>& indices)
|
void Foam::faceZone::reset(const Map<bool>& newIndices)
|
||||||
{
|
{
|
||||||
clearAddressing();
|
clearAddressing();
|
||||||
|
|
||||||
labelList::setSize(indices.size());
|
labelList& indices = *this;
|
||||||
|
indices = newIndices.sortedToc();
|
||||||
|
|
||||||
flipMap_.setSize(indices.size());
|
flipMap_.setSize(indices.size());
|
||||||
|
|
||||||
label i = 0;
|
forAll(flipMap_, i)
|
||||||
forAllConstIter(Map<bool>, indices, iter)
|
|
||||||
{
|
{
|
||||||
operator[](i) = iter.key();
|
flipMap_[i] = newIndices[indices[i]];
|
||||||
flipMap_[i] = *iter;
|
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -506,17 +505,23 @@ void Foam::faceZone::swap(faceZone& fz)
|
|||||||
|
|
||||||
void Foam::faceZone::topoChange(const polyTopoChangeMap& map)
|
void Foam::faceZone::topoChange(const polyTopoChangeMap& map)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
Map<bool> indices;
|
Map<bool> indices;
|
||||||
const labelList& faceMap = map.faceMap();
|
const labelList& faceMap = map.faceMap();
|
||||||
const labelList& reverseFaceMap = map.reverseFaceMap();
|
const labelList& reverseFaceMap = map.reverseFaceMap();
|
||||||
|
const labelHashSet& flipFaceFlux = map.flipFaceFlux();
|
||||||
|
|
||||||
forAll(faceMap, facei)
|
forAll(faceMap, facei)
|
||||||
{
|
{
|
||||||
const label i = localIndex(faceMap[facei]);
|
const label i = localIndex(faceMap[facei]);
|
||||||
if (faceMap[facei] >= 0 && i != -1)
|
if (faceMap[facei] >= 0 && i != -1)
|
||||||
{
|
{
|
||||||
indices.insert(facei, flipMap_[i]);
|
indices.insert
|
||||||
|
(
|
||||||
|
facei,
|
||||||
|
flipFaceFlux.found(facei)
|
||||||
|
? !flipMap_[i]
|
||||||
|
: flipMap_[i]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -525,12 +530,17 @@ void Foam::faceZone::topoChange(const polyTopoChangeMap& map)
|
|||||||
const label i = localIndex(facei);
|
const label i = localIndex(facei);
|
||||||
if (reverseFaceMap[facei] >= 0 && i != -1)
|
if (reverseFaceMap[facei] >= 0 && i != -1)
|
||||||
{
|
{
|
||||||
indices.insert(reverseFaceMap[facei], flipMap_[i]);
|
indices.insert
|
||||||
|
(
|
||||||
|
reverseFaceMap[facei],
|
||||||
|
flipFaceFlux.found(reverseFaceMap[facei])
|
||||||
|
? !flipMap_[i]
|
||||||
|
: flipMap_[i]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
reset(indices);
|
reset(indices);
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -272,9 +272,7 @@ void Foam::polyMeshUnMergeCyclics(polyMesh& mesh, const scalar includedAngle)
|
|||||||
false,
|
false,
|
||||||
patchFaceHalves[patchFacei]
|
patchFaceHalves[patchFacei]
|
||||||
? patchHalf0[patchi]
|
? patchHalf0[patchi]
|
||||||
: patchHalf1[patchi],
|
: patchHalf1[patchi]
|
||||||
-1,
|
|
||||||
false
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -710,15 +710,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::splitFaces
|
|||||||
nei = mesh_.faceNeighbour()[facei];
|
nei = mesh_.faceNeighbour()[facei];
|
||||||
}
|
}
|
||||||
|
|
||||||
const label zonei = mesh_.faceZones().whichZone(facei);
|
|
||||||
bool zoneFlip = false;
|
|
||||||
if (zonei != -1)
|
|
||||||
{
|
|
||||||
const faceZone& fz = mesh_.faceZones()[zonei];
|
|
||||||
zoneFlip = fz.flipMap()[fz.whichFace(facei)];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Pout<< "face:" << facei << " verts:" << f
|
Pout<< "face:" << facei << " verts:" << f
|
||||||
@ -734,9 +725,7 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::splitFaces
|
|||||||
own, // owner
|
own, // owner
|
||||||
nei, // neighbour
|
nei, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchi, // patch for face
|
patchi // patch for face
|
||||||
zonei, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
|
|
||||||
meshMod.addFace
|
meshMod.addFace
|
||||||
@ -746,9 +735,7 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::splitFaces
|
|||||||
nei, // neighbour
|
nei, // neighbour
|
||||||
facei, // master face
|
facei, // master face
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchi, // patch for face
|
patchi // patch for face
|
||||||
zonei, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,6 @@ License
|
|||||||
#include "refinementSurfaces.H"
|
#include "refinementSurfaces.H"
|
||||||
#include "faceSet.H"
|
#include "faceSet.H"
|
||||||
#include "polyTopoChange.H"
|
#include "polyTopoChange.H"
|
||||||
#include "meshTools.H"
|
|
||||||
#include "localPointRegion.H"
|
#include "localPointRegion.H"
|
||||||
#include "duplicatePoints.H"
|
#include "duplicatePoints.H"
|
||||||
#include "regionSplit.H"
|
#include "regionSplit.H"
|
||||||
@ -37,7 +36,6 @@ License
|
|||||||
#include "patchFaceOrientation.H"
|
#include "patchFaceOrientation.H"
|
||||||
#include "PatchEdgeFaceWave.H"
|
#include "PatchEdgeFaceWave.H"
|
||||||
#include "patchEdgeFaceRegion.H"
|
#include "patchEdgeFaceRegion.H"
|
||||||
#include "OSspecific.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -50,14 +48,6 @@ Foam::label Foam::meshRefinement::createBaffle
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const face& f = mesh_.faces()[facei];
|
const face& f = mesh_.faces()[facei];
|
||||||
const label zoneID = mesh_.faceZones().whichZone(facei);
|
|
||||||
bool zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = mesh_.faceZones()[zoneID];
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
|
||||||
}
|
|
||||||
|
|
||||||
meshMod.modifyFace
|
meshMod.modifyFace
|
||||||
(
|
(
|
||||||
@ -66,12 +56,9 @@ Foam::label Foam::meshRefinement::createBaffle
|
|||||||
mesh_.faceOwner()[facei], // owner
|
mesh_.faceOwner()[facei], // owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
ownPatch, // patch for face
|
ownPatch // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
label dupFacei = -1;
|
label dupFacei = -1;
|
||||||
|
|
||||||
if (mesh_.isInternalFace(facei))
|
if (mesh_.isInternalFace(facei))
|
||||||
@ -84,12 +71,6 @@ Foam::label Foam::meshRefinement::createBaffle
|
|||||||
<< " ownPatch:" << ownPatch << abort(FatalError);
|
<< " ownPatch:" << ownPatch << abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool reverseFlip = false;
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
reverseFlip = !zoneFlip;
|
|
||||||
}
|
|
||||||
|
|
||||||
dupFacei = meshMod.addFace
|
dupFacei = meshMod.addFace
|
||||||
(
|
(
|
||||||
f.reverseFace(), // modified face
|
f.reverseFace(), // modified face
|
||||||
@ -97,9 +78,7 @@ Foam::label Foam::meshRefinement::createBaffle
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
facei, // masterFaceID,
|
facei, // masterFaceID,
|
||||||
true, // face flip
|
true, // face flip
|
||||||
nbrPatch, // patch for face
|
nbrPatch // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
reverseFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return dupFacei;
|
return dupFacei;
|
||||||
@ -431,14 +410,17 @@ void Foam::meshRefinement::checkZoneFaces() const
|
|||||||
forAll(pp, i)
|
forAll(pp, i)
|
||||||
{
|
{
|
||||||
const label facei = pp.start() + i;
|
const label facei = pp.start() + i;
|
||||||
const label zonei = fZones.whichZone(facei);
|
const labelList zones = fZones.whichZones(facei);
|
||||||
|
|
||||||
if (zonei != -1)
|
forAll(zones, zonei)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
if (zones[zonei] != -1)
|
||||||
<< "face:" << facei << " on patch " << pp.name()
|
{
|
||||||
<< " is in zone " << fZones[zonei].name()
|
FatalErrorInFunction
|
||||||
<< exit(FatalError);
|
<< "face:" << facei << " on patch " << pp.name()
|
||||||
|
<< " is in zone " << fZones[zones[zonei]].name()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -809,7 +791,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::mergeBaffles
|
|||||||
|
|
||||||
const faceList& faces = mesh_.faces();
|
const faceList& faces = mesh_.faces();
|
||||||
const labelList& faceOwner = mesh_.faceOwner();
|
const labelList& faceOwner = mesh_.faceOwner();
|
||||||
const meshFaceZones& faceZones = mesh_.faceZones();
|
|
||||||
|
|
||||||
forAll(couples, i)
|
forAll(couples, i)
|
||||||
{
|
{
|
||||||
@ -824,15 +805,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::mergeBaffles
|
|||||||
if (face1 < 0 || own0 < own1)
|
if (face1 < 0 || own0 < own1)
|
||||||
{
|
{
|
||||||
// Use face0 as the new internal face.
|
// Use face0 as the new internal face.
|
||||||
const label zoneID = faceZones.whichZone(face0);
|
|
||||||
bool zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = faceZones[zoneID];
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(face0)];
|
|
||||||
}
|
|
||||||
|
|
||||||
const label nei = (face1 < 0 ? -1 : own1);
|
const label nei = (face1 < 0 ? -1 : own1);
|
||||||
|
|
||||||
meshMod.removeFace(face1, -1);
|
meshMod.removeFace(face1, -1);
|
||||||
@ -843,22 +815,12 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::mergeBaffles
|
|||||||
own0, // owner
|
own0, // owner
|
||||||
nei, // neighbour
|
nei, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
-1, // patch for face
|
-1 // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Use face1 as the new internal face.
|
// Use face1 as the new internal face.
|
||||||
const label zoneID = faceZones.whichZone(face1);
|
|
||||||
bool zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = faceZones[zoneID];
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(face1)];
|
|
||||||
}
|
|
||||||
|
|
||||||
meshMod.removeFace(face0, -1);
|
meshMod.removeFace(face0, -1);
|
||||||
meshMod.modifyFace
|
meshMod.modifyFace
|
||||||
@ -868,9 +830,7 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::mergeBaffles
|
|||||||
own1, // owner
|
own1, // owner
|
||||||
own0, // neighbour
|
own0, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
-1, // patch for face
|
-1 // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3170,6 +3130,7 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::zonify
|
|||||||
|
|
||||||
// Put the faces into the correct zone
|
// Put the faces into the correct zone
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
List<Map<bool>> faceZonesAddedFaces(mesh_.faceZones().size());
|
||||||
|
|
||||||
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
|
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
|
||||||
{
|
{
|
||||||
@ -3200,17 +3161,7 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::zonify
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
meshMod.modifyFace
|
faceZonesAddedFaces[faceZoneI].insert(facei, flip);
|
||||||
(
|
|
||||||
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
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3247,17 +3198,7 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::zonify
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
meshMod.modifyFace
|
faceZonesAddedFaces[faceZoneI].insert(facei, flip);
|
||||||
(
|
|
||||||
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++;
|
facei++;
|
||||||
}
|
}
|
||||||
@ -3268,6 +3209,12 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::meshRefinement::zonify
|
|||||||
// Change the mesh without keeping old points, parallel sync
|
// Change the mesh without keeping old points, parallel sync
|
||||||
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, true);
|
autoPtr<polyTopoChangeMap> map = meshMod.changeMesh(mesh_, true);
|
||||||
|
|
||||||
|
// Add the new faces to the faceZones in the merged mesh
|
||||||
|
forAll(faceZonesAddedFaces, zonei)
|
||||||
|
{
|
||||||
|
mesh_.faceZones()[zonei].insert(faceZonesAddedFaces[zonei]);
|
||||||
|
}
|
||||||
|
|
||||||
// Update fields
|
// Update fields
|
||||||
mesh_.topoChange(map);
|
mesh_.topoChange(map);
|
||||||
|
|
||||||
|
|||||||
@ -569,21 +569,11 @@ void Foam::createShellMesh::setRefinement
|
|||||||
-1, // nei
|
-1, // nei
|
||||||
faceToFaceMap.size(), // masterFaceID : current facei
|
faceToFaceMap.size(), // masterFaceID : current facei
|
||||||
true, // flipFaceFlux
|
true, // flipFaceFlux
|
||||||
bottomPatchID[facei], // patchID
|
bottomPatchID[facei] // patchID
|
||||||
-1, // zoneID
|
|
||||||
false // zoneFlip
|
|
||||||
);
|
);
|
||||||
|
|
||||||
faceToFaceMap.append(-facei-1); // points to flipped original face
|
faceToFaceMap.append(-facei-1); // points to flipped original face
|
||||||
faceToEdgeMap.append(-1);
|
faceToEdgeMap.append(-1);
|
||||||
|
|
||||||
// const face newF(patch_.localFaces()[facei].reverseFace());
|
|
||||||
// Pout<< "Added bottom face "
|
|
||||||
// << newF
|
|
||||||
// << " coords:" << UIndirectList<point>(meshMod.points(), newF)
|
|
||||||
// << " own " << addedCells[facei]
|
|
||||||
// << " patch:" << bottomPatchID[facei]
|
|
||||||
// << " at " << patch_.faceCentres()[facei]
|
|
||||||
// << endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add in between faces and face on top
|
// Add in between faces and face on top
|
||||||
@ -624,20 +614,11 @@ void Foam::createShellMesh::setRefinement
|
|||||||
nei, // nei
|
nei, // nei
|
||||||
faceToFaceMap.size(), // masterFaceID : current facei
|
faceToFaceMap.size(), // masterFaceID : current facei
|
||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
patchi, // patchID
|
patchi // patchID
|
||||||
-1, // zoneID
|
|
||||||
false // zoneFlip
|
|
||||||
);
|
);
|
||||||
|
|
||||||
faceToFaceMap.append(facei+1); // unflipped
|
faceToFaceMap.append(facei+1); // unflipped
|
||||||
faceToEdgeMap.append(-1);
|
faceToEdgeMap.append(-1);
|
||||||
|
|
||||||
// Pout<< "Added in between face " << newF
|
|
||||||
// << " coords:" << UIndirectList<point>(meshMod.points(), newF)
|
|
||||||
// << " at layer " << layerI
|
|
||||||
// << " own " << own
|
|
||||||
// << " nei " << nei
|
|
||||||
// << " at " << patch_.faceCentres()[facei]
|
|
||||||
// << endl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -750,21 +731,6 @@ void Foam::createShellMesh::setRefinement
|
|||||||
patchi = ePatches[0];
|
patchi = ePatches[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
//{
|
|
||||||
// Pout<< "Adding from face:" << patch_.faceCentres()[eFaces[0]]
|
|
||||||
// << " from edge:"
|
|
||||||
// << patch_.localPoints()[f[fp0]]
|
|
||||||
// << patch_.localPoints()[f[fp1]]
|
|
||||||
// << " at layer:" << layerI
|
|
||||||
// << " with new points:" << newF
|
|
||||||
// << " locations:"
|
|
||||||
// << UIndirectList<point>(meshMod.points(), newF)
|
|
||||||
// << " own:" << minCelli
|
|
||||||
// << " nei:" << maxCelli
|
|
||||||
// << endl;
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
// newF already outwards pointing.
|
// newF already outwards pointing.
|
||||||
meshMod.addFace
|
meshMod.addFace
|
||||||
(
|
(
|
||||||
@ -773,10 +739,9 @@ void Foam::createShellMesh::setRefinement
|
|||||||
maxCelli, // nei
|
maxCelli, // nei
|
||||||
faceToFaceMap.size(), // masterFaceID
|
faceToFaceMap.size(), // masterFaceID
|
||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
patchi, // patchID
|
patchi // patchID
|
||||||
-1, // zoneID
|
|
||||||
false // zoneFlip
|
|
||||||
);
|
);
|
||||||
|
|
||||||
faceToFaceMap.append(0);
|
faceToFaceMap.append(0);
|
||||||
faceToEdgeMap.append(edgeI);
|
faceToEdgeMap.append(edgeI);
|
||||||
}
|
}
|
||||||
@ -844,19 +809,6 @@ void Foam::createShellMesh::setRefinement
|
|||||||
}
|
}
|
||||||
newF.last() = v0;
|
newF.last() = v0;
|
||||||
}
|
}
|
||||||
////if (ePatches.size() == 0)
|
|
||||||
//{
|
|
||||||
// Pout<< "Adding from MULTI face:"
|
|
||||||
// << patch_.faceCentres()[minFacei]
|
|
||||||
// << " from edge:"
|
|
||||||
// << patch_.localPoints()[f[fp0]]
|
|
||||||
// << patch_.localPoints()[f[fp1]]
|
|
||||||
// << " at layer:" << layerI
|
|
||||||
// << " with new points:" << newF
|
|
||||||
// << " locations:"
|
|
||||||
// << UIndirectList<point>(meshMod.points(), newF)
|
|
||||||
// << endl;
|
|
||||||
//}
|
|
||||||
|
|
||||||
// newF already outwards pointing.
|
// newF already outwards pointing.
|
||||||
meshMod.addFace
|
meshMod.addFace
|
||||||
@ -866,9 +818,7 @@ void Foam::createShellMesh::setRefinement
|
|||||||
-1, // nei
|
-1, // nei
|
||||||
faceToFaceMap.size(), // masterFaceID
|
faceToFaceMap.size(), // masterFaceID
|
||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
ePatches[i], // patchID
|
ePatches[i] // patchID
|
||||||
-1, // zoneID
|
|
||||||
false // zoneFlip
|
|
||||||
);
|
);
|
||||||
faceToFaceMap.append(0);
|
faceToFaceMap.append(0);
|
||||||
faceToEdgeMap.append(edgeI);
|
faceToEdgeMap.append(edgeI);
|
||||||
|
|||||||
@ -539,16 +539,7 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::fvMeshDistribute::repatch
|
|||||||
{
|
{
|
||||||
if (newPatchID[bFacei] != -1)
|
if (newPatchID[bFacei] != -1)
|
||||||
{
|
{
|
||||||
label facei = mesh_.nInternalFaces() + bFacei;
|
const label facei = mesh_.nInternalFaces() + bFacei;
|
||||||
|
|
||||||
label zoneID = mesh_.faceZones().whichZone(facei);
|
|
||||||
bool zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = mesh_.faceZones()[zoneID];
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
|
||||||
}
|
|
||||||
|
|
||||||
meshMod.modifyFace
|
meshMod.modifyFace
|
||||||
(
|
(
|
||||||
@ -557,9 +548,7 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::fvMeshDistribute::repatch
|
|||||||
mesh_.faceOwner()[facei], // owner
|
mesh_.faceOwner()[facei], // owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
newPatchID[bFacei], // patch for face
|
newPatchID[bFacei] // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -747,14 +736,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::fvMeshDistribute::mergeSharedPoints
|
|||||||
|
|
||||||
label patchID = mesh_.boundaryMesh().whichPatch(facei);
|
label patchID = mesh_.boundaryMesh().whichPatch(facei);
|
||||||
label nei = (patchID == -1 ? mesh_.faceNeighbour()[facei] : -1);
|
label nei = (patchID == -1 ? mesh_.faceNeighbour()[facei] : -1);
|
||||||
label zoneID = mesh_.faceZones().whichZone(facei);
|
|
||||||
bool zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = mesh_.faceZones()[zoneID];
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
|
||||||
}
|
|
||||||
|
|
||||||
meshMod.modifyFace
|
meshMod.modifyFace
|
||||||
(
|
(
|
||||||
@ -763,9 +744,7 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::fvMeshDistribute::mergeSharedPoints
|
|||||||
mesh_.faceOwner()[facei], // owner
|
mesh_.faceOwner()[facei], // owner
|
||||||
nei, // neighbour
|
nei, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchID, // patch for face
|
patchID // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -218,9 +218,7 @@ void Foam::mergePatchPairs::addFaces
|
|||||||
tgtOwn, // Neighbour cell
|
tgtOwn, // Neighbour cell
|
||||||
srcFacei, // Master face index
|
srcFacei, // Master face index
|
||||||
false, // Flip
|
false, // Flip
|
||||||
-1, // Patch index
|
-1 // Patch index
|
||||||
-1, // Zone index
|
|
||||||
false // Zone sign
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -239,9 +237,7 @@ void Foam::mergePatchPairs::addFaces
|
|||||||
srcOwn, // Neighbour cell
|
srcOwn, // Neighbour cell
|
||||||
tgtFacei, // Master face index
|
tgtFacei, // Master face index
|
||||||
false, // Flip
|
false, // Flip
|
||||||
-1, // Patch index
|
-1 // Patch index
|
||||||
-1, // Zone index
|
|
||||||
false // Zone sign
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -257,15 +253,6 @@ void Foam::mergePatchPairs::addFaces
|
|||||||
const label srcFacei = srcPatchStart + faceSrcFaces[fi];
|
const label srcFacei = srcPatchStart + faceSrcFaces[fi];
|
||||||
const label srcOwn = mesh_.faceOwner()[srcFacei];
|
const label srcOwn = mesh_.faceOwner()[srcFacei];
|
||||||
|
|
||||||
// Get source face zone info
|
|
||||||
const label zoneIndex = mesh_.faceZones().whichZone(srcFacei);
|
|
||||||
bool zoneFlip = false;
|
|
||||||
if (zoneIndex >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = mesh_.faceZones()[zoneIndex];
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(srcFacei)];
|
|
||||||
}
|
|
||||||
|
|
||||||
meshMod.addFace
|
meshMod.addFace
|
||||||
(
|
(
|
||||||
f, // Face to add
|
f, // Face to add
|
||||||
@ -273,9 +260,7 @@ void Foam::mergePatchPairs::addFaces
|
|||||||
-1, // Neighbour cell
|
-1, // Neighbour cell
|
||||||
srcFacei, // Master face index
|
srcFacei, // Master face index
|
||||||
false, // Flip
|
false, // Flip
|
||||||
srcPatchi, // Patch index
|
srcPatchi // Patch index
|
||||||
zoneIndex, // Zone index
|
|
||||||
zoneFlip // Zone sign
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -290,15 +275,6 @@ void Foam::mergePatchPairs::addFaces
|
|||||||
const label tgtFacei = tgtPatchStart + faceTgtFaces[fi];
|
const label tgtFacei = tgtPatchStart + faceTgtFaces[fi];
|
||||||
const label tgtOwn = mesh_.faceOwner()[tgtFacei];
|
const label tgtOwn = mesh_.faceOwner()[tgtFacei];
|
||||||
|
|
||||||
// Get target face zone info
|
|
||||||
const label zoneIndex = mesh_.faceZones().whichZone(tgtFacei);
|
|
||||||
bool zoneFlip = false;
|
|
||||||
if (zoneIndex >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = mesh_.faceZones()[zoneIndex];
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(tgtFacei)];
|
|
||||||
}
|
|
||||||
|
|
||||||
meshMod.addFace
|
meshMod.addFace
|
||||||
(
|
(
|
||||||
f.reverseFace(), // Face to add
|
f.reverseFace(), // Face to add
|
||||||
@ -306,9 +282,7 @@ void Foam::mergePatchPairs::addFaces
|
|||||||
-1, // Neighbour cell
|
-1, // Neighbour cell
|
||||||
tgtFacei, // Master face index
|
tgtFacei, // Master face index
|
||||||
false, // Flip
|
false, // Flip
|
||||||
tgtPatchi, // Patch index
|
tgtPatchi // Patch index
|
||||||
zoneIndex, // Zone index
|
|
||||||
zoneFlip // Zone sign
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -510,15 +484,6 @@ void Foam::mergePatchPairs::modifyFaces
|
|||||||
|
|
||||||
if (modified)
|
if (modified)
|
||||||
{
|
{
|
||||||
// Get current zone info
|
|
||||||
const label zoneIndex = mesh_.faceZones().whichZone(fi);
|
|
||||||
bool zoneFlip = false;
|
|
||||||
if (zoneIndex >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = mesh_.faceZones()[zoneIndex];
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(fi)];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mesh_.isInternalFace(fi))
|
if (mesh_.isInternalFace(fi))
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -539,9 +504,7 @@ void Foam::mergePatchPairs::modifyFaces
|
|||||||
mesh_.faceOwner()[fi], // Owner cell
|
mesh_.faceOwner()[fi], // Owner cell
|
||||||
mesh_.faceNeighbour()[fi], // Neighbour cell
|
mesh_.faceNeighbour()[fi], // Neighbour cell
|
||||||
false, // Face flip
|
false, // Face flip
|
||||||
-1, // Patch index
|
-1 // Patch index
|
||||||
zoneIndex, // Zone index
|
|
||||||
zoneFlip // Zone flip
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -564,9 +527,7 @@ void Foam::mergePatchPairs::modifyFaces
|
|||||||
mesh_.faceOwner()[fi], // Owner cell
|
mesh_.faceOwner()[fi], // Owner cell
|
||||||
-1, // Neighbour cell
|
-1, // Neighbour cell
|
||||||
false, // Face flip
|
false, // Face flip
|
||||||
mesh_.boundaryMesh().whichPatch(fi), // Patch index
|
mesh_.boundaryMesh().whichPatch(fi) // Patch index
|
||||||
zoneIndex, // Zone index
|
|
||||||
zoneFlip // Zone flip
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -162,31 +162,16 @@ void Foam::meshCutter::faceCells
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::meshCutter::getFaceInfo
|
Foam::label Foam::meshCutter::getPatchIndex(const label facei) const
|
||||||
(
|
|
||||||
const label facei,
|
|
||||||
label& patchID,
|
|
||||||
label& zoneID,
|
|
||||||
label& zoneFlip
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
patchID = -1;
|
label patchID = -1;
|
||||||
|
|
||||||
if (!mesh().isInternalFace(facei))
|
if (!mesh().isInternalFace(facei))
|
||||||
{
|
{
|
||||||
patchID = mesh().boundaryMesh().whichPatch(facei);
|
patchID = mesh().boundaryMesh().whichPatch(facei);
|
||||||
}
|
}
|
||||||
|
|
||||||
zoneID = mesh().faceZones().whichZone(facei);
|
return patchID;
|
||||||
|
|
||||||
zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = mesh().faceZones()[zoneID];
|
|
||||||
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -199,9 +184,7 @@ void Foam::meshCutter::addFace
|
|||||||
const label nei
|
const label nei
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
label patchID, zoneID, zoneFlip;
|
const label patchID = getPatchIndex(facei);
|
||||||
|
|
||||||
getFaceInfo(facei, patchID, zoneID, zoneFlip);
|
|
||||||
|
|
||||||
if ((nei == -1) || (own < nei))
|
if ((nei == -1) || (own < nei))
|
||||||
{
|
{
|
||||||
@ -212,8 +195,6 @@ void Foam::meshCutter::addFace
|
|||||||
<< " with new owner:" << own
|
<< " with new owner:" << own
|
||||||
<< " with new neighbour:" << nei
|
<< " with new neighbour:" << nei
|
||||||
<< " patchID:" << patchID
|
<< " patchID:" << patchID
|
||||||
<< " zoneID:" << zoneID
|
|
||||||
<< " zoneFlip:" << zoneFlip
|
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -224,9 +205,7 @@ void Foam::meshCutter::addFace
|
|||||||
nei, // neighbour
|
nei, // neighbour
|
||||||
facei, // master face for addition
|
facei, // master face for addition
|
||||||
false, // flux flip
|
false, // flux flip
|
||||||
patchID, // patch for face
|
patchID // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face zone flip
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -238,8 +217,6 @@ void Foam::meshCutter::addFace
|
|||||||
<< " with new owner:" << nei
|
<< " with new owner:" << nei
|
||||||
<< " with new neighbour:" << own
|
<< " with new neighbour:" << own
|
||||||
<< " patchID:" << patchID
|
<< " patchID:" << patchID
|
||||||
<< " zoneID:" << zoneID
|
|
||||||
<< " zoneFlip:" << zoneFlip
|
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -250,9 +227,7 @@ void Foam::meshCutter::addFace
|
|||||||
own, // neighbour
|
own, // neighbour
|
||||||
facei, // master face for addition
|
facei, // master face for addition
|
||||||
false, // flux flip
|
false, // flux flip
|
||||||
patchID, // patch for face
|
patchID // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face zone flip
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -267,9 +242,7 @@ void Foam::meshCutter::modifyFace
|
|||||||
const label nei
|
const label nei
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
label patchID, zoneID, zoneFlip;
|
const label patchID = getPatchIndex(facei);
|
||||||
|
|
||||||
getFaceInfo(facei, patchID, zoneID, zoneFlip);
|
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
@ -288,8 +261,6 @@ void Foam::meshCutter::modifyFace
|
|||||||
<< " new vertices:" << newFace
|
<< " new vertices:" << newFace
|
||||||
<< " new owner:" << own
|
<< " new owner:" << own
|
||||||
<< " new neighbour:" << nei
|
<< " new neighbour:" << nei
|
||||||
<< " new zoneID:" << zoneID
|
|
||||||
<< " new zoneFlip:" << zoneFlip
|
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -302,9 +273,7 @@ void Foam::meshCutter::modifyFace
|
|||||||
own, // owner
|
own, // owner
|
||||||
nei, // neighbour
|
nei, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchID, // patch for face
|
patchID // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -316,9 +285,7 @@ void Foam::meshCutter::modifyFace
|
|||||||
nei, // owner
|
nei, // owner
|
||||||
own, // neighbour
|
own, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchID, // patch for face
|
patchID // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -632,19 +599,16 @@ void Foam::meshCutter::setRefinement
|
|||||||
// Convert loop (=list of cuts) into proper face.
|
// Convert loop (=list of cuts) into proper face.
|
||||||
// Orientation should already be ok. (done by cellCuts)
|
// Orientation should already be ok. (done by cellCuts)
|
||||||
//
|
//
|
||||||
face newFace(loopToFace(celli, loop));
|
const face newFace(loopToFace(celli, loop));
|
||||||
|
|
||||||
label addedFacei =
|
const label addedFacei = meshMod.addFace
|
||||||
meshMod.addFace
|
|
||||||
(
|
(
|
||||||
newFace, // face
|
newFace, // face
|
||||||
celli, // owner
|
celli, // owner
|
||||||
addedCells_[celli], // neighbour
|
addedCells_[celli], // neighbour
|
||||||
-1, // master face for addition
|
-1, // master face for addition
|
||||||
false, // flux flip
|
false, // flux flip
|
||||||
-1, // patch for face
|
-1 // patch for face
|
||||||
-1, // zone for face
|
|
||||||
false // face zone flip
|
|
||||||
);
|
);
|
||||||
|
|
||||||
addedFaces_.insert(celli, addedFacei);
|
addedFaces_.insert(celli, addedFacei);
|
||||||
|
|||||||
@ -172,14 +172,8 @@ class meshCutter
|
|||||||
label& nei
|
label& nei
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Get patch information for face.
|
//- Get patch index face
|
||||||
void getFaceInfo
|
label getPatchIndex(const label facei) const;
|
||||||
(
|
|
||||||
const label facei,
|
|
||||||
label& patchID,
|
|
||||||
label& zoneID,
|
|
||||||
label& zoneFlip
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Adds a face on top of existing facei. Flips face
|
//- Adds a face on top of existing facei. Flips face
|
||||||
// if owner>neighbour
|
// if owner>neighbour
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -69,13 +69,11 @@ Foam::perfectInterface::perfectInterface
|
|||||||
(
|
(
|
||||||
const word& name,
|
const word& name,
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
const word& faceZoneName,
|
|
||||||
const word& masterPatchName,
|
const word& masterPatchName,
|
||||||
const word& slavePatchName
|
const word& slavePatchName
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mesh_(mesh),
|
mesh_(mesh),
|
||||||
faceZoneIndex_(mesh_.faceZones().findIndex(faceZoneName)),
|
|
||||||
masterPatchIndex_(mesh_.boundaryMesh().findIndex(masterPatchName)),
|
masterPatchIndex_(mesh_.boundaryMesh().findIndex(masterPatchName)),
|
||||||
slavePatchIndex_(mesh_.boundaryMesh().findIndex(slavePatchName))
|
slavePatchIndex_(mesh_.boundaryMesh().findIndex(slavePatchName))
|
||||||
{}
|
{}
|
||||||
@ -250,16 +248,6 @@ void Foam::perfectInterface::setRefinement
|
|||||||
patchi = patches.whichPatch(facei);
|
patchi = patches.whichPatch(facei);
|
||||||
}
|
}
|
||||||
|
|
||||||
const label zoneID = mesh_.faceZones().whichZone(facei);
|
|
||||||
|
|
||||||
bool zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = mesh_.faceZones()[zoneID];
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
|
||||||
}
|
|
||||||
|
|
||||||
ref.modifyFace
|
ref.modifyFace
|
||||||
(
|
(
|
||||||
newFace, // modified face
|
newFace, // modified face
|
||||||
@ -267,9 +255,7 @@ void Foam::perfectInterface::setRefinement
|
|||||||
mesh_.faceOwner()[facei], // owner
|
mesh_.faceOwner()[facei], // owner
|
||||||
nbr, // neighbour
|
nbr, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchi, // patch for face
|
patchi // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -297,9 +283,6 @@ void Foam::perfectInterface::setRefinement
|
|||||||
// 5. Modify patch0 faces for new points (not really necessary; see
|
// 5. Modify patch0 faces for new points (not really necessary; see
|
||||||
// comment above about patch1 and patch0 never sharing points) and
|
// comment above about patch1 and patch0 never sharing points) and
|
||||||
// becoming internal.
|
// becoming internal.
|
||||||
const boolList& mfFlip =
|
|
||||||
mesh_.faceZones()[faceZoneIndex_].flipMap();
|
|
||||||
|
|
||||||
forAll(pp0, i)
|
forAll(pp0, i)
|
||||||
{
|
{
|
||||||
const label facei = pp0.addressing()[i];
|
const label facei = pp0.addressing()[i];
|
||||||
@ -325,9 +308,7 @@ void Foam::perfectInterface::setRefinement
|
|||||||
own, // owner
|
own, // owner
|
||||||
nbr, // neighbour
|
nbr, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
-1, // patch for face
|
-1 // patch for face
|
||||||
faceZoneIndex_, // zone for face
|
|
||||||
mfFlip[i] // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -339,9 +320,7 @@ void Foam::perfectInterface::setRefinement
|
|||||||
nbr, // owner
|
nbr, // owner
|
||||||
own, // neighbour
|
own, // neighbour
|
||||||
true, // face flip
|
true, // face flip
|
||||||
-1, // patch for face
|
-1 // patch for face
|
||||||
faceZoneIndex_, // zone for face
|
|
||||||
!mfFlip[i] // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -354,8 +333,7 @@ void Foam::perfectInterface::setRefinement(polyTopoChange& ref) const
|
|||||||
{
|
{
|
||||||
Pout<< "bool perfectInterface::setRefinement(polyTopoChange&) const : "
|
Pout<< "bool perfectInterface::setRefinement(polyTopoChange&) const : "
|
||||||
<< "masterPatchIndex_:" << masterPatchIndex_
|
<< "masterPatchIndex_:" << masterPatchIndex_
|
||||||
<< " slavePatchIndex_:" << slavePatchIndex_
|
<< " slavePatchIndex_:" << slavePatchIndex_ << endl;
|
||||||
<< " faceZoneIndex_:" << faceZoneIndex_ << endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -56,9 +56,6 @@ class perfectInterface
|
|||||||
|
|
||||||
const polyMesh& mesh_;
|
const polyMesh& mesh_;
|
||||||
|
|
||||||
//- Master face zone ID
|
|
||||||
label faceZoneIndex_;
|
|
||||||
|
|
||||||
//- Master patch ID
|
//- Master patch ID
|
||||||
label masterPatchIndex_;
|
label masterPatchIndex_;
|
||||||
|
|
||||||
@ -88,7 +85,6 @@ public:
|
|||||||
(
|
(
|
||||||
const word& name,
|
const word& name,
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
const word& faceZoneName,
|
|
||||||
const word& masterPatchName,
|
const word& masterPatchName,
|
||||||
const word& slavePatchName
|
const word& slavePatchName
|
||||||
);
|
);
|
||||||
@ -109,7 +105,7 @@ public:
|
|||||||
|
|
||||||
//- Insert the layer addition/removal instructions
|
//- Insert the layer addition/removal instructions
|
||||||
// into the topological change. Uses only mesh, not any of the
|
// into the topological change. Uses only mesh, not any of the
|
||||||
// patch and zone indices. Bit of a workaround - used in extruding
|
// patch indices. Bit of a workaround - used in extruding
|
||||||
// a mesh.
|
// a mesh.
|
||||||
virtual void setRefinement
|
virtual void setRefinement
|
||||||
(
|
(
|
||||||
|
|||||||
@ -228,12 +228,6 @@ Foam::label Foam::addPatchCellLayer::addSideFace
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
label masterFacei = -1;
|
label masterFacei = -1;
|
||||||
|
|
||||||
// Zone info comes from any side patch face. Otherwise -1 since we
|
|
||||||
// don't know what to put it in - inherit from the extruded faces?
|
|
||||||
label zonei = -1; // mesh_.faceZones().whichZone(meshFacei);
|
|
||||||
bool flip = false;
|
|
||||||
|
|
||||||
label addedFacei = -1;
|
label addedFacei = -1;
|
||||||
|
|
||||||
// Is patch edge external edge of indirectPrimitivePatch?
|
// Is patch edge external edge of indirectPrimitivePatch?
|
||||||
@ -246,7 +240,7 @@ Foam::label Foam::addPatchCellLayer::addSideFace
|
|||||||
// Loop over all faces connected to edge and see if we can find a face
|
// Loop over all faces connected to edge and see if we can find a face
|
||||||
// that is otherPatchID
|
// that is otherPatchID
|
||||||
|
|
||||||
// Get my mesh face and its zone.
|
// Get my mesh face
|
||||||
label meshFacei = pp.addressing()[ownFacei];
|
label meshFacei = pp.addressing()[ownFacei];
|
||||||
|
|
||||||
forAll(meshFaces, k)
|
forAll(meshFaces, k)
|
||||||
@ -261,13 +255,6 @@ Foam::label Foam::addPatchCellLayer::addSideFace
|
|||||||
{
|
{
|
||||||
// Found the patch face. Use it to map from
|
// Found the patch face. Use it to map from
|
||||||
masterFacei = facei;
|
masterFacei = facei;
|
||||||
|
|
||||||
zonei = mesh_.faceZones().whichZone(facei);
|
|
||||||
if (zonei != -1)
|
|
||||||
{
|
|
||||||
label index = mesh_.faceZones()[zonei].whichFace(facei);
|
|
||||||
flip = mesh_.faceZones()[zonei].flipMap()[index];
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -295,12 +282,6 @@ Foam::label Foam::addPatchCellLayer::addSideFace
|
|||||||
layerOwn = layerI;
|
layerOwn = layerI;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Pout<< "Added boundary face:" << newFace
|
|
||||||
// << " own:" << addedCells[ownFacei][layerOwn]
|
|
||||||
// << " patch:" << newPatchID
|
|
||||||
// << endl;
|
|
||||||
|
|
||||||
addedFacei = meshMod.addFace
|
addedFacei = meshMod.addFace
|
||||||
(
|
(
|
||||||
newFace, // face
|
newFace, // face
|
||||||
@ -308,9 +289,7 @@ Foam::label Foam::addPatchCellLayer::addSideFace
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
masterFacei, // master face
|
masterFacei, // master face
|
||||||
false, // flux flip
|
false, // flux flip
|
||||||
newPatchID, // patch for face
|
newPatchID // patch for face
|
||||||
zonei, // zone for face
|
|
||||||
flip // face zone flip
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -369,15 +348,8 @@ Foam::label Foam::addPatchCellLayer::addSideFace
|
|||||||
addedCells[nbrFacei][layerNbr], // neighbour
|
addedCells[nbrFacei][layerNbr], // neighbour
|
||||||
-1, // master face
|
-1, // master face
|
||||||
false, // flux flip
|
false, // flux flip
|
||||||
-1, // patch for face
|
-1 // patch for face
|
||||||
zonei, // zone for face
|
|
||||||
flip // face zone flip
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Pout<< "Added internal face:" << newFace
|
|
||||||
// << " own:" << addedCells[ownFacei][layerOwn]
|
|
||||||
// << " nei:" << addedCells[nbrFacei][layerNbr]
|
|
||||||
// << endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return addedFacei;
|
return addedFacei;
|
||||||
@ -1158,21 +1130,12 @@ void Foam::addPatchCellLayer::setRefinement
|
|||||||
// Get new neighbour
|
// Get new neighbour
|
||||||
label nei;
|
label nei;
|
||||||
label patchi;
|
label patchi;
|
||||||
label zonei = -1;
|
|
||||||
bool flip = false;
|
|
||||||
|
|
||||||
|
|
||||||
if (i == addedCells[patchFacei].size()-1)
|
if (i == addedCells[patchFacei].size()-1)
|
||||||
{
|
{
|
||||||
// Top layer so is patch face.
|
// Top layer so is patch face.
|
||||||
nei = -1;
|
nei = -1;
|
||||||
patchi = patchID[patchFacei];
|
patchi = patchID[patchFacei];
|
||||||
zonei = mesh_.faceZones().whichZone(meshFacei);
|
|
||||||
if (zonei != -1)
|
|
||||||
{
|
|
||||||
const faceZone& fz = mesh_.faceZones()[zonei];
|
|
||||||
flip = fz.flipMap()[fz.whichFace(meshFacei)];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1181,7 +1144,6 @@ void Foam::addPatchCellLayer::setRefinement
|
|||||||
patchi = -1;
|
patchi = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
layerFaces_[patchFacei][i+1] = meshMod.addFace
|
layerFaces_[patchFacei][i+1] = meshMod.addFace
|
||||||
(
|
(
|
||||||
newFace, // face
|
newFace, // face
|
||||||
@ -1189,9 +1151,7 @@ void Foam::addPatchCellLayer::setRefinement
|
|||||||
nei, // neighbour
|
nei, // neighbour
|
||||||
(addToMesh_ ? meshFacei : -1), // master face
|
(addToMesh_ ? meshFacei : -1), // master face
|
||||||
false, // flux flip
|
false, // flux flip
|
||||||
patchi, // patch for face
|
patchi // patch for face
|
||||||
zonei, // zone for face
|
|
||||||
flip // face zone flip
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1218,9 +1178,7 @@ void Foam::addPatchCellLayer::setRefinement
|
|||||||
mesh_.faceOwner()[meshFacei], // owner
|
mesh_.faceOwner()[meshFacei], // owner
|
||||||
addedCells[patchFacei][0], // neighbour
|
addedCells[patchFacei][0], // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
-1, // patch for face
|
-1 // patch for face
|
||||||
-1, // zonei, // zone for face
|
|
||||||
false // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1233,15 +1191,6 @@ void Foam::addPatchCellLayer::setRefinement
|
|||||||
{
|
{
|
||||||
if (nFaceLayers[patchFacei] > 0)
|
if (nFaceLayers[patchFacei] > 0)
|
||||||
{
|
{
|
||||||
label meshFacei = pp.addressing()[patchFacei];
|
|
||||||
label zonei = mesh_.faceZones().whichZone(meshFacei);
|
|
||||||
bool zoneFlip = false;
|
|
||||||
if (zonei != -1)
|
|
||||||
{
|
|
||||||
const faceZone& fz = mesh_.faceZones()[zonei];
|
|
||||||
zoneFlip = !fz.flipMap()[fz.whichFace(meshFacei)];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reverse and renumber old patch face.
|
// Reverse and renumber old patch face.
|
||||||
face f(pp.localFaces()[patchFacei].reverseFace());
|
face f(pp.localFaces()[patchFacei].reverseFace());
|
||||||
forAll(f, fp)
|
forAll(f, fp)
|
||||||
@ -1256,9 +1205,7 @@ void Foam::addPatchCellLayer::setRefinement
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
-1, // masterFace
|
-1, // masterFace
|
||||||
true, // face flip
|
true, // face flip
|
||||||
exposedPatchID[patchFacei], // patch for face
|
exposedPatchID[patchFacei] // patch for face
|
||||||
zonei, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -639,23 +639,12 @@ void Foam::combineFaces::setRefinement
|
|||||||
// Modify master face
|
// Modify master face
|
||||||
// ~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
label masterFacei = setFaces[0];
|
const label masterFacei = setFaces[0];
|
||||||
|
|
||||||
// Get outside face in mesh vertex labels
|
// Get outside face in mesh vertex labels
|
||||||
face outsideFace(getOutsideFace(bigFace));
|
const face outsideFace(getOutsideFace(bigFace));
|
||||||
|
|
||||||
label zoneID = mesh_.faceZones().whichZone(masterFacei);
|
const label patchi = mesh_.boundaryMesh().whichPatch(masterFacei);
|
||||||
|
|
||||||
bool zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = mesh_.faceZones()[zoneID];
|
|
||||||
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(masterFacei)];
|
|
||||||
}
|
|
||||||
|
|
||||||
label patchi = mesh_.boundaryMesh().whichPatch(masterFacei);
|
|
||||||
|
|
||||||
meshMod.modifyFace
|
meshMod.modifyFace
|
||||||
(
|
(
|
||||||
@ -664,9 +653,7 @@ void Foam::combineFaces::setRefinement
|
|||||||
mesh_.faceOwner()[masterFacei], // owner
|
mesh_.faceOwner()[masterFacei], // owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchi, // patch for face
|
patchi // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -922,15 +909,8 @@ void Foam::combineFaces::setUnrefinement
|
|||||||
// Restore
|
// Restore
|
||||||
// ~~~~~~~
|
// ~~~~~~~
|
||||||
|
|
||||||
label own = mesh_.faceOwner()[masterFacei];
|
const label own = mesh_.faceOwner()[masterFacei];
|
||||||
label zoneID = mesh_.faceZones().whichZone(masterFacei);
|
const label patchi = mesh_.boundaryMesh().whichPatch(masterFacei);
|
||||||
bool zoneFlip = false;
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = mesh_.faceZones()[zoneID];
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(masterFacei)];
|
|
||||||
}
|
|
||||||
label patchi = mesh_.boundaryMesh().whichPatch(masterFacei);
|
|
||||||
|
|
||||||
if (mesh_.boundaryMesh()[patchi].coupled())
|
if (mesh_.boundaryMesh()[patchi].coupled())
|
||||||
{
|
{
|
||||||
@ -951,9 +931,7 @@ void Foam::combineFaces::setUnrefinement
|
|||||||
own, // owner
|
own, // owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchi, // patch for face
|
patchi // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
restoredFaces.insert(masterFacei, masterFacei);
|
restoredFaces.insert(masterFacei, masterFacei);
|
||||||
|
|
||||||
@ -970,9 +948,7 @@ void Foam::combineFaces::setUnrefinement
|
|||||||
-1, // neighbour,
|
-1, // neighbour,
|
||||||
masterFacei, // masterFaceID,
|
masterFacei, // masterFaceID,
|
||||||
false, // flipFaceFlux,
|
false, // flipFaceFlux,
|
||||||
patchi, // patchID,
|
patchi // patchID,
|
||||||
zoneID, // zoneID,
|
|
||||||
zoneFlip // zoneFlip
|
|
||||||
);
|
);
|
||||||
restoredFaces.insert(facei, masterFacei);
|
restoredFaces.insert(facei, masterFacei);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -142,16 +142,6 @@ void Foam::duplicatePoints::setRefinement
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get current zone info
|
|
||||||
label zoneID = mesh_.faceZones().whichZone(facei);
|
|
||||||
bool zoneFlip = false;
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = mesh_.faceZones()[zoneID];
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (mesh_.isInternalFace(facei))
|
if (mesh_.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
meshMod.modifyFace
|
meshMod.modifyFace
|
||||||
@ -161,9 +151,7 @@ void Foam::duplicatePoints::setRefinement
|
|||||||
mesh_.faceOwner()[facei], // owner
|
mesh_.faceOwner()[facei], // owner
|
||||||
mesh_.faceNeighbour()[facei], // neighbour
|
mesh_.faceNeighbour()[facei], // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
-1, // patch for face
|
-1 // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -175,9 +163,7 @@ void Foam::duplicatePoints::setRefinement
|
|||||||
mesh_.faceOwner()[facei], // owner
|
mesh_.faceOwner()[facei], // owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patches.whichPatch(facei), // patch for face
|
patches.whichPatch(facei) // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1550,7 +1550,6 @@ bool Foam::edgeCollapser::setRefinement
|
|||||||
|
|
||||||
|
|
||||||
const polyBoundaryMesh& boundaryMesh = mesh_.boundaryMesh();
|
const polyBoundaryMesh& boundaryMesh = mesh_.boundaryMesh();
|
||||||
const meshFaceZones& faceZones = mesh_.faceZones();
|
|
||||||
|
|
||||||
// Renumber faces that use points
|
// Renumber faces that use points
|
||||||
forAll(allPointInfo, pointi)
|
forAll(allPointInfo, pointi)
|
||||||
@ -1567,18 +1566,6 @@ bool Foam::edgeCollapser::setRefinement
|
|||||||
{
|
{
|
||||||
doneFace[facei] = true;
|
doneFace[facei] = true;
|
||||||
|
|
||||||
// Get current zone info
|
|
||||||
label zoneID = faceZones.whichZone(facei);
|
|
||||||
|
|
||||||
bool zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = faceZones[zoneID];
|
|
||||||
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get current connectivity
|
// Get current connectivity
|
||||||
label own = faceOwner[facei];
|
label own = faceOwner[facei];
|
||||||
label nei = -1;
|
label nei = -1;
|
||||||
@ -1600,9 +1587,7 @@ bool Foam::edgeCollapser::setRefinement
|
|||||||
own, // owner
|
own, // owner
|
||||||
nei, // neighbour
|
nei, // neighbour
|
||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
patchID, // patch
|
patchID // patch
|
||||||
zoneID,
|
|
||||||
zoneFlip
|
|
||||||
);
|
);
|
||||||
|
|
||||||
meshChanged = true;
|
meshChanged = true;
|
||||||
|
|||||||
@ -90,31 +90,16 @@ void Foam::hexRef8::reorder
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::hexRef8::getFaceInfo
|
Foam::label Foam::hexRef8::getPatchIndex(const label facei) const
|
||||||
(
|
|
||||||
const label facei,
|
|
||||||
label& patchID,
|
|
||||||
label& zoneID,
|
|
||||||
label& zoneFlip
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
patchID = -1;
|
label patchID = -1;
|
||||||
|
|
||||||
if (!mesh_.isInternalFace(facei))
|
if (!mesh_.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
patchID = mesh_.boundaryMesh().whichPatch(facei);
|
patchID = mesh_.boundaryMesh().whichPatch(facei);
|
||||||
}
|
}
|
||||||
|
|
||||||
zoneID = mesh_.faceZones().whichZone(facei);
|
return patchID;
|
||||||
|
|
||||||
zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = mesh_.faceZones()[zoneID];
|
|
||||||
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -127,9 +112,7 @@ Foam::label Foam::hexRef8::addFace
|
|||||||
const label nei
|
const label nei
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
label patchID, zoneID, zoneFlip;
|
const label patchID = getPatchIndex(facei);
|
||||||
|
|
||||||
getFaceInfo(facei, patchID, zoneID, zoneFlip);
|
|
||||||
|
|
||||||
label newFacei = -1;
|
label newFacei = -1;
|
||||||
|
|
||||||
@ -143,9 +126,7 @@ Foam::label Foam::hexRef8::addFace
|
|||||||
nei, // neighbour
|
nei, // neighbour
|
||||||
facei, // master face for addition
|
facei, // master face for addition
|
||||||
false, // flux flip
|
false, // flux flip
|
||||||
patchID, // patch for face
|
patchID // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face zone flip
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -158,9 +139,7 @@ Foam::label Foam::hexRef8::addFace
|
|||||||
own, // neighbour
|
own, // neighbour
|
||||||
facei, // master face for addition
|
facei, // master face for addition
|
||||||
false, // flux flip
|
false, // flux flip
|
||||||
patchID, // patch for face
|
patchID // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face zone flip
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return newFacei;
|
return newFacei;
|
||||||
@ -186,9 +165,7 @@ Foam::label Foam::hexRef8::addInternalFace
|
|||||||
nei, // neighbour
|
nei, // neighbour
|
||||||
meshFacei, // master face for addition
|
meshFacei, // master face for addition
|
||||||
false, // flux flip
|
false, // flux flip
|
||||||
-1, // patch for face
|
-1 // patch for face
|
||||||
-1, // zone for face
|
|
||||||
false // face zone flip
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -202,9 +179,7 @@ Foam::label Foam::hexRef8::addInternalFace
|
|||||||
nei, // neighbour
|
nei, // neighbour
|
||||||
-1, // master face for addition
|
-1, // master face for addition
|
||||||
false, // flux flip
|
false, // flux flip
|
||||||
-1, // patch for face
|
-1 // patch for face
|
||||||
-1, // zone for face
|
|
||||||
false // face zone flip
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -219,9 +194,7 @@ void Foam::hexRef8::modifyFace
|
|||||||
const label nei
|
const label nei
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
label patchID, zoneID, zoneFlip;
|
const label patchID = getPatchIndex(facei);
|
||||||
|
|
||||||
getFaceInfo(facei, patchID, zoneID, zoneFlip);
|
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
@ -242,9 +215,7 @@ void Foam::hexRef8::modifyFace
|
|||||||
own, // owner
|
own, // owner
|
||||||
nei, // neighbour
|
nei, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchID, // patch for face
|
patchID // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -256,9 +227,7 @@ void Foam::hexRef8::modifyFace
|
|||||||
nei, // owner
|
nei, // owner
|
||||||
own, // neighbour
|
own, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchID, // patch for face
|
patchID // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -105,14 +105,8 @@ class hexRef8
|
|||||||
labelList& elems
|
labelList& elems
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Get patch and zone info
|
//- Get patch index
|
||||||
void getFaceInfo
|
label getPatchIndex(const label facei) const;
|
||||||
(
|
|
||||||
const label facei,
|
|
||||||
label& patchID,
|
|
||||||
label& zoneID,
|
|
||||||
label& zoneFlip
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Adds a face on top of existing facei. Reverses if necessary.
|
//- Adds a face on top of existing facei. Reverses if necessary.
|
||||||
label addFace
|
label addFace
|
||||||
|
|||||||
@ -327,13 +327,12 @@ void Foam::polyTopoChange::checkFace
|
|||||||
const label facei,
|
const label facei,
|
||||||
const label own,
|
const label own,
|
||||||
const label nei,
|
const label nei,
|
||||||
const label patchi,
|
const label patchi
|
||||||
const label zoneI
|
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
if (nei == -1)
|
if (nei == -1)
|
||||||
{
|
{
|
||||||
if (own == -1 && zoneI != -1)
|
if (own == -1)
|
||||||
{
|
{
|
||||||
// retired face
|
// retired face
|
||||||
}
|
}
|
||||||
@ -865,9 +864,6 @@ void Foam::polyTopoChange::reorderCompactFaces
|
|||||||
|
|
||||||
inplaceReorder(oldToNew, flipFaceFlux_);
|
inplaceReorder(oldToNew, flipFaceFlux_);
|
||||||
flipFaceFlux_.setCapacity(newSize);
|
flipFaceFlux_.setCapacity(newSize);
|
||||||
renumberKey(oldToNew, faceZone_);
|
|
||||||
inplaceReorder(oldToNew, faceZoneFlip_);
|
|
||||||
faceZoneFlip_.setCapacity(newSize);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1174,12 +1170,6 @@ void Foam::polyTopoChange::compact
|
|||||||
? 0
|
? 0
|
||||||
: 1
|
: 1
|
||||||
);
|
);
|
||||||
faceZoneFlip_[facei] =
|
|
||||||
(
|
|
||||||
faceZoneFlip_[facei]
|
|
||||||
? 0
|
|
||||||
: 1
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1313,150 +1303,6 @@ void Foam::polyTopoChange::calcPatchPointMap
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::polyTopoChange::resetZones
|
|
||||||
(
|
|
||||||
const polyMesh& mesh,
|
|
||||||
polyMesh& newMesh
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
// faceZones
|
|
||||||
// ~~~~~~~~~
|
|
||||||
|
|
||||||
{
|
|
||||||
const meshFaceZones& faceZones = mesh.faceZones();
|
|
||||||
|
|
||||||
labelList nFaces(faceZones.size(), 0);
|
|
||||||
|
|
||||||
forAllConstIter(Map<label>, faceZone_, iter)
|
|
||||||
{
|
|
||||||
label zoneI = iter();
|
|
||||||
|
|
||||||
if (zoneI < 0 || zoneI >= faceZones.size())
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Illegal zoneID " << zoneI << " for face "
|
|
||||||
<< iter.key()
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
nFaces[zoneI]++;
|
|
||||||
}
|
|
||||||
|
|
||||||
labelListList addressing(faceZones.size());
|
|
||||||
boolListList flipMode(faceZones.size());
|
|
||||||
|
|
||||||
forAll(addressing, zoneI)
|
|
||||||
{
|
|
||||||
addressing[zoneI].setSize(nFaces[zoneI]);
|
|
||||||
flipMode[zoneI].setSize(nFaces[zoneI]);
|
|
||||||
}
|
|
||||||
nFaces = 0;
|
|
||||||
|
|
||||||
forAllConstIter(Map<label>, faceZone_, iter)
|
|
||||||
{
|
|
||||||
label zoneI = iter();
|
|
||||||
label facei = iter.key();
|
|
||||||
|
|
||||||
label index = nFaces[zoneI]++;
|
|
||||||
|
|
||||||
addressing[zoneI][index] = facei;
|
|
||||||
flipMode[zoneI][index] = faceZoneFlip_[facei];
|
|
||||||
}
|
|
||||||
// Sort the addressing
|
|
||||||
forAll(addressing, zoneI)
|
|
||||||
{
|
|
||||||
labelList newToOld;
|
|
||||||
sortedOrder(addressing[zoneI], newToOld);
|
|
||||||
{
|
|
||||||
labelList newAddressing(addressing[zoneI].size());
|
|
||||||
forAll(newAddressing, i)
|
|
||||||
{
|
|
||||||
newAddressing[i] = addressing[zoneI][newToOld[i]];
|
|
||||||
}
|
|
||||||
addressing[zoneI].transfer(newAddressing);
|
|
||||||
}
|
|
||||||
{
|
|
||||||
boolList newFlipMode(flipMode[zoneI].size());
|
|
||||||
forAll(newFlipMode, i)
|
|
||||||
{
|
|
||||||
newFlipMode[i] = flipMode[zoneI][newToOld[i]];
|
|
||||||
}
|
|
||||||
flipMode[zoneI].transfer(newFlipMode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reset the addressing on the zone
|
|
||||||
forAll(newMesh.faceZones(), zoneI)
|
|
||||||
{
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Pout<< "faceZone:" << zoneI
|
|
||||||
<< " name:" << newMesh.faceZones()[zoneI].name()
|
|
||||||
<< " size:" << addressing[zoneI].size()
|
|
||||||
<< endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
newMesh.faceZones()[zoneI].resetAddressing
|
|
||||||
(
|
|
||||||
addressing[zoneI],
|
|
||||||
flipMode[zoneI]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::polyTopoChange::calcFaceZonePointMap
|
|
||||||
(
|
|
||||||
const polyMesh& mesh,
|
|
||||||
const List<Map<label>>& oldMeshFaceZonesPointMaps,
|
|
||||||
labelListList& faceZonePointMap
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
const meshFaceZones& faceZones = mesh.faceZones();
|
|
||||||
|
|
||||||
faceZonePointMap.setSize(faceZones.size());
|
|
||||||
|
|
||||||
forAll(faceZones, zoneI)
|
|
||||||
{
|
|
||||||
const faceZone& newZone = faceZones[zoneI];
|
|
||||||
|
|
||||||
const labelList& newMeshZonePoints = newZone().meshPoints();
|
|
||||||
|
|
||||||
const Map<label>& oldMeshZonePointMap =
|
|
||||||
oldMeshFaceZonesPointMaps[zoneI];
|
|
||||||
|
|
||||||
labelList& curFzPointRnb = faceZonePointMap[zoneI];
|
|
||||||
|
|
||||||
curFzPointRnb.setSize(newMeshZonePoints.size());
|
|
||||||
|
|
||||||
forAll(newMeshZonePoints, pointi)
|
|
||||||
{
|
|
||||||
if (newMeshZonePoints[pointi] < pointMap_.size())
|
|
||||||
{
|
|
||||||
Map<label>::const_iterator ozmpmIter =
|
|
||||||
oldMeshZonePointMap.find
|
|
||||||
(
|
|
||||||
pointMap_[newMeshZonePoints[pointi]]
|
|
||||||
);
|
|
||||||
|
|
||||||
if (ozmpmIter != oldMeshZonePointMap.end())
|
|
||||||
{
|
|
||||||
curFzPointRnb[pointi] = ozmpmIter();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
curFzPointRnb[pointi] = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
curFzPointRnb[pointi] = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::polyTopoChange::reorderCoupledFaces
|
void Foam::polyTopoChange::reorderCoupledFaces
|
||||||
(
|
(
|
||||||
const bool syncParallel,
|
const bool syncParallel,
|
||||||
@ -1591,8 +1437,7 @@ void Foam::polyTopoChange::compactAndReorder
|
|||||||
List<Map<label>>& oldPatchMeshPointMaps,
|
List<Map<label>>& oldPatchMeshPointMaps,
|
||||||
labelList& oldPatchNMeshPoints,
|
labelList& oldPatchNMeshPoints,
|
||||||
labelList& oldPatchSizes,
|
labelList& oldPatchSizes,
|
||||||
labelList& oldPatchStarts,
|
labelList& oldPatchStarts
|
||||||
List<Map<label>>& oldMeshFaceZonesPointMaps
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (mesh.boundaryMesh().size() != nPatches_)
|
if (mesh.boundaryMesh().size() != nPatches_)
|
||||||
@ -1667,24 +1512,11 @@ void Foam::polyTopoChange::compactAndReorder
|
|||||||
|
|
||||||
forAll(boundary, patchi)
|
forAll(boundary, patchi)
|
||||||
{
|
{
|
||||||
// Copy old face zone point maps
|
|
||||||
oldPatchMeshPointMaps[patchi] = boundary[patchi].meshPointMap();
|
oldPatchMeshPointMaps[patchi] = boundary[patchi].meshPointMap();
|
||||||
oldPatchNMeshPoints[patchi] = boundary[patchi].meshPoints().size();
|
oldPatchNMeshPoints[patchi] = boundary[patchi].meshPoints().size();
|
||||||
oldPatchSizes[patchi] = boundary[patchi].size();
|
oldPatchSizes[patchi] = boundary[patchi].size();
|
||||||
oldPatchStarts[patchi] = boundary[patchi].start();
|
oldPatchStarts[patchi] = boundary[patchi].start();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Grab old face zone point maps.
|
|
||||||
// These need to be saved before resetting the mesh and are used
|
|
||||||
// later on to calculate the faceZone pointMaps.
|
|
||||||
oldMeshFaceZonesPointMaps.setSize(mesh.faceZones().size());
|
|
||||||
|
|
||||||
forAll(mesh.faceZones(), zoneI)
|
|
||||||
{
|
|
||||||
const faceZone& oldZone = mesh.faceZones()[zoneI];
|
|
||||||
|
|
||||||
oldMeshFaceZonesPointMaps[zoneI] = oldZone().meshPointMap();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1706,8 +1538,6 @@ Foam::polyTopoChange::polyTopoChange(const label nPatches, const bool strict)
|
|||||||
faceMap_(0),
|
faceMap_(0),
|
||||||
reverseFaceMap_(0),
|
reverseFaceMap_(0),
|
||||||
flipFaceFlux_(0),
|
flipFaceFlux_(0),
|
||||||
faceZone_(0),
|
|
||||||
faceZoneFlip_(0),
|
|
||||||
nActiveFaces_(0),
|
nActiveFaces_(0),
|
||||||
cellMap_(0),
|
cellMap_(0),
|
||||||
reverseCellMap_(0)
|
reverseCellMap_(0)
|
||||||
@ -1734,8 +1564,6 @@ Foam::polyTopoChange::polyTopoChange
|
|||||||
faceMap_(0),
|
faceMap_(0),
|
||||||
reverseFaceMap_(0),
|
reverseFaceMap_(0),
|
||||||
flipFaceFlux_(0),
|
flipFaceFlux_(0),
|
||||||
faceZone_(0),
|
|
||||||
faceZoneFlip_(0),
|
|
||||||
nActiveFaces_(0),
|
nActiveFaces_(0),
|
||||||
cellMap_(0),
|
cellMap_(0),
|
||||||
reverseCellMap_(0)
|
reverseCellMap_(0)
|
||||||
@ -1781,7 +1609,6 @@ Foam::polyTopoChange::polyTopoChange
|
|||||||
const faceList& faces = mesh.faces();
|
const faceList& faces = mesh.faces();
|
||||||
const labelList& faceOwner = mesh.faceOwner();
|
const labelList& faceOwner = mesh.faceOwner();
|
||||||
const labelList& faceNeighbour = mesh.faceNeighbour();
|
const labelList& faceNeighbour = mesh.faceNeighbour();
|
||||||
const meshFaceZones& faceZones = mesh.faceZones();
|
|
||||||
|
|
||||||
// Resize
|
// Resize
|
||||||
label nAllFaces = mesh.faces().size();
|
label nAllFaces = mesh.faces().size();
|
||||||
@ -1793,26 +1620,8 @@ Foam::polyTopoChange::polyTopoChange
|
|||||||
faceMap_.setCapacity(faceMap_.size() + nAllFaces);
|
faceMap_.setCapacity(faceMap_.size() + nAllFaces);
|
||||||
reverseFaceMap_.setCapacity(reverseFaceMap_.size() + nAllFaces);
|
reverseFaceMap_.setCapacity(reverseFaceMap_.size() + nAllFaces);
|
||||||
flipFaceFlux_.setCapacity(faces_.size() + nAllFaces);
|
flipFaceFlux_.setCapacity(faces_.size() + nAllFaces);
|
||||||
faceZone_.resize(faceZone_.size() + nAllFaces/100);
|
|
||||||
faceZoneFlip_.setCapacity(faces_.size() + nAllFaces);
|
|
||||||
|
|
||||||
|
|
||||||
// Precalc offset zones
|
|
||||||
labelList newZoneID(nAllFaces, -1);
|
|
||||||
boolList zoneFlip(nAllFaces, false);
|
|
||||||
|
|
||||||
forAll(faceZones, zoneI)
|
|
||||||
{
|
|
||||||
const labelList& faceLabels = faceZones[zoneI];
|
|
||||||
const boolList& flipMap = faceZones[zoneI].flipMap();
|
|
||||||
|
|
||||||
forAll(faceLabels, j)
|
|
||||||
{
|
|
||||||
newZoneID[faceLabels[j]] = zoneI;
|
|
||||||
zoneFlip[faceLabels[j]] = flipMap[j];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add faces in mesh order
|
// Add faces in mesh order
|
||||||
|
|
||||||
// 1. Internal faces
|
// 1. Internal faces
|
||||||
@ -1825,9 +1634,7 @@ Foam::polyTopoChange::polyTopoChange
|
|||||||
faceNeighbour[facei],
|
faceNeighbour[facei],
|
||||||
facei, // masterFaceID
|
facei, // masterFaceID
|
||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
-1, // patchID
|
-1 // patchID
|
||||||
newZoneID[facei], // zoneID
|
|
||||||
zoneFlip[facei] // zoneFlip
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1857,9 +1664,7 @@ Foam::polyTopoChange::polyTopoChange
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
facei, // masterFaceID
|
facei, // masterFaceID
|
||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
patchi, // patchID
|
patchi // patchID
|
||||||
newZoneID[facei], // zoneID
|
|
||||||
zoneFlip[facei] // zoneFlip
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1884,8 +1689,6 @@ void Foam::polyTopoChange::clear()
|
|||||||
faceMap_.clearStorage();
|
faceMap_.clearStorage();
|
||||||
reverseFaceMap_.clearStorage();
|
reverseFaceMap_.clearStorage();
|
||||||
flipFaceFlux_.clearStorage();
|
flipFaceFlux_.clearStorage();
|
||||||
faceZone_.clearStorage();
|
|
||||||
faceZoneFlip_.clearStorage();
|
|
||||||
nActiveFaces_ = 0;
|
nActiveFaces_ = 0;
|
||||||
|
|
||||||
cellMap_.clearStorage();
|
cellMap_.clearStorage();
|
||||||
@ -1911,8 +1714,6 @@ void Foam::polyTopoChange::setCapacity
|
|||||||
faceMap_.setCapacity(nFaces);
|
faceMap_.setCapacity(nFaces);
|
||||||
reverseFaceMap_.setCapacity(nFaces);
|
reverseFaceMap_.setCapacity(nFaces);
|
||||||
flipFaceFlux_.setCapacity(nFaces);
|
flipFaceFlux_.setCapacity(nFaces);
|
||||||
faceZone_.resize(faceZone_.size() + nFaces/100);
|
|
||||||
faceZoneFlip_.setCapacity(nFaces);
|
|
||||||
|
|
||||||
cellMap_.setCapacity(nCells);
|
cellMap_.setCapacity(nCells);
|
||||||
reverseCellMap_.setCapacity(nCells);
|
reverseCellMap_.setCapacity(nCells);
|
||||||
@ -2031,15 +1832,13 @@ Foam::label Foam::polyTopoChange::addFace
|
|||||||
const label nei,
|
const label nei,
|
||||||
const label masterFaceID,
|
const label masterFaceID,
|
||||||
const bool flipFaceFlux,
|
const bool flipFaceFlux,
|
||||||
const label patchID,
|
const label patchID
|
||||||
const label zoneID,
|
|
||||||
const bool zoneFlip
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Check validity
|
// Check validity
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
checkFace(f, -1, own, nei, patchID, zoneID);
|
checkFace(f, -1, own, nei, patchID);
|
||||||
}
|
}
|
||||||
|
|
||||||
label facei = faces_.size();
|
label facei = faces_.size();
|
||||||
@ -2066,12 +1865,6 @@ Foam::label Foam::polyTopoChange::addFace
|
|||||||
|
|
||||||
flipFaceFlux_[facei] = (flipFaceFlux ? 1 : 0);
|
flipFaceFlux_[facei] = (flipFaceFlux ? 1 : 0);
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
faceZone_.insert(facei, zoneID);
|
|
||||||
}
|
|
||||||
faceZoneFlip_[facei] = (zoneFlip ? 1 : 0);
|
|
||||||
|
|
||||||
return facei;
|
return facei;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2083,15 +1876,13 @@ void Foam::polyTopoChange::modifyFace
|
|||||||
const label own,
|
const label own,
|
||||||
const label nei,
|
const label nei,
|
||||||
const bool flipFaceFlux,
|
const bool flipFaceFlux,
|
||||||
const label patchID,
|
const label patchID
|
||||||
const label zoneID,
|
|
||||||
const bool zoneFlip
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Check validity
|
// Check validity
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
checkFace(f, facei, own, nei, patchID, zoneID);
|
checkFace(f, facei, own, nei, patchID);
|
||||||
}
|
}
|
||||||
|
|
||||||
faces_[facei] = f;
|
faces_[facei] = f;
|
||||||
@ -2100,25 +1891,6 @@ void Foam::polyTopoChange::modifyFace
|
|||||||
region_[facei] = patchID;
|
region_[facei] = patchID;
|
||||||
|
|
||||||
flipFaceFlux_[facei] = (flipFaceFlux ? 1 : 0);
|
flipFaceFlux_[facei] = (flipFaceFlux ? 1 : 0);
|
||||||
|
|
||||||
Map<label>::iterator faceFnd = faceZone_.find(facei);
|
|
||||||
|
|
||||||
if (faceFnd != faceZone_.end())
|
|
||||||
{
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
faceFnd() = zoneID;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
faceZone_.erase(faceFnd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
faceZone_.insert(facei, zoneID);
|
|
||||||
}
|
|
||||||
faceZoneFlip_[facei] = (zoneFlip ? 1 : 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2158,8 +1930,6 @@ void Foam::polyTopoChange::removeFace(const label facei, const label mergeFacei)
|
|||||||
reverseFaceMap_[facei] = -1;
|
reverseFaceMap_[facei] = -1;
|
||||||
}
|
}
|
||||||
flipFaceFlux_[facei] = 0;
|
flipFaceFlux_[facei] = 0;
|
||||||
faceZone_.erase(facei);
|
|
||||||
faceZoneFlip_[facei] = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2244,7 +2014,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::changeMesh
|
|||||||
labelList oldPatchNMeshPoints;
|
labelList oldPatchNMeshPoints;
|
||||||
labelList oldPatchSizes;
|
labelList oldPatchSizes;
|
||||||
labelList oldPatchStarts;
|
labelList oldPatchStarts;
|
||||||
List<Map<label>> oldMeshFaceZonesPointMaps;
|
|
||||||
|
|
||||||
// Compact, reorder patch faces and calculate mesh/patch maps.
|
// Compact, reorder patch faces and calculate mesh/patch maps.
|
||||||
compactAndReorder
|
compactAndReorder
|
||||||
@ -2264,8 +2033,7 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::changeMesh
|
|||||||
oldPatchMeshPointMaps,
|
oldPatchMeshPointMaps,
|
||||||
oldPatchNMeshPoints,
|
oldPatchNMeshPoints,
|
||||||
oldPatchSizes,
|
oldPatchSizes,
|
||||||
oldPatchStarts,
|
oldPatchStarts
|
||||||
oldMeshFaceZonesPointMaps
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const label nOldPoints(mesh.nPoints());
|
const label nOldPoints(mesh.nPoints());
|
||||||
@ -2344,17 +2112,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::changeMesh
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Zones
|
|
||||||
// ~~~~~
|
|
||||||
resetZones(mesh, mesh);
|
|
||||||
|
|
||||||
// Clear zone info
|
|
||||||
{
|
|
||||||
faceZone_.clearStorage();
|
|
||||||
faceZoneFlip_.clearStorage();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Patch point renumbering
|
// Patch point renumbering
|
||||||
// For every preserved point on a patch give the old position.
|
// For every preserved point on a patch give the old position.
|
||||||
// For added points, the index is set to -1
|
// For added points, the index is set to -1
|
||||||
@ -2366,10 +2123,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::changeMesh
|
|||||||
patchPointMap
|
patchPointMap
|
||||||
);
|
);
|
||||||
|
|
||||||
// Create the face zone point renumbering
|
|
||||||
labelListList faceZonePointMap(mesh.faceZones().size());
|
|
||||||
calcFaceZonePointMap(mesh, oldMeshFaceZonesPointMaps, faceZonePointMap);
|
|
||||||
|
|
||||||
labelHashSet flipFaceFluxSet(getSetIndices(flipFaceFlux_));
|
labelHashSet flipFaceFluxSet(getSetIndices(flipFaceFlux_));
|
||||||
|
|
||||||
return autoPtr<polyTopoChangeMap>
|
return autoPtr<polyTopoChangeMap>
|
||||||
@ -2452,7 +2205,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::makeMesh
|
|||||||
labelList oldPatchNMeshPoints;
|
labelList oldPatchNMeshPoints;
|
||||||
labelList oldPatchSizes;
|
labelList oldPatchSizes;
|
||||||
labelList oldPatchStarts;
|
labelList oldPatchStarts;
|
||||||
List<Map<label>> oldMeshFaceZonesPointMaps;
|
|
||||||
|
|
||||||
// Compact, reorder patch faces and calculate mesh/patch maps.
|
// Compact, reorder patch faces and calculate mesh/patch maps.
|
||||||
compactAndReorder
|
compactAndReorder
|
||||||
@ -2472,8 +2224,7 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::makeMesh
|
|||||||
oldPatchMeshPointMaps,
|
oldPatchMeshPointMaps,
|
||||||
oldPatchNMeshPoints,
|
oldPatchNMeshPoints,
|
||||||
oldPatchSizes,
|
oldPatchSizes,
|
||||||
oldPatchStarts,
|
oldPatchStarts
|
||||||
oldMeshFaceZonesPointMaps
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const label nOldPoints(mesh.nPoints());
|
const label nOldPoints(mesh.nPoints());
|
||||||
@ -2580,19 +2331,13 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::makeMesh
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start with empty faceZone
|
// Copy faceZone from old mesh
|
||||||
const meshFaceZones& oldFaceZones = mesh.faceZones();
|
const meshFaceZones& oldFaceZones = mesh.faceZones();
|
||||||
List<faceZone*> fZonePtrs(oldFaceZones.size());
|
List<faceZone*> fZonePtrs(oldFaceZones.size());
|
||||||
{
|
{
|
||||||
forAll(oldFaceZones, i)
|
forAll(oldFaceZones, i)
|
||||||
{
|
{
|
||||||
fZonePtrs[i] = new faceZone
|
fZonePtrs[i] = oldFaceZones[i].clone(newMesh.faceZones()).ptr();
|
||||||
(
|
|
||||||
oldFaceZones[i].name(),
|
|
||||||
labelList(0),
|
|
||||||
boolList(0),
|
|
||||||
newMesh.faceZones()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2607,13 +2352,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::makeMesh
|
|||||||
}
|
}
|
||||||
|
|
||||||
newMesh.addZones(pZonePtrs, fZonePtrs, cZonePtrs);
|
newMesh.addZones(pZonePtrs, fZonePtrs, cZonePtrs);
|
||||||
resetZones(mesh, newMesh);
|
|
||||||
|
|
||||||
// Clear zone info
|
|
||||||
{
|
|
||||||
faceZone_.clearStorage();
|
|
||||||
faceZoneFlip_.clearStorage();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Patch point renumbering
|
// Patch point renumbering
|
||||||
// For every preserved point on a patch give the old position.
|
// For every preserved point on a patch give the old position.
|
||||||
@ -2626,10 +2364,6 @@ Foam::autoPtr<Foam::polyTopoChangeMap> Foam::polyTopoChange::makeMesh
|
|||||||
patchPointMap
|
patchPointMap
|
||||||
);
|
);
|
||||||
|
|
||||||
// Create the face zone point renumbering
|
|
||||||
labelListList faceZonePointMap(newMesh.faceZones().size());
|
|
||||||
calcFaceZonePointMap(newMesh, oldMeshFaceZonesPointMaps, faceZonePointMap);
|
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Pout<< "New mesh:" << nl;
|
Pout<< "New mesh:" << nl;
|
||||||
|
|||||||
@ -155,12 +155,6 @@ class polyTopoChange
|
|||||||
//- In mapping whether to reverse the flux
|
//- In mapping whether to reverse the flux
|
||||||
PackedBoolList flipFaceFlux_;
|
PackedBoolList flipFaceFlux_;
|
||||||
|
|
||||||
//- Zone of face
|
|
||||||
Map<label> faceZone_;
|
|
||||||
|
|
||||||
//- Orientation of face in zone
|
|
||||||
PackedBoolList faceZoneFlip_;
|
|
||||||
|
|
||||||
//- Active faces
|
//- Active faces
|
||||||
label nActiveFaces_;
|
label nActiveFaces_;
|
||||||
|
|
||||||
@ -236,8 +230,7 @@ class polyTopoChange
|
|||||||
const label facei,
|
const label facei,
|
||||||
const label own,
|
const label own,
|
||||||
const label nei,
|
const label nei,
|
||||||
const label patchi,
|
const label patchi
|
||||||
const label zoneI
|
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Construct cells (in packed storage)
|
//- Construct cells (in packed storage)
|
||||||
@ -323,31 +316,15 @@ class polyTopoChange
|
|||||||
labelListList&
|
labelListList&
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
void resetZones
|
//- Do all coupled patch face reordering
|
||||||
|
void reorderCoupledFaces
|
||||||
(
|
(
|
||||||
const polyMesh&, // mesh to get existing info from
|
const bool syncParallel,
|
||||||
polyMesh& // mesh to change zones on
|
const polyBoundaryMesh&,
|
||||||
) const;
|
const labelList& patchStarts,
|
||||||
|
const labelList& patchSizes,
|
||||||
void calcFaceZonePointMap
|
const pointField& points
|
||||||
(
|
);
|
||||||
const polyMesh&,
|
|
||||||
const List<Map<label>>&,
|
|
||||||
labelListList&
|
|
||||||
) const;
|
|
||||||
|
|
||||||
|
|
||||||
// Coupling
|
|
||||||
|
|
||||||
//- Do all coupled patch face reordering
|
|
||||||
void reorderCoupledFaces
|
|
||||||
(
|
|
||||||
const bool syncParallel,
|
|
||||||
const polyBoundaryMesh&,
|
|
||||||
const labelList& patchStarts,
|
|
||||||
const labelList& patchSizes,
|
|
||||||
const pointField& points
|
|
||||||
);
|
|
||||||
|
|
||||||
void compactAndReorder
|
void compactAndReorder
|
||||||
(
|
(
|
||||||
@ -365,8 +342,7 @@ class polyTopoChange
|
|||||||
List<Map<label>>& oldPatchMeshPointMaps,
|
List<Map<label>>& oldPatchMeshPointMaps,
|
||||||
labelList& oldPatchNMeshPoints,
|
labelList& oldPatchNMeshPoints,
|
||||||
labelList& oldPatchSizes,
|
labelList& oldPatchSizes,
|
||||||
labelList& oldPatchStarts,
|
labelList& oldPatchStarts
|
||||||
List<Map<label>>& oldMeshFaceZonesPointMaps
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -465,7 +441,7 @@ public:
|
|||||||
void removePoint(const label, const label);
|
void removePoint(const label, const label);
|
||||||
|
|
||||||
//- Add face to cells and return new face index
|
//- Add face to cells and return new face index
|
||||||
// own,nei<0, zoneID>=0 : add inactive face (to end of face list)
|
// own, nei <0 >=0 : add inactive face (to end of face list)
|
||||||
label addFace
|
label addFace
|
||||||
(
|
(
|
||||||
const face& f,
|
const face& f,
|
||||||
@ -473,9 +449,7 @@ public:
|
|||||||
const label nei,
|
const label nei,
|
||||||
const label masterFaceID,
|
const label masterFaceID,
|
||||||
const bool flipFaceFlux,
|
const bool flipFaceFlux,
|
||||||
const label patchID,
|
const label patchID
|
||||||
const label zoneID,
|
|
||||||
const bool zoneFlip
|
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Modify vertices or cell of face
|
//- Modify vertices or cell of face
|
||||||
@ -486,9 +460,7 @@ public:
|
|||||||
const label own,
|
const label own,
|
||||||
const label nei,
|
const label nei,
|
||||||
const bool flipFaceFlux,
|
const bool flipFaceFlux,
|
||||||
const label patchID,
|
const label patchID
|
||||||
const label zoneID,
|
|
||||||
const bool zoneFlip
|
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Remove face / merge faces
|
//- Remove face / merge faces
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -244,7 +244,6 @@ void Foam::removeCells::setRefinement
|
|||||||
const faceList& faces = mesh_.faces();
|
const faceList& faces = mesh_.faces();
|
||||||
const labelList& faceOwner = mesh_.faceOwner();
|
const labelList& faceOwner = mesh_.faceOwner();
|
||||||
const labelList& faceNeighbour = mesh_.faceNeighbour();
|
const labelList& faceNeighbour = mesh_.faceNeighbour();
|
||||||
const meshFaceZones& faceZones = mesh_.faceZones();
|
|
||||||
|
|
||||||
// Count starting number of faces using each point. Keep up to date whenever
|
// Count starting number of faces using each point. Keep up to date whenever
|
||||||
// removing a face.
|
// removing a face.
|
||||||
@ -291,21 +290,6 @@ void Foam::removeCells::setRefinement
|
|||||||
|
|
||||||
// nei is remaining cell. Facei becomes external cell
|
// nei is remaining cell. Facei becomes external cell
|
||||||
|
|
||||||
label zoneID = faceZones.whichZone(facei);
|
|
||||||
bool zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = faceZones[zoneID];
|
|
||||||
// Note: we reverse the owner/neighbour of the face
|
|
||||||
// so should also select the other side of the zone
|
|
||||||
zoneFlip = !fZone.flipMap()[fZone.whichFace(facei)];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pout<< "Putting exposed internal face " << facei
|
|
||||||
// << " fc:" << mesh_.faceCentres()[facei]
|
|
||||||
// << " into patch " << newPatchID[facei] << endl;
|
|
||||||
|
|
||||||
meshMod.modifyFace
|
meshMod.modifyFace
|
||||||
(
|
(
|
||||||
f.reverseFace(), // modified face
|
f.reverseFace(), // modified face
|
||||||
@ -313,9 +297,7 @@ void Foam::removeCells::setRefinement
|
|||||||
nei, // owner
|
nei, // owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
true, // face flip
|
true, // face flip
|
||||||
newPatchID[facei], // patch for face
|
newPatchID[facei] // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -334,16 +316,6 @@ void Foam::removeCells::setRefinement
|
|||||||
// << " fc:" << mesh_.faceCentres()[facei]
|
// << " fc:" << mesh_.faceCentres()[facei]
|
||||||
// << " into patch " << newPatchID[facei] << endl;
|
// << " into patch " << newPatchID[facei] << endl;
|
||||||
|
|
||||||
// own is remaining cell. Facei becomes external cell.
|
|
||||||
label zoneID = faceZones.whichZone(facei);
|
|
||||||
bool zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = faceZones[zoneID];
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
|
||||||
}
|
|
||||||
|
|
||||||
meshMod.modifyFace
|
meshMod.modifyFace
|
||||||
(
|
(
|
||||||
f, // modified face
|
f, // modified face
|
||||||
@ -351,9 +323,7 @@ void Foam::removeCells::setRefinement
|
|||||||
own, // owner
|
own, // owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
newPatchID[facei], // patch for face
|
newPatchID[facei] // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -370,19 +340,6 @@ void Foam::removeCells::setRefinement
|
|||||||
{
|
{
|
||||||
if (newPatchID[facei] != -1)
|
if (newPatchID[facei] != -1)
|
||||||
{
|
{
|
||||||
// Pout<< "Putting uncoupled coupled face " << facei
|
|
||||||
// << " fc:" << mesh_.faceCentres()[facei]
|
|
||||||
// << " into patch " << newPatchID[facei] << endl;
|
|
||||||
|
|
||||||
label zoneID = faceZones.whichZone(facei);
|
|
||||||
bool zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = faceZones[zoneID];
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
|
||||||
}
|
|
||||||
|
|
||||||
meshMod.modifyFace
|
meshMod.modifyFace
|
||||||
(
|
(
|
||||||
faces[facei], // modified face
|
faces[facei], // modified face
|
||||||
@ -390,9 +347,7 @@ void Foam::removeCells::setRefinement
|
|||||||
faceOwner[facei], // owner
|
faceOwner[facei], // owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
newPatchID[facei], // patch for face
|
newPatchID[facei] // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if (removedCell[faceOwner[facei]])
|
else if (removedCell[faceOwner[facei]])
|
||||||
|
|||||||
@ -325,10 +325,7 @@ void Foam::removeFaces::mergeFaces
|
|||||||
own = cellRegionMaster[cellRegion[own]];
|
own = cellRegionMaster[cellRegion[own]];
|
||||||
}
|
}
|
||||||
|
|
||||||
label patchID, zoneID, zoneFlip;
|
const label patchID = getPatchIndex(facei);
|
||||||
|
|
||||||
getFaceInfo(facei, patchID, zoneID, zoneFlip);
|
|
||||||
|
|
||||||
label nei = -1;
|
label nei = -1;
|
||||||
|
|
||||||
if (mesh_.isInternalFace(facei))
|
if (mesh_.isInternalFace(facei))
|
||||||
@ -367,17 +364,6 @@ void Foam::removeFaces::mergeFaces
|
|||||||
reverse(mergedFace);
|
reverse(mergedFace);
|
||||||
}
|
}
|
||||||
|
|
||||||
//{
|
|
||||||
// Pout<< "Modifying masterface " << facei
|
|
||||||
// << " from faces:" << faceLabels
|
|
||||||
// << " old verts:" << UIndirectList<face>(mesh_.faces(), faceLabels)
|
|
||||||
// << " for new verts:"
|
|
||||||
// << mergedFace
|
|
||||||
// << " possibly new owner " << own
|
|
||||||
// << " or new nei " << nei
|
|
||||||
// << endl;
|
|
||||||
//}
|
|
||||||
|
|
||||||
modifyFace
|
modifyFace
|
||||||
(
|
(
|
||||||
mergedFace, // modified face
|
mergedFace, // modified face
|
||||||
@ -386,14 +372,10 @@ void Foam::removeFaces::mergeFaces
|
|||||||
nei, // neighbour
|
nei, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchID, // patch for face
|
patchID, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip, // face flip in zone
|
|
||||||
|
|
||||||
meshMod
|
meshMod
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// Remove all but master face.
|
// Remove all but master face.
|
||||||
forAll(faceLabels, patchFacei)
|
forAll(faceLabels, patchFacei)
|
||||||
{
|
{
|
||||||
@ -407,37 +389,19 @@ void Foam::removeFaces::mergeFaces
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Get patch, zone info for facei
|
Foam::label Foam::removeFaces::getPatchIndex(const label facei) const
|
||||||
void Foam::removeFaces::getFaceInfo
|
|
||||||
(
|
|
||||||
const label facei,
|
|
||||||
|
|
||||||
label& patchID,
|
|
||||||
label& zoneID,
|
|
||||||
label& zoneFlip
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
patchID = -1;
|
label patchID = -1;
|
||||||
|
|
||||||
if (!mesh_.isInternalFace(facei))
|
if (!mesh_.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
patchID = mesh_.boundaryMesh().whichPatch(facei);
|
patchID = mesh_.boundaryMesh().whichPatch(facei);
|
||||||
}
|
}
|
||||||
|
|
||||||
zoneID = mesh_.faceZones().whichZone(facei);
|
return patchID;
|
||||||
|
|
||||||
zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = mesh_.faceZones()[zoneID];
|
|
||||||
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Return face with all pointsToRemove removed.
|
|
||||||
Foam::face Foam::removeFaces::filterFace
|
Foam::face Foam::removeFaces::filterFace
|
||||||
(
|
(
|
||||||
const labelHashSet& pointsToRemove,
|
const labelHashSet& pointsToRemove,
|
||||||
@ -466,7 +430,6 @@ Foam::face Foam::removeFaces::filterFace
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Wrapper for meshMod.modifyFace. Reverses face if own>nei.
|
|
||||||
void Foam::removeFaces::modifyFace
|
void Foam::removeFaces::modifyFace
|
||||||
(
|
(
|
||||||
const face& f,
|
const face& f,
|
||||||
@ -475,30 +438,12 @@ void Foam::removeFaces::modifyFace
|
|||||||
const label nei,
|
const label nei,
|
||||||
const bool flipFaceFlux,
|
const bool flipFaceFlux,
|
||||||
const label newPatchID,
|
const label newPatchID,
|
||||||
const bool removeFromZone,
|
|
||||||
const label zoneID,
|
|
||||||
const bool zoneFlip,
|
|
||||||
|
|
||||||
polyTopoChange& meshMod
|
polyTopoChange& meshMod
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
if ((nei == -1) || (own < nei))
|
if ((nei == -1) || (own < nei))
|
||||||
{
|
{
|
||||||
// if (debug)
|
|
||||||
// {
|
|
||||||
// Pout<< "ModifyFace (unreversed) :"
|
|
||||||
// << " facei:" << masterFaceID
|
|
||||||
// << " f:" << f
|
|
||||||
// << " own:" << own
|
|
||||||
// << " nei:" << nei
|
|
||||||
// << " flipFaceFlux:" << flipFaceFlux
|
|
||||||
// << " newPatchID:" << newPatchID
|
|
||||||
// << " removeFromZone:" << removeFromZone
|
|
||||||
// << " zoneID:" << zoneID
|
|
||||||
// << " zoneFlip:" << zoneFlip
|
|
||||||
// << endl;
|
|
||||||
// }
|
|
||||||
|
|
||||||
meshMod.modifyFace
|
meshMod.modifyFace
|
||||||
(
|
(
|
||||||
f, // modified face
|
f, // modified face
|
||||||
@ -506,28 +451,11 @@ void Foam::removeFaces::modifyFace
|
|||||||
own, // owner
|
own, // owner
|
||||||
nei, // neighbour
|
nei, // neighbour
|
||||||
flipFaceFlux, // face flip
|
flipFaceFlux, // face flip
|
||||||
newPatchID, // patch for face
|
newPatchID // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// if (debug)
|
|
||||||
// {
|
|
||||||
// Pout<< "ModifyFace (!reversed) :"
|
|
||||||
// << " facei:" << masterFaceID
|
|
||||||
// << " f:" << f.reverseFace()
|
|
||||||
// << " own:" << nei
|
|
||||||
// << " nei:" << own
|
|
||||||
// << " flipFaceFlux:" << flipFaceFlux
|
|
||||||
// << " newPatchID:" << newPatchID
|
|
||||||
// << " removeFromZone:" << removeFromZone
|
|
||||||
// << " zoneID:" << zoneID
|
|
||||||
// << " zoneFlip:" << zoneFlip
|
|
||||||
// << endl;
|
|
||||||
// }
|
|
||||||
|
|
||||||
meshMod.modifyFace
|
meshMod.modifyFace
|
||||||
(
|
(
|
||||||
f.reverseFace(),// modified face
|
f.reverseFace(),// modified face
|
||||||
@ -535,9 +463,7 @@ void Foam::removeFaces::modifyFace
|
|||||||
nei, // owner
|
nei, // owner
|
||||||
own, // neighbour
|
own, // neighbour
|
||||||
flipFaceFlux, // face flip
|
flipFaceFlux, // face flip
|
||||||
newPatchID, // patch for face
|
newPatchID // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1440,10 +1366,7 @@ void Foam::removeFaces::setRefinement
|
|||||||
own = cellRegionMaster[cellRegion[own]];
|
own = cellRegionMaster[cellRegion[own]];
|
||||||
}
|
}
|
||||||
|
|
||||||
label patchID, zoneID, zoneFlip;
|
const label patchID = getPatchIndex(facei);
|
||||||
|
|
||||||
getFaceInfo(facei, patchID, zoneID, zoneFlip);
|
|
||||||
|
|
||||||
label nei = -1;
|
label nei = -1;
|
||||||
|
|
||||||
if (mesh_.isInternalFace(facei))
|
if (mesh_.isInternalFace(facei))
|
||||||
@ -1456,16 +1379,6 @@ void Foam::removeFaces::setRefinement
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (debug)
|
|
||||||
// {
|
|
||||||
// Pout<< "Modifying " << facei
|
|
||||||
// << " old verts:" << mesh_.faces()[facei]
|
|
||||||
// << " for new verts:" << f
|
|
||||||
// << " or for new owner " << own << " or for new nei "
|
|
||||||
// << nei
|
|
||||||
// << endl;
|
|
||||||
// }
|
|
||||||
|
|
||||||
modifyFace
|
modifyFace
|
||||||
(
|
(
|
||||||
f, // modified face
|
f, // modified face
|
||||||
@ -1474,10 +1387,6 @@ void Foam::removeFaces::setRefinement
|
|||||||
nei, // neighbour
|
nei, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchID, // patch for face
|
patchID, // patch for face
|
||||||
false, // remove from zone
|
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip, // face flip in zone
|
|
||||||
|
|
||||||
meshMod
|
meshMod
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -126,14 +126,8 @@ class removeFaces
|
|||||||
polyTopoChange& meshMod
|
polyTopoChange& meshMod
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Get patch, zone info for facei
|
//- Get patch index
|
||||||
void getFaceInfo
|
label getPatchIndex(const label facei) const;
|
||||||
(
|
|
||||||
const label facei,
|
|
||||||
label& patchID,
|
|
||||||
label& zoneID,
|
|
||||||
label& zoneFlip
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return face with all pointsToRemove removed.
|
//- Return face with all pointsToRemove removed.
|
||||||
face filterFace(const labelHashSet&, const label) const;
|
face filterFace(const labelHashSet&, const label) const;
|
||||||
@ -147,9 +141,6 @@ class removeFaces
|
|||||||
const label nei,
|
const label nei,
|
||||||
const bool flipFaceFlux,
|
const bool flipFaceFlux,
|
||||||
const label newPatchID,
|
const label newPatchID,
|
||||||
const bool removeFromZone,
|
|
||||||
const label zoneID,
|
|
||||||
const bool zoneFlip,
|
|
||||||
|
|
||||||
polyTopoChange& meshMod
|
polyTopoChange& meshMod
|
||||||
) const;
|
) const;
|
||||||
|
|||||||
@ -94,17 +94,6 @@ void Foam::removePoints::modifyFace
|
|||||||
patchi = mesh_.boundaryMesh().whichPatch(facei);
|
patchi = mesh_.boundaryMesh().whichPatch(facei);
|
||||||
}
|
}
|
||||||
|
|
||||||
label zoneID = mesh_.faceZones().whichZone(facei);
|
|
||||||
|
|
||||||
bool zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = mesh_.faceZones()[zoneID];
|
|
||||||
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
|
||||||
}
|
|
||||||
|
|
||||||
meshMod.modifyFace
|
meshMod.modifyFace
|
||||||
(
|
(
|
||||||
newFace, // modified face
|
newFace, // modified face
|
||||||
@ -112,9 +101,7 @@ void Foam::removePoints::modifyFace
|
|||||||
owner, // owner
|
owner, // owner
|
||||||
neighbour, // neighbour
|
neighbour, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchi, // patch for face
|
patchi // patch for face
|
||||||
zoneID, // zone for face
|
|
||||||
zoneFlip // face flip in zone
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -102,17 +102,6 @@ void Foam::repatcher::changePatchID
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const label zoneID = mesh_.faceZones().whichZone(faceID);
|
|
||||||
|
|
||||||
bool zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = mesh_.faceZones()[zoneID];
|
|
||||||
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(faceID)];
|
|
||||||
}
|
|
||||||
|
|
||||||
meshMod().modifyFace
|
meshMod().modifyFace
|
||||||
(
|
(
|
||||||
mesh_.faces()[faceID], // face
|
mesh_.faces()[faceID], // face
|
||||||
@ -120,41 +109,7 @@ void Foam::repatcher::changePatchID
|
|||||||
mesh_.faceOwner()[faceID], // owner
|
mesh_.faceOwner()[faceID], // owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // flip flux
|
false, // flip flux
|
||||||
patchID, // patch ID
|
patchID // patch ID
|
||||||
zoneID, // zone ID
|
|
||||||
zoneFlip // zone flip
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::repatcher::setFaceZone
|
|
||||||
(
|
|
||||||
const label faceID,
|
|
||||||
const label zoneID,
|
|
||||||
const bool zoneFlip
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if (polyTopoChange::debug)
|
|
||||||
{
|
|
||||||
// Check that the request is possible
|
|
||||||
if (faceID > mesh_.faces().size())
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "out of range."
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
meshMod().modifyFace
|
|
||||||
(
|
|
||||||
mesh_.faces()[faceID], // face
|
|
||||||
faceID, // face ID
|
|
||||||
mesh_.faceOwner()[faceID], // owner
|
|
||||||
mesh_.faceNeighbour()[faceID], // neighbour
|
|
||||||
false, // flip flux
|
|
||||||
mesh_.boundaryMesh().whichPatch(faceID), // patch ID
|
|
||||||
zoneID, // zone ID
|
|
||||||
zoneFlip // zone flip
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -188,17 +143,6 @@ void Foam::repatcher::changeAnchorPoint
|
|||||||
|
|
||||||
label patchID = mesh_.boundaryMesh().whichPatch(faceID);
|
label patchID = mesh_.boundaryMesh().whichPatch(faceID);
|
||||||
|
|
||||||
const label zoneID = mesh_.faceZones().whichZone(faceID);
|
|
||||||
|
|
||||||
bool zoneFlip = false;
|
|
||||||
|
|
||||||
if (zoneID >= 0)
|
|
||||||
{
|
|
||||||
const faceZone& fZone = mesh_.faceZones()[zoneID];
|
|
||||||
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(faceID)];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fp == 0)
|
if (fp == 0)
|
||||||
{
|
{
|
||||||
// Do dummy modify to keep patch ordering.
|
// Do dummy modify to keep patch ordering.
|
||||||
@ -209,9 +153,7 @@ void Foam::repatcher::changeAnchorPoint
|
|||||||
mesh_.faceOwner()[faceID], // owner
|
mesh_.faceOwner()[faceID], // owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // flip flux
|
false, // flip flux
|
||||||
patchID, // patch ID
|
patchID // patch ID
|
||||||
zoneID, // zone ID
|
|
||||||
zoneFlip // zone flip
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -239,9 +181,7 @@ void Foam::repatcher::changeAnchorPoint
|
|||||||
mesh_.faceOwner()[faceID], // owner
|
mesh_.faceOwner()[faceID], // owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // flip flux
|
false, // flip flux
|
||||||
patchID, // patch ID
|
patchID // patch ID
|
||||||
zoneID, // zone ID
|
|
||||||
zoneFlip // zone flip
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -95,14 +95,6 @@ public:
|
|||||||
const label patchID
|
const label patchID
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Set zone ID for a face
|
|
||||||
void setFaceZone
|
|
||||||
(
|
|
||||||
const label faceID,
|
|
||||||
const label zoneID,
|
|
||||||
const bool zoneFlip
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Change anchor point (zero'th point of face) for a boundary face.
|
//- Change anchor point (zero'th point of face) for a boundary face.
|
||||||
void changeAnchorPoint
|
void changeAnchorPoint
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user