34 namespace patchToPatches
54 bool Foam::patchToPatches::rays::intersectFaces
64 const treeBoundBox srcFaceBox =
72 const treeBoundBox tgtFaceBox =
75 if (srcFaceBox.overlaps(tgtFaceBox))
77 srcLocalTgtFaces_[srcFacei].append(tgtFacei);
78 tgtLocalSrcFaces_[tgtFacei].append(srcFacei);
106 localTgtPatchPtr_.reset
108 new PrimitiveOldTimePatch<faceList, pointField>
110 faceList(tgtPatch, newToOldLocalTgtFace),
116 return newToOldLocalTgtFace;
120 void Foam::patchToPatches::rays::distributeSrc
125 localSrcProcFacesPtr_.reset
129 distributePatch(srcMapPtr_(), srcPatch, localSrcPatchPtr_)
141 const transformer& tgtToSrc
144 const label nCouples =
155 if (!isSingleProcess() && !
isNull(tgtToSrc))
157 autoPtr<PrimitiveOldTimePatch<faceList, pointField>>
158 localTgtPatchPtr(localTgtPatchPtr_.ptr());
160 localTgtPatchPtr_.set
162 new PrimitiveOldTimePatch<faceList, pointField>
165 tgtToSrc.invTransformPosition(localTgtPatchPtr().
points()),
166 isNull(localTgtPatchPtr().points0())
167 ? NullObjectRef<pointField>()
168 : tgtToSrc.invTransformPosition(localTgtPatchPtr().points0())()
180 const autoPtr<PrimitiveOldTimePatch<faceList, pointField>>&
182 const autoPtr<List<remote>>& localOutProcFacesPtr,
183 const List<DynamicList<label>>& inLocalOutFaces,
184 const scalar fraction,
191 forAll(inLocalOutFaces[inFacei], i)
193 const label localOutFacei = inLocalOutFaces[inFacei][i];
197 ? outPatch[localOutFacei]
198 : localOutPatchPtr()[localOutFacei];
203 : localOutPatchPtr().points();
207 : localOutPatchPtr().points0();
211 (1 - fraction)*outF.points(outPoints0)
212 + fraction*outF.points(outPoints)
226 : localOutProcFacesPtr()[localOutFacei];
230 return remote({-1, -1});
235 Foam::patchToPatches::rays::srcWeights()
const
238 return tmpNrc<List<DynamicList<scalar>>>(
nullptr);
243 Foam::patchToPatches::rays::tgtWeights()
const
246 return tmpNrc<List<DynamicList<scalar>>>(
nullptr);
272 const scalar fraction,
273 const label srcFacei,
284 localTgtProcFacesPtr_,
298 const scalar fraction,
299 const label tgtFacei,
310 localSrcProcFacesPtr_,
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
const Point & rawPoint() const
Return point with no checking.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
Class to generate coupling geometry between two primitive patches.
virtual treeBoundBox srcBox(const face &srcFace, const pointField &srcPoints, const vectorField &srcPointNormals) const =0
Get the bound box for a source face.
virtual labelList finaliseLocal(const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0, const primitiveOldTimePatch &tgtPatch)
Finalise the intersection locally. Trims the local target patch.
treeBoundBox tgtBox(const primitiveOldTimePatch &tgtPatch, const label tgtFacei) const
Get the bound box for a target face.
virtual label finalise(const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0, const primitiveOldTimePatch &tgtPatch, const transformer &tgtToSrc)
Finalising.
static treeBoundBox srcBoxStatic(const face &srcFace, const pointField &srcPoints, const vectorField &srcPointNormals)
Get the bound box for a source face.
rays(const bool reverse)
Construct from components.
remote srcToTgtRay(const primitiveOldTimePatch &tgtPatch, const scalar fraction, const label srcFacei, const vector &srcP, const vector &srcN, point &tgtP) const
Compute a ray intersection from the source side to the target.
remote tgtToSrcRay(const primitiveOldTimePatch &srcPatch, const scalar fraction, const label tgtFacei, const vector &tgtP, const vector &tgtN, point &srcP) const
Compute a ray intersection from the target side to the source.
Struct for keeping processor, element (cell, face, point) index.
A class for managing temporary objects without reference counting.
Standard boundBox + extra functionality for use in octree.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
volVectorField vectorField(fieldObject, mesh)
defineTypeNameAndDebug(intersection, 0)
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
vectorField pointField
pointField is a vectorField.
vector point
Point is a vector.
void reverse(UList< T > &, const label n)
Vector< scalar > vector
A scalar version of the templated Vector.
PrimitiveOldTimePatch< SubList< face >, const pointField & > primitiveOldTimePatch
Addressing for a faceList slice.
PointHit< point > pointHit
Field< vector > vectorField
Specialisation of Field<T> for vector.
bool isNull(const T &t)
Return true if t is a reference to the nullObject of type T.
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.