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_
virtual void clearGeom()
Clear 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.
virtual const cyclicACMIPolyPatch & neighbPatch() const
Return a reference to the neighbour patch.
virtual void resetAMI(const AMIPatchToPatchInterpolation::interpolationMethod &AMIMethod=AMIPatchToPatchInterpolation::imFaceAreaWeight) const
Reset the AMI interpolator.
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...
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.
virtual void updateMesh(PstreamBuffers &)
Update of the patch topology.
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, 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)
interpolationMethod
Enumeration specifying interpolation method.
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
const polyPatch & nonOverlapPatch() const
Return a const reference to the non-overlapping patch.
A list of faces which address into the list of points.
virtual void movePoints(PstreamBuffers &pBufs, const pointField &)
Correct patches after moving 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 updateMesh(PstreamBuffers &)
Update of the patch topology.
virtual void initMovePoints(PstreamBuffers &pBufs, const pointField &)
Initialise the patches for moving points.
virtual void resetAMI(const AMIPatchToPatchInterpolation::interpolationMethod &AMIMethod=AMIPatchToPatchInterpolation::imFaceAreaWeight) const
Reset the AMI interpolator.
static const word null
An empty word.
const scalarField & tgtWeightsSum() const
Return const access to normalisation factor of target.
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)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
virtual void clearGeom()
Clear geometry.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
const vectorField::subField faceAreas() const
Return face normals.
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.
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.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
word name(const complex &)
Return a string representation of a complex.
const scalarField & srcWeightsSum() const
Return const access to normalisation factor of source.
virtual void initOrder(PstreamBuffers &, const primitivePatch &) const
Initialize ordering for primitivePatch. Does not.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
prefixOSstream Pout(cout, "Pout")
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 bMesh & mesh() const
A patch is a list of labels that address the faces in the global face list.
virtual void initOrder(PstreamBuffers &, const primitivePatch &) const
Initialize 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 movePoints(PstreamBuffers &pBufs, const pointField &)
Correct patches after moving points.
virtual void initMovePoints(PstreamBuffers &pBufs, const pointField &)
Initialise the patches for moving points.