34 namespace patchToPatches
55 bool Foam::patchToPatches::rays::intersectFaces
65 const treeBoundBox srcFaceBox =
73 const treeBoundBox tgtFaceBox =
76 if (srcFaceBox.overlaps(tgtFaceBox))
78 srcLocalTgtFaces_[srcFacei].append(tgtFacei);
79 tgtLocalSrcFaces_[tgtFacei].append(srcFacei);
91 Foam::patchToPatches::rays::distributeTgt
97 distributionMap& tgtMap
103 tmpNrc<PrimitiveOldTimePatch<faceList, pointField>> localTgtPatchPtr =
113 localTgtPatchPtr_.reset(localTgtPatchPtr.ptr());
116 tmpNrc<PrimitiveOldTimePatch<faceList, pointField>>
124 Foam::patchToPatches::rays::distributeSrc
127 distributionMap& srcMap
133 tmpNrc<PrimitiveOldTimePatch<faceList, pointField>> localSrcPatchPtr =
136 localSrcPatchPtr_.reset(localSrcPatchPtr.ptr());
139 tmpNrc<PrimitiveOldTimePatch<faceList, pointField>>
152 const transformer& tgtToSrc
155 const label nCouples =
166 if (!isSingleProcess() && !
isNull(tgtToSrc))
168 autoPtr<PrimitiveOldTimePatch<faceList, pointField>>
169 localTgtPatchPtr(localTgtPatchPtr_.ptr());
171 localTgtPatchPtr_.set
173 new PrimitiveOldTimePatch<faceList, pointField>
176 tgtToSrc.invTransformPosition(localTgtPatchPtr().
points()),
177 isNull(localTgtPatchPtr().points0())
178 ? NullObjectRef<pointField>()
179 : tgtToSrc.invTransformPosition(localTgtPatchPtr().points0())()
191 const autoPtr<PrimitiveOldTimePatch<faceList, pointField>>&
193 const autoPtr<List<procFace>>& localOutProcFacesPtr,
194 const List<DynamicList<label>>& inLocalOutFaces,
195 const scalar fraction,
202 forAll(inLocalOutFaces[inFacei], i)
204 const label localOutFacei = inLocalOutFaces[inFacei][i];
208 ? outPatch[localOutFacei]
209 : localOutPatchPtr()[localOutFacei];
214 : localOutPatchPtr().points();
218 : localOutPatchPtr().points0();
222 (1 - fraction)*outF.points(outPoints0)
223 + fraction*outF.points(outPoints)
237 : localOutProcFacesPtr()[localOutFacei];
241 return procFace({-1, -1});
283 const scalar fraction,
284 const label srcFacei,
295 localTgtProcFacesPtr_,
309 const scalar fraction,
310 const label tgtFacei,
321 localSrcProcFacesPtr_,
addToRunTimeSelectionTable(patchToPatch, intersection, bool)
virtual treeBoundBox srcBox(const face &srcFace, const pointField &srcPoints, const vectorField &srcPointNormals) const =0
Get the bound box for a source face.
#define forAll(list, i)
Loop across all elements in list.
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Structure to conveniently store processor and face indices.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
virtual tmpNrc< List< DynamicList< scalar > > > tgtWeights(const primitivePatch &tgtPatch) const
For each target face, the coupled source weights.
Vector< scalar > vector
A scalar version of the templated Vector.
Macros for easy insertion into run-time selection tables.
virtual tmpNrc< PrimitiveOldTimePatch< faceList, pointField > > distributeSrc(const primitiveOldTimePatch &srcPatch, distributionMap &srcMap)
Distribute the source patch so that everything the target.
A list of faces which address into the list of points.
vectorField pointField
pointField is a vectorField.
bool isNull(const T &t)
Return true if t is a reference to the nullObject of type T.
defineTypeNameAndDebug(intersection, 0)
PrimitiveOldTimePatch< SubList< face >, const pointField & > primitiveOldTimePatch
Addressing for a faceList slice.
virtual tmpNrc< PrimitiveOldTimePatch< faceList, pointField > > distributeTgt(const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0, const primitiveOldTimePatch &tgtPatch, distributionMap &tgtMap)
Distribute the target patch so that enough is locally available.
const Point & rawPoint() const
Return point with no checking.
procFace 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.
A class for managing temporary objects without reference counting.
virtual label finalise(const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0, const primitiveOldTimePatch &tgtPatch, const transformer &tgtToSrc)
Finalising.
vector point
Point is a vector.
virtual tmpNrc< List< DynamicList< scalar > > > srcWeights(const primitivePatch &srcPatch) const
For each source face, the coupled target weights.
Standard boundBox + extra functionality for use in octree.
treeBoundBox tgtBox(const primitiveOldTimePatch &tgtPatch, const label tgtFacei) const
Get the bound box for a target face.
Field< vector > vectorField
Specialisation of Field<T> for vector.
procFace 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.
static treeBoundBox srcBoxStatic(const face &srcFace, const pointField &srcPoints, const vectorField &srcPointNormals)
Get the bound box for a source face.
PointHit< point > pointHit
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Class to generate coupling geometry between two primitive patches.
rays(const bool reverse)
Construct from components.