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)
130 == wallFvPatch::typeName
140 - contactAnglePtr_->boundaryField()[patchI]
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
326 const processorFaPatch& procPatch =
332 FieldField<Field, vector> lsPoints(patchPointLabels.
size());
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];
365 OPstream toNeighbProc
371 toNeighbProc << lsPoints;
374 FieldField<Field, vector> ngbLsPoints(patchPointLabels.
size());
376 IPstream fromNeighbProc
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];
458 List<vector>(curPointFaces.
size());
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;
518Foam::tmp<Foam::vectorField>
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;
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
label size() const noexcept
bool set(const label i, bool val=true)
A bitSet::set() method for a list of bool.
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.
static void allGatherList(UList< T > &values, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Gather data, but keep individual values separate. Uses MPI_Allgather or manual communication.
void size(const label n)
Older name for setAddressableSize.
label find(const T &val) const
Find index of the first occurrence of the value.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Negative if the process is not a...
@ buffered
"buffered" : (MPI_Bsend, MPI_Recv)
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run.
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 (demand-driven).
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, but can be overloaded.
const labelList & pointLabels() const
Return patch point labels.
const fvBoundaryMesh & boundary() const noexcept
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.
const globalMeshData & globalData() const
Return parallel info (demand-driven).
virtual const pointField & oldPoints() const
Return old points (mesh motion).
virtual const pointField & points() const
Return raw points.
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.
const labelList & nonGlobalPatchPoints() const
Return the set of labels of the processor patch points which are.
A class for managing temporary objects.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
const volScalarField & p0
List< edge > edgeList
List of edge.
Type gAverage(const FieldField< Field, Type > &f, const label comm)
The global arithmetic average of a FieldField.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
RectangularMatrix< scalar > scalarRectangularMatrix
dimensionedScalar sin(const dimensionedScalar &ds)
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.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Tensor2D< scalar > tensor2D
Tensor2D of scalars, i.e. Tensor2D<scalar>.
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.
static constexpr const zero Zero
Global zero (0).
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
vectorField pointField
pointField is a vectorField.
UList< label > labelUList
A UList of labels.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &f1, const label comm)
dimensionedScalar cos(const dimensionedScalar &ds)
#define forAll(list, i)
Loop across all elements in list.
Unit conversion functions.
const vector L(dict.get< vector >("L"))
const Vector< label > N(dict.get< Vector< label > >("N"))