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

Function cutEdge

src/dynamicMesh/meshCut/cellLooper/geomCellLooper.C:80–106  ·  view source on GitHub ↗

Cut edge with plane. Return true and set weight to fraction between edge-start and edge-end

Source from the content-addressed store, hash-verified

78// Cut edge with plane. Return true and set weight to fraction between
79// edge-start and edge-end
80bool Foam::geomCellLooper::cutEdge
81(
82 const plane& cutPlane,
83 const label edgeI,
84 scalar& weight
85) const
86{
87 const pointField& pts = mesh().points();
88
89 const edge& e = mesh().edges()[edgeI];
90
91 scalar s = cutPlane.normalIntersect(pts[e.start()], e.vec(pts));
92
93 if ((s > -pointEqualTol_) && (s < 1 + pointEqualTol_))
94 {
95 weight = s;
96
97 return true;
98 }
99 else
100 {
101 // Make sure we don't use this value
102 weight = -GREAT;
103
104 return false;
105 }
106}
107
108
109// If edge close enough to endpoint snap to endpoint.

Callers 2

cutFunction · 0.85
triSurfaceTools.CFile · 0.85

Calls 6

meshFunction · 0.85
normalIntersectMethod · 0.80
pointsMethod · 0.45
edgesMethod · 0.45
startMethod · 0.45
vecMethod · 0.45

Tested by

no test coverage detected