34 template<
class Type,
class DType,
class LUType>
47 commsType == UPstream::commsTypes::buffered
48 || commsType == UPstream::commsTypes::nonBlocking
51 forAll(interfaces_, interfacei)
53 if (interfaces_.set(interfacei))
55 interfaces_[interfacei].initInterfaceMatrixUpdate
62 interfaceCoeffs[interfacei],
68 else if (commsType == UPstream::commsTypes::scheduled)
70 const lduSchedule& patchSchedule = this->patchSchedule();
76 label interfacei=patchSchedule.
size()/2;
77 interfacei<interfaces_.size();
81 if (interfaces_.set(interfacei))
83 interfaces_[interfacei].initInterfaceMatrixUpdate
90 interfaceCoeffs[interfacei],
91 UPstream::commsTypes::buffered
99 <<
"Unsupported communications type " 100 << UPstream::commsTypeNames[commsType]
106 template<
class Type,
class DType,
class LUType>
110 const FieldField<Field, LUType>& interfaceCoeffs,
111 const Field<Type>& psiif,
113 const label startRequest
116 const UPstream::commsTypes commsType = UPstream::defaultCommsType;
120 commsType == UPstream::commsTypes::nonBlocking
121 && UPstream::nPollProcInterfaces
130 DynamicList<int> indices;
134 bool pollingActive = (UPstream::nPollProcInterfaces < 0);
137 && UPstream::waitSomeRequests(startRequest, -1, &indices)
142 pollingActive =
false;
144 forAll(interfaces_, interfacei)
146 auto* intf = interfaces_.get(interfacei);
148 if (intf && !intf->updatedMatrix())
152 intf->updateInterfaceMatrix
159 interfaceCoeffs[interfacei],
165 pollingActive =
true;
175 commsType == UPstream::commsTypes::buffered
176 || commsType == UPstream::commsTypes::nonBlocking
181 if (commsType == UPstream::commsTypes::nonBlocking)
183 UPstream::waitRequests(startRequest);
187 const bool noCheck = (commsType == UPstream::commsTypes::buffered);
189 forAll(interfaces_, interfacei)
191 auto* intf = interfaces_.get(interfacei);
193 if (intf && (noCheck || !intf->updatedMatrix()))
195 intf->updateInterfaceMatrix
202 interfaceCoeffs[interfacei],
208 else if (commsType == UPstream::commsTypes::scheduled)
210 const lduSchedule& patchSchedule = this->patchSchedule();
213 for (
const auto& schedEval : patchSchedule)
215 const label interfacei = schedEval.patch;
217 if (interfaces_.set(interfacei))
221 interfaces_[interfacei].initInterfaceMatrixUpdate
228 interfaceCoeffs[interfacei],
234 interfaces_[interfacei].updateInterfaceMatrix
241 interfaceCoeffs[interfacei],
252 label interfacei=patchSchedule.size()/2;
253 interfacei<interfaces_.size();
257 if (interfaces_.set(interfacei))
259 interfaces_[interfacei].updateInterfaceMatrix
266 interfaceCoeffs[interfacei],
267 UPstream::commsTypes::buffered
275 <<
"Unsupported communications type " 276 << UPstream::commsTypeNames[commsType]
void initMatrixInterfaces(const bool add, const FieldField< Field, LUType > &interfaceCoeffs, const Field< Type > &psiif, Field< Type > &result) const
Initialise the update of interfaced interfaces.
void size(const label n)
Older name for setAddressableSize.
errorManipArg< error, int > exit(error &err, const int errNo=1)
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.
A field of fields is a PtrList of fields with reference counting.
#define forAll(list, i)
Loop across all elements in list.
Generic templated field type.
void updateMatrixInterfaces(const bool add, const FieldField< Field, LUType > &interfaceCoeffs, const Field< Type > &psiif, Field< Type > &result, const label startRequest) const
Update 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)