33 void Foam::particle::stationaryTetGeometry
47 vertex1 = pts[triIs[1]];
48 vertex2 = pts[triIs[2]];
54 vector centre, base, vertex1, vertex2;
55 stationaryTetGeometry(centre, base, vertex1, vertex2);
61 inline void Foam::particle::movingTetGeometry
63 const scalar fraction,
66 Pair<vector>& vertex1,
70 const triFace triIs(currentTetIndices().faceTriIs(mesh_));
78 const vector ccOld = mesh_.cells()[celli_].
centre(ptsOld, mesh_.faces());
79 const vector ccNew = mesh_.cells()[celli_].
centre(ptsNew, mesh_.faces());
84 const Pair<scalar>
s = stepFractionSpan();
85 const scalar f0 =
s[0] + stepFraction_*
s[1], f1 = fraction*
s[1];
87 centre[0] = ccOld + f0*(ccNew - ccOld);
88 base[0] = ptsOld[triIs[0]] + f0*(ptsNew[triIs[0]] - ptsOld[triIs[0]]);
89 vertex1[0] = ptsOld[triIs[1]] + f0*(ptsNew[triIs[1]] - ptsOld[triIs[1]]);
90 vertex2[0] = ptsOld[triIs[2]] + f0*(ptsNew[triIs[2]] - ptsOld[triIs[2]]);
92 centre[1] = f1*(ccNew - ccOld);
93 base[1] = f1*(ptsNew[triIs[0]] - ptsOld[triIs[0]]);
94 vertex1[1] = f1*(ptsNew[triIs[1]] - ptsOld[triIs[1]]);
95 vertex2[1] = f1*(ptsNew[triIs[2]] - ptsOld[triIs[2]]);
101 const scalar fraction
104 Pair<vector> centre, base, vertex1, vertex2;
105 movingTetGeometry(fraction, centre, base, vertex1, vertex2);
108 Pair<barycentricTensor>
120 label
id = particleCount_++;
125 <<
"Particle counter has overflowed. This might cause problems"
126 <<
" when reconstructing particle tracks." <<
endl;
194 return stepFraction_;
200 return stepFraction_;
230 if (mesh_.time().subCycling())
233 const TimeState& tsOld = mesh_.time().prevTimeState();
256 return s[0] + stepFraction_*
s[1];
262 return tetIndices(celli_, tetFacei_, tetPti_);
270 return movingTetTransform(0)[0];
274 return stationaryTetTransform();
281 return currentTetIndices().faceTri(mesh_).unitNormal();
293 return onFace() && mesh_.isInternalFace(facei_);
299 return onFace() && !mesh_.isInternalFace(facei_);
305 return onFace() ? mesh_.boundaryMesh().whichPatch(facei_) : -1;
311 return currentTetTransform() & coordinates_;
317 if (!onBoundaryFace())
320 <<
"Patch data was requested for a particle that isn't on a patch"
327 movingTetGeometry(1, centre, base, vertex1, vertex2);
329 n =
triPointRef(base[0], vertex1[0], vertex2[0]).unitNormal();
334 coordinates_.b()*base[1]
335 + coordinates_.c()*vertex1[1]
336 + coordinates_.d()*vertex2[1];
340 U /= mesh_.time().deltaTValue();
344 vector centre, base, vertex1, vertex2;
345 stationaryTetGeometry(centre, base, vertex1, vertex2);