60 if (!isA<cyclicAMIFvPatch>(
p))
63 <<
" patch type '" <<
p.type()
64 <<
"' not constraint type '" << typeName <<
"'"
65 <<
"\n for patch " <<
p.name()
66 <<
" of field " << this->internalField().name()
67 <<
" in file " << this->internalField().objectPath()
71 if (!
dict.found(
"value"))
75 this->
evaluate(Pstream::commsTypes::blocking);
88 const cyclicAMIFvPatchField<Type>& ptf,
90 const DimensionedField<Type, volMesh>& iF,
91 const fvPatchFieldMapper& mapper
94 cyclicAMILduInterfaceField(),
95 coupledFvPatchField<Type>(ptf,
p, iF, mapper),
96 cyclicAMIPatch_(
refCast<const cyclicAMIFvPatch>(
p))
98 if (!isA<cyclicAMIFvPatch>(this->
patch()))
101 <<
"' not constraint type '" << typeName <<
"'"
102 <<
"\n for patch " <<
p.name()
103 <<
" of field " << this->internalField().name()
104 <<
" in file " << this->internalField().objectPath()
113 const cyclicAMIFvPatchField<Type>& ptf
116 cyclicAMILduInterfaceField(),
118 cyclicAMIPatch_(ptf.cyclicAMIPatch_)
131 cyclicAMIPatch_(ptf.cyclicAMIPatch_)
140 return cyclicAMIPatch_.coupled();
148 const Field<Type>& iField = this->primitiveField();
158 if (cyclicAMIPatch_.applyLowWeightCorrection())
160 Field<Type> pnfInternal(iField, cyclicAMIPatch_.faceCells());
162 tpnf = cyclicAMIPatch_.interpolate(pnf, pnfInternal);
166 tpnf = cyclicAMIPatch_.interpolate(pnf);
185 this->primitiveField()
188 return refCast<const cyclicAMIFvPatchField<Type>>
190 fld.boundaryField()[cyclicAMIPatch_.neighbPatchID()]
209 lduAddr.
patchAddr(cyclicAMIPatch_.neighbPatchID());
216 transformCoupleField(pnf, cmpt);
218 if (cyclicAMIPatch_.applyLowWeightCorrection())
221 pnf = cyclicAMIPatch_.interpolate(pnf, pif);
225 pnf = cyclicAMIPatch_.interpolate(pnf);
229 this->addToInternalField(result, !
add,
faceCells, coeffs, pnf);
246 lduAddr.
patchAddr(cyclicAMIPatch_.neighbPatchID());
251 transformCoupleField(pnf);
253 if (cyclicAMIPatch_.applyLowWeightCorrection())
255 Field<Type> pif(psiInternal, cyclicAMIPatch_.faceCells());
256 pnf = cyclicAMIPatch_.interpolate(pnf, pif);
260 pnf = cyclicAMIPatch_.interpolate(pnf);
266 this->addToInternalField(result, !
add,
faceCells, coeffs, pnf);
279 if (this->cyclicAMIPatch().owner())
281 label index = this->
patch().index();
283 const label globalPatchID =
301 const labelUList& u = matrix.lduAddr().upperAddr();
302 const labelUList& l = matrix.lduAddr().lowerAddr();
311 label globalFaceI =
faceMap[j];
313 const scalar boundCorr = -bndCoeffs[subFaceI];
314 const scalar intCorr = -intCoeffs[subFaceI];
316 matrix.upper()[globalFaceI] += boundCorr;
317 matrix.diag()[u[globalFaceI]] -= intCorr;
318 matrix.diag()[l[globalFaceI]] -= boundCorr;
320 if (matrix.asymmetric())
322 matrix.lower()[globalFaceI] += intCorr;
330 if (matrix.
psi(mat).mesh().fluxRequired(this->internalField().name()))
334 globalPatchID, intCoeffs*pTraits<Type>::one
338 globalPatchID, bndCoeffs*pTraits<Type>::one
341 const label nbrPathID =
342 cyclicAMIPatch_.cyclicAMIPatch().neighbPatchID();
344 const label nbrGlobalPatchID =
350 nbrGlobalPatchID, intCoeffs*pTraits<Type>::one
354 nbrGlobalPatchID, bndCoeffs*pTraits<Type>::one
365 fvMatrix<Type>& matrix,
366 const Field<scalar>& coeffs,
370 const label index(this->
patch().index());
372 const label nSubFaces
374 matrix.lduMeshAssembly().cellBoundMap()[mat][index].size()
377 Field<scalar> mapCoeffs(nSubFaces,
Zero);
380 cyclicAMIPatch_.cyclicAMIPatch().AMI().srcWeights();
386 for(label i=0; i<w.size(); i++)
388 const label localFaceId =
389 matrix.lduMeshAssembly().facePatchFaceMap()[mat][index][subFaceI];
390 mapCoeffs[subFaceI] = w[i]*coeffs[localFaceId];
395 return tmp<Field<scalar>>(
new Field<scalar>(mapCoeffs));
400 template<
class Type2>
403 const refPtr<mapDistribute>& mapPtr,
406 List<Type2>& expandedData
409 expandedData.setSize(stencil.size());
413 mapPtr().distribute(work);
418 expandedData[facei].
append
420 UIndirectList<typename Type2::value_type>(work, slots)
429 expandedData[facei].
append
431 UIndirectList<typename Type2::value_type>(data, slots)
442 this->writeEntry(
"value",
os);