lduMatrixUpdateMatrixInterfaces.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "lduMatrix.H"
00028
00029
00030
00031 void Foam::lduMatrix::initMatrixInterfaces
00032 (
00033 const FieldField<Field, scalar>& coupleCoeffs,
00034 const lduInterfaceFieldPtrsList& interfaces,
00035 const scalarField& psiif,
00036 scalarField& result,
00037 const direction cmpt
00038 ) const
00039 {
00040 if
00041 (
00042 Pstream::defaultCommsType == Pstream::blocking
00043 || Pstream::defaultCommsType == Pstream::nonBlocking
00044 )
00045 {
00046 forAll (interfaces, interfaceI)
00047 {
00048 if (interfaces.set(interfaceI))
00049 {
00050 interfaces[interfaceI].initInterfaceMatrixUpdate
00051 (
00052 psiif,
00053 result,
00054 *this,
00055 coupleCoeffs[interfaceI],
00056 cmpt,
00057 Pstream::defaultCommsType
00058 );
00059 }
00060 }
00061 }
00062 else if (Pstream::defaultCommsType == Pstream::scheduled)
00063 {
00064 const lduSchedule& patchSchedule = this->patchSchedule();
00065
00066
00067
00068 for
00069 (
00070 label interfaceI=patchSchedule.size()/2;
00071 interfaceI<interfaces.size();
00072 interfaceI++
00073 )
00074 {
00075 if (interfaces.set(interfaceI))
00076 {
00077 interfaces[interfaceI].initInterfaceMatrixUpdate
00078 (
00079 psiif,
00080 result,
00081 *this,
00082 coupleCoeffs[interfaceI],
00083 cmpt,
00084 Pstream::blocking
00085 );
00086 }
00087 }
00088 }
00089 else
00090 {
00091 FatalErrorIn("lduMatrix::initMatrixInterfaces")
00092 << "Unsuported communications type "
00093 << Pstream::commsTypeNames[Pstream::defaultCommsType]
00094 << exit(FatalError);
00095 }
00096 }
00097
00098
00099 void Foam::lduMatrix::updateMatrixInterfaces
00100 (
00101 const FieldField<Field, scalar>& coupleCoeffs,
00102 const lduInterfaceFieldPtrsList& interfaces,
00103 const scalarField& psiif,
00104 scalarField& result,
00105 const direction cmpt
00106 ) const
00107 {
00108 if
00109 (
00110 Pstream::defaultCommsType == Pstream::blocking
00111 || Pstream::defaultCommsType == Pstream::nonBlocking
00112 )
00113 {
00114
00115 if (Pstream::defaultCommsType == Pstream::nonBlocking)
00116 {
00117 IPstream::waitRequests();
00118 OPstream::waitRequests();
00119 }
00120
00121 forAll (interfaces, interfaceI)
00122 {
00123 if (interfaces.set(interfaceI))
00124 {
00125 interfaces[interfaceI].updateInterfaceMatrix
00126 (
00127 psiif,
00128 result,
00129 *this,
00130 coupleCoeffs[interfaceI],
00131 cmpt,
00132 Pstream::defaultCommsType
00133 );
00134 }
00135 }
00136 }
00137 else if (Pstream::defaultCommsType == Pstream::scheduled)
00138 {
00139 const lduSchedule& patchSchedule = this->patchSchedule();
00140
00141
00142 forAll (patchSchedule, i)
00143 {
00144 label interfaceI = patchSchedule[i].patch;
00145
00146 if (interfaces.set(interfaceI))
00147 {
00148 if (patchSchedule[i].init)
00149 {
00150 interfaces[interfaceI].initInterfaceMatrixUpdate
00151 (
00152 psiif,
00153 result,
00154 *this,
00155 coupleCoeffs[interfaceI],
00156 cmpt,
00157 Pstream::scheduled
00158 );
00159 }
00160 else
00161 {
00162 interfaces[interfaceI].updateInterfaceMatrix
00163 (
00164 psiif,
00165 result,
00166 *this,
00167 coupleCoeffs[interfaceI],
00168 cmpt,
00169 Pstream::scheduled
00170 );
00171 }
00172 }
00173 }
00174
00175
00176
00177 for
00178 (
00179 label interfaceI=patchSchedule.size()/2;
00180 interfaceI<interfaces.size();
00181 interfaceI++
00182 )
00183 {
00184 if (interfaces.set(interfaceI))
00185 {
00186 interfaces[interfaceI].updateInterfaceMatrix
00187 (
00188 psiif,
00189 result,
00190 *this,
00191 coupleCoeffs[interfaceI],
00192 cmpt,
00193 Pstream::blocking
00194 );
00195 }
00196 }
00197 }
00198 else
00199 {
00200 FatalErrorIn("lduMatrix::updateMatrixInterfaces")
00201 << "Unsuported communications type "
00202 << Pstream::commsTypeNames[Pstream::defaultCommsType]
00203 << exit(FatalError);
00204 }
00205 }
00206
00207
00208
Copyright © 2000-2009 OpenCFD Ltd