ENH: splitMeshRegions: -overwrite and -insidePoint/-largestOnly will overwrite starting mesh

This commit is contained in:
mattijs
2011-07-28 22:21:35 +01:00
parent d7429428a2
commit 5fa1338e0e

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -55,7 +55,6 @@ Description
this if you don't mind having disconnected domains in a single region. this if you don't mind having disconnected domains in a single region.
This option requires all cells to be in one (and one only) cellZone. This option requires all cells to be in one (and one only) cellZone.
- Should work in parallel. - Should work in parallel.
cellZones can differ on either side of processor boundaries in which case cellZones can differ on either side of processor boundaries in which case
the faces get moved from processor patch to directMapped patch. Not the faces get moved from processor patch to directMapped patch. Not
@ -66,6 +65,13 @@ Description
region that covers more than 50% of the zone. It has to be a subset region that covers more than 50% of the zone. It has to be a subset
so cannot have any cells in any other zone. so cannot have any cells in any other zone.
- If explicitly a single region has been selected (-largestOnly or
-insidePoint) its region name will be either
- name of a cellZone it matches to or
- "largestOnly" respectively "insidePoint" or
- polyMesh::defaultRegion if additionally -overwrite
(so it will overwrite the input mesh!)
- writes maps like decomposePar back to original mesh: - writes maps like decomposePar back to original mesh:
- pointRegionAddressing : for every point in this region the point in - pointRegionAddressing : for every point in this region the point in
the original mesh the original mesh
@ -1866,6 +1872,29 @@ int main(int argc, char *argv[])
regionNames, regionNames,
zoneToRegion zoneToRegion
); );
// Override any default region names if single region selected
if (largestOnly || insidePoint)
{
forAll(regionToZone, regionI)
{
if (regionToZone[regionI] == -1)
{
if (overwrite)
{
regionNames[regionI] = polyMesh::defaultRegion;
}
else if (insidePoint)
{
regionNames[regionI] = "insidePoint";
}
else if (largestOnly)
{
regionNames[regionI] = "largestOnly";
}
}
}
}
} }
Info<< endl << "Number of regions:" << nCellRegions << nl << endl; Info<< endl << "Number of regions:" << nCellRegions << nl << endl;
@ -2173,7 +2202,8 @@ int main(int argc, char *argv[])
Info<< nl Info<< nl
<< "Subsetting region " << regionI << "Subsetting region " << regionI
<< " of size " << regionSizes[regionI] << endl; << " of size " << regionSizes[regionI]
<< " as named region " << regionNames[regionI] << endl;
createAndWriteRegion createAndWriteRegion
( (