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];
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;
519 Foam::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;
Base class for coordinate system specification, the default coordinate system type is cartesian ...
const labelListList & pointEdges() const
Return point-edge addressing.
labelList internalPoints() const
Return internal point labels.
void size(const label n)
Older name for setAddressableSize.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &f1)
vectorField & facesDisplacementDir()
Return reference to control points displacement direction field.
label nGlobalPoints() const noexcept
Return number of globally shared points.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const Field< point_type > & localPoints() const
Return pointField of points in patch.
label nPoints() const noexcept
Number of mesh points.
const vector L(dict.get< vector >("L"))
const labelList & nonGlobalPatchPoints() const
Return the set of labels of the processor patch points which are.
const labelListList & pointEdges() const
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Unit conversion functions.
UPtrList< const labelUList > edgeFaces() const
Return a list of edgeFaces for each patch.
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
vectorField & pointsDisplacementDir()
Return reference to point displacement direction field.
const labelList & sharedPointLabels() const noexcept
Return indices of local points that are globally shared.
const labelList & pointLabels() const
Return patch point labels.
const labelList & neighbPoints() const
Return neighbour point labels. This is for my local point the.
virtual label size() const
Patch size is the number of edge labels, but can be overloaded.
const faGlobalMeshData & globalData() const
Return parallel info (demand-driven)
SubList< label > subList
Declare type of subList.
label k
Boltzmann constant.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
faMesh & aMesh()
Return reference to finite area mesh.
A templated (2 x 2) tensor of objects of <T> derived from VectorSpace.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
A field of fields is a PtrList of fields with reference counting.
virtual const pointField & points() const
Return raw points.
#define forAll(list, i)
Loop across all elements in list.
Input inter-processor communications stream.
const uindirectPrimitivePatch & patch() const
Return constant reference to primitive patch.
label size() const noexcept
The number of elements in table.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
A List obtained as a section of another List.
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run. ...
const dimensionedScalar e
Elementary charge.
void setSize(const label n)
Alias for resize()
dimensionedScalar cos(const dimensionedScalar &ds)
static const Identity< scalar > I
const labelList & sharedPointAddr() const noexcept
Return addressing into the complete globally shared points list.
virtual const pointField & oldPoints() const
Return old points (mesh motion)
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
const labelListList & edgeFaces() const
Return edge-face addressing.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
vectorField & controlPoints()
Return control points.
label find(const T &val) const
Find index of the first occurrence of the value.
const labelListList & pointFaces() const
Return point-face addressing.
dimensionedScalar sin(const dimensionedScalar &ds)
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
tmp< surfaceVectorField > delta() const
Return face deltas as surfaceVectorField.
Output inter-processor communications stream.
const faBoundaryMesh & boundary() const noexcept
Return constant reference to boundary mesh.
labelList & motionPointsMask()
Return reference to motion points mask field.
const Vector< label > N(dict.get< Vector< label >>("N"))
int neighbProcNo() const noexcept
Return neighbour processor number.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
static void allGatherList(UList< T > &values, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Gather data, but keep individual values separate. Uses MPI_Allgather or manual linear/tree communicat...
labelList boundaryPoints() const
Return boundary point labels.
Type gAverage(const FieldField< Field, Type > &f)
const edgeVectorField & edgeAreaNormals() const
Return edge area normals.
const labelListList & pointFaces() const
const fvBoundaryMesh & boundary() const noexcept
Return reference to boundary mesh.
Field< vector > vectorField
Specialisation of Field<T> for vector.
A class for managing temporary objects.
"buffered" : (MPI_Bsend, MPI_Recv)
const vectorField & pointAreaNormals() const
Return point area normals.
constexpr scalar degToRad(const scalar deg) noexcept
Conversion from degrees to radians.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
const volScalarField & p0
const labelListList & edgeFaces() const
static constexpr const zero Zero
Global zero (0)