63 <<
" patch type '" <<
p.type()
64 <<
"' not constraint type '" <<
typeName <<
"'"
65 <<
"\n for patch " <<
p.name()
81 const cyclicFvPatchField<Type>& ptf,
83 const DimensionedField<Type, volMesh>& iF,
84 const fvPatchFieldMapper& mapper
87 coupledFvPatchField<Type>(ptf,
p, iF, mapper),
88 cyclicPatch_(
refCast<const cyclicFvPatch>(
p))
93 <<
"\n patch type '" <<
p.type()
94 <<
"' not constraint type '" <<
typeName <<
"'"
95 <<
"\n for patch " <<
p.name()
106 const cyclicFvPatchField<Type>& ptf
111 cyclicPatch_(ptf.cyclicPatch_)
123 cyclicPatch_(ptf.cyclicPatch_)
132 const Field<Type>& iField = this->primitiveField();
134 cyclicPatch().cyclicPatch().neighbPatch().faceCells();
142 forwardT()[0], iField[nbrFaceCells[facei]]
150 pnf[facei] = iField[nbrFaceCells[facei]];
157Foam::tmp<Foam::Field<Type>>
173 this->primitiveField()
261 if (this->cyclicPatch().owner())
263 label index = this->patch().index();
265 const label globalPatchID =
286 label globalFaceI =
faceMap[faceI];
288 const scalar boundCorr = -boundCoeffsCmpt[faceI];
289 const scalar intCorr = -intCoeffsCmpt[faceI];
291 matrix.
upper()[globalFaceI] += boundCorr;
292 matrix.
diag()[u[globalFaceI]] -= boundCorr;
293 matrix.
diag()[l[globalFaceI]] -= intCorr;
297 matrix.
lower()[globalFaceI] += intCorr;
312 const label nbrPathID = this->cyclicPatch().neighbPatchID();
314 const label nbrGlobalPatchID =
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-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...
const Mesh & mesh() const noexcept
Return const reference to mesh.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Generic GeometricField class.
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
const word & name() const noexcept
Return the object name.
fileName objectPath() const
The complete path + object name.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
commsTypes
Communications types.
@ buffered
"buffered" : (MPI_Bsend, MPI_Recv)
Abstract base class for coupled patches.
coupledFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual void evaluate(const Pstream::commsTypes commsType)
Evaluate the patch field.
This boundary condition enforces a cyclic condition between a pair of boundaries.
const cyclicFvPatchField< Type > & neighbourPatchField() const
Return reference to neighbour patchField.
virtual bool doTransform() const
Does the patch field perform the transformation.
cyclicFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
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.
const cyclicFvPatch & cyclicPatch() const
Return local reference cast into the cyclic patch.
virtual void write(Ostream &os) const
Write.
virtual void manipulateMatrix(fvMatrix< Type > &m, const label iMatrix, const direction cmp)
Manipulate matrix.
virtual tmp< Field< Type > > patchNeighbourField() const
Return neighbour coupled internal cell data.
virtual const tensorField & forwardT() const
Return face transformation tensor.
cyclicLduInterfaceField()=default
Construct null.
void transformCoupleField(Field< Type > &f) const
Transform given patch field.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Smooth ATC in cells next to a set of patches supplied by type.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
const FieldField< Field, Type > & internalCoeffs() const noexcept
fvBoundary scalar field containing pseudo-matrix coeffs for internal cells
const FieldField< Field, Type > & boundaryCoeffs() const noexcept
fvBoundary scalar field containing pseudo-matrix coeffs for boundary cells
const lduPrimitiveMeshAssembly & lduMeshAssembly()
Return optional lduAdressing.
const GeometricField< Type, fvPatchField, volMesh > & psi(const label i=0) const
Return psi.
const fvPatch & patch() const noexcept
Return the patch.
A FieldMapper for finite-volume patch fields.
virtual void write(Ostream &) const
Write.
const Field< Type > & primitiveField() const noexcept
Return const-reference to the internal field values.
const DimensionedField< Type, volMesh > & internalField() const noexcept
Return const-reference to the dimensioned internal field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
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.
void addToInternalField(Field< Type > &result, const bool add, const labelUList &faceCells, const scalarField &coeffs, const Field< Type > &vals) const
Add/subtract weighted contributions to internal field.
const lduAddressing & lduAddr() const
Return the LDU addressing.
bool asymmetric() const noexcept
Matrix is asymmetric (ie, full).
const scalarField & diag() const
const scalarField & upper() const
const scalarField & lower() const
const labelListListList & faceBoundMap() const
Return boundary face map.
const labelListList & patchLocalToGlobalMap() const
Return patchLocalToGlobalMap.
A traits class, which is primarily used for primitives and vector-space.
bool fluxRequired(const word &name) const
Get flux-required for given name, or default.
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)
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
List< label > labelList
A List of labels.
refinementData transform(const tensor &, const refinementData val)
No-op rotational transform for base types.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
void add(DimensionedField< scalar, GeoMesh > &result, const dimensioned< scalar > &dt1, const DimensionedField< scalar, GeoMesh > &f2)
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
Field< solveScalar > solveScalarField
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
errorManipArg< error, int > exit(error &err, const int errNo=1)
UList< label > labelUList
A UList of labels.
#define forAll(list, i)
Loop across all elements in list.