mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: extrudeMesh: make edge collape optional
This commit is contained in:
@ -238,6 +238,25 @@ int main(int argc, char *argv[])
|
|||||||
dict.lookup("constructFrom")
|
dict.lookup("constructFrom")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Any merging of small edges
|
||||||
|
const scalar mergeTol(dict.lookupOrDefault<scalar>("mergeTol", 1e-4));
|
||||||
|
|
||||||
|
Info<< "Extruding from " << ExtrudeModeNames[mode]
|
||||||
|
<< " using model " << model().type() << endl;
|
||||||
|
if (flipNormals)
|
||||||
|
{
|
||||||
|
Info<< "Flipping normals before extruding" << endl;
|
||||||
|
}
|
||||||
|
if (mergeTol > 0)
|
||||||
|
{
|
||||||
|
Info<< "Collapsing edges < " << mergeTol << " of bounding box" << endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Info<< "Not collapsing any edges after extrusion" << endl;
|
||||||
|
}
|
||||||
|
Info<< endl;
|
||||||
|
|
||||||
|
|
||||||
// Generated mesh (one of either)
|
// Generated mesh (one of either)
|
||||||
autoPtr<fvMesh> meshFromMesh;
|
autoPtr<fvMesh> meshFromMesh;
|
||||||
@ -715,7 +734,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
const boundBox& bb = mesh.bounds();
|
const boundBox& bb = mesh.bounds();
|
||||||
const vector span = bb.span();
|
const vector span = bb.span();
|
||||||
const scalar mergeDim = 1e-4 * bb.minDim();
|
const scalar mergeDim = mergeTol * bb.minDim();
|
||||||
|
|
||||||
Info<< "Mesh bounding box : " << bb << nl
|
Info<< "Mesh bounding box : " << bb << nl
|
||||||
<< " with span : " << span << nl
|
<< " with span : " << span << nl
|
||||||
@ -726,6 +745,7 @@ int main(int argc, char *argv[])
|
|||||||
// Collapse edges
|
// Collapse edges
|
||||||
// ~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
if (mergeDim > 0)
|
||||||
{
|
{
|
||||||
Info<< "Collapsing edges < " << mergeDim << " ..." << nl << endl;
|
Info<< "Collapsing edges < " << mergeDim << " ..." << nl << endl;
|
||||||
|
|
||||||
|
|||||||
@ -88,4 +88,8 @@ sigmaRadialCoeffs
|
|||||||
// degree wedges.
|
// degree wedges.
|
||||||
mergeFaces false; //true;
|
mergeFaces false; //true;
|
||||||
|
|
||||||
|
// Merge small edges. Fraction of bounding box.
|
||||||
|
mergeTol 0;
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -10,12 +10,14 @@ FoamFile
|
|||||||
version 2.0;
|
version 2.0;
|
||||||
format ascii;
|
format ascii;
|
||||||
class dictionary;
|
class dictionary;
|
||||||
object extrudeProperties;
|
object extrudeMeshDict;
|
||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// What to extrude:
|
// What to extrude:
|
||||||
// patch : from patch of another case ('sourceCase')
|
// patch : from patch of another case ('sourceCase')
|
||||||
|
// mesh : as above but with original case included
|
||||||
|
// surface : from externally read surface
|
||||||
|
|
||||||
constructFrom patch;
|
constructFrom patch;
|
||||||
sourceCase "../wingMotion_snappyHexMesh";
|
sourceCase "../wingMotion_snappyHexMesh";
|
||||||
@ -24,7 +26,8 @@ sourcePatches (front);
|
|||||||
// If construct from patch: patch to use for back (can be same as sourcePatch)
|
// If construct from patch: patch to use for back (can be same as sourcePatch)
|
||||||
exposedPatchName back;
|
exposedPatchName back;
|
||||||
|
|
||||||
// Flip surface normals before usage.
|
// Flip surface normals before usage. Valid only for extrude from surface or
|
||||||
|
// patch.
|
||||||
flipNormals false;
|
flipNormals false;
|
||||||
|
|
||||||
//- Linear extrusion in point-normal direction
|
//- Linear extrusion in point-normal direction
|
||||||
@ -41,7 +44,10 @@ linearNormalCoeffs
|
|||||||
|
|
||||||
// Do front and back need to be merged? Usually only makes sense for 360
|
// Do front and back need to be merged? Usually only makes sense for 360
|
||||||
// degree wedges.
|
// degree wedges.
|
||||||
mergeFaces false;
|
mergeFaces false; //true;
|
||||||
|
|
||||||
|
// Merge small edges. Fraction of bounding box.
|
||||||
|
mergeTol 0;
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
Reference in New Issue
Block a user