42Foam::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)
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] =
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];
471 if (curSharedPointIndex != -1)
473 label curPoint = spLabels[curSharedPointIndex];
475 label nAllPoints = 0;
476 forAll(procLsPoints, procI)
478 nAllPoints += procLsPoints[procI].size();
484 forAll(procLsPoints, procI)
486 forAll(procLsPoints[procI], pointI)
489 procLsPoints[procI][pointI];
495 lsPlanePointAndNormal
499 pointNormals[curPoint]
503 const vector& P = pointAndNormal[0];
504 const vector&
N = pointAndNormal[1];
506 displacement[curPoint] =
514 return tdisplacement;
519Foam::interfaceTrackingFvMesh::lsPlanePointAndNormal
528 dir -= axis*(axis&dir);
538 const label nCoeffs = 2;
541 scalar
L = 2*
max(
mag(localPoints-avgLocalPoint));
542 for (label i=0; i<localPoints.size(); i++)
544 M[i][0] = (localPoints[i].x() - avgLocalPoint.x())/
L;
545 M[i][1] = (localPoints[i].y() - avgLocalPoint.y())/
L;
549 for (label i=0; i<
M.n(); i++)
551 for (label j=0; j<
M.m(); j++)
560 for (label i=0; i<nCoeffs; i++)
562 for (label j=0; j<nCoeffs; j++)
564 for (label
k=0;
k<
M.n();
k++)
566 lsM[i*nCoeffs+j] +=
M[
k][i]*
M[
k][j];
577 for (label i=0; i<nCoeffs; i++)
579 for (label j=0; j<
M.n(); j++)
581 for (label
k=0;
k<nCoeffs;
k++)
583 curInvMatrix[i][j] += invLsM[i*nCoeffs+
k]*
M[j][
k]*W[j];
594 source[i] = (localPoints[i].z() - avgLocalPoint.z())/
L;
597 for (label i=0; i<nCoeffs; i++)
599 for (label j=0; j<source.size(); j++)
601 coeffs[i] += curInvMatrix[i][j]*source[j];
605 vector n0(-coeffs[0], -coeffs[1], 1.0);
606 n0 = cs.globalVector(n0);
610 p0 = cs.globalPosition(
p0);
613 auto& pointAndNormal = tpointAndNormal.ref();
615 pointAndNormal[0] =
p0;
616 pointAndNormal[1] = n0;
618 return tpointAndNormal;
A field of fields is a PtrList of fields with reference counting.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
label size() const noexcept
The number of elements in table.
Input inter-processor communications stream.
SubList< label > subList
Declare type of subList.
void setSize(const label n)
Alias for resize()
Output inter-processor communications stream.
const labelListList & pointEdges() const
Return point-edge addressing.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
const Field< point_type > & localPoints() const
Return pointField of points in patch.
const labelListList & pointFaces() const
Return point-face addressing.
const labelListList & edgeFaces() const
Return edge-face addressing.
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)
A List obtained as a section of another List.
A templated (2 x 2) tensor of objects of <T> derived from VectorSpace.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
label find(const T &val, label pos=0) const
Find index of the first occurrence of the value.
void size(const label n)
Older name for setAddressableSize.
Base class for coordinate system specification, the default coordinate system type is cartesian .
UPtrList< const labelUList > edgeFaces() const
Return a list of edgeFaces for each patch.
const labelList & sharedPointAddr() const noexcept
Return addressing into the complete globally shared points list.
const labelList & sharedPointLabels() const noexcept
Return indices of local points that are globally shared.
label nGlobalPoints() const noexcept
Return number of globally shared points.
labelList internalPoints() const
Return internal point labels.
const faBoundaryMesh & boundary() const noexcept
Return constant reference to boundary mesh.
const uindirectPrimitivePatch & patch() const
Return constant reference to primitive patch.
const faGlobalMeshData & globalData() const
Return parallel info.
const edgeVectorField & edgeAreaNormals() const
Return edge area normals.
const vectorField & pointAreaNormals() const
Return point area normals.
labelList boundaryPoints() const
Return boundary point labels.
virtual label size() const
Patch size is the number of edge labels.
const labelList & pointLabels() const
Return patch point labels.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
tmp< surfaceVectorField > delta() const
Return face deltas as surfaceVectorField.
vectorField & controlPoints()
Return control points.
vectorField & pointsDisplacementDir()
Return reference to point displacement direction field.
vectorField & facesDisplacementDir()
Return reference to control points displacement direction field.
faMesh & aMesh()
Return reference to finite area mesh.
labelList & motionPointsMask()
Return reference to motion points mask field.
virtual const pointField & oldPoints() const
Return old points (mesh motion)
const labelListList & pointEdges() const
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
const labelListList & pointFaces() const
const labelListList & edgeFaces() const
const labelList & neighbPoints() const
Return neighbour point labels. This is for my local point the.
int neighbProcNo() const noexcept
Return neighbour processor number.
int myProcNo() const noexcept
Return processor number.
const labelList & nonGlobalPatchPoints() const
Return the set of labels of the processor patch points which are.
A class for managing temporary objects.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
const volScalarField & p0
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedScalar sin(const dimensionedScalar &ds)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
static const Identity< scalar > I
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
constexpr scalar degToRad() noexcept
Multiplication factor for degrees to radians conversion.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Field< vector > vectorField
Specialisation of Field<T> for vector.
Type gAverage(const FieldField< Field, Type > &f)
static constexpr const zero Zero
Global zero (0)
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
dimensionedScalar cos(const dimensionedScalar &ds)
#define forAll(list, i)
Loop across all elements in list.
static const char *const typeName
The type name used in ensight case files.
Unit conversion functions.
const vector L(dict.get< vector >("L"))
const Vector< label > N(dict.get< Vector< label > >("N"))