35 namespace patchToPatches
120 srcDistances_.resize(srcPatch.size());
121 srcDistances_ = vGreat;
123 tgtDistances_.resize(tgtPatch.size());
124 tgtDistances_ = vGreat;
145 tgtDistances_ =
List<scalar>(tgtDistances_, newToOldLocalTgtFace);
147 return newToOldLocalTgtFace;
157 forAll(srcLocalTgtFaces_, srcFacei)
159 srcLocalTgtFaces_[srcFacei].resize
161 min(srcLocalTgtFaces_[srcFacei].size(), 1)
164 forAll(tgtLocalSrcFaces_, tgtFacei)
166 tgtLocalSrcFaces_[tgtFacei].resize
168 min(tgtLocalSrcFaces_[tgtFacei].size(), 1)
174 forAll(tgtLocalSrcFaces_, tgtFacei)
176 if (!tgtLocalSrcFaces_[tgtFacei].empty())
178 tgtDistances[tgtFacei].
resize(1, tgtDistances_[tgtFacei]);
194 tgtDistances_.resize(tgtLocalSrcFaces_.size());
195 forAll(tgtLocalSrcFaces_, tgtFacei)
197 if (tgtLocalSrcFaces_[tgtFacei].size() > 1)
201 const label srcFacei = tgtLocalSrcFaces_[tgtFacei][i];
203 tgtLocalSrcFaces_[tgtFacei].resize(1);
204 tgtLocalSrcFaces_[tgtFacei][0] = srcFacei;
206 tgtDistances_[tgtFacei] = tgtDistances[tgtFacei][i];
222 forAll(srcLocalTgtFaces_, srcFacei)
224 srcLocalTgtFaces_[srcFacei].resize
226 min(srcLocalTgtFaces_[srcFacei].size(), 1)
229 forAll(tgtLocalSrcFaces_, tgtFacei)
231 tgtLocalSrcFaces_[tgtFacei].resize
233 min(tgtLocalSrcFaces_[tgtFacei].size(), 1)
237 const label nCouples =
255 result += !ll[i].empty();
262 <<
"Coupled " << countNonEmpty(srcLocalTgtFaces_)
264 <<
" source faces and " << countNonEmpty(tgtLocalSrcFaces_)
266 <<
" target faces" <<
endl;
271 auto writeConnections = []
280 typeName +
"_" + (isSrc ?
"src" :
"tgt") +
"Connections";
284 forAll(faceLocalOtherFaces, facei)
287 forAll(faceLocalOtherFaces[facei], i)
289 const label otherFacei = faceLocalOtherFaces[facei][i];
290 const point& q = otherPatch.faceCentres()[otherFacei];
296 writeConnections(srcPatch, tgtPatch,
true, srcLocalTgtFaces_);
297 writeConnections(tgtPatch, srcPatch,
false, tgtLocalSrcFaces_);
299 auto writeNotConnected = []
307 forAll(faceLocalOtherFaces, facei)
309 if (faceLocalOtherFaces[facei].empty())
311 unconnected.
append(facei);
316 typeName +
"_" + (isSrc ?
"src" :
"tgt") +
"NotConnected";
330 writeNotConnected(srcPatch, srcLocalTgtFaces_,
true);
331 writeNotConnected(tgtPatch, tgtLocalSrcFaces_,
false);
348 forAll(srcLocalTgtFaces_, srcFacei)
350 if (!srcLocalTgtFaces_[srcFacei].empty())
352 result[srcFacei].
resize(1, scalar(1));
370 forAll(tgtLocalSrcFaces_, tgtFacei)
372 if (!tgtLocalSrcFaces_[tgtFacei].empty())
374 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.
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.
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
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.
void reverse(UList< T > &, const label n)
labelList first(const UList< labelPair > &p)
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)
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
label findMin(const ListType &, const label start=0)
Find index of min element (and less than given element).
tmp< DimensionedField< scalar, GeoMesh, Field > > magSqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
Ostream & indent(Ostream &os)
Indent stream.