MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / isFeaturePoint

Function isFeaturePoint

src/meshTools/cellFeatures/cellFeatures.C:414–478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
413
414bool Foam::cellFeatures::isFeaturePoint(const label edge0, const label edge1)
415 const
416{
417 if
418 (
419 (edge0 < 0)
420 || (edge0 >= mesh_.nEdges())
421 || (edge1 < 0)
422 || (edge1 >= mesh_.nEdges())
423 )
424 {
425 FatalErrorInFunction
426 << "Illegal edge labels : edge0:" << edge0 << " edge1:" << edge1
427 << abort(FatalError);
428 }
429
430 const edge& e0 = mesh_.edges()[edge0];
431
432 vector e0Vec = e0.vec(mesh_.points());
433 e0Vec /= mag(e0Vec);
434
435 const edge& e1 = mesh_.edges()[edge1];
436
437 vector e1Vec = e1.vec(mesh_.points());
438 e1Vec /= mag(e1Vec);
439
440 scalar cosAngle;
441
442 if
443 (
444 (e0.start() == e1.end())
445 || (e0.end() == e1.start())
446 )
447 {
448 // Same direction
449 cosAngle = e0Vec & e1Vec;
450 }
451 else if
452 (
453 (e0.start() == e1.start())
454 || (e0.end() == e1.end())
455 )
456 {
457 // back on back
458 cosAngle = - e0Vec & e1Vec;
459 }
460 else
461 {
462 cosAngle = GREAT; // satisfy compiler
463
464 FatalErrorInFunction
465 << "Edges do not share common vertex. e0:" << e0
466 << " e1:" << e1 << abort(FatalError);
467 }
468
469 if (cosAngle < minCos_)
470 {
471 // Angle larger than criterium

Callers 2

cellFeatures.CFile · 0.70
isFeatureVertexFunction · 0.70

Calls 8

abortFunction · 0.50
magClass · 0.50
nEdgesMethod · 0.45
edgesMethod · 0.45
vecMethod · 0.45
pointsMethod · 0.45
startMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected