33 namespace patchToPatches
43 Foam::label Foam::patchToPatches::matching::finalise
49 const transformer& tgtToSrc
52 const label nCouples =
63 auto forwardCheck = []
66 const List<DynamicList<label>>& localOtherFaces,
70 forAll(localOtherFaces, facei)
72 if (localOtherFaces[facei].size() != 1)
75 << (isSrc ?
"Source" :
"Target")
76 <<
" face #" << facei <<
" at "
77 << patch.faceCentres()[facei]
78 <<
" did not match a face on the "
79 << (isSrc ?
"target" :
"source")
88 auto reverseCheck = []
91 const List<DynamicList<label>>& otherLocalFaces,
92 const autoPtr<distributionMap>& mapPtr,
98 mapPtr.valid() ? mapPtr->constructSize() : patch.size(),
102 forAll(otherLocalFaces, otherFacei)
104 forAll(otherLocalFaces[otherFacei], i)
106 count[otherLocalFaces[otherFacei][i]] ++;
117 mapPtr->constructMap(),
130 if (
count[facei] != 1)
133 << (isSrc ?
"Source" :
"Target")
134 <<
" face #" << facei <<
" at "
135 << patch.faceCentres()[facei]
136 <<
" did not match a face on the "
137 << (isSrc ?
"target" :
"source")
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
static void distribute(const Pstream::commsTypes commsType, const List< labelPair > &schedule, const label constructSize, const labelListList &subMap, const bool subHasFlip, const labelListList &constructMap, const bool constructHasFlip, List< T > &, const negateOp &negOp, const int tag=UPstream::msgType())
Distribute data. Note:schedule only used for.
Class to generate coupling geometry between two primitive patches.
tmp< Field< Type > > tgtToSrc(const Field< Type > &tgtFld) const
Interpolate a target patch field to the source with no left.
List< DynamicList< label > > tgtLocalSrcFaces_
For each target face, the coupled local source faces.
autoPtr< distributionMap > srcMapPtr_
Map from source patch faces to target-local source patch faces.
List< DynamicList< label > > srcLocalTgtFaces_
For each source face, the coupled local target faces.
autoPtr< distributionMap > tgtMapPtr_
Map from target patch faces to source-local target patch faces.
Class to generate patchToPatch coupling geometry. Couples a face to the single matching opposite face...
matching(const bool reverse)
Construct from components.
Class to generate patchToPatch coupling geometry. Couples a face to the single nearest opposite face ...
virtual label finalise(const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0, const primitiveOldTimePatch &tgtPatch, const transformer &tgtToSrc)
Finalise the intersection.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
volVectorField vectorField(fieldObject, mesh)
addToRunTimeSelectionTable(patchToPatch, intersection, bool)
defineTypeNameAndDebug(intersection, 0)
errorManipArg< error, int > exit(error &err, const int errNo=1)
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.
void reverse(UList< T > &, const label n)
PrimitiveOldTimePatch< SubList< face >, const pointField & > primitiveOldTimePatch
Addressing for a faceList slice.
label count(const ListType &l, typename ListType::const_reference x)
Count the number of occurrences of a value in a list.