73 return s < VSMALL ?
Zero : (a ^
b) /
s;
83 const point& basePoint,
84 const point& rightPoint,
85 const point& leftPoint,
86 const point& centrePoint
89 const vector mid(centrePoint - basePoint);
95 0.5*(rightPoint - basePoint),
101 0.5*(leftPoint - basePoint)
158 const point& ownCentre,
159 const point& neiCentre
162 const scalar magEdge(edgeVec.
mag());
164 if (magEdge < ROOTVSMALL)
186 return magEdge*edgeNorm;
194 const point& ownCentre
197 const scalar magEdge(edgeVec.
mag());
199 if (magEdge < ROOTVSMALL)
218 return magEdge*edgeNorm;
231 bitSet markPoints(
p.nPoints());
232 for (
const edge&
e :
p.boundaryEdges())
236 markPoints.
set(
e.second());
248void Foam::faMesh::calcLduAddressing()
const
251 <<
"Calculating addressing" <<
endl;
256 <<
"lduPtr_ already allocated"
260 lduPtr_ =
new faMeshLduAddressing(*
this);
264void Foam::faMesh::calcPatchStarts()
const
267 <<
"Calculating patch starts" <<
endl;
272 <<
"patchStartsPtr_ already allocated"
280void Foam::faMesh::calcLe()
const
283 <<
"Calculating local edges" <<
endl;
288 <<
"LePtr_ already allocated"
298 mesh().pointsInstance(),
321 <<
"Using geometryOrder < 1 : "
322 "simplified edge area-normals for Le() calculation"
325 UIndirectList<vector> fCentres(
mesh().faceCentres(), faceLabels());
331 for (label edgei = 0; edgei < nInternalEdges_; ++edgei)
336 edges_[edgei].line(localPoints),
337 fCentres[owner()[edgei]],
338 fCentres[neighbour()[edgei]]
343 for (label edgei = nInternalEdges_; edgei < nEdges_; ++edgei)
348 edges_[edgei].line(localPoints),
349 fCentres[owner()[edgei]]
359 for (label edgei = 0; edgei < nInternalEdges_; ++edgei)
361 vector& leVector = internalFld[edgei];
363 vector edgeVec = edges_[edgei].vec(localPoints);
364 const scalar magEdge(
mag(edgeVec));
366 if (magEdge < ROOTVSMALL)
373 const vector edgeCtr = edges_[edgei].centre(localPoints);
374 const vector& edgeNorm = edgeNormals[edgei];
375 const vector& ownCentre = fCentres[owner()[edgei]];
377 leVector = magEdge*
normalised(edgeVec ^ edgeNorm);
378 leVector *=
sign(leVector & (edgeCtr - ownCentre));
389 boundary()[patchi].patchSlice(edges_);
391 vectorField& patchLe = Le.boundaryFieldRef()[patchi];
395 vector& leVector = patchLe[bndEdgei];
396 const label meshEdgei(
boundary()[patchi].start() + bndEdgei);
398 vector edgeVec = bndEdges[bndEdgei].vec(localPoints);
399 const scalar magEdge(
mag(edgeVec));
401 if (magEdge < ROOTVSMALL)
408 const vector edgeCtr = bndEdges[bndEdgei].centre(localPoints);
409 const vector& edgeNorm = edgeNormals[meshEdgei];
410 const vector& ownCentre = fCentres[bndEdgeFaces[bndEdgei]];
412 leVector = magEdge*
normalised(edgeVec ^ edgeNorm);
413 leVector *=
sign(leVector & (edgeCtr - ownCentre));
433 for (label edgei = 0; edgei < nInternalEdges_; ++edgei)
435 vector& leVector = internalFld[edgei];
437 vector edgeVec = edges_[edgei].vec(localPoints);
438 const scalar magEdge(
mag(edgeVec));
440 if (magEdge < ROOTVSMALL)
447 const vector& edgeCtr = eCentres[edgei];
448 const vector& edgeNorm = edgeNormals[edgei];
449 const vector& ownCentre = fCentres[owner()[edgei]];
451 leVector = magEdge*
normalised(edgeVec ^ edgeNorm);
452 leVector *=
sign(leVector & (edgeCtr - ownCentre));
461 boundary()[patchi].patchSlice(edges_);
464 edgeNormals.boundaryField()[patchi];
466 vectorField& patchLe = Le.boundaryFieldRef()[patchi];
467 const vectorField& patchECentres = eCentres.boundaryField()[patchi];
471 vector& leVector = patchLe[bndEdgei];
473 vector edgeVec = bndEdges[bndEdgei].vec(localPoints);
474 const scalar magEdge(
mag(edgeVec));
476 if (magEdge < ROOTVSMALL)
483 const vector& edgeCtr = patchECentres[bndEdgei];
484 const vector& edgeNorm = bndEdgeNormals[bndEdgei];
485 const vector& ownCentre = fCentres[bndEdgeFaces[bndEdgei]];
487 leVector = magEdge*
normalised(edgeVec ^ edgeNorm);
488 leVector *=
sign(leVector & (edgeCtr - ownCentre));
494void Foam::faMesh::calcMagLe()
const
497 <<
"Calculating local edge magnitudes" <<
endl;
502 <<
"magLePtr_ already allocated"
512 mesh().pointsInstance(),
526 auto iter = magLe.primitiveFieldRef().begin();
528 for (
const edge&
e : internalEdges())
530 *iter =
e.mag(localPoints);
541 auto iter = bfld[patchi].begin();
543 for (
const edge&
e :
boundary()[patchi].patchSlice(edges_))
545 *iter =
e.mag(localPoints);
553void Foam::faMesh::calcAreaCentres()
const
556 <<
"Calculating face centres" <<
endl;
561 <<
"centresPtr_ already allocated"
571 mesh().pointsInstance(),
582 const faceList& localFaces = faces();
588 centres.ref()[facei] = localFaces[facei].centre(localPoints);
593 auto& bfld = centres.boundaryFieldRef();
597 auto iter = bfld[patchi].begin();
599 for (
const edge&
e :
boundary()[patchi].patchSlice(edges_))
601 *iter =
e.centre(localPoints);
609void Foam::faMesh::calcEdgeCentres()
const
612 <<
"Calculating edge centres" <<
endl;
617 <<
"edgeCentresPtr_ already allocated"
627 mesh().pointsInstance(),
641 auto iter = centres.primitiveFieldRef().begin();
643 for (
const edge&
e : internalEdges())
645 *iter =
e.centre(localPoints);
656 auto iter = bfld[patchi].begin();
658 for (
const edge&
e :
boundary()[patchi].patchSlice(edges_))
660 *iter =
e.centre(localPoints);
668void Foam::faMesh::calcS()
const
671 <<
"Calculating areas" <<
endl;
676 <<
"SPtr_ already allocated"
680 SPtr_ =
new DimensionedField<scalar, areaMesh>
696 const faceList& localFaces = faces();
701 S[facei] = localFaces[facei].mag(localPoints);
706void Foam::faMesh::calcFaceAreaNormals()
const
709 <<
"Calculating face area normals" <<
endl;
711 if (faceAreaNormalsPtr_)
714 <<
"faceAreaNormalsPtr_ already allocated"
718 faceAreaNormalsPtr_ =
724 mesh().pointsInstance(),
735 const faceList& localFaces = faces();
742 nInternal[faceI] = localFaces[faceI].unitNormal(localPoints);
747 const auto& edgeNormalsBoundary = edgeAreaNormals().boundaryField();
756void Foam::faMesh::calcEdgeAreaNormals()
const
759 <<
"Calculating edge area normals" <<
endl;
761 if (edgeAreaNormalsPtr_)
764 <<
"edgeAreaNormalsPtr_ already allocated"
768 edgeAreaNormalsPtr_ =
774 mesh().pointsInstance(),
785 const vectorField& pointNormals = pointAreaNormals();
789 forAll(edgeAreaNormals.internalField(), edgei)
791 const edge&
e = edges_[edgei];
794 vector& edgeNorm = edgeAreaNormals.ref()[edgei];
797 edgeNorm = (pointNormals[
e.
first()] + pointNormals[
e.second()]);
799 edgeNorm.removeCollinear(edgeVec);
800 edgeNorm.normalise();
804 auto& bfld = edgeAreaNormals.boundaryFieldRef();
808 auto& pfld = bfld[patchi];
811 boundary()[patchi].patchSlice(edges_);
813 forAll(patchEdges, bndEdgei)
815 const edge&
e = patchEdges[bndEdgei];
818 vector& edgeNorm = pfld[bndEdgei];
821 edgeNorm = (pointNormals[
e.
first()] + pointNormals[
e.second()]);
823 edgeNorm.removeCollinear(edgeVec);
824 edgeNorm.normalise();
830void Foam::faMesh::calcFaceCurvatures()
const
833 <<
"Calculating face curvatures" <<
endl;
835 if (faceCurvaturesPtr_)
838 <<
"faceCurvaturesPtr_ already allocated"
848 mesh().pointsInstance(),
865 faceCurvatures =
sign(kN&faceAreaNormals())*
mag(kN);
869void Foam::faMesh::calcEdgeTransformTensors()
const
872 <<
"Calculating edge transformation tensors" <<
endl;
874 if (edgeTransformTensorsPtr_)
877 <<
"edgeTransformTensorsPtr_ already allocated"
881 edgeTransformTensorsPtr_ =
new FieldField<Field, tensor>(nEdges_);
882 auto& edgeTransformTensors = *edgeTransformTensorsPtr_;
885 for (label edgei = 0; edgei < nEdges_; ++edgei)
887 edgeTransformTensors.set(edgei,
new Field<tensor>(3,
tensor::I));
897 for (label edgei = 0; edgei < nInternalEdges_; ++edgei)
899 const label ownFacei = owner()[edgei];
900 const label neiFacei = neighbour()[edgei];
901 auto& tensors = edgeTransformTensors[edgei];
903 vector edgeCtr = Ce.internalField()[edgei];
907 edgeCtr -= skewCorrectionVectors().internalField()[edgei];
914 Ne.internalField()[edgei],
915 (edgeCtr - Cf.internalField()[ownFacei])
922 Nf.internalField()[ownFacei],
923 (edgeCtr - Cf.internalField()[ownFacei])
930 Nf.internalField()[neiFacei],
931 (Cf.internalField()[neiFacei] - edgeCtr)
942 vectorField nbrCf(Cf.boundaryField()[patchi].patchNeighbourField());
943 vectorField nbrNf(Nf.boundaryField()[patchi].patchNeighbourField());
945 forAll(edgeFaces, bndEdgei)
947 const label ownFacei = edgeFaces[bndEdgei];
948 const label meshEdgei(
boundary()[patchi].start() + bndEdgei);
950 auto& tensors = edgeTransformTensors[meshEdgei];
952 vector edgeCtr = Ce.boundaryField()[patchi][bndEdgei];
956 edgeCtr -= skewCorrectionVectors()
957 .boundaryField()[patchi][bndEdgei];
964 Ne.boundaryField()[patchi][bndEdgei],
965 (edgeCtr - Cf.internalField()[ownFacei])
972 Nf.internalField()[ownFacei],
973 (edgeCtr - Cf.internalField()[ownFacei])
981 (nbrCf[bndEdgei] - edgeCtr)
987 forAll(edgeFaces, bndEdgei)
989 const label ownFacei = edgeFaces[bndEdgei];
990 const label meshEdgei(
boundary()[patchi].start() + bndEdgei);
992 auto& tensors = edgeTransformTensors[meshEdgei];
994 vector edgeCtr = Ce.boundaryField()[patchi][bndEdgei];
998 edgeCtr -= skewCorrectionVectors()
999 .boundaryField()[patchi][bndEdgei];
1006 Ne.boundaryField()[patchi][bndEdgei],
1007 (edgeCtr - Cf.internalField()[ownFacei])
1014 Nf.internalField()[ownFacei],
1015 (edgeCtr - Cf.internalField()[ownFacei])
1029 <<
"Calculating internal points" <<
endl;
1041 <<
"Calculating boundary points" <<
endl;
1075void Foam::faMesh::calcPointAreaNormals(
vectorField& result)
const
1078 <<
"Calculating pointAreaNormals : face dual method" <<
endl;
1084 const faceList& faces = patch().localFaces();
1089 for (
const face&
f : faces)
1091 const label nVerts(
f.
size());
1094 for (label i = 0; i < nVerts; ++i)
1098 centrePoint /= nVerts;
1100 for (label i = 0; i < nVerts; ++i)
1102 const label pt0 =
f.thisLabel(i);
1118 bitSet nbrBoundaryAdjust(
boundary().size(),
true);
1122 const faPatch& fap =
boundary()[patchi];
1124 if (isA<wedgeFaPatch>(fap))
1128 const auto& wedgePatch = refCast<const wedgeFaPatch>(fap);
1130 const labelList& patchPoints = wedgePatch.pointLabels();
1137 wedgePatch.centreNormal()
1141 for (
const label pti : patchPoints)
1143 result[pti].removeCollinear(
N);
1147 if (wedgePatch.axisPoint() > -1)
1149 result[wedgePatch.axisPoint()] =
1153 &result[wedgePatch.axisPoint()]
1158 nbrBoundaryAdjust.
unset(patchi);
1164 const auto& procPatch = refCast<const processorFaPatch>(fap);
1166 const labelList& patchPoints = procPatch.pointLabels();
1167 const labelList& nbrPatchPoints = procPatch.neighbPoints();
1170 procPatch.nonGlobalPatchPoints();
1176 UIndirectList<vector>(result, patchPoints)
1183 procPatch.neighbProcNo(),
1184 patchPointNormals.cdata_bytes(),
1185 patchPointNormals.size_bytes()
1190 patchPointNormals.resize(nbrPatchPoints.size());
1196 procPatch.neighbProcNo(),
1197 patchPointNormals.data_bytes(),
1198 patchPointNormals.size_bytes()
1202 for (
const label pti : nonGlobalPatchPoints)
1204 result[patchPoints[pti]] +=
1205 patchPointNormals[nbrPatchPoints[pti]];
1209 nbrBoundaryAdjust.
unset(patchi);
1211 else if (fap.coupled())
1214 nbrBoundaryAdjust.unset(patchi);
1222 else if (!correctPatchPointNormals(patchi))
1225 nbrBoundaryAdjust.unset(patchi);
1231 if (globalData().nGlobalPoints())
1233 const labelList& spLabels = globalData().sharedPointLabels();
1234 const labelList& addr = globalData().sharedPointAddr();
1238 UIndirectList<vector>(result, spLabels)
1243 globalData().nGlobalPoints(),
1249 gpNormals[addr[i]] += spNormals[i];
1257 spNormals[i] = gpNormals[addr[i]];
1260 forAll(spNormals, pointI)
1262 result[spLabels[pointI]] = spNormals[pointI];
1267 if (
returnReduce(nbrBoundaryAdjust.any(), orOp<bool>()))
1272 <<
"Apply " << nbrBoundaryAdjust.count()
1273 <<
" boundary neighbour corrections" <<
nl;
1280 const auto& haloNormals = this->haloFaceNormals();
1282 Map<vector> fpNormals(4*nBoundaryEdges());
1284 for (
const label patchi : nbrBoundaryAdjust)
1286 const faPatch& fap =
boundary()[patchi];
1287 const labelList& edgeLabels = fap.edgeLabels();
1289 if (fap.ngbPolyPatchIndex() < 0)
1292 <<
"Neighbour polyPatch index is not defined "
1293 <<
"for faPatch " << fap.name()
1297 for (
const label edgei : edgeLabels)
1299 const edge&
e =
patch().edges()[edgei];
1302 const vector& fnorm = haloNormals[edgei - nInternalEdges_];
1304 fpNormals(
e.
first()) += fnorm;
1305 fpNormals(
e.second()) += fnorm;
1321 const label pointi = iter.key();
1324 result[pointi].removeCollinear(fpnorm);
1332void Foam::faMesh::calcPointAreaNormalsByQuadricsFit(
vectorField& result)
const
1334 const labelList intPoints(internalPoints());
1335 const labelList bndPoints(boundaryPoints());
1341 forAll(intPoints, pointI)
1343 label curPoint = intPoints[pointI];
1346 const labelList curFaces(faceSet.toc());
1350 for (
const label facei : curFaces)
1352 const labelList& facePoints = faces[facei];
1353 pointSet.insert(facePoints);
1355 pointSet.erase(curPoint);
1358 if (pointSet.size() < 5)
1361 <<
"WARNING: Extending point set for fitting." <<
endl;
1365 for (
const label facei : curFaces)
1368 faceSet.insert(curFaceFaces);
1370 curFaces = faceSet.toc();
1374 for (
const label facei : curFaces)
1376 const labelList& facePoints = faces[facei];
1377 pointSet.insert(facePoints);
1379 pointSet.erase(curPoint);
1380 curPoints = pointSet.toc();
1385 for (label i=0; i<curPoints.size(); ++i)
1392 coordSystem::cartesian cs
1396 allPoints[0] -
points[curPoint]
1399 for (
point&
p : allPoints)
1401 p = cs.localPosition(
p);
1411 for (label i = 0; i <
allPoints.size(); ++i)
1413 M[i][0] =
sqr(allPoints[i].
x());
1414 M[i][1] =
sqr(allPoints[i].
y());
1422 for (label i = 0; i < MtM.n(); ++i)
1424 for (label j = 0; j < MtM.m(); ++j)
1426 for (label
k = 0;
k <
M.n(); ++
k)
1428 MtM[i][j] +=
M[
k][i]*
M[
k][j]*W[
k];
1435 for (label i=0; i<MtR.size(); ++i)
1437 for (label j=0; j<
M.n(); ++j)
1447 curNormal = cs.globalVector(curNormal);
1449 curNormal *=
sign(curNormal&result[curPoint]);
1451 result[curPoint] = curNormal;
1457 const faPatch& fap =
boundary()[patchI];
1461 const processorFaPatch& procPatch =
1462 refCast<const processorFaPatch>(
boundary()[patchI]);
1464 const labelList& patchPointLabels = procPatch.pointLabels();
1466 labelList toNgbProcLsPointStarts(patchPointLabels.size(),
Zero);
1469 10*patchPointLabels.size(),
1474 for (label pointI=0; pointI<patchPointLabels.size(); ++pointI)
1476 label curPoint = patchPointLabels[pointI];
1478 toNgbProcLsPointStarts[pointI] =
nPoints;
1481 const labelList curFaces(faceSet.toc());
1485 for (
const label facei : curFaces)
1487 const labelList& facePoints = faces[facei];
1488 pointSet.insert(facePoints);
1490 pointSet.erase(curPoint);
1493 for (label i=0; i<curPoints.size(); ++i)
1502 OPstream toNeighbProc
1505 procPatch.neighbProcNo(),
1506 toNgbProcLsPoints.size_bytes()
1507 + toNgbProcLsPointStarts.size_bytes()
1512 << toNgbProcLsPoints
1513 << toNgbProcLsPointStarts;
1518 for (
const faPatch& fap :
boundary())
1522 const processorFaPatch& procPatch =
1523 refCast<const processorFaPatch>(fap);
1525 const labelList& patchPointLabels = procPatch.pointLabels();
1527 labelList fromNgbProcLsPointStarts(patchPointLabels.size(),
Zero);
1531 IPstream fromNeighbProc
1534 procPatch.neighbProcNo(),
1535 10*patchPointLabels.size()*
sizeof(
vector)
1536 + fromNgbProcLsPointStarts.size_bytes()
1541 >> fromNgbProcLsPoints
1542 >> fromNgbProcLsPointStarts;
1546 procPatch.nonGlobalPatchPoints();
1548 forAll(nonGlobalPatchPoints, pointI)
1551 patchPointLabels[nonGlobalPatchPoints[pointI]];
1553 procPatch.neighbPoints()[nonGlobalPatchPoints[pointI]];
1556 faceSet.
insert(pointFaces[curPoint]);
1562 for (
const label facei : curFaces)
1564 const labelList& facePoints = faces[facei];
1565 pointSet.insert(facePoints);
1567 pointSet.erase(curPoint);
1570 label nAllPoints = curPoints.
size();
1572 if (curNgbPoint == fromNgbProcLsPointStarts.size() - 1)
1575 fromNgbProcLsPoints.size()
1576 - fromNgbProcLsPointStarts[curNgbPoint];
1581 fromNgbProcLsPointStarts[curNgbPoint + 1]
1582 - fromNgbProcLsPointStarts[curNgbPoint];
1587 for (label i=0; i<curPoints.size(); ++i)
1589 allPointsExt[counter++] =
points[curPoints[i]];
1592 if (curNgbPoint == fromNgbProcLsPointStarts.size() - 1)
1596 label i=fromNgbProcLsPointStarts[curNgbPoint];
1597 i<fromNgbProcLsPoints.size();
1601 allPointsExt[counter++] = fromNgbProcLsPoints[i];
1608 label i=fromNgbProcLsPointStarts[curNgbPoint];
1609 i<fromNgbProcLsPointStarts[curNgbPoint+1];
1613 allPointsExt[counter++] = fromNgbProcLsPoints[i];
1619 boundBox bb(allPointsExt,
false);
1620 scalar tol = 0.001*
mag(bb.max() - bb.min());
1625 bool duplicate =
false;
1626 for (label i=0; i<nAllPoints; ++i)
1645 allPoints[nAllPoints++] = allPointsExt[pI];
1654 <<
"There are no enough points for quadrics "
1655 <<
"fitting for a point at processor patch"
1663 dir.removeCollinear(axis);
1666 const coordinateSystem cs(
"cs", origin, axis, dir);
1674 allPoints[pI] = cs.localPosition(allPoints[pI]);
1684 for (label i=0; i<
allPoints.size(); ++i)
1686 M[i][0] =
sqr(allPoints[i].
x());
1687 M[i][1] =
sqr(allPoints[i].
y());
1695 for (label i = 0; i < MtM.n(); ++i)
1697 for (label j = 0; j < MtM.m(); ++j)
1699 for (label
k = 0;
k <
M.n(); ++
k)
1701 MtM[i][j] +=
M[
k][i]*
M[
k][j]*W[
k];
1708 for (label i = 0; i < MtR.size(); ++i)
1710 for (label j = 0; j <
M.n(); ++j)
1720 curNormal = cs.globalVector(curNormal);
1722 curNormal *=
sign(curNormal&result[curPoint]);
1724 result[curPoint] = curNormal;
1730 if (globalData().nGlobalPoints() > 0)
1732 const labelList& spLabels = globalData().sharedPointLabels();
1734 const labelList& addr = globalData().sharedPointAddr();
1736 for (label
k=0;
k<globalData().nGlobalPoints(); ++
k)
1740 const label curSharedPointIndex = addr.find(
k);
1744 if (curSharedPointIndex != -1)
1746 label curPoint = spLabels[curSharedPointIndex];
1749 const labelList curFaces(faceSet.toc());
1752 for (
const label facei : curFaces)
1754 const labelList& facePoints = faces[facei];
1755 pointSet.insert(facePoints);
1757 pointSet.erase(curPoint);
1764 const boundBox bb(locPoints,
false);
1765 tol = 0.001*
mag(bb.max() - bb.min());
1770 if (curSharedPointIndex != -1)
1772 label curPoint = spLabels[curSharedPointIndex];
1774 label nAllPoints = 0;
1775 forAll(procLsPoints, procI)
1777 nAllPoints += procLsPoints[procI].size();
1783 forAll(procLsPoints, procI)
1785 forAll(procLsPoints[procI], pointI)
1787 bool duplicate =
false;
1788 for (label i=0; i<nAllPoints; ++i)
1795 - procLsPoints[procI][pointI]
1808 procLsPoints[procI][pointI];
1818 <<
"There are no enough points for quadratic "
1819 <<
"fitting for a global processor point "
1827 dir.removeCollinear(axis);
1830 coordinateSystem cs(
"cs", origin, axis, dir);
1834 forAll(allPoints, pointI)
1839 allPoints[pointI] = cs.localPosition(allPoints[pointI]);
1849 for (label i=0; i<
allPoints.size(); ++i)
1851 M[i][0] =
sqr(allPoints[i].
x());
1852 M[i][1] =
sqr(allPoints[i].
y());
1859 for (label i = 0; i < MtM.n(); ++i)
1861 for (label j = 0; j < MtM.m(); ++j)
1863 for (label
k = 0;
k <
M.n(); ++
k)
1865 MtM[i][j] +=
M[
k][i]*
M[
k][j]*W[
k];
1871 for (label i = 0; i < MtR.size(); ++i)
1873 for (label j = 0; j <
M.n(); ++j)
1883 curNormal = cs.globalVector(curNormal);
1885 curNormal *=
sign(curNormal&result[curPoint]);
1887 result[curPoint] = curNormal;
1902 <<
"Calculating edge length correction" <<
endl;
1908 "edgeLengthCorrection",
1909 mesh().pointsInstance(),
1918 const vectorField& pointNormals = pointAreaNormals();
1922 scalar sinAlpha =
mag
1924 pointNormals[edges()[edgeI].start()]^
1925 pointNormals[edges()[edgeI].end()]
1938 boundary()[patchI].patchSlice(edges())
1941 forAll(patchEdges, edgeI)
1946 pointNormals[patchEdges[edgeI].start()]
1947 ^ pointNormals[patchEdges[edgeI].end()]
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
Internal & ref(const bool updateAccessTime=true)
Return a reference to the dimensioned internal field.
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
SubList< edge > subList
Declare type of subList.
void setSize(const label n)
Alias for resize()
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
A list of faces which address into the list of points.
label nProcs() const noexcept
Number of ranks associated with PstreamBuffers.
static void allGatherList(const List< commsStruct > &comms, List< T > &values, const int tag, const label comm)
static void combineAllGather(const List< commsStruct > &comms, T &value, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
virtual bool read()
Re-read model coefficients if they have changed.
A List obtained as a section of another List.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
T & first()
Return the first element of the list.
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type unset(const label i)
void size(const label n)
Older name for setAddressableSize.
static bool & parRun() noexcept
Test if this a parallel run.
Vector< Cmpt > & normalise(const scalar tol=ROOTVSMALL)
Inplace normalise the vector by its magnitude.
Vector< Cmpt > & removeCollinear(const Vector< Cmpt > &unitVec)
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
void flip()
Invert all bits in the addressable region.
labelList sortedToc() const
The indices of the on bits as a sorted labelList.
void set(const bitSet &bitset)
Set specified bits from another bitset.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
labelList internalPoints() const
Return internal point labels.
static int geometryOrder() noexcept
Return the current geometry treatment (0: primitive, 1: standard)
tmp< edgeScalarField > edgeLengthCorrection() const
Return edge length correction.
labelList boundaryPoints() const
Return boundary point labels.
A face is a list of labels corresponding to mesh vertices.
virtual bool write()
Write the output fields.
PointRef first() const noexcept
Return first point.
Point centre() const
Return centre (centroid)
PointRef last() const noexcept
Return last (second) point.
scalar mag() const
Return scalar magnitude.
Point vec() const
Return start-to-end vector.
int myProcNo() const noexcept
Return processor number.
A class for managing temporary objects.
A triangle primitive used to calculate face normals and swept volumes.
vector areaNormal() const
The area normal - with magnitude equal to area of triangle.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
bool coupled(solutionDict.getOrDefault("coupledEnergyField", false))
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Namespace of functions to calculate explicit derivatives.
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))
surfaceVectorField faceNormals(mesh.Sf()/mesh.magSf())
#define DebugInfo
Report an information message using Foam::Info.
#define WarningInFunction
Report a warning using Foam::Warning.
#define PoutInFunction
Report using Foam::Pout with FUNCTION_NAME prefix.
#define DebugInFunction
Report an information message using Foam::Info.
tmp< GeometricField< Type, faPatchField, areaMesh > > edgeIntegrate(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
const std::string patch
OpenFOAM patch number as a std::string.
dimensionedScalar asin(const dimensionedScalar &ds)
GeometricField< vector, faePatchField, edgeMesh > edgeVectorField
const dimensionSet dimless
Dimensionless.
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
dimensionedScalar sign(const dimensionedScalar &ds)
List< label > labelList
A List of labels.
RectangularMatrix< scalar > scalarRectangularMatrix
dimensionedSymmTensor sqr(const dimensionedVector &dv)
static vector areaInvDistSqrWeightedNormal(const vector &a, const vector &b)
quaternion normalised(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
const dimensionSet dimArea(sqr(dimLength))
vectorField pointField
pointField is a vectorField.
vector point
Point is a vector.
static vector areaInvDistSqrWeightedNormalDualEdge(const point &basePoint, const point &rightPoint, const point &leftPoint, const point ¢rePoint)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static Foam::bitSet markupBoundaryPoints(const uindirectPrimitivePatch &p)
GeometricField< vector, faPatchField, areaMesh > areaVectorField
GeometricField< scalar, faePatchField, edgeMesh > edgeScalarField
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
List< labelList > labelListList
A List of labelList.
triangle< point, const point & > triPointRef
A triangle using referred points.
GeometricField< scalar, faPatchField, areaMesh > areaScalarField
static tensor rotation_e3e1(const vector &unitAxis1, vector dirn)
errorManip< error > abort(error &err)
Field< vector > vectorField
Specialisation of Field<T> for vector.
SquareMatrix< scalar > scalarSquareMatrix
static constexpr const zero Zero
Global zero (0)
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
static vector calcEdgeNormalFromFace(const linePointRef &edgeVec, const point &ownCentre, const point &neiCentre)
void LUsolve(scalarSquareMatrix &matrix, List< Type > &source)
List< face > faceList
A List of faces.
UList< label > labelUList
A UList of labels.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
dimensionedScalar cos(const dimensionedScalar &ds)
dimensionedTensor skew(const dimensionedTensor &dt)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.
const Vector< label > N(dict.get< Vector< label > >("N"))