surface patch handling improvements

This commit is contained in:
mattijs
2009-08-17 22:04:14 +01:00
parent 47066c7e51
commit 064892f3f8
3 changed files with 18 additions and 21 deletions

View File

@ -158,45 +158,33 @@ int main(int argc, char *argv[])
label trianglei = 0;
label maxRegion1 = labelMin;
// Copy triangles1 into trianglesAll
// Determine max region.
forAll(surface1, faceI)
{
facesAll[trianglei] = surface1[faceI];
maxRegion1 = max(maxRegion1, facesAll[trianglei].region());
trianglei++;
facesAll[trianglei++] = surface1[faceI];
}
label nRegions1 = surface1.patches().size();
label nRegions1 = maxRegion1 + 1;
if (!mergeRegions)
{
Info<< "Surface " << inFileName1 << " has " << nRegions1 << " regions"
Info<< "Surface " << inFileName1 << " has " << nRegions1
<< " regions"
<< nl
<< "All region numbers in " << inFileName2 << " will be offset"
<< " by this amount" << nl << endl;
}
// Add (renumbered) surface2 triangles
label maxRegion2 = labelMin;
forAll(surface2, faceI)
{
const labelledTri& tri = surface2[faceI];
labelledTri& destTri = facesAll[trianglei++];
destTri[0] = tri[0] + points1.size();
destTri[1] = tri[1] + points1.size();
destTri[2] = tri[2] + points1.size();
maxRegion2 = max(maxRegion2, tri.region());
if (mergeRegions)
{
destTri.region() = tri.region();
@ -207,7 +195,7 @@ int main(int argc, char *argv[])
}
}
label nRegions2 = maxRegion2 + 1;
label nRegions2 = surface2.patches().size();
geometricSurfacePatchList newPatches;
@ -218,11 +206,11 @@ int main(int argc, char *argv[])
forAll(surface1.patches(), patchI)
{
newPatches[patchI] = surface1.patches()[ patchI];
newPatches[patchI] = surface1.patches()[patchI];
}
forAll(surface2.patches(), patchI)
{
newPatches[patchI] = surface2.patches()[ patchI];
newPatches[patchI] = surface2.patches()[patchI];
}
}
else
@ -244,12 +232,12 @@ int main(int argc, char *argv[])
forAll(surface1.patches(), patchI)
{
newPatches[newPatchI++] = surface1.patches()[ patchI];
newPatches[newPatchI++] = surface1.patches()[patchI];
}
forAll(surface2.patches(), patchI)
{
newPatches[newPatchI++] = surface2.patches()[ patchI];
newPatches[newPatchI++] = surface2.patches()[patchI];
}
}