60 if (!isA<cyclicAMIFvPatch>(
p))
63 <<
" patch type '" <<
p.type()
64 <<
"' not constraint type '" <<
typeName <<
"'"
65 <<
"\n for patch " <<
p.
name()
71 if (!dict.
found(
"value"))
98 if (!isA<cyclicAMIFvPatch>(this->
patch()))
101 <<
"' not constraint type '" <<
typeName <<
"'"
102 <<
"\n for patch " << p.
name()
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);
171 tpnf.
ref() = transform(forwardT(), tpnf());
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 =
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;
322 matrix.
lower()[globalFaceI] += intCorr;
330 if (matrix.
psi(mat).mesh().fluxRequired(this->internalField().name()))
341 const label nbrPathID =
342 cyclicAMIPatch_.cyclicAMIPatch().neighbPatchID();
344 const label nbrGlobalPatchID =
370 const label index(this->patch().index());
372 const label nSubFaces
380 cyclicAMIPatch_.cyclicAMIPatch().AMI().srcWeights();
386 for(label i=0; i<w.
size(); i++)
388 const label localFaceId =
390 mapCoeffs[subFaceI] = w[i]*coeffs[localFaceId];
395 return tmp<Field<scalar>>(
new Field<scalar>(mapCoeffs));
403 const refPtr<mapDistribute>& mapPtr,
404 const labelListList& stencil,
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);
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
static const char *const typeName
Typename for Field.
Generic templated field type.
Generic GeometricField class.
const word & name() const noexcept
Return the object name.
void setSize(const label n)
Alias for resize()
void append(const T &val)
Append an element at the end of the list.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void size(const label n)
Older name for setAddressableSize.
commsTypes
Types of communications.
const dictionary & coeffs() const
Return const dictionary of the model.
Abstract base class for coupled patches.
virtual void evaluate(const Pstream::commsTypes commsType)
Evaluate the patch field.
virtual const labelUList & faceCells() const
Return faceCell addressing.
This boundary condition enforces a cyclic condition between a pair of boundaries, whereby communicati...
const cyclicAMIFvPatchField< Type > & neighbourPatchField() const
Return reference to neighbour patchField.
virtual void manipulateMatrix(fvMatrix< Type > &m, const label iMatrix, const direction cmpt)
Manipulate matrix.
virtual void updateInterfaceMatrix(solveScalarField &result, const bool add, const lduAddressing &lduAddr, const label patchId, const solveScalarField &psiInternal, const scalarField &coeffs, const direction cmpt, const Pstream::commsTypes commsType) const
Update result field based on interface functionality.
virtual bool coupled() const
Return true if coupled. Note that the underlying patch.
virtual tmp< Field< Type > > patchNeighbourField() const
Return neighbour coupled internal cell data.
Cyclic patch for Arbitrary Mesh Interface (AMI)
virtual const cyclicAMIFvPatch & neighbPatch() const
Return processor number.
Abstract base class for cyclic AMI coupled interfaces.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
Smooth ATC in cells next to a set of patches supplied by type.
virtual bool write()
Write the output fields.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
const FieldField< Field, Type > & internalCoeffs() const noexcept
const FieldField< Field, Type > & boundaryCoeffs() const noexcept
const lduPrimitiveMeshAssembly & lduMeshAssembly()
Return optional lduAdressing.
const GeometricField< Type, fvPatchField, volMesh > & psi(const label i=0) const
Return psi.
A FieldMapper for finite-volume patch fields.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual tmp< Field< Type > > patchInternalField() const
Return internal field next to patch as patch field.
virtual void operator=(const UList< Type > &)
const DimensionedField< Type, volMesh > & internalField() const
Return dimensioned internal field reference.
const fvPatch & patch() const
Return patch.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual const word & name() const
Return name.
The class contains the addressing required by the lduMatrix: upper, lower and losort.
virtual const labelUList & upperAddr() const =0
Return upper addressing.
virtual const labelUList & lowerAddr() const =0
Return lower addressing.
virtual const labelUList & patchAddr(const label patchNo) const =0
Return patch to internal addressing given patch number.
const lduAddressing & lduAddr() const
Return the LDU addressing.
const labelListListList & cellBoundMap() const
Return patch local sub-face to nbrCellId map.
const labelListListList & faceBoundMap() const
Return boundary face map.
const labelListListList & facePatchFaceMap() const
Return patch local sub-face to local patch face map.
const labelListList & patchLocalToGlobalMap() const
Return patchLocalToGlobalMap.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
A class for managing temporary objects.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
To & refCast(From &r)
Reference type cast template function.
List< label > labelList
A List of labels.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dict add("bounds", meshBb)
#define forAll(list, i)
Loop across all elements in list.