60 if (!isA<cyclicACMIFvPatch>(
p))
63 <<
" patch type '" <<
p.type()
64 <<
"' not constraint type '" <<
typeName <<
"'"
65 <<
"\n for patch " <<
p.
name()
71 if (!dict.
found(
"value") && this->coupled())
84 <<
" patch " <<
p.
name()
86 <<
" refers to non-overlap patch "
88 <<
" which is not constructed yet." <<
nl
89 <<
" Either supply an initial value or change the ordering"
112 if (!isA<cyclicACMIFvPatch>(this->
patch()))
115 <<
"' not constraint type '" <<
typeName <<
"'"
116 <<
"\n for patch " << p.
name()
133 cyclicACMIPatch_(ptf.cyclicACMIPatch_)
146 cyclicACMIPatch_(ptf.cyclicACMIPatch_)
155 return cyclicACMIPatch_.coupled();
163 const Field<Type>& iField = this->primitiveField();
173 cyclicACMIPatch_.interpolate
200 this->primitiveField()
203 return refCast<const cyclicACMIFvPatchField<Type>>
205 fld.boundaryField()[cyclicACMIPatch_.neighbPatchID()]
217 this->primitiveField()
221 return fld.boundaryField()[cyclicACMIPatch_.nonOverlapPatchID()];
247 lduAddr.
patchAddr(cyclicACMIPatch_.neighbPatchID());
252 transformCoupleField(pnf, cmpt);
254 pnf = cyclicACMIPatch_.interpolate(pnf);
258 this->addToInternalField(result, !
add,
faceCells, coeffs, pnf);
277 lduAddr.
patchAddr(cyclicACMIPatch_.neighbPatchID());
282 transformCoupleField(pnf);
284 pnf = cyclicACMIPatch_.interpolate(pnf);
288 this->addToInternalField(result, !
add,
faceCells, coeffs, pnf);
298 const scalarField& mask = cyclicACMIPatch_.cyclicACMIPatch().mask();
316 if (this->cyclicACMIPatch().owner())
318 label index = this->patch().index();
320 const label globalPatchID =
348 label globalFaceI =
faceMap[j];
350 const scalar boundCorr = -bndCoeffs[subFaceI];
351 const scalar intCorr = -intCoeffs[subFaceI];
353 matrix.
upper()[globalFaceI] += boundCorr;
354 matrix.
diag()[u[globalFaceI]] -= intCorr;
355 matrix.
diag()[l[globalFaceI]] -= boundCorr;
359 matrix.
lower()[globalFaceI] += intCorr;
367 if (matrix.
psi(mat).mesh().fluxRequired(this->internalField().name()))
378 const label nbrPathID =
379 cyclicACMIPatch_.cyclicACMIPatch().neighbPatchID();
381 const label nbrGlobalPatchID =
407 const label index(this->patch().index());
409 const label nSubFaces
417 cyclicACMIPatch_.cyclicACMIPatch().AMI().srcWeights();
419 const scalarField& mask = cyclicACMIPatch_.cyclicACMIPatch().mask();
426 for(label i=0; i<w.
size(); i++)
428 if (mask[faceI] > tol)
430 const label localFaceId =
432 [mat][index][subFaceI];
433 mapCoeffs[subFaceI] = w[i]*coeffs[localFaceId];
439 return tmp<Field<scalar>>(
new Field<scalar>(mapCoeffs));
452 const scalarField& mask = cyclicACMIPatch_.cyclicACMIPatch().mask();
462 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 Boundary & boundaryField() const
Return const-reference to the boundary field.
const word & name() const noexcept
Return the object name.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const T * set(const label i) const
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 cyclicACMIFvPatchField< Type > & neighbourPatchField() const
Return reference to neighbour patchField.
const fvPatchField< Type > & nonOverlapPatchField() const
Return reference to non-overlapping patchField.
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 void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void manipulateMatrix(fvMatrix< Type > &matrix)
Manipulate matrix.
virtual tmp< Field< Type > > patchNeighbourField() const
Return neighbour coupled internal cell data.
Cyclic patch for Arbitrarily Coupled Mesh Interface (ACMI)
const cyclicACMIPolyPatch & cyclicACMIPatch() const
Return local reference cast into the cyclic patch.
virtual const cyclicACMIFvPatch & neighbPatch() const
Return neighbour fvPatch.
virtual label nonOverlapPatchID() const
Return neighbour.
Abstract base class for cyclic ACMI coupled interfaces.
static scalar tolerance()
Overlap tolerance.
const word & nonOverlapPatchName() const
Non-overlapping patch name.
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...
const Field< Type > & primitiveField() const
Return internal field reference.
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.
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
static constexpr const zero Zero
Global zero (0)
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.