51 forAll(interfaces, interfacei)
53 if (interfaces.
set(interfacei))
55 interfaces[interfacei].initInterfaceMatrixUpdate
62 coupleCoeffs[interfacei],
78 interfacei<interfaces.
size();
82 if (interfaces.
set(interfacei))
84 interfaces[interfacei].initInterfaceMatrixUpdate
91 coupleCoeffs[interfacei],
101 <<
"Unsupported communications type " 111 const FieldField<Field, scalar>& coupleCoeffs,
116 const label startRequest
133 DynamicList<int> indices;
152 pollingActive =
false;
154 forAll(interfaces, interfacei)
156 auto* intf = interfaces.get(interfacei);
158 if (intf && !intf->updatedMatrix())
162 intf->updateInterfaceMatrix
169 coupleCoeffs[interfacei],
176 pollingActive =
true;
193 bool allUpdated =
true;
195 forAll(interfaces, interfacei)
197 auto* intf = interfaces.get(interfacei);
199 if (intf && !intf->updatedMatrix())
203 intf->updateInterfaceMatrix
210 coupleCoeffs[interfacei],
247 forAll(interfaces, interfacei)
249 auto* intf = interfaces.get(interfacei);
251 if (intf && (noCheck || !intf->updatedMatrix()))
253 intf->updateInterfaceMatrix
260 coupleCoeffs[interfacei],
269 const lduSchedule& patchSchedule = this->patchSchedule();
272 for (
const auto& sched : patchSchedule)
274 const label interfacei = sched.patch;
276 if (interfaces.set(interfacei))
280 interfaces[interfacei].initInterfaceMatrixUpdate
287 coupleCoeffs[interfacei],
294 interfaces[interfacei].updateInterfaceMatrix
301 coupleCoeffs[interfacei],
313 label interfacei=patchSchedule.size()/2;
314 interfacei<interfaces.size();
318 if (interfaces.set(interfacei))
320 interfaces[interfacei].updateInterfaceMatrix
327 coupleCoeffs[interfacei],
337 <<
"Unsupported communications type " UPtrList< const lduInterfaceField > lduInterfaceFieldPtrsList
List of coupled interface fields to be used in coupling.
void size(const label n)
Older name for setAddressableSize.
static const Enum< commsTypes > commsTypeNames
Enumerated names for the communication types.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Field< solveScalar > solveScalarField
commsTypes
Communications types.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
List< lduScheduleEntry > lduSchedule
A List of lduSchedule entries.
static void waitRequests()
Wait for all requests to finish.
A field of fields is a PtrList of fields with reference counting.
#define forAll(list, i)
Loop across all elements in list.
const lduSchedule & patchSchedule() const
Return the patch evaluation schedule.
static int nPollProcInterfaces
Number of polling cycles in processor updates.
"scheduled" (MPI standard) : (MPI_Send, MPI_Recv)
label size() const noexcept
The number of entries in the list.
void updateMatrixInterfaces(const bool add, const FieldField< Field, scalar > &interfaceCoeffs, const lduInterfaceFieldPtrsList &interfaces, const solveScalarField &psiif, solveScalarField &result, const direction cmpt, const label startRequest) const
Update interfaced interfaces for matrix operations.
void initMatrixInterfaces(const bool add, const FieldField< Field, scalar > &interfaceCoeffs, const lduInterfaceFieldPtrsList &interfaces, const solveScalarField &psiif, solveScalarField &result, const direction cmpt) const
Initialise the update of interfaced interfaces for matrix operations.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
static commsTypes defaultCommsType
Default commsType.
const lduMesh & mesh() const noexcept
Return the LDU mesh from which the addressing is obtained.
const lduAddressing & lduAddr() const
Return the LDU addressing.
"nonBlocking" (immediate) : (MPI_Isend, MPI_Irecv)
"buffered" : (MPI_Bsend, MPI_Recv)
static bool waitSomeRequests(const label pos, label len=-1, DynamicList< int > *indices=nullptr)
Wait until some requests (from position onwards) have finished. Corresponds to MPI_Waitsome() ...
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie...