Go to the documentation of this file.
54 for (
const scalar
sum : weightSum)
60 else if (
sum > scalar(1) - tolerance_)
69 Info<<
"ACMI: Patch " <<
name <<
" uncovered/blended/covered = "
70 << nUncovered <<
", " << nTotal-nUncovered-nCovered
71 <<
", " << nCovered <<
endl;
88 const polyPatch& nonOverlapPatch = this->nonOverlapPatch();
91 <<
"cyclicACMIPolyPatch::resetAMI : recalculating weights"
92 <<
" for " <<
name() <<
" and " << nonOverlapPatch.
name()
100 <<
"cyclicACMIPolyPatch::resetAMI : clearing cellCentres"
101 <<
" for " <<
name() <<
" and " << nonOverlapPatch.
name()
105 <<
"The mesh already has cellCentres calculated when"
106 <<
" resetting ACMI " <<
name() <<
"." <<
nl
107 <<
"This is a problem since ACMI adapts the face areas"
108 <<
" (to close cells) so this has" <<
nl
109 <<
"to be done before cell centre calculation." <<
nl
110 <<
"This can happen if e.g. the cyclicACMI is after"
111 <<
" any processor patches in the boundary." <<
endl;
144 <<
" non-overlap patch: " <<
patch.nonOverlapPatch().name()
145 <<
" size:" <<
patch.nonOverlapPatch().size()
146 <<
" mask size:" <<
patch.srcMask().size() <<
endl;
151 <<
" non-overlap patch: " <<
patch.nonOverlapPatch().name()
152 <<
" size:" <<
patch.nonOverlapPatch().size()
153 <<
" mask size:" <<
patch.neighbPatch().tgtMask().size()
162 if (!owner() || !canResetAMI())
167 scalePatchFaceAreas(*
this);
168 scalePatchFaceAreas(this->neighbPatch());
180 const scalar maxTol = scalar(1) - tolerance_;
187 <<
"rescaling non-overlap patch areas for: " << nonOverlapPatch.
name()
191 if (mask.size() != noSf.size())
194 <<
"Inconsistent sizes for patch: " << acmipp.
name()
195 <<
" - not manipulating patches" <<
nl
196 <<
" - size: " << size() <<
nl
197 <<
" - non-overlap patch size: " << noSf.size() <<
nl
198 <<
" - mask size: " << mask.size() <<
nl
199 <<
"This is OK for decomposition but should be considered fatal "
200 <<
"at run-time" <<
endl;
207 const scalar w =
min(maxTol,
max(tolerance_, mask[facei]));
208 noSf[facei] *= scalar(1) - w;
211 if (!createAMIFaces_)
218 <<
"scaling coupled patch areas for: " << acmipp.
name() <<
endl;
225 Sf[facei] *=
max(tolerance_, mask[facei]);
237 scalar&
sum = weightsSum[i];
259 if (!createAMIFaces_ && canResetAMI())
264 scalePatchFaceAreas();
288 scalePatchFaceAreas();
350 const word& patchType,
352 const word& defaultAMIMethod
367 nonOverlapPatchID_(-1),
371 AMIPtr_->setRequireMatch(
false);
384 const word& patchType,
385 const word& defaultAMIMethod
389 nonOverlapPatchName_(
dict.
get<
word>(
"nonOverlapPatch")),
390 nonOverlapPatchID_(-1),
394 AMIPtr_->setRequireMatch(
false);
396 if (nonOverlapPatchName_ ==
name)
399 <<
"Non-overlapping patch name " << nonOverlapPatchName_
400 <<
" cannot be the same as this patch " <<
name
416 nonOverlapPatchName_(pp.nonOverlapPatchName_),
417 nonOverlapPatchID_(-1),
421 AMIPtr_->setRequireMatch(
false);
434 const label newStart,
435 const word& nbrPatchName,
436 const word& nonOverlapPatchName
440 nonOverlapPatchName_(nonOverlapPatchName),
441 nonOverlapPatchID_(-1),
445 AMIPtr_->setRequireMatch(
false);
447 if (nonOverlapPatchName_ ==
name())
450 <<
"Non-overlapping patch name " << nonOverlapPatchName_
451 <<
" cannot be the same as this patch " <<
name()
470 nonOverlapPatchName_(pp.nonOverlapPatchName_),
471 nonOverlapPatchID_(-1),
475 AMIPtr_->setRequireMatch(
false);
484 return refCast<const cyclicACMIPolyPatch>(pp);
490 if (nonOverlapPatchID_ == -1)
495 if (nonOverlapPatchID_ == -1)
498 <<
"Illegal non-overlapping patch name " << nonOverlapPatchName_
499 <<
nl <<
"Valid patch names are "
504 if (nonOverlapPatchID_ < index())
507 <<
"Boundary ordering error: " <<
type()
508 <<
" patch must be defined prior to its non-overlapping patch"
510 <<
type() <<
" patch: " <<
name() <<
", ID:" << index() <<
nl
511 <<
"Non-overlap patch: " << nonOverlapPatchName_
512 <<
", ID:" << nonOverlapPatchID_ <<
nl
520 if (size() == noPp.size())
527 scalar ratio =
mag(magSf[facei]/(noMagSf[facei] + ROOTVSMALL));
529 if (ratio - 1 > tolerance_)
544 <<
"Inconsistent ACMI patches " <<
name() <<
" and "
545 << noPp.
name() <<
". Patches should have identical topology"
550 return nonOverlapPatchID_;
580 os.
writeEntry(
"nonOverlapPatch", nonOverlapPatchName_);
int debug
Static debugging option.
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
virtual bool order(PstreamBuffers &, const primitivePatch &, labelList &faceMap, labelList &rotation) const
Return new ordering for primitivePatch.
const bMesh & mesh() const
void clearGeom()
Clear geometry.
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
virtual void movePoints(PstreamBuffers &pBufs, const pointField &)
Correct patches after moving points.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
virtual void resetAMI() const
Reset the AMI interpolator, use current patch points.
A class for handling words, derived from Foam::string.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
virtual void initOrder(PstreamBuffers &, const primitivePatch &) const
const scalarField & tgtWeightsSum() const
virtual void initGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
const scalarListList & weights() const
Helper function to return the weights.
const scalarField & srcWeightsSum() const
Ostream & endl(Ostream &os)
Add newline and flush stream.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
prefixOSstream Pout
An Ostream wrapper for parallel output to std::cout.
virtual void resetAMI() const
Reset the AMI interpolator, use current patch points.
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
virtual void initMovePoints(PstreamBuffers &pBufs, const pointField &)
Initialise the patches for moving points.
virtual void updateMesh(PstreamBuffers &)
Update of the patch topology.
SubField is a Field obtained as a section of another Field.
virtual void updateMesh(PstreamBuffers &)
Update of the patch topology.
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
const scalarField & weightsSum() const
Helper function to return the weights sum.
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
const polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
messageStream Info
Information stream (uses stdout - output is on the master only)
A patch is a list of labels that address the faces in the global face list.
virtual const scalarField & srcMask() const
Return the mask/weighting for the source patch.
word name(const complex &c)
Return string representation of complex.
bool hasCellCentres() const
virtual void movePoints(PstreamBuffers &pBufs, const pointField &)
Correct patches after moving points.
virtual void clearGeom()
Clear geometry.
virtual bool order(PstreamBuffers &, const primitivePatch &, labelList &faceMap, labelList &rotation) const
Return new ordering for primitivePatch.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
virtual void initOrder(PstreamBuffers &, const primitivePatch &) const
Initialize ordering for primitivePatch. Does not.
virtual label nonOverlapPatchID() const
Non-overlapping patch ID.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
reduce(hasMovingMesh, orOp< bool >())
const Field< point_type > & points() const
Return reference to global points.
cyclicACMIPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType, const transformType transform=UNKNOWN, const word &defaultAMIMethod=partialFaceAreaWeightAMI::typeName)
Construct from (base coupled patch) components.
Macros for easy insertion into run-time selection tables.
#define DebugPout
Report an information message using Foam::Pout.
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual void initMovePoints(PstreamBuffers &pBufs, const pointField &)
Initialise the patches for moving points.
virtual void scalePatchFaceAreas()
Scale patch face areas to maintain physical area.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual const cyclicACMIPolyPatch & neighbPatch() const
Return a reference to the neighbour patch.
const std::string patch
OpenFOAM patch number as a std::string.
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
virtual void clearGeom()
Clear geometry.
const vectorField::subField faceAreas() const
Return face normals.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
static const word null
An empty word.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
const polyPatch & nonOverlapPatch() const
Return a const reference to the non-overlapping patch.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
virtual const scalarField & tgtMask() const
Return the mask/weighting for the target patch.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Cyclic patch for Arbitrarily Coupled Mesh Interface (ACMI)
const scalarField & mask() const
Mask field where 1 = overlap(coupled), 0 = no-overlap.
defineTypeNameAndDebug(combustionModel, 0)
const word & name() const
The patch name.
#define WarningInFunction
Report a warning using Foam::Warning.
A list of faces which address into the list of points.
virtual void initGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
void reportCoverage(const word &name, const scalarField &weightSum) const
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
const vectorField & faceAreas() const
Cyclic patch for Arbitrary Mesh Interface (AMI)