38 namespace patchToPatches
123 srcDistances_.resize(srcPatch.size());
124 srcDistances_ = vGreat;
126 tgtDistances_.resize(tgtPatch.size());
127 tgtDistances_ = vGreat;
148 tgtDistances_ =
List<scalar>(tgtDistances_, newToOldLocalTgtFace);
150 return newToOldLocalTgtFace;
160 forAll(srcLocalTgtFaces_, srcFacei)
162 srcLocalTgtFaces_[srcFacei].resize
164 min(srcLocalTgtFaces_[srcFacei].size(), 1)
167 forAll(tgtLocalSrcFaces_, tgtFacei)
169 tgtLocalSrcFaces_[tgtFacei].resize
171 min(tgtLocalSrcFaces_[tgtFacei].size(), 1)
177 forAll(tgtLocalSrcFaces_, tgtFacei)
179 if (!tgtLocalSrcFaces_[tgtFacei].empty())
181 tgtDistances[tgtFacei].
resize(1, tgtDistances_[tgtFacei]);
197 tgtDistances_.resize(tgtLocalSrcFaces_.size());
198 forAll(tgtLocalSrcFaces_, tgtFacei)
200 if (tgtLocalSrcFaces_[tgtFacei].size() > 1)
204 const label srcFacei = tgtLocalSrcFaces_[tgtFacei][i];
206 tgtLocalSrcFaces_[tgtFacei].resize(1);
207 tgtLocalSrcFaces_[tgtFacei][0] = srcFacei;
209 tgtDistances_[tgtFacei] = tgtDistances[tgtFacei][i];
225 forAll(srcLocalTgtFaces_, srcFacei)
227 srcLocalTgtFaces_[srcFacei].resize
229 min(srcLocalTgtFaces_[srcFacei].size(), 1)
232 forAll(tgtLocalSrcFaces_, tgtFacei)
234 tgtLocalSrcFaces_[tgtFacei].resize
236 min(tgtLocalSrcFaces_[tgtFacei].size(), 1)
240 const label nCouples =
258 result += !ll[i].empty();
265 <<
"Coupled " << countNonEmpty(srcLocalTgtFaces_)
267 <<
" source faces and " << countNonEmpty(tgtLocalSrcFaces_)
269 <<
" target faces" <<
endl;
274 auto writeConnections = []
283 typeName +
"_" + (isSrc ?
"src" :
"tgt") +
"Connections";
287 forAll(faceLocalOtherFaces, facei)
290 forAll(faceLocalOtherFaces[facei], i)
292 const label otherFacei = faceLocalOtherFaces[facei][i];
293 const point& q = otherPatch.faceCentres()[otherFacei];
299 writeConnections(srcPatch, tgtPatch,
true, srcLocalTgtFaces_);
300 writeConnections(tgtPatch, srcPatch,
false, tgtLocalSrcFaces_);
302 auto writeNotConnected = []
310 forAll(faceLocalOtherFaces, facei)
312 if (faceLocalOtherFaces[facei].empty())
314 unconnected.
append(facei);
319 typeName +
"_" + (isSrc ?
"src" :
"tgt") +
"NotConnected";
333 writeNotConnected(srcPatch, srcLocalTgtFaces_,
true);
334 writeNotConnected(tgtPatch, tgtLocalSrcFaces_,
false);
351 forAll(srcLocalTgtFaces_, srcFacei)
353 if (!srcLocalTgtFaces_[srcFacei].empty())
355 result[srcFacei].
resize(1, scalar(1));
373 forAll(tgtLocalSrcFaces_, tgtFacei)
375 if (!tgtLocalSrcFaces_[tgtFacei].empty())
377 result[tgtFacei].
resize(1, scalar(1));
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
Functions for constructing bounding spheres of lists of points.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
void resize(const label)
Alias for setSize(const label)
OFstream which keeps track of vertices.
const List< FaceType > & localFaces() const
Return patch faces addressing into local point list.
const Field< PointType > & localPoints() const
Return pointField of points in patch.
const Field< PointType > & faceCentres() const
Return face centres for patch.
A List with indirect addressing.
static bool & parRun()
Is this a parallel run?
Class to generate coupling geometry between two primitive patches.
List< DynamicList< label > > tgtLocalSrcFaces_
For each target face, the coupled local source faces.
virtual void rDistributeTgt(const primitiveOldTimePatch &tgtPatch)
Send data that resulted from an intersection between the source.
virtual labelList finaliseLocal(const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0, const primitiveOldTimePatch &tgtPatch)
Finalise the intersection locally. Trims the local target patch.
List< DynamicList< label > > srcLocalTgtFaces_
For each source face, the coupled local target faces.
virtual label finalise(const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0, const primitiveOldTimePatch &tgtPatch, const transformer &tgtToSrc)
Finalising.
Class to generate patchToPatch coupling geometry. Couples a face to the single nearby opposite face o...
virtual bool intersectFaces(const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0, const primitiveOldTimePatch &tgtPatch, const label srcFacei, const label tgtFacei)
Intersect two faces.
virtual void initialise(const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0, const primitiveOldTimePatch &tgtPatch)
Initialisation.
Class to generate patchToPatch coupling geometry. Couples a face to the single nearest opposite face ...
nearest(const bool reverse)
Construct from components.
virtual tmpNrc< List< DynamicList< scalar > > > tgtWeights() const
For each target face, the coupled source weights.
List< scalar > tgtDistances_
For each target face, the distance to its coupled source face.
List< scalar > srcDistances_
For each source face, the distance to its coupled target face.
virtual void rDistributeTgt(const primitiveOldTimePatch &tgtPatch)
Send data that resulted from an intersection between the source.
virtual labelList finaliseLocal(const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0, const primitiveOldTimePatch &tgtPatch)
Finalise the intersection locally. Trims the local target patch.
virtual bool intersectFaces(const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0, const primitiveOldTimePatch &tgtPatch, const label srcFacei, const label tgtFacei)
Intersect two faces.
virtual void initialise(const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0, const primitiveOldTimePatch &tgtPatch)
Initialisation.
virtual tmpNrc< List< DynamicList< scalar > > > srcWeights() const
For each source face, the coupled target weights.
virtual label finalise(const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0, const primitiveOldTimePatch &tgtPatch, const transformer &tgtToSrc)
Finalise the intersection.
A class for managing temporary objects without reference counting.
T & ref()
Return non-const reference or generate a fatal error.
A class for handling words, derived from string.
addToRunTimeSelectionTable(patchToPatch, intersection, bool)
defineTypeNameAndDebug(intersection, 0)
void write(const fileName &file, const word &title, const bool binary, const PointField &points, const VertexList &vertices, const LineList &lines, const FaceList &faces, const wordList &fieldNames, const boolList &fieldIsPointValues, const UPtrList< const Field< label >> &fieldLabelValues #define FieldTypeValuesConstArg(Type, nullArg))
Write VTK polygonal data to a file. Takes a PtrList of fields of labels and.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
line< point, const point & > linePointRef
Line using referred points.
word name(const bool)
Return a word representation of a bool.
void reverse(UList< T > &, const label n)
labelList first(const UList< labelPair > &p)
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
List< labelList > labelListList
A List of labelList.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
label findMin(const ListType &, const label start=0)
Find index of min element (and less than given element).
Ostream & indent(Ostream &os)
Indent stream.
dimensioned< scalar > magSqr(const dimensioned< Type > &)