mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: simplify mapped patch cloning in extrudeToRegionMesh
This commit is contained in:
@ -1126,7 +1126,7 @@ void setCouplingInfo
|
|||||||
|
|
||||||
forAll(zoneToPatch, zoneI)
|
forAll(zoneToPatch, zoneI)
|
||||||
{
|
{
|
||||||
label patchi = zoneToPatch[zoneI];
|
const label patchi = zoneToPatch[zoneI];
|
||||||
|
|
||||||
if (patchi != -1)
|
if (patchi != -1)
|
||||||
{
|
{
|
||||||
@ -1139,16 +1139,8 @@ void setCouplingInfo
|
|||||||
const scalar mergeSqrDist =
|
const scalar mergeSqrDist =
|
||||||
gMax(magSqr(offsets[zoneI]-avgOffset));
|
gMax(magSqr(offsets[zoneI]-avgOffset));
|
||||||
|
|
||||||
// Verify uniformity of offset
|
// Create with uniform offset initially
|
||||||
// (same check as blockMesh geom merge)
|
auto mappedPtr = autoPtr<mappedWallPolyPatch>::New
|
||||||
if (mergeSqrDist < magSqr(10*SMALL*bb.span()))
|
|
||||||
{
|
|
||||||
Info<< "Adding on " << mesh.name()
|
|
||||||
<< " coupling patch " << pp.name()
|
|
||||||
<< " with uniform offset " << avgOffset << endl;
|
|
||||||
|
|
||||||
// Uniform offset
|
|
||||||
newPatches[patchi] = new mappedWallPolyPatch
|
|
||||||
(
|
(
|
||||||
pp.name(),
|
pp.name(),
|
||||||
pp.size(),
|
pp.size(),
|
||||||
@ -1161,28 +1153,24 @@ void setCouplingInfo
|
|||||||
avgOffset, // uniform offset
|
avgOffset, // uniform offset
|
||||||
patches
|
patches
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Info<< "Adding on " << mesh.name() << " coupling patch "
|
||||||
|
<< pp.name() << " with ";
|
||||||
|
|
||||||
|
// Verify uniformity of offset
|
||||||
|
// (same check as blockMesh geom merge)
|
||||||
|
if (mergeSqrDist < magSqr(10*SMALL*bb.span()))
|
||||||
|
{
|
||||||
|
Info<< "uniform offset " << avgOffset << endl;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Info<< "Adding on " << mesh.name()
|
Info<< "non-uniform offset" << endl;
|
||||||
<< " coupling patch " << pp.name()
|
|
||||||
<< " with non-uniform offset" << endl;
|
|
||||||
|
|
||||||
// Uniform offset
|
(*mappedPtr).setOffset(offsets[zoneI]);
|
||||||
newPatches[patchi] = new mappedWallPolyPatch
|
|
||||||
(
|
|
||||||
pp.name(),
|
|
||||||
pp.size(),
|
|
||||||
pp.start(),
|
|
||||||
patchi,
|
|
||||||
sampleRegion, // sampleRegion
|
|
||||||
mode, // sampleMode
|
|
||||||
pp.name(), // samplePatch
|
|
||||||
|
|
||||||
offsets[zoneI], // non-uniform offsets
|
|
||||||
patches
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
newPatches[patchi] = mappedPtr.release();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user