34 void Foam::particle::stationaryTetGeometry
48 vertex1 = pts[triIs[1]];
49 vertex2 = pts[triIs[2]];
55 vector centre, base, vertex1, vertex2;
56 stationaryTetGeometry(centre, base, vertex1, vertex2);
62 inline void Foam::particle::movingTetGeometry
64 const scalar fraction,
67 Pair<vector>& vertex1,
71 const triFace triIs(currentTetIndices().faceTriIs(mesh_));
83 const vector ccOld = mesh_.oldCellCentres()[celli_];
84 const vector ccNew = mesh_.cellCentres()[celli_];
89 const Pair<scalar>
s = stepFractionSpan();
90 const scalar f0 =
s[0] + stepFraction_*
s[1], f1 = fraction*
s[1];
92 centre[0] = ccOld + f0*(ccNew - ccOld);
93 base[0] = ptsOld[triIs[0]] + f0*(ptsNew[triIs[0]] - ptsOld[triIs[0]]);
94 vertex1[0] = ptsOld[triIs[1]] + f0*(ptsNew[triIs[1]] - ptsOld[triIs[1]]);
95 vertex2[0] = ptsOld[triIs[2]] + f0*(ptsNew[triIs[2]] - ptsOld[triIs[2]]);
97 centre[1] = f1*(ccNew - ccOld);
98 base[1] = f1*(ptsNew[triIs[0]] - ptsOld[triIs[0]]);
99 vertex1[1] = f1*(ptsNew[triIs[1]] - ptsOld[triIs[1]]);
100 vertex2[1] = f1*(ptsNew[triIs[2]] - ptsOld[triIs[2]]);
106 const scalar fraction
109 Pair<vector> centre, base, vertex1, vertex2;
110 movingTetGeometry(fraction, centre, base, vertex1, vertex2);
113 Pair<barycentricTensor>
125 label
id = particleCount_++;
130 <<
"Particle counter has overflowed. This might cause problems"
131 <<
" when reconstructing particle tracks." <<
endl;
199 return stepFraction_;
205 return stepFraction_;
235 if (mesh_.time().subCycling())
238 const TimeState& tsOld = mesh_.time().prevTimeState();
261 return s[0] + stepFraction_*
s[1];
267 return tetIndices(celli_, tetFacei_, tetPti_);
273 if (mesh_.moving() && stepFraction_ != 1)
275 return movingTetTransform(0)[0];
279 return stationaryTetTransform();
286 return currentTetIndices().faceTri(mesh_).unitNormal();
298 return onFace() && mesh_.isInternalFace(facei_);
304 return onFace() && !mesh_.isInternalFace(facei_);
310 return onFace() ? mesh_.boundaryMesh().whichPatch(facei_) : -1;
316 return currentTetTransform() & coordinates_;
330 if (!onBoundaryFace())
333 <<
"Patch data was requested for a particle that isn't on a patch"
337 if ((mesh_.moving() && stepFraction_ != 1))
340 movingTetGeometry(1, centre, base, vertex1, vertex2);
342 n =
triPointRef(base[0], vertex1[0], vertex2[0]).unitNormal();
347 coordinates_.b()*base[1]
348 + coordinates_.c()*vertex1[1]
349 + coordinates_.d()*vertex2[1];
353 U /= mesh_.time().deltaTValue();
357 vector centre, base, vertex1, vertex2;
358 stationaryTetGeometry(centre, base, vertex1, vertex2);