42 Foam::interfaceTrackingFvMesh::pointDisplacement()
48 auto& displacement = tdisplacement.ref();
55 for (
const label curPoint : internalPoints)
61 for (label i=0; i<curPointFaces.size(); i++)
63 label curFace = curPointFaces[i];
74 pointNormals[curPoint]
78 vector& P = pointAndNormal[0];
81 displacement[curPoint] =
99 forAll(patchMirrorPoints, patchI)
101 patchMirrorPoints.set
120 if (contactAnglePtr_)
122 label ngbPolyPatchID =
125 if (ngbPolyPatchID != -1)
130 == wallFvPatch::typeName
152 forAll(rotationAxis, edgeI)
158 rotationAxis[edgeI] =
159 e*(
e&rotationAxis[edgeI])
160 /
mag((
e&rotationAxis[edgeI]));
162 rotationAxis /=
mag(rotationAxis) + SMALL;
165 forAll(rotationAxis2, edgeI)
167 rotationAxis2[edgeI] =
171 rotationAxis2[edgeI] =
173 *(rotationAxis2[edgeI]&rotationAxis[edgeI])
175 mag((rotationAxis2[edgeI]&rotationAxis[edgeI]))
179 rotationAxis2 /=
mag(rotationAxis2) + SMALL;
183 + rotationAxis*(rotationAxis &
N)*(1 -
cos(rotAngle))
184 + (rotationAxis^
N)*
sin(rotAngle);
188 N = (rotationAxis^
N);
190 N = (
N^rotationAxis2);
225 patchMirrorPoints[patchI] =
237 for (
const label curPoint : boundaryPoints)
248 forAll(curPointEdges, edgeI)
250 label curEdge = curPointEdges[edgeI];
260 label index = pEdges.find(curEdge);
269 mirrorPoints[++counter] =
279 curPointFaces.size() + mirrorPoints.size(),
285 for (label i=0; i<curPointFaces.size(); i++)
287 label curFace = curPointFaces[i];
292 for (label i=0; i<mirrorPoints.size(); i++)
294 lsPoints[++counter] = mirrorPoints[i];
299 lsPlanePointAndNormal
303 pointNormals[curPoint]
307 vector& P = pointAndNormal[0];
310 displacement[curPoint] =
323 == processorFaPatch::typeName
341 forAll(nonGlobalPatchPoints, pointI)
343 label curPatchPoint =
344 nonGlobalPatchPoints[pointI];
347 patchPointLabels[curPatchPoint];
351 lsPoints[curPatchPoint].
setSize(curPointFaces.size());
353 forAll(curPointFaces, faceI)
355 label curFace = curPointFaces[faceI];
371 toNeighbProc << lsPoints;
382 fromNeighbProc >> ngbLsPoints;
385 forAll(nonGlobalPatchPoints, pointI)
387 label curPatchPoint =
388 nonGlobalPatchPoints[pointI];
391 patchPointLabels[curPatchPoint];
393 label curNgbPoint = procPatch.
neighbPoints()[curPatchPoint];
397 lsPoints[curPatchPoint].
size()
398 + ngbLsPoints[curNgbPoint].
size(),
403 forAll(lsPoints[curPatchPoint], pointI)
405 allLsPoints[++counter] = lsPoints[curPatchPoint][pointI];
407 forAll(ngbLsPoints[curNgbPoint], pointI)
409 allLsPoints[++counter] = ngbLsPoints[curNgbPoint][pointI];
414 lsPlanePointAndNormal
418 pointNormals[curPoint]
422 vector& P = pointAndNormal[0];
427 displacement[curPoint] =
449 label curSharedPointIndex = addr.find(
k);
451 if (curSharedPointIndex != -1)
453 label curPoint = spLabels[curSharedPointIndex];
460 forAll(curPointFaces, faceI)
462 label curFace = curPointFaces[faceI];
472 if (curSharedPointIndex != -1)
474 label curPoint = spLabels[curSharedPointIndex];
476 label nAllPoints = 0;
477 forAll(procLsPoints, procI)
479 nAllPoints += procLsPoints[procI].size();
485 forAll(procLsPoints, procI)
487 forAll(procLsPoints[procI], pointI)
490 procLsPoints[procI][pointI];
496 lsPlanePointAndNormal
500 pointNormals[curPoint]
504 const vector& P = pointAndNormal[0];
505 const vector&
N = pointAndNormal[1];
507 displacement[curPoint] =
515 return tdisplacement;
520 Foam::interfaceTrackingFvMesh::lsPlanePointAndNormal
529 dir -= axis*(axis&dir);
539 const label nCoeffs = 2;
542 scalar
L = 2*
max(
mag(localPoints-avgLocalPoint));
543 for (label i=0; i<localPoints.size(); i++)
545 M[i][0] = (localPoints[i].x() - avgLocalPoint.
x())/
L;
546 M[i][1] = (localPoints[i].y() - avgLocalPoint.
y())/
L;
550 for (label i=0; i<
M.n(); i++)
552 for (label j=0; j<
M.m(); j++)
561 for (label i=0; i<nCoeffs; i++)
563 for (label j=0; j<nCoeffs; j++)
565 for (label
k=0;
k<
M.n();
k++)
567 lsM[i*nCoeffs+j] +=
M[
k][i]*
M[
k][j];
578 for (label i=0; i<nCoeffs; i++)
580 for (label j=0; j<
M.n(); j++)
582 for (label
k=0;
k<nCoeffs;
k++)
584 curInvMatrix[i][j] += invLsM[i*nCoeffs+
k]*
M[j][
k]*W[j];
593 for (label i=0; i<
points.size(); i++)
595 source[i] = (localPoints[i].z() - avgLocalPoint.
z())/
L;
598 for (label i=0; i<nCoeffs; i++)
600 for (label j=0; j<source.size(); j++)
602 coeffs[i] += curInvMatrix[i][j]*source[j];
606 vector n0(-coeffs[0], -coeffs[1], 1.0);
607 n0 = cs.globalVector(n0);
611 p0 = cs.globalPosition(
p0);
614 auto& pointAndNormal = tpointAndNormal.ref();
616 pointAndNormal[0] =
p0;
617 pointAndNormal[1] = n0;
619 return tpointAndNormal;