49 neighbPointsPtr_.clear();
50 nonGlobalPatchPointsPtr_.clear();
62 const label nbrPolyPatchi,
64 const label neighbProcNo,
70 neighbProcNo_(neighbProcNo),
73 neighbEdgeFaceCentres_(),
74 neighbPointsPtr_(nullptr),
75 nonGlobalPatchPointsPtr_(nullptr)
84 const label nbrPolyPatchi,
86 const label neighbProcNo,
110 const word& patchType
114 myProcNo_(
dict.get<label>(
"myProcNo")),
115 neighbProcNo_(
dict.get<label>(
"neighbProcNo")),
116 neighbEdgeCentres_(),
117 neighbEdgeLengths_(),
118 neighbEdgeFaceCentres_(),
119 neighbPointsPtr_(nullptr),
120 nonGlobalPatchPointsPtr_(nullptr)
151 labelList& ngpp = *nonGlobalPatchPointsPtr_;
162 label nNonShared = 0;
164 forAll(faMeshPatchPoints, pointi)
166 const label mpi = meshPoints[faMeshPatchPoints[pointi]];
167 if (!sharedPoints.
found(mpi))
169 ngpp[nNonShared] = pointi;
186 <<
"On patch " <<
name()
187 <<
" trying to access out of range neighbour processor "
188 << neighbProcNo() <<
". This can happen if" <<
nl
189 <<
" trying to run on an incorrect number of processors"
193 UOPstream toNeighbProc(neighbProcNo(), pBufs);
198 << edgeFaceCentres();
208 UIPstream fromNeighbProc(neighbProcNo(), pBufs);
211 >> neighbEdgeCentres_
212 >> neighbEdgeLengths_
213 >> neighbEdgeFaceCentres_;
220 scalar nmagEl =
mag(neighbEdgeLengths_[edgei]);
221 scalar avEl = (magEl[edgei] + nmagEl)/2.0;
223 if (
mag(magEl[edgei] - nmagEl)/avEl > 1
e-6)
227 <<
" length does not match neighbour by "
228 << 100*
mag(magEl[edgei] - nmagEl)/avEl
229 <<
"% -- possible edge ordering problem"
239 neighbEdgeLengths_/
mag(neighbEdgeLengths_)
271 neighbPointsPtr_.clear();
278 <<
"On patch " <<
name()
279 <<
" trying to access out of range neighbour processor "
280 << neighbProcNo() <<
". This can happen if" <<
nl
281 <<
" trying to run on an incorrect number of processors"
294 for (label patchPointI = 0; patchPointI <
nPoints(); ++patchPointI)
296 label edgeI = ptEdges[patchPointI][0];
298 patchEdge[patchPointI] = edgeI;
300 const edge&
e = patchEdges[edgeI];
305 UOPstream toNeighbProc(neighbProcNo(), pBufs);
319 neighbPointsPtr_.clear();
330 UIPstream fromNeighbProc(neighbProcNo(), pBufs);
342 labelList& neighbPoints = *neighbPointsPtr_;
347 forAll(nbrPatchEdge, nbrPointI)
350 const edge&
e = patchEdges[nbrPatchEdge[nbrPointI]];
352 const label index = 1 - nbrIndexInEdge[nbrPointI];
356 neighbPoints[patchPointI] = nbrPointI;
370 if (!neighbPointsPtr_)
378 <<
"No extended addressing calculated for patch " <<
name()
380 <<
"This can happen if the number of points on both"
381 <<
" sides of the two coupled patches differ." <<
nl
382 <<
"This happens if the processorPatch was constructed from"
383 <<
" part of a cyclic patch."
387 return *neighbPointsPtr_;
400 /
mag(neighbEdgeLengths())
404 - neighbEdgeFaceCentres()
408 w = neighbEdgeCentresCn/
411 + neighbEdgeCentresCn
445 - neighbEdgeFaceCentres()
457 - neighbEdgeFaceCentres()
471 if (!nonGlobalPatchPointsPtr_)
473 makeNonGlobalPatchPoints();
476 return *nonGlobalPatchPointsPtr_;
485 return patchInternalField(internalData);
495 return patchInternalField(internalData, edgeFaces);
505 send(commsType, interfaceData);
515 return receive<label>(commsType, this->size());
525 send(commsType, patchInternalField(iF)());
535 return receive<label>(commsType, this->size());
546 return receive<label>(commsType, this->size());
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
void resize(const label len)
Adjust allocated size of list.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
label nProcs() const noexcept
Number of ranks associated with PstreamBuffers.
label comm() const noexcept
Communicator.
A List obtained as a section of another List.
bool found(const T &val, label pos=0) const
True if the value if found in the list.
label find(const T &val, label pos=0) const
Find index of the first occurrence of the value.
void size(const label n)
Older name for setAddressableSize.
commsTypes
Types of communications.
static bool & parRun() noexcept
Test if this a parallel run.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
const bMesh & mesh() const
coupledFaPatch is an abstract base class for patches that couple regions of the computational domain ...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Finite area boundary mesh.
void calcGeometry()
Calculate the geometry for the patches.
Finite area patch class. Used for 2-D non-Euclidian finite area method.
virtual tmp< vectorField > delta() const
Return cell-centre to face-centre vector.
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
virtual bool write()
Write the output fields.
virtual void initMovePoints()
Initialise the patches for moving points.
void movePoints()
Update for new mesh geometry.
void updateMesh()
Update for new mesh topology.
virtual void initTransfer(const Pstream::commsTypes commsType, const labelUList &interfaceData) const
Initialise interface data transfer.
virtual ~processorFaPatch()
Destructor.
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
void makeWeights(scalarField &) const
Make patch weighting factors.
const labelList & neighbPoints() const
Return neighbour point labels. This is for my local point the.
void makeNonGlobalPatchPoints() const
Find non-globa patch points.
void makeDeltaCoeffs(scalarField &) const
Make patch face - neighbour cell distances.
void initGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
virtual label comm() const
Return communicator used for communication.
virtual tmp< vectorField > delta() const
Return delta (P to N) vectors across coupled patch.
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Initialise neighbour field transfer.
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
const labelList & nonGlobalPatchPoints() const
Return the set of labels of the processor patch points which are.
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
Neighbour processor patch.
transferModelList & transfer()
Transfer.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
List< label > labelList
A List of labels.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
errorManip< error > abort(error &err)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
labelList pointLabels(nPoints, -1)
#define forAll(list, i)
Loop across all elements in list.