mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: improved handling of 'unresolved' surface intersections (issue #450)
- the heuristic for matching unresolved intersections is a relatively simple matching scheme that seems to be more robust than attempting to walk the geometry or the cuts. - avoid false positives for self intersection
This commit is contained in:
@ -73,7 +73,7 @@ Foam::surfaceFeaturesExtraction::method::New
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(methodName);
|
||||
|
||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
FatalIOErrorInFunction
|
||||
(
|
||||
|
||||
@ -84,6 +84,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAllConstIter(dictionary, dict, iter)
|
||||
{
|
||||
const word& dictName = iter().keyword();
|
||||
|
||||
if (!iter().isDict())
|
||||
{
|
||||
continue;
|
||||
@ -106,7 +108,7 @@ int main(int argc, char *argv[])
|
||||
const word outputName =
|
||||
fileName
|
||||
(
|
||||
surfaceDict.lookupOrDefault<word>("output", iter().keyword())
|
||||
surfaceDict.lookupOrDefault<word>("output", dictName)
|
||||
).lessExt();
|
||||
|
||||
// The "surfaces" entry is normally optional, but if the sub-dictionary
|
||||
@ -115,7 +117,7 @@ int main(int argc, char *argv[])
|
||||
// additional switch.
|
||||
if
|
||||
(
|
||||
iter().keyword() == "surfaces" // mandatory
|
||||
dictName == "surfaces" // mandatory
|
||||
|| surfaceDict.found("surfaces") // or optional
|
||||
)
|
||||
{
|
||||
@ -123,14 +125,14 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
loader.select(iter().keyword());
|
||||
loader.select(dictName);
|
||||
}
|
||||
|
||||
if (loader.selected().empty())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "No surfaces specified/found for entry: "
|
||||
<< iter().keyword() << exit(FatalError);
|
||||
<< dictName << exit(FatalError);
|
||||
}
|
||||
// DebugVar(loader.available());
|
||||
// DebugVar(outputName);
|
||||
@ -153,7 +155,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Problem loading surface(s) for entry: "
|
||||
<< iter().keyword() << exit(FatalError);
|
||||
<< dictName << exit(FatalError);
|
||||
}
|
||||
|
||||
triSurface surf = surfPtr();
|
||||
|
||||
@ -134,7 +134,7 @@ surface2.nas
|
||||
// - If other dictionaries contain a 'surfaces' entry,
|
||||
// it will be taken for the input.
|
||||
//
|
||||
surfaces
|
||||
dummyName
|
||||
{
|
||||
extractionMethod extractFromSurface;
|
||||
|
||||
@ -169,4 +169,39 @@ surfaces
|
||||
writeObj yes;
|
||||
}
|
||||
|
||||
|
||||
// Handle single or multiple surfaces
|
||||
//
|
||||
// - If the dictionary is named 'surfaces', it must also contain a 'surfaces'
|
||||
// entry (wordRe list).
|
||||
//
|
||||
// - If other dictionaries contain a 'surfaces' entry,
|
||||
// it will be taken for the input.
|
||||
//
|
||||
surfaces
|
||||
{
|
||||
extractionMethod extractFromNone;
|
||||
|
||||
surfaces (surface1.stl surface2.nas);
|
||||
|
||||
// Base output name (optional)
|
||||
// output surfaces;
|
||||
|
||||
// Generate additional features from self-intersect
|
||||
selfIntersection true;
|
||||
|
||||
// Tolerance for surface intersections
|
||||
tolerance 1e-3;
|
||||
|
||||
extractFromNoneCoeffs
|
||||
{
|
||||
includedAngle 0;
|
||||
}
|
||||
|
||||
// Write options
|
||||
|
||||
// Write features to obj format for postprocessing
|
||||
writeObj yes;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
Reference in New Issue
Block a user