41 const Foam::scalar Foam::cyclicACMIPolyPatch::tolerance_ = 1
e-10;
49 const polyPatch& nonOverlapPatch = this->nonOverlapPatch();
53 Pout<<
"cyclicACMIPolyPatch::resetAMI : recalculating weights" 54 <<
" for " <<
name() <<
" and " << nonOverlapPatch.
name()
58 if (boundaryMesh().
mesh().hasCellCentres())
62 Pout<<
"cyclicACMIPolyPatch::resetAMI : clearing cellCentres" 63 <<
" for " <<
name() <<
" and " << nonOverlapPatch.
name()
74 (void)boundaryMesh().mesh().faceAreas();
102 Sf[facei] *= srcMask_[facei];
103 magSf[facei] =
mag(Sf[facei]);
104 noSf[facei] *= 1.0 - srcMask_[facei];
105 noMagSf[facei] =
mag(noSf[facei]);
112 refCast<const cyclicACMIPolyPatch>(this->nbrPatch());
122 Sf[facei] *= tgtMask_[facei];
123 magSf[facei] =
mag(Sf[facei]);
124 noSf[facei] *= 1.0 - tgtMask_[facei];
125 noMagSf[facei] =
mag(noSf[facei]);
139 scalar&
sum = srcWeightsSum[i];
157 scalar&
sum = tgtWeightsSum[i];
231 const word& patchType
246 nonOverlapPatchID_(-1),
262 const word& patchType
275 nonOverlapPatchName_(dict.
lookup(
"nonOverlapPatch")),
276 nonOverlapPatchID_(-1),
281 if (nonOverlapPatchName_ == name)
286 ) <<
"Non-overlapping patch name " << nonOverlapPatchName_
287 <<
" cannot be the same as this patch " << name
303 nonOverlapPatchName_(pp.nonOverlapPatchName_),
304 nonOverlapPatchID_(-1),
320 const label newStart,
321 const word& nbrPatchName,
322 const word& nonOverlapPatchName
326 nonOverlapPatchName_(nonOverlapPatchName),
327 nonOverlapPatchID_(-1),
332 if (nonOverlapPatchName_ ==
name())
335 <<
"Non-overlapping patch name " << nonOverlapPatchName_
336 <<
" cannot be the same as this patch " <<
name()
355 nonOverlapPatchName_(pp.nonOverlapPatchName_),
356 nonOverlapPatchID_(-1),
376 const polyPatch& pp = this->boundaryMesh()[nbrPatchID()];
377 return refCast<const cyclicACMIPolyPatch>(pp);
383 if (nonOverlapPatchID_ == -1)
386 this->boundaryMesh().findPatchID(nonOverlapPatchName_);
388 if (nonOverlapPatchID_ == -1)
391 <<
"Illegal non-overlapping patch name " << nonOverlapPatchName_
392 <<
nl <<
"Valid patch names are " 393 << this->boundaryMesh().names()
397 if (nonOverlapPatchID_ < index())
400 <<
"Boundary ordering error: " <<
type()
401 <<
" patch must be defined prior to its non-overlapping patch" 403 <<
type() <<
" patch: " <<
name() <<
", ID:" << index() <<
nl 404 <<
"Non-overlap patch: " << nonOverlapPatchName_
405 <<
", ID:" << nonOverlapPatchID_ <<
nl 409 const polyPatch& noPp = this->boundaryMesh()[nonOverlapPatchID_];
413 if (size() == noPp.size())
420 scalar ratio =
mag(magSf[facei]/(noMagSf[facei] + rootVSmall));
422 if (ratio - 1 > tolerance_)
437 <<
"Inconsistent ACMI patches " <<
name() <<
" and " 438 << noPp.
name() <<
". Patches should have identical topology" 443 return nonOverlapPatchID_;
472 writeEntry(os,
"nonOverlapPatch", nonOverlapPatchName_);
virtual void resetAMI() const
Reset the AMI interpolator.
virtual void initCalcGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
virtual void initCalcGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
Cyclic patch for Arbitrarily Coupled Mesh Interface (ACMI)
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return name.
virtual bool order(PstreamBuffers &, const primitivePatch &, labelList &faceMap, labelList &rotation) const
Return new ordering for primitivePatch.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
const scalarListList & tgtWeights() const
Return const access to target patch weights.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool cp(const fileName &src, const fileName &dst, const bool followLink=true)
Copy, recursively if necessary, the source to the destination.
virtual const scalarField & tgtMask() const
Return the mask/weighting for the target patch.
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
Pre-declare related SubField type.
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
Macros for easy insertion into run-time selection tables.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
const polyPatch & nonOverlapPatch() const
Return a const reference to the non-overlapping patch.
A list of faces which address into the list of points.
void clearGeom()
Clear geometry.
virtual const scalarField & srcMask() const
Return the mask/weighting for the source patch.
A class for handling words, derived from string.
virtual void initMovePoints(PstreamBuffers &pBufs, const pointField &)
Initialise the patches for moving points.
static const word null
An empty word.
const scalarField & tgtWeightsSum() const
Return const access to normalisation factor of target.
Cyclic patch for Arbitrary Mesh Interface (AMI)
cyclicACMIPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType)
Construct from (base couped patch) components.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
const vectorField::subField faceAreas() const
Return face areas.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
const scalarListList & srcWeights() const
Return const access to source patch weights.
virtual bool order(PstreamBuffers &, const primitivePatch &, labelList &faceMap, labelList &rotation) const
Return new ordering for primitivePatch.
defineTypeNameAndDebug(combustionModel, 0)
Buffers for inter-processor communications streams (UOPstream, UIPstream).
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
word name(const complex &)
Return a string representation of a complex.
const scalarField & srcWeightsSum() const
Return const access to normalisation factor of source.
virtual const cyclicACMIPolyPatch & nbrPatch() const
Return a reference to the neighbour patch.
virtual void initOrder(PstreamBuffers &, const primitivePatch &) const
Initialise ordering for primitivePatch. Does not.
const scalarField::subField magFaceAreas() const
Return face area magnitudes.
virtual void resetAMI() const
Reset the AMI interpolator.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
prefixOSstream Pout(cout, "Pout")
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
virtual ~cyclicACMIPolyPatch()
Destructor.
dimensioned< scalar > mag(const dimensioned< Type > &)
const doubleScalar e
Elementary charge.
Mesh consisting of general polyhedral cells.
A patch is a list of labels that address the faces in the global face list.
virtual void initOrder(PstreamBuffers &, const primitivePatch &) const
Initialise ordering for primitivePatch. Does not.
virtual label nonOverlapPatchID() const
Non-overlapping patch ID.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
virtual void initMovePoints(PstreamBuffers &pBufs, const pointField &)
Initialise the patches for moving points.