34 template<
class Type,
class DType,
class LUType>
47 commsType == UPstream::commsTypes::blocking
48 || commsType == UPstream::commsTypes::nonBlocking
51 forAll(interfaces_, interfacei)
53 if (interfaces_.set(interfacei))
55 interfaces_[interfacei].initInterfaceMatrixUpdate
62 interfaceCoeffs[interfacei],
69 else if (commsType == UPstream::commsTypes::scheduled)
71 const lduSchedule& patchSchedule = this->patchSchedule();
77 label interfacei=patchSchedule.
size()/2;
78 interfacei<interfaces_.size();
82 if (interfaces_.set(interfacei))
84 interfaces_[interfacei].initInterfaceMatrixUpdate
91 interfaceCoeffs[interfacei],
93 UPstream::commsTypes::blocking
101 <<
"Unsupported communications type " 102 << UPstream::commsTypeNames[commsType]
108 template<
class Type,
class DType,
class LUType>
112 const FieldField<Field, LUType>& interfaceCoeffs,
113 const Field<Type>& psiif,
117 const UPstream::commsTypes commsType = UPstream::defaultCommsType;
121 commsType == UPstream::commsTypes::blocking
122 || commsType == UPstream::commsTypes::nonBlocking
126 if (commsType == UPstream::commsTypes::nonBlocking)
128 UPstream::waitRequests();
131 forAll(interfaces_, interfacei)
133 if (interfaces_.set(interfacei))
135 interfaces_[interfacei].updateInterfaceMatrix
142 interfaceCoeffs[interfacei],
149 else if (commsType == UPstream::commsTypes::scheduled)
151 const lduSchedule& patchSchedule = this->patchSchedule();
154 for (
const auto& schedEval : patchSchedule)
156 const label interfacei = schedEval.patch;
158 if (interfaces_.set(interfacei))
162 interfaces_[interfacei].initInterfaceMatrixUpdate
169 interfaceCoeffs[interfacei],
176 interfaces_[interfacei].updateInterfaceMatrix
183 interfaceCoeffs[interfacei],
195 label interfacei=patchSchedule.size()/2;
196 interfacei<interfaces_.size();
200 if (interfaces_.set(interfacei))
202 interfaces_[interfacei].updateInterfaceMatrix
209 interfaceCoeffs[interfacei],
211 Pstream::commsTypes::blocking
219 <<
"Unsupported communications type " 220 << 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.
void updateMatrixInterfaces(const bool add, const FieldField< Field, LUType > &interfaceCoeffs, const Field< Type > &psiif, Field< Type > &result) const
Update interfaced interfaces for matrix operations.
errorManipArg< error, int > exit(error &err, const int errNo=1)
commsTypes
Types of communications.
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 add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)