Go to the documentation of this file.
52 template<
class ListType>
53 inline bool isnan(
const ListType& l)
62 template<
class ListType>
66 if( (l[i] < -VGREAT) || (l[i] > VGREAT) )
72 template<
class Face1,
class Face2>
87 if( f2[pJ] ==
f1[pI] )
97 triNei[1] = f2[f2.fcIndex(
pos)];
98 triNei[2] = f2[f2.rcIndex(
pos)];
101 triOwn[1] =
f1[
f1.fcIndex(pI)];
102 triOwn[2] =
f1[
f1.rcIndex(pI)];
130 template<
class Face1,
class Face2>
148 if( f2[pJ] ==
f1[pI] )
158 triNei[1] = f2[f2.fcIndex(
pos)];
159 triNei[2] = f2[f2.rcIndex(
pos)];
162 triOwn[1] =
f1[
f1.fcIndex(pI)];
163 triOwn[2] =
f1[
f1.rcIndex(pI)];
189 nOwn /= (
mag(nOwn) + VSMALL);
196 nNei /= (
mag(nNei) + VSMALL);
222 "scalar angleBetweenFaces"
223 "(const pointField&, const face&, const face&)"
224 ) <<
"Faces " <<
f1 <<
" and " << f2
228 return angle / counter;
241 if( pfcs[faceI].size() > 2 )
277 currentlyMerged[nI] = currentlyMerged[nJ] =
true;
278 mergedFaces[counter++] =
293 if( !currentlyMerged[pfI] )
316 if(
mag(pv & v) > (1.0-SMALL) )
328 if(
mag(d) > VSMALL )
331 if(
mag(d &
n) < SMALL )
345 const vector v = end - start;
350 if( (
n & (v/
mag(v))) < SMALL )
353 const scalar t((
n & (fp - start)) / (
n & v));
355 if( (t > -SMALL) && (t < (1.0+SMALL)) )
370 const vector v0 = tet.
a() - tet.
d();
371 const vector v1 = tet.
b() - tet.
d();
372 const vector v2 = tet.
c() - tet.
d();
377 for(
label i=0;i<3;++i)
394 if( (
u0 < -SMALL) || (
u0 > (1.0+SMALL)) )
399 if( (u1 < -SMALL) || ((
u0+u1) > (1.0+SMALL)) )
404 if( (u2 < -SMALL) || (u2 > (1.0+SMALL)) )
408 const scalar u3 = 1.0 -
u0 - u1 - u2;
410 if( (u3 < -SMALL) || (u3 > (1.0+SMALL)) )
418 const point& edgePoint0,
419 const point& edgePoint1,
422 point& nearestOnEdge,
426 const vector v = lp1 - lp0;
427 const vector d = lp0 - edgePoint0;
428 const vector e = edgePoint1 - edgePoint0;
430 const scalar vMag =
mag(v);
434 const scalar eMag =
mag(
e);
437 nearestOnEdge = edgePoint0;
442 if(
mag((v/vMag) & (
e/eMag)) > (1.0 - SMALL) )
447 mat.
xy() = mat.
yx() = -1.0 * (v&
e);
452 source[0] = -1.0 * (d&v);
457 nearestOnLine = lp0 + v * sol[0];
460 nearestOnEdge = edgePoint1;
462 else if( sol[1] < 0.0 )
464 nearestOnEdge = edgePoint0;
468 nearestOnEdge = edgePoint0 +
e * sol[1];
480 const vector v0 = tri.
b() - tri.
a();
481 const vector v1 = tri.
c() - tri.
a();
484 const scalar dot00 = (v0 & v0);
485 const scalar dot01 = (v0 & v1);
486 const scalar dot02 = (v0 & v2);
487 const scalar dot11 = (v1 & v1);
488 const scalar dot12 = (v1 & v2);
491 const scalar
det = dot00 * dot11 - dot01 * dot01;
524 const scalar u = (dot11 * dot02 - dot01 * dot12) /
det;
525 const scalar v = (dot00 * dot12 - dot01 * dot02) /
det;
527 const point pProj = tri.
a() + u * v0 + v * v1;
530 if( (u >= -SMALL) && (v >= -SMALL) && ((u + v) <= (1.0+SMALL)) )
538 const scalar ed = ((pProj - tri.
a()) & v1) / (
magSqr(v1) + VSMALL);
550 return (tri.
a() + v1 * ed);
553 else if( v < -SMALL )
555 const scalar ed = ((pProj - tri.
a()) & v0) / (
magSqr(v0) + VSMALL);
567 return (tri.
a() + v0 * ed);
572 const vector ev = tri.
b() - tri.
c();
573 const scalar ed = ((pProj - tri.
c()) & ev) / (
magSqr(ev) + VSMALL);
585 return (tri.
c() + ev * ed);
620 if( origins.
size() != normals.
size() )
623 "inline bool findMinimizerPoint"
624 "(const DynList<point>&, const DynList<vector>&, point&)"
634 n /= (
mag(
n) + VSMALL);
640 source += (origins[i] &
n) *
n;
644 if( determinant < SMALL )
647 pMin = (
inv(mat, determinant) & source);
655 const point& lineStart,
656 const point& lineEnd,
660 const point& p0 = tria.
a();
661 const vector v(lineStart - lineEnd);
662 const vector v0 = tria.
b() - p0;
663 const vector v1 = tria.
c() - p0;
664 const vector sp = lineStart - p0;
668 for(
label i=0;i<3;++i)
683 if( (t < -SMALL) || (t > (1.0+SMALL)) )
693 if( (u1 < -SMALL) || ((
u0+u1) > (1.0+SMALL)) )
729 scalar tMax(1.0+SMALL), tMin(-SMALL);
732 const scalar d =
mag(v);
747 for(
label dir=0;dir<3;++dir)
749 const scalar vd = v[dir];
750 const scalar sd =
s[dir];
752 if(
mag(vd) > (SMALL * d) )
757 tMax =
Foam::min(tMax, (pMax[dir] - sd) / vd);
761 tMin =
Foam::max(tMin, (pMax[dir] - sd) / vd);
765 else if( (sd <
pMin[dir]) || (sd > pMax[dir]) )
771 if( (tMax - tMin) > -SMALL )
814 const point centre =
f.centre(facePoints);
830 facePoints[
f.nextLabel(pI)],
834 const bool currIntersection =
843 if( currIntersection )
851 const point&
s = facePoints[
f[pI]];
852 const point&
e = facePoints[
f.nextLabel(pI)];
854 const bool intersected =
878 const scalar distTol,
886 "inline bool doEdgesOverlap(const point, const point&,"
887 "const point&, const point&, const scalar, const scalar,"
888 "FixedList<point, 2>& overlappingPart)"
889 ) <<
"Distance is not specified" <<
endl;
895 const scalar de0 =
mag(e0);
896 e0 /= (de0 + VSMALL);
899 const scalar de1 =
mag(e1);
900 e1 /= (de1 + VSMALL);
903 if(
mag(e0 & e1) < cosTol )
906 scalar t00 = (e1p0 - e0p0) & e0;
907 scalar t01 = (e1p1 - e0p0) & e0;
909 scalar t10 = (e0p0 - e1p0) & e1;
910 scalar t11 = (e0p1 - e1p0) & e1;
915 (
magSqr(e0p0 + t00*e0 - e1p0) <= distTol*distTol) ||
916 (
magSqr(e0p0 + t01*e0 - e1p1) <= distTol*distTol) ||
917 (
magSqr(e1p0 + t10*e1 - e0p0) <= distTol*distTol) ||
918 (
magSqr(e1p0 + t11*e1 - e0p1) <= distTol*distTol)
921 vector vec = e0 + (((e0 & e1) > 0.0) ? e1 : -e1);
922 vec /= (
mag(vec) + VSMALL);
923 const point origin = 0.25 * (e0p0 + e0p1 + e1p0 + e1p1);
926 t00 = (e0p0 - origin) & vec;
927 t01 = (e0p1 - origin) & vec;
928 t10 = (e1p0 - origin) & vec;
929 t11 = (e1p1 - origin) & vec;
932 const scalar t0Min =
Foam::min(t00, t01);
933 const scalar t0Max =
Foam::max(t00, t01);
934 const scalar t1Min =
Foam::min(t10, t11);
935 const scalar t1Max =
Foam::max(t10, t11);
939 overlappingPart[0] = origin + t1Min * vec;
940 overlappingPart[1] = origin + t0Max * vec;
944 else if( t0Min < t1Max )
946 overlappingPart[0] = origin + t0Min * vec;
947 overlappingPart[1] = origin + t1Max * vec;
961 const scalar distTol,
969 "inline bool doTrianglesOverlap(const triangle<point, point>&,"
970 " const triangle<point, point>&, DynList<point>&,"
971 " const scalar, const scalar)"
972 ) <<
"Distance is not specified" <<
endl;
978 const scalar dn0 =
mag(n0);
979 n0 /= (dn0 + VSMALL);
985 const scalar dn1 =
mag(n1);
986 n1 /= (dn1 + VSMALL);
992 if( (
mag(n0 & n1) < cosTol) && (dn0 >= VSMALL) && (dn1 >= VSMALL) )
998 (
mag((tri1.
a() - tri0.
a()) & n0) < distTol) ||
999 (
mag((tri1.
b() - tri0.
a()) & n0) < distTol) ||
1000 (
mag((tri1.
c() - tri0.
a()) & n0) < distTol) ||
1001 (
mag((tri0.
a() - tri1.
a()) & n1) < distTol) ||
1002 (
mag((tri0.
b() - tri1.
a()) & n1) < distTol) ||
1003 (
mag((tri0.
c() - tri1.
a()) & n1) < distTol)
1006 vector vec = n0 + ((n0 & n1) >= 0.0 ? n1 : -n1);
1007 vec /= (
mag(vec) + VSMALL);
1010 overlappingPolygon.
clear();
1013 point bestPoint = tri0.
a();
1014 scalar distSq =
magSqr(tri0.
a() - origin);
1016 scalar dSq =
magSqr(tri0.
b() - origin);
1020 bestPoint = tri0.
b();
1023 dSq =
magSqr(tri0.
c() - origin);
1027 bestPoint = tri0.
c();
1030 dSq =
magSqr(tri1.
a() - origin);
1034 bestPoint = tri1.
a();
1037 dSq =
magSqr(tri1.
b() - origin);
1041 bestPoint = tri1.
b();
1044 dSq =
magSqr(tri1.
c() - origin);
1048 bestPoint = tri1.
c();
1051 if( distSq < VSMALL )
1055 vector x = (bestPoint - origin) - ((bestPoint - origin) & vec) * vec;
1056 x /= (
mag(
x) + VSMALL);
1060 poly2D[0] =
point2D((tri0.
a() - origin) &
x, (tri0.
a() - origin) &
y);
1061 poly2D[1] =
point2D((tri0.
b() - origin) &
x, (tri0.
b() - origin) &
y);
1062 poly2D[2] =
point2D((tri0.
c() - origin) &
x, (tri0.
c() - origin) &
y);
1065 t1Proj[0] =
point2D((tri1.
a() - origin) &
x, (tri1.
a() - origin) &
y);
1066 t1Proj[1] =
point2D((tri1.
b() - origin) &
x, (tri1.
b() - origin) &
y);
1067 t1Proj[2] =
point2D((tri1.
c() - origin) &
x, (tri1.
c() - origin) &
y);
1071 const vector2D vec = t1Proj[(eI+1)%3] - t1Proj[eI];
1076 const vector2D pVec = poly2D[pI] - t1Proj[eI];
1077 distance[pI] = vec.
y() * pVec.
x() - vec.
x() * pVec.
y();
1086 newPoly2D.
append(poly2D[pI]);
1105 else if(
distance.fcElement(pI) >= 0.0 )
1127 if( poly2D.
size() == 0 )
1129 overlappingPolygon.
clear();
1137 const point2D& pp = poly2D[pI];
1138 overlappingPolygon[pI] = origin +
x * pp.
x() +
y * pp.
y();
1144 overlappingPolygon.
clear();
1152 const scalar distTol
1159 "inline bool doTrianglesIntersect(const triangle<point, point>&,"
1160 " const triangle<point, point>&,"
1161 " const scalar, const scalar)"
1162 ) <<
"Distance is not specified" <<
endl;
1169 if(
magSqr(np - tri0.
a()) < distTol*distTol )
1172 if(
magSqr(np - tri0.
b()) < distTol*distTol )
1175 if(
magSqr(np - tri0.
c()) < distTol*distTol )
1180 if(
magSqr(np - tri1.
a()) < distTol*distTol )
1183 if(
magSqr(np - tri1.
b()) < distTol*distTol )
1186 if(
magSqr(np - tri1.
c()) < distTol*distTol )
1213 const scalar distTol
1220 "inline bool doTrianglesIntersect(const triangle<point, point>&,"
1221 " const triangle<point, point>&, DynList<point>&,"
1222 " const scalar, const scalar)"
1223 ) <<
"Distance is not specified" <<
endl;
1229 const scalar dn0 =
mag(n0);
1230 n0 /= (dn0 + VSMALL);
1233 const scalar dn1 =
mag(n1);
1234 n1 /= (dn1 + VSMALL);
1239 distancesTri0[0] = (tri0.
a() - tri1.
a()) & n1;
1240 distancesTri0[1] = (tri0.
b() - tri1.
a()) & n1;
1241 distancesTri0[2] = (tri0.
c() - tri1.
a()) & n1;
1244 if(
mag(distancesTri0[i]) < distTol )
1245 distancesTri0[i] = 0.0;
1247 bool hasPositive(
false), hasNegative(
false), hasZero(
false);
1249 forAll(distancesTri0, pI)
1251 if( distancesTri0[pI] >= distTol )
1255 else if( distancesTri0[pI] <= -distTol )
1268 (hasPositive && !hasNegative && !hasZero) ||
1269 (hasNegative && !hasPositive && !hasZero)
1273 intersectionPoints.
clear();
1278 (hasPositive && (hasNegative || hasZero)) ||
1279 (hasNegative && (hasPositive || hasZero))
1283 if(
mag(distancesTri0[0]) < distTol)
1285 intersectionLine0.
append(tri0.
a());
1287 else if( distancesTri0[0] * distancesTri0[1] < 0.0 )
1291 (tri0.
a() * distancesTri0[1] - tri0.
b() * distancesTri0[0]) /
1292 (distancesTri0[0] - distancesTri0[1])
1296 if(
mag(distancesTri0[1]) < distTol )
1298 intersectionLine0.
append(tri0.
b());
1300 else if( distancesTri0[1] * distancesTri0[2] < 0.0 )
1304 (tri0.
b() * distancesTri0[2] - tri0.
c() * distancesTri0[1]) /
1305 (distancesTri0[1] - distancesTri0[2])
1309 if(
mag(distancesTri0[2]) < distTol )
1311 intersectionLine0.
append(tri0.
c());
1313 else if( distancesTri0[2] * distancesTri0[0] < 0.0 )
1317 (tri0.
c() * distancesTri0[0] - tri0.
a() * distancesTri0[2]) /
1318 (distancesTri0[2] - distancesTri0[0])
1332 distancesTri1[0] = (tri1.
a() - tri0.
a()) & n0;
1333 distancesTri1[1] = (tri1.
b() - tri0.
a()) & n0;
1334 distancesTri1[2] = (tri1.
c() - tri0.
a()) & n0;
1337 if(
mag(distancesTri1[i]) < distTol )
1338 distancesTri1[i] = 0.0;
1340 hasPositive =
false;
1341 hasNegative =
false;
1345 forAll(distancesTri1, pI)
1347 if( distancesTri1[pI] >= distTol )
1351 else if( distancesTri1[pI] <= -distTol )
1363 (hasPositive && !hasNegative && !hasZero) ||
1364 (hasNegative && !hasPositive && !hasZero)
1368 intersectionPoints.
clear();
1373 (hasPositive && (hasNegative || hasZero)) ||
1374 (hasNegative && (hasPositive || hasZero))
1378 if(
mag(distancesTri1[0]) < distTol)
1380 intersectionLine1.
append(tri1.
a());
1382 else if( distancesTri1[0] * distancesTri1[1] < 0.0 )
1386 (tri1.
a() * distancesTri1[1] - tri1.
b() * distancesTri1[0]) /
1387 (distancesTri1[0] - distancesTri1[1])
1391 if(
mag(distancesTri1[1]) < distTol)
1393 intersectionLine1.
append(tri1.
b());
1395 else if( distancesTri1[1] * distancesTri1[2] < 0.0 )
1399 (tri1.
b() * distancesTri1[2] - tri1.
c() * distancesTri1[1]) /
1400 (distancesTri1[1] - distancesTri1[2])
1404 if(
mag(distancesTri1[2]) < distTol)
1406 intersectionLine1.
append(tri1.
c());
1408 else if( distancesTri1[2] * distancesTri1[0] < 0.0 )
1411 (tri1.
c() * distancesTri1[0] - tri1.
a() * distancesTri1[2]) /
1412 (distancesTri1[2] - distancesTri1[0])
1426 if(
magSqr(vec) < SMALL )
1433 scalar t0Min(VGREAT), t0Max(-VGREAT);
1435 forAll(intersectionLine0, i)
1437 const scalar t = intersectionLine0[i] & vec;
1442 p0Min = intersectionLine0[i];
1447 p0Max = intersectionLine0[i];
1451 scalar t1Min(VGREAT), t1Max(-VGREAT);
1453 forAll(intersectionLine1, i)
1455 const scalar t = intersectionLine1[i] & vec;
1460 p1Min = intersectionLine1[i];
1465 p1Max = intersectionLine1[i];
1469 if( (t1Min <= t0Max) && (t1Max >= t0Min) )
1471 intersectionPoints.
setSize(2);
1472 intersectionPoints[0] = p1Min;
1473 intersectionPoints[1] = p0Max;
1477 else if( (t0Min <= t1Max) && (t0Max >= t1Min) )
1479 intersectionPoints.
setSize(2);
1480 intersectionPoints[0] = p0Min;
1481 intersectionPoints[1] = p1Max;
1486 intersectionPoints.
setSize(0);
1496 const scalar distTol
1502 if(
mag(
p - fp[
f[pI]]) < distTol )
1508 vector lv =
n ^ fe[pI].vec(fp);
1511 const scalar d = pv & lv;
1526 const scalar distTol
1530 const scalar tolSqr =
sqr(distTol);
1534 const edge fe =
f.faceEdge(eI);
1545 if(
magSqr(np -
p) <= tolSqr )
1573 normal /= (magN + VSMALL);
1587 vector& v = edgeVecs[eI];
1589 const edge e =
f.faceEdge(eI);
1591 v /= (
mag(v) + VSMALL);
1598 const vector& pv = edgeVecs[
f.rcIndex(pI)];
1599 const vector& nv = edgeVecs[pI];
1601 if( ((pv ^ nv) &
normal) >= -0.05 )
1603 OkPoints[pI] =
true;
1607 OkPoints[pI] =
false;
1617 const point& edgePoint0,
1618 const point& edgePoint1,
1622 const vector e = edgePoint1 - edgePoint0;
1623 const scalar d =
mag(
e);
1626 if( d < ROOTVSMALL )
1629 return edgePoint0 + ((
e / (d*d)) * (
e &
k));
1634 const point& edgePoint0,
1635 const point& edgePoint1,
1639 const vector e = edgePoint1 - edgePoint0;
1646 const scalar t = (
e &
k) / (dSq + VSMALL);
1656 return edgePoint0 + (
e * t);
1661 const point& edgePoint0,
1662 const point& edgePoint1,
1672 const point& centre,
1687 if(
magSqr(
p - centre) < rangeSq )
1688 triaInRange.
insert(it.key());
1699 if( !elGroup.found(it.key()) )
1703 elGroup.insert(it.key(), nGroups);
1705 while( front.
size() )
1711 const label edgeI = faceEdges(fLabel, feI);
1714 if( testEdge.found(edgeI) )
1716 if( !testEdge[edgeI] )
1724 if(
magSqr(np - centre) < rangeSq )
1726 testEdge.insert(edgeI, 1);
1730 testEdge.insert(edgeI, 0);
1737 const label nei = edgeFaces(edgeI, efI);
1740 triaInRange.
found(nei) &&
1744 elGroup.insert(nei, nGroups);
1760 const point& centre,
1773 const edge&
e = edges[it.key()];
1778 if(
magSqr(
p - centre) < rangeSq )
1779 edgesInRange.
insert(it.key());
1790 if( !elGroup.found(it.key()) )
1794 elGroup.insert(it.key(), nGroups);
1796 while( front.
size() )
1799 const edge&
e = edges[eLabel];
1801 for(
label i=0;i<2;++i)
1803 if( pointTest.found(
e[i]) )
1805 if( !pointTest[
e[i]] )
1812 pointTest.insert(
e[i], 1);
1816 pointTest.insert(
e[i], 0);
1823 const label nei = pointEdges(
e[i], peI);
1825 if( edgesInRange.
found(nei) && !elGroup.found(nei) )
1827 elGroup.insert(nei, nGroups);
Geometry queries useful for mesh generation.
Templated 3D tensor derived from VectorSpace adding construction from 9 components,...
const vector & normal() const
Return plane normal.
label numberOfFaceGroups(const labelHashSet &containedElements, const point ¢re, const scalar range, const triSurf &surface)
find number of face groups within a given range
bool doFaceAndTriangleIntersect(const triSurf &surface, const label triI, const face &f, const pointField &facePoints)
check if the surface triangle and the face intersect
point nearestPoint(const point &p) const
Return nearest point in the plane for the given point.
bool doTrianglesIntersect(const triangle< point, point > &tri0, const triangle< point, point > &tri1, const scalar distTol=-1.0)
check the existence of intersection between the two triangles
const point & max() const
Maximum describing the bounding box.
bool vertexOnLine(const point &p, const edge &e, const pointField &ep)
check if the point p belongs to the edge e
bool planeIntersectsEdge(const point &start, const point &end, const plane &pl, point &intersection)
check if the edge intersects the plane
point nearestPointOnTheEdge(const point &edgePoint0, const point &edgePoint1, const point &p)
find the vertex on the line of the edge nearest to the point p
bool isnan(const ListType &)
check if a list has nan entries
#define forAll(list, i)
Loop across all elements in list.
scalar distanceOfPointFromTheEdge(const point &edgePoint0, const point &edgePoint1, const point &p)
find and return the distance between the edge and the point p
point nearestPointOnTheTriangle(const triangle< point, point > &tri, const point &)
find the nearest point on the triangle to the given point
T & newElmt(const label)
Return subscript-checked element of UList.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
void dot(FieldField< Field1, typename innerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensionedScalar pMin("pMin", dimPressure, fluid)
bool lineFaceIntersection(const point &, const point &, const face &, const pointField &fp, point &intersection)
check if the line and the face intersect
bool nearestEdgePointToTheLine(const point &edgePoint0, const point &edgePoint1, const point &lp0, const point &lp1, point &nearestOnEdge, point &nearestOnLine)
find the nearest points on the edge and the line
Ostream & endl(Ostream &os)
Add newline and flush stream.
scalar solveSecond(const FixedList< scalar, 3 > &source)
return the second component of the solution vector
dimensioned< scalar > mag(const dimensioned< Type > &)
labelList patchFaces(const polyBoundaryMesh &patches, const wordList &names)
T removeLastElement()
Return and remove the last element.
bool contains(const T &e) const
check if the element is in the list (takes linear time)
faceList mergePatchFaces(const List< DynList< label > > &pfcs, const pointField &polyPoints)
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
bool isinf(const ListType &)
check if a list has inf entries
Point centre() const
Return centre (centroid)
Geometric class that creates a 2D plane and can return the intersection point between a line and the ...
A triangle primitive used to calculate face normals and swept volumes.
Triangle storage. Null constructable (unfortunately triangle<point, point> is not)
bool pointInsideFace(const point &p, const face &f, const vector &n, const pointField &fp, const scalar distTol=SMALL)
check if the point is inside or outside the face
const Point & c() const
Return third vertex.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
vector normal() const
Return vector normal.
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
scalar determinant()
return matrix determinant
const Point & a() const
Return first vertex.
#define forAllRow(graph, rowI, index)
const point & min() const
Minimum describing the bounding box.
point nearestPointOnTheEdgeExact(const point &edgePoint0, const point &edgePoint1, const point &p)
find the vertex on the edge nearest to the point p
face mergeTwoFaces(const faceType1 &f1, const faceType2 &f2)
returns a merged face
bool isSharedEdgeConvex(const pointField &points, const Face1 &f1, const Face2 &f2)
check if the faces share a convex edge
const Point & b() const
Return second vertex.
label size() const
Return number of elements in table.
bool isFaceConvexAndOk(const face &f, const pointField &fp, DynList< bool > &OkPoints)
check if the face is convex. Concave points are flagged false
bool triLineIntersection(const triangle< point, point > &tria, const point &lineStart, const point &lineEnd, point &intersection)
check if a line intersects the triangle, and return the intersection
bool found(const Key &) const
Return true if hashedEntry is found in table.
errorManip< error > abort(error &err)
vector2D point2D
Point2D is a vector.
const double e
Elementary charge.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().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))
bool findMinimizerPoint(const DynList< point > &origins, const DynList< vector > &normals, point &pMin)
bool pointInTetrahedron(const point &p, const tetrahedron< point, point > &tet)
check if a vertex lies inside the tetrahedron
scalar distance(const vector &p1, const vector &p2)
scalar angleBetweenFaces(const pointField &points, const Face1 &f1, const Face2 &f2)
angle between the two faces in radians
const Point & a() const
Return vertices.
label numberOfEdgeGroups(const labelHashSet &containedEdges, const point ¢re, const scalar range, const triSurf &surface)
find the number of edge groups within the given range
bool boundBoxLineIntersection(const point &, const point &, const boundBox &)
check if the line intersects the bounding box
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
bool doTrianglesOverlap(const triangle< point, point > &tri0, const triangle< point, point > &tri1, DynList< point > &overlappingPolygon, const scalar distTol=-1.0, const scalar cosTol=Foam::cos(5.0 *(M_PI/180.0)))
check the existence of overlap between the two triangles
dimensionedSymmTensor sqr(const dimensionedVector &dv)
An ordered pair of two objects of type <T> with first() and second() elements.
bool contains(const point &) const
Contains point? (inside or on edge)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void setSize(const label)
Reset size of List.
dimensionedScalar acos(const dimensionedScalar &ds)
const T & fcElement(const label index, const label offset=1) const
return forward and reverse circular elements
label k
Boltzmann constant.
scalar solveFirst(const FixedList< scalar, 3 > &source)
return the first component of the solution vector
const point & refPoint() const
Return or return plane base point.
bool insert(const Key &key)
Insert a new entry.
Triangle with additional region number.
A bounding box defined in terms of the points at its extremities.
const dimensionedScalar c
Speed of light in a vacuum.
bool vertexInPlane(const point &p, const plane &pl)
check if the point p belongs to the plane
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
A face is a list of labels corresponding to mesh vertices.
#define WarningIn(functionName)
Report a warning using Foam::Warning.
dimensionedScalar det(const dimensionedSphericalTensor &dt)
scalar mag() const
Return volume.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
bool doEdgesOverlap(const point &e0p0, const point &e0p1, const point &e1p0, const point &e1p1, FixedList< point, 2 > &overlappingPart, const scalar distTol=-1.0, const scalar cosTol=Foam::cos(5.0 *(M_PI/180.0)))
check the existence of overlap between the two edges
dimensioned< scalar > magSqr(const dimensioned< Type > &)
void clear()
Clear the list, i.e. set next free to zero.
bool shareAnEdge(const faceType1 &f1, const faceType2 &f2)
check if two faces share an edge
A normal distribution model.
scalar solveThird(const FixedList< scalar, 3 > &source)
return the third component of the solution vector
void append(const T &e)
Append an element at the end of the list.
dimensionedScalar pos(const dimensionedScalar &ds)