34template<
class Po
int,
class Po
intRef>
35template<
class AboveOp,
class BelowOp>
45 FixedList<scalar, 3> d;
53 d[i] = pln.signedDistance(tri[i]);
76 label i1 = d.fcIndex(i0);
77 label i2 = d.fcIndex(i1);
80 point p01 = planeIntersection(d, tri, i0, i1);
81 point p02 = planeIntersection(d, tri, i0, i2);
83 aboveOp(triPoints(tri[i1], tri[i2], p02));
84 aboveOp(triPoints(tri[i1], p02, p01));
85 belowOp(triPoints(tri[i0], p01, p02));
93 label i1 = d.fcIndex(i0);
94 label i2 = d.fcIndex(i1);
97 point p01 = planeIntersection(d, tri, i0, i1);
98 point p02 = planeIntersection(d, tri, i0, i2);
100 belowOp(triPoints(tri[i1], tri[i2], p02));
101 belowOp(triPoints(tri[i1], p02, p01));
102 aboveOp(triPoints(tri[i0], p01, p02));
112template<
class Po
int,
class Po
intRef>
113template<
class AboveOp,
class BelowOp>
121 triSliceWithPlane(pl,
triPoints(a_, b_, c_), aboveOp, belowOp);
125template<
class Po
int,
class Po
intRef>
126template<
class Ins
ideOp,
class Outs
ideOp>
144 storeOp insideOpA(insideTrisA, nInsideA);
148 storeOp outsideOpA(outsideTrisA, nOutsideA);
158 const plane pl0(tgt.
a(), tgt.
b(), tgt.
b() +
s*
n);
159 triSliceWithPlane(pl0, thisTri, insideOpA, outsideOpA);
164 if (insideOpA.
nTris_ == 0)
170 if (outsideOpA.
nTris_ == 0)
182 storeOp insideOpB(insideTrisB, nInsideB);
190 const plane pl0(tgt.
b(), tgt.
c(), tgt.
c() +
s*
n);
192 for (label i = 0; i < insideOpA.
nTris_; i++)
195 triSliceWithPlane(pl0, tri, insideOpB, outsideOpA);
212 const plane pl0(tgt.
c(), tgt.
a(), tgt.
a() +
s*
n);
216 for (label i = 0; i < insideOpB.
nTris_; i++)
219 triSliceWithPlane(pl0, tri, insideOpA, outsideOpA);
232 for (label i = 0; i < insideOpA.
nTris_; i++)
234 insideOp(insideOpA.
tris_[i]);
237 for (label i = 0; i < outsideOpA.
nTris_; i++)
239 outsideOp(outsideOpA.
tris_[i]);
A 1D vector of objects of type <T> with a fixed length <N>.
Geometric class that creates a 3D plane and can return the intersection point between a line and the ...
Triangle storage. Null constructable (unfortunately triangle<point, point> is not)
triIntersectionList & tris_
A triangle primitive used to calculate face normals and swept volumes.
void sliceWithPlane(const plane &pln, AboveOp &aboveOp, BelowOp &belowOp) const
Decompose triangle into triangles above and below plane.
const Point & a() const
Return first vertex.
void triangleOverlap(const vector &n, const triangle< Point, PointRef > &tri, InsideOp &insideOp, OutsideOp &outsideOp) const
Decompose triangle into triangles inside and outside.
const Point & c() const
Return third vertex.
const Point & b() const
Return second vertex.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
vector point
Point is a vector.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
#define forAll(list, i)
Loop across all elements in list.