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