41 const Foam::scalar Foam::cyclicACMIPolyPatch::tolerance_ = 1
e-10;
52 const polyPatch& nonOverlapPatch = this->nonOverlapPatch();
56 Pout<<
"cyclicACMIPolyPatch::resetAMI : recalculating weights" 57 <<
" for " <<
name() <<
" and " << nonOverlapPatch.
name()
65 Pout<<
"cyclicACMIPolyPatch::resetAMI : clearing cellCentres" 66 <<
" for " <<
name() <<
" and " << nonOverlapPatch.
name()
116 Sf[facei] *= srcMask_[facei];
117 noSf[facei] *= 1.0 - srcMask_[facei];
124 refCast<const cyclicACMIPolyPatch>(this->neighbPatch());
132 Sf[facei] *= tgtMask_[facei];
133 noSf[facei] *= 1.0 - tgtMask_[facei];
147 scalar&
sum = srcWeightsSum[i];
165 scalar&
sum = tgtWeightsSum[i];
185 Pout<<
"cyclicACMIPolyPatch::initGeometry : " <<
name() <<
endl;
199 Pout<<
"cyclicACMIPolyPatch::calcGeometry : " <<
name() <<
endl;
213 Pout<<
"cyclicACMIPolyPatch::initMovePoints : " <<
name() <<
endl;
230 Pout<<
"cyclicACMIPolyPatch::movePoints : " <<
name() <<
endl;
240 Pout<<
"cyclicACMIPolyPatch::initUpdateMesh : " <<
name() <<
endl;
250 Pout<<
"cyclicACMIPolyPatch::updateMesh : " <<
name() <<
endl;
260 Pout<<
"cyclicACMIPolyPatch::clearGeom : " <<
name() <<
endl;
287 const word& patchType,
293 nonOverlapPatchID_(-1),
298 AMIRequireMatch_ =
false;
311 const word& patchType
315 nonOverlapPatchName_(dict.
lookup(
"nonOverlapPatch")),
316 nonOverlapPatchID_(-1),
321 AMIRequireMatch_ =
false;
323 if (nonOverlapPatchName_ == name)
328 ) <<
"Non-overlapping patch name " << nonOverlapPatchName_
329 <<
" cannot be the same as this patch " << name
345 nonOverlapPatchName_(pp.nonOverlapPatchName_),
346 nonOverlapPatchID_(-1),
351 AMIRequireMatch_ =
false;
364 const label newStart,
365 const word& nbrPatchName,
366 const word& nonOverlapPatchName
370 nonOverlapPatchName_(nonOverlapPatchName),
371 nonOverlapPatchID_(-1),
376 AMIRequireMatch_ =
false;
378 if (nonOverlapPatchName_ ==
name())
381 <<
"Non-overlapping patch name " << nonOverlapPatchName_
382 <<
" cannot be the same as this patch " <<
name()
401 nonOverlapPatchName_(pp.nonOverlapPatchName_),
402 nonOverlapPatchID_(-1),
407 AMIRequireMatch_ =
false;
422 return refCast<const cyclicACMIPolyPatch>(pp);
428 if (nonOverlapPatchID_ == -1)
433 if (nonOverlapPatchID_ == -1)
436 <<
"Illegal non-overlapping patch name " << nonOverlapPatchName_
437 <<
nl <<
"Valid patch names are " 442 if (nonOverlapPatchID_ < index())
445 <<
"Boundary ordering error: " <<
type()
446 <<
" patch must be defined prior to its non-overlapping patch" 448 <<
type() <<
" patch: " <<
name() <<
", ID:" << index() <<
nl 449 <<
"Non-overlap patch: " << nonOverlapPatchName_
450 <<
", ID:" << nonOverlapPatchID_ <<
nl 458 if (size() == noPp.size())
465 scalar ratio =
mag(magSf[facei]/(noMagSf[facei] + ROOTVSMALL));
467 if (ratio - 1 > tolerance_)
482 <<
"Inconsistent ACMI patches " <<
name() <<
" and " 483 << noPp.
name() <<
". Patches should have identical topology" 488 return nonOverlapPatchID_;
542 os.
writeKeyword(
"nonOverlapPatch") << nonOverlapPatchName_
const vectorField::subField faceAreas() const
Return face normals.
virtual void clearGeom()
Clear geometry.
virtual bool order(PstreamBuffers &, const primitivePatch &, labelList &faceMap, labelList &rotation) const
Return new ordering for primitivePatch.
Cyclic patch for Arbitrarily Coupled Mesh Interface (ACMI)
virtual void initOrder(PstreamBuffers &, const primitivePatch &) const
Initialize ordering for primitivePatch. Does not.
#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.
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
virtual void initGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
const double e
Elementary charge.
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const scalarListList & srcWeights() const
Return const access to source patch weights.
virtual label nonOverlapPatchID() const
Non-overlapping patch ID.
virtual void resetAMI(const AMIPatchToPatchInterpolation::interpolationMethod &AMIMethod=AMIPatchToPatchInterpolation::imFaceAreaWeight) const
Reset the AMI interpolator.
void size(const label)
Override size to be inconsistent with allocated storage.
virtual void updateMesh(PstreamBuffers &)
Update of the patch topology.
virtual const cyclicACMIPolyPatch & neighbPatch() const
Return a reference to the neighbour patch.
virtual const scalarField & srcMask() const
Return the mask/weighting for the source patch.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface...
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool cp(const fileName &src, const fileName &dst)
Copy, recursively if necessary, the source to the destination.
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)
interpolationMethod
Enumeration specifying interpolation method.
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
virtual void initOrder(PstreamBuffers &, const primitivePatch &) const
Initialize ordering for primitivePatch. Does not.
A list of faces which address into the list of points.
virtual void movePoints(PstreamBuffers &pBufs, const pointField &)
Correct patches after moving points.
virtual const scalarField & tgtMask() const
Return the mask/weighting for the target patch.
void clearGeom()
Clear geometry.
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
A class for handling words, derived from string.
virtual void updateMesh(PstreamBuffers &)
Update of the patch topology.
virtual void initMovePoints(PstreamBuffers &pBufs, const pointField &)
Initialise the patches for moving points.
static const word null
An empty word.
cyclicACMIPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType, const transformType transform=UNKNOWN)
Construct from (base couped patch) components.
Cyclic patch for Arbitrary Mesh Interface (AMI)
const word & name() const
Return name.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
virtual void resetAMI(const AMIPatchToPatchInterpolation::interpolationMethod &AMIMethod=AMIPatchToPatchInterpolation::imFaceAreaWeight) const
Reset the AMI interpolator.
virtual void clearGeom()
Clear geometry.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
prefixOSstream Pout(cout,"Pout")
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
virtual void initGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
defineTypeNameAndDebug(combustionModel, 0)
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
const bMesh & mesh() const
Buffers for inter-processor communications streams (UOPstream, UIPstream).
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
word name(const complex &)
Return a string representation of a complex.
virtual bool order(PstreamBuffers &, const primitivePatch &, labelList &faceMap, labelList &rotation) const
Return new ordering for primitivePatch.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
const scalarField & srcWeightsSum() const
Return const access to normalisation factor of source.
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
virtual ~cyclicACMIPolyPatch()
Destructor.
dimensioned< scalar > mag(const dimensioned< Type > &)
Mesh consisting of general polyhedral cells.
const scalarField & tgtWeightsSum() const
Return const access to normalisation factor of target.
A patch is a list of labels that address the faces in the global face list.
const scalarListList & tgtWeights() const
Return const access to target patch weights.
const polyPatch & nonOverlapPatch() const
Return a const reference to the non-overlapping patch.
virtual void movePoints(PstreamBuffers &pBufs, const pointField &)
Correct patches after moving points.
virtual void initMovePoints(PstreamBuffers &pBufs, const pointField &)
Initialise the patches for moving points.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.