mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add faceZone::resetAddressing with constant flipMap
- remove unused static variable, use updated hashtable methods
This commit is contained in:
@ -76,100 +76,102 @@ Description
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
label addPointZone(const polyMesh& mesh, const word& name)
|
||||
label addPointZone(polyMesh& mesh, const word& name)
|
||||
{
|
||||
label zoneID = mesh.pointZones().findZoneID(name);
|
||||
pointZoneMesh& zones = mesh.pointZones();
|
||||
label zoneID = zones.findZoneID(name);
|
||||
|
||||
if (zoneID != -1)
|
||||
{
|
||||
Info<< "Reusing existing pointZone "
|
||||
<< mesh.pointZones()[zoneID].name()
|
||||
Info<< "Reusing existing pointZone " << zones[zoneID].name()
|
||||
<< " at index " << zoneID << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
pointZoneMesh& pointZones = const_cast<polyMesh&>(mesh).pointZones();
|
||||
zoneID = pointZones.size();
|
||||
Info<< "Adding pointZone " << name << " at index " << zoneID << endl;
|
||||
|
||||
pointZones.setSize(zoneID+1);
|
||||
pointZones.set
|
||||
(
|
||||
zoneID,
|
||||
new pointZone
|
||||
(
|
||||
name,
|
||||
labelList(0),
|
||||
zoneID,
|
||||
pointZones
|
||||
)
|
||||
);
|
||||
return zoneID;
|
||||
}
|
||||
|
||||
zoneID = zones.size();
|
||||
Info<< "Adding pointZone " << name << " at index " << zoneID << endl;
|
||||
|
||||
zones.setSize(zoneID+1);
|
||||
zones.set
|
||||
(
|
||||
zoneID,
|
||||
new pointZone
|
||||
(
|
||||
name,
|
||||
labelList(0),
|
||||
zoneID,
|
||||
zones
|
||||
)
|
||||
);
|
||||
|
||||
return zoneID;
|
||||
}
|
||||
|
||||
|
||||
label addFaceZone(const polyMesh& mesh, const word& name)
|
||||
label addFaceZone(polyMesh& mesh, const word& name)
|
||||
{
|
||||
label zoneID = mesh.faceZones().findZoneID(name);
|
||||
faceZoneMesh& zones = mesh.faceZones();
|
||||
label zoneID = zones.findZoneID(name);
|
||||
|
||||
if (zoneID != -1)
|
||||
{
|
||||
Info<< "Reusing existing faceZone " << mesh.faceZones()[zoneID].name()
|
||||
Info<< "Reusing existing faceZone " << zones[zoneID].name()
|
||||
<< " at index " << zoneID << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
faceZoneMesh& faceZones = const_cast<polyMesh&>(mesh).faceZones();
|
||||
zoneID = faceZones.size();
|
||||
Info<< "Adding faceZone " << name << " at index " << zoneID << endl;
|
||||
|
||||
faceZones.setSize(zoneID+1);
|
||||
faceZones.set
|
||||
(
|
||||
zoneID,
|
||||
new faceZone
|
||||
(
|
||||
name,
|
||||
labelList(0),
|
||||
boolList(),
|
||||
zoneID,
|
||||
faceZones
|
||||
)
|
||||
);
|
||||
return zoneID;
|
||||
}
|
||||
|
||||
zoneID = zones.size();
|
||||
Info<< "Adding faceZone " << name << " at index " << zoneID << endl;
|
||||
|
||||
zones.setSize(zoneID+1);
|
||||
zones.set
|
||||
(
|
||||
zoneID,
|
||||
new faceZone
|
||||
(
|
||||
name,
|
||||
labelList(0),
|
||||
boolList(),
|
||||
zoneID,
|
||||
zones
|
||||
)
|
||||
);
|
||||
|
||||
return zoneID;
|
||||
}
|
||||
|
||||
|
||||
label addCellZone(const polyMesh& mesh, const word& name)
|
||||
label addCellZone(polyMesh& mesh, const word& name)
|
||||
{
|
||||
label zoneID = mesh.cellZones().findZoneID(name);
|
||||
cellZoneMesh& zones = mesh.cellZones();
|
||||
label zoneID = zones.findZoneID(name);
|
||||
|
||||
if (zoneID != -1)
|
||||
{
|
||||
Info<< "Reusing existing cellZone " << mesh.cellZones()[zoneID].name()
|
||||
Info<< "Reusing existing cellZone " << zones[zoneID].name()
|
||||
<< " at index " << zoneID << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
cellZoneMesh& cellZones = const_cast<polyMesh&>(mesh).cellZones();
|
||||
zoneID = cellZones.size();
|
||||
Info<< "Adding cellZone " << name << " at index " << zoneID << endl;
|
||||
|
||||
cellZones.setSize(zoneID+1);
|
||||
cellZones.set
|
||||
(
|
||||
zoneID,
|
||||
new cellZone
|
||||
(
|
||||
name,
|
||||
labelList(0),
|
||||
zoneID,
|
||||
cellZones
|
||||
)
|
||||
);
|
||||
return zoneID;
|
||||
}
|
||||
|
||||
zoneID = zones.size();
|
||||
Info<< "Adding cellZone " << name << " at index " << zoneID << endl;
|
||||
|
||||
zones.setSize(zoneID+1);
|
||||
zones.set
|
||||
(
|
||||
zoneID,
|
||||
new cellZone
|
||||
(
|
||||
name,
|
||||
labelList(0),
|
||||
zoneID,
|
||||
zones
|
||||
)
|
||||
);
|
||||
|
||||
return zoneID;
|
||||
}
|
||||
|
||||
@ -340,13 +342,9 @@ int main(int argc, char *argv[])
|
||||
if (perfectCover)
|
||||
{
|
||||
// Add empty zone for resulting internal faces
|
||||
label cutZoneID = addFaceZone(mesh, cutZoneName);
|
||||
const label cutZoneID = addFaceZone(mesh, cutZoneName);
|
||||
|
||||
mesh.faceZones()[cutZoneID].resetAddressing
|
||||
(
|
||||
isf,
|
||||
boolList(masterPatch.size(), false)
|
||||
);
|
||||
mesh.faceZones()[cutZoneID].resetAddressing(isf.xfer(), false);
|
||||
|
||||
// Add the perfect interface mesh modifier
|
||||
stitcher.set
|
||||
@ -370,11 +368,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
label masterZoneID = addFaceZone(mesh, mergePatchName + "MasterZone");
|
||||
|
||||
mesh.faceZones()[masterZoneID].resetAddressing
|
||||
(
|
||||
isf,
|
||||
boolList(masterPatch.size(), false)
|
||||
);
|
||||
mesh.faceZones()[masterZoneID].resetAddressing(isf.xfer(), false);
|
||||
|
||||
// Slave patch
|
||||
const polyPatch& slavePatch = mesh.boundaryMesh()[slavePatchName];
|
||||
@ -387,19 +381,11 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
label slaveZoneID = addFaceZone(mesh, mergePatchName + "SlaveZone");
|
||||
mesh.faceZones()[slaveZoneID].resetAddressing
|
||||
(
|
||||
osf,
|
||||
boolList(slavePatch.size(), false)
|
||||
);
|
||||
mesh.faceZones()[slaveZoneID].resetAddressing(osf.xfer(), false);
|
||||
|
||||
// Add empty zone for cut faces
|
||||
label cutZoneID = addFaceZone(mesh, cutZoneName);
|
||||
mesh.faceZones()[cutZoneID].resetAddressing
|
||||
(
|
||||
labelList(0),
|
||||
boolList(0, false)
|
||||
);
|
||||
const label cutZoneID = addFaceZone(mesh, cutZoneName);
|
||||
mesh.faceZones()[cutZoneID].resetAddressing(labelList(0), false);
|
||||
|
||||
|
||||
// Add the sliding interface mesh modifier
|
||||
|
||||
Reference in New Issue
Block a user