mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: make coeffs dictionaries optional for surfaceFeatureExtract
This commit is contained in:
@ -1,11 +1,7 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/surfMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/edgeMesh/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude
|
||||||
-I$(LIB_SRC)/triSurface/lnInclude \
|
|
||||||
-I$(LIB_SRC)/surfMesh/lnInclude
|
|
||||||
|
|
||||||
LIB_LIBS = \
|
LIB_LIBS = \
|
||||||
-lmeshTools \
|
-lmeshTools
|
||||||
-ledgeMesh \
|
|
||||||
-ltriSurface
|
|
||||||
|
|||||||
@ -53,7 +53,8 @@ Foam::surfaceFeaturesExtraction::extractFromFile::extractFromFile
|
|||||||
:
|
:
|
||||||
method()
|
method()
|
||||||
{
|
{
|
||||||
const dictionary& coeffDict = dict.subDict("extractFromFileCoeffs");
|
const dictionary& coeffDict =
|
||||||
|
dict.optionalSubDict("extractFromFileCoeffs");
|
||||||
|
|
||||||
coeffDict.lookup("featureEdgeFile") >> featureEdgeFile_;
|
coeffDict.lookup("featureEdgeFile") >> featureEdgeFile_;
|
||||||
coeffDict.readIfPresent("geometricTestOnly", geometricTestOnly_);
|
coeffDict.readIfPresent("geometricTestOnly", geometricTestOnly_);
|
||||||
|
|||||||
@ -27,8 +27,11 @@ Class
|
|||||||
Description
|
Description
|
||||||
Run-time selectable surface feature extraction.
|
Run-time selectable surface feature extraction.
|
||||||
|
|
||||||
|
Mandatory dictionary entries: "featureEdgeFile".
|
||||||
|
Optional dictionary entries: "geometricTestOnly".
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
extractionMethod.C
|
extractFromFile.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -36,8 +39,6 @@ SourceFiles
|
|||||||
#define surfaceFeaturesExtraction_extractFromFile_H
|
#define surfaceFeaturesExtraction_extractFromFile_H
|
||||||
|
|
||||||
#include "surfaceFeaturesExtraction.H"
|
#include "surfaceFeaturesExtraction.H"
|
||||||
#include "dictionary.H"
|
|
||||||
#include "Switch.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -52,7 +52,7 @@ Foam::surfaceFeaturesExtraction::extractFromNone::extractFromNone
|
|||||||
:
|
:
|
||||||
method()
|
method()
|
||||||
{
|
{
|
||||||
const dictionary& coeffDict = dict.subOrEmptyDict("extractFromNoneCoeffs");
|
const dictionary& coeffDict = dict.optionalSubDict("noneCoeffs");
|
||||||
|
|
||||||
coeffDict.readIfPresent("includedAngle", includedAngle_);
|
coeffDict.readIfPresent("includedAngle", includedAngle_);
|
||||||
coeffDict.readIfPresent("geometricTestOnly", geometricTestOnly_);
|
coeffDict.readIfPresent("geometricTestOnly", geometricTestOnly_);
|
||||||
|
|||||||
@ -25,10 +25,13 @@ Class
|
|||||||
Foam::surfaceFeaturesExtraction::extractFromNone
|
Foam::surfaceFeaturesExtraction::extractFromNone
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Run-time selectable surface feature extraction.
|
Run-time selectable surface feature extraction - no extraction.
|
||||||
|
Primarily useful with self-intersection methods.
|
||||||
|
|
||||||
|
Optional dictionary entries: "includedAngle", "geometricTestOnly".
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
extractionMethod.C
|
extractFromNone.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -36,10 +39,6 @@ SourceFiles
|
|||||||
#define surfaceFeaturesExtraction_extractFromNone_H
|
#define surfaceFeaturesExtraction_extractFromNone_H
|
||||||
|
|
||||||
#include "surfaceFeaturesExtraction.H"
|
#include "surfaceFeaturesExtraction.H"
|
||||||
#include "dictionary.H"
|
|
||||||
#include "Switch.H"
|
|
||||||
#include "triSurface.H"
|
|
||||||
#include "edgeIntersections.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -52,7 +52,8 @@ Foam::surfaceFeaturesExtraction::extractFromSurface::extractFromSurface
|
|||||||
:
|
:
|
||||||
method()
|
method()
|
||||||
{
|
{
|
||||||
const dictionary& coeffDict = dict.subDict("extractFromSurfaceCoeffs");
|
const dictionary& coeffDict =
|
||||||
|
dict.optionalSubDict("extractFromSurfaceCoeffs");
|
||||||
|
|
||||||
coeffDict.lookup("includedAngle") >> includedAngle_;
|
coeffDict.lookup("includedAngle") >> includedAngle_;
|
||||||
coeffDict.readIfPresent("geometricTestOnly", geometricTestOnly_);
|
coeffDict.readIfPresent("geometricTestOnly", geometricTestOnly_);
|
||||||
|
|||||||
@ -25,10 +25,13 @@ Class
|
|||||||
Foam::surfaceFeaturesExtraction::extractFromSurface
|
Foam::surfaceFeaturesExtraction::extractFromSurface
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Run-time selectable surface feature extraction.
|
Run-time selectable surface feature extraction - extract from surface.
|
||||||
|
|
||||||
|
Mandatory dictionary entries: "includedAngle".
|
||||||
|
Optional dictionary entries: "geometricTestOnly".
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
extractionMethod.C
|
extractFromSurface.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -36,10 +39,6 @@ SourceFiles
|
|||||||
#define surfaceFeaturesExtraction_extractFromSurface_H
|
#define surfaceFeaturesExtraction_extractFromSurface_H
|
||||||
|
|
||||||
#include "surfaceFeaturesExtraction.H"
|
#include "surfaceFeaturesExtraction.H"
|
||||||
#include "dictionary.H"
|
|
||||||
#include "Switch.H"
|
|
||||||
#include "triSurface.H"
|
|
||||||
#include "edgeIntersections.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -19,17 +19,22 @@ surface1.stl
|
|||||||
// How to obtain raw features (extractFromFile | extractFromSurface | none)
|
// How to obtain raw features (extractFromFile | extractFromSurface | none)
|
||||||
extractionMethod extractFromSurface;
|
extractionMethod extractFromSurface;
|
||||||
|
|
||||||
|
// Mark edges whose adjacent surface normals are at an angle less
|
||||||
|
// than includedAngle as features
|
||||||
|
// - 0 : selects no edges
|
||||||
|
// - 180: selects all edges
|
||||||
|
includedAngle 120;
|
||||||
|
|
||||||
|
// Do not mark region edges
|
||||||
|
geometricTestOnly yes;
|
||||||
|
|
||||||
|
/* alternative specification as coeff dictionary
|
||||||
extractFromSurfaceCoeffs
|
extractFromSurfaceCoeffs
|
||||||
{
|
{
|
||||||
// Mark edges whose adjacent surface normals are at an angle less
|
|
||||||
// than includedAngle as features
|
|
||||||
// - 0 : selects no edges
|
|
||||||
// - 180: selects all edges
|
|
||||||
includedAngle 120;
|
includedAngle 120;
|
||||||
|
|
||||||
// Do not mark region edges
|
|
||||||
geometricTestOnly yes;
|
geometricTestOnly yes;
|
||||||
}
|
} */
|
||||||
|
|
||||||
// Generate additional features from self-intersect
|
// Generate additional features from self-intersect
|
||||||
selfIntersection false;
|
selfIntersection false;
|
||||||
@ -69,27 +74,27 @@ surface2.nas
|
|||||||
// Use a plane to select feature edges
|
// Use a plane to select feature edges
|
||||||
// (normal)(basePoint)
|
// (normal)(basePoint)
|
||||||
// Keep only edges that intersect the plane will be included
|
// Keep only edges that intersect the plane will be included
|
||||||
plane (1 0 0)(0 0 0);
|
plane (1 0 0)(0 0 0);
|
||||||
|
|
||||||
// Select feature edges using a box
|
// Select feature edges using a box
|
||||||
// (minPt)(maxPt)
|
// (minPt)(maxPt)
|
||||||
// Keep edges inside the box:
|
// Keep edges inside the box:
|
||||||
insideBox (0 0 0)(1 1 1);
|
insideBox (0 0 0)(1 1 1);
|
||||||
// Keep edges outside the box:
|
// Keep edges outside the box:
|
||||||
outsideBox (0 0 0)(1 1 1);
|
outsideBox (0 0 0)(1 1 1);
|
||||||
|
|
||||||
// Keep nonManifold edges (edges with >2 connected faces where
|
// Keep nonManifold edges (edges with >2 connected faces where
|
||||||
// the faces form more than two different normal planes)
|
// the faces form more than two different normal planes)
|
||||||
nonManifoldEdges yes;
|
nonManifoldEdges yes;
|
||||||
|
|
||||||
// Keep open edges (edges with 1 connected face)
|
// Keep open edges (edges with 1 connected face)
|
||||||
openEdges yes;
|
openEdges yes;
|
||||||
}
|
}
|
||||||
|
|
||||||
addFeatures
|
addFeatures
|
||||||
{
|
{
|
||||||
// Add (without merging) another extendedFeatureEdgeMesh
|
// Add (without merging) another extendedFeatureEdgeMesh
|
||||||
name axZ.extendedFeatureEdgeMesh;
|
name axZ.extendedFeatureEdgeMesh;
|
||||||
|
|
||||||
// Optionally flip features (invert all normals, making
|
// Optionally flip features (invert all normals, making
|
||||||
// convex<->concave etc)
|
// convex<->concave etc)
|
||||||
@ -149,19 +154,10 @@ dummyName
|
|||||||
// Tolerance for surface intersections
|
// Tolerance for surface intersections
|
||||||
tolerance 1e-3;
|
tolerance 1e-3;
|
||||||
|
|
||||||
extractFromSurfaceCoeffs
|
includedAngle 120;
|
||||||
{
|
|
||||||
includedAngle 120;
|
|
||||||
|
|
||||||
// Do not mark region edges
|
// Do not mark region edges
|
||||||
geometricTestOnly yes;
|
geometricTestOnly yes;
|
||||||
}
|
|
||||||
|
|
||||||
extractFromNoneCoeffs
|
|
||||||
{
|
|
||||||
includedAngle 120;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write options
|
// Write options
|
||||||
|
|
||||||
@ -180,7 +176,7 @@ dummyName
|
|||||||
//
|
//
|
||||||
surfaces
|
surfaces
|
||||||
{
|
{
|
||||||
extractionMethod extractFromNone;
|
extractionMethod none;
|
||||||
|
|
||||||
surfaces (surface1.stl surface2.nas);
|
surfaces (surface1.stl surface2.nas);
|
||||||
|
|
||||||
@ -193,10 +189,12 @@ surfaces
|
|||||||
// Tolerance for surface intersections
|
// Tolerance for surface intersections
|
||||||
tolerance 1e-3;
|
tolerance 1e-3;
|
||||||
|
|
||||||
extractFromNoneCoeffs
|
/* alternative specification as coeff dictionary
|
||||||
|
noneCoeffs
|
||||||
{
|
{
|
||||||
includedAngle 0;
|
includedAngle 0;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// Write options
|
// Write options
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user