Go to the documentation of this file.
44 const Foam::scalar Foam::cyclicACMIPolyPatch::tolerance_ = 1
e-10;
55 const polyPatch& nonOverlapPatch = this->nonOverlapPatch();
59 Pout<<
"cyclicACMIPolyPatch::resetAMI : recalculating weights"
60 <<
" for " <<
name() <<
" and " << nonOverlapPatch.
name()
68 Pout<<
"cyclicACMIPolyPatch::resetAMI : clearing cellCentres"
69 <<
" for " <<
name() <<
" and " << nonOverlapPatch.
name()
84 ).primitiveMesh::clearGeom();
95 cyclicAMIPolyPatch::resetAMI
97 AMIPatchToPatchInterpolation::imPartialFaceAreaWeight
108 label nUncovered = 0;
112 scalar
sum = wghtsSum[facei];
113 if (
sum < tolerance_)
117 else if (
sum > scalar(1)-tolerance_)
126 Info<<
"ACMI: Patch source uncovered/blended/covered = "
127 << nUncovered <<
", " << nTotal-nUncovered-nCovered
128 <<
", " << nCovered <<
endl;
133 label nUncovered = 0;
137 scalar
sum = wghtsSum[facei];
138 if (
sum < tolerance_)
142 else if (
sum > scalar(1)-tolerance_)
151 Info<<
"ACMI: Patch target uncovered/blended/covered = "
152 << nUncovered <<
", " << nTotal-nUncovered-nCovered
153 <<
", " << nCovered <<
endl;
172 Sf[facei] *= srcMask_[facei];
173 noSf[facei] *= 1.0 - srcMask_[facei];
180 refCast<const cyclicACMIPolyPatch>(this->neighbPatch());
188 Sf[facei] *= tgtMask_[facei];
189 noSf[facei] *= 1.0 - tgtMask_[facei];
203 scalar&
sum = srcWeightsSum[i];
221 scalar&
sum = tgtWeightsSum[i];
241 Pout<<
"cyclicACMIPolyPatch::initGeometry : " <<
name() <<
endl;
257 Pout<<
"cyclicACMIPolyPatch::calcGeometry : " <<
name() <<
endl;
271 Pout<<
"cyclicACMIPolyPatch::initMovePoints : " <<
name() <<
endl;
290 Pout<<
"cyclicACMIPolyPatch::movePoints : " <<
name() <<
endl;
300 Pout<<
"cyclicACMIPolyPatch::initUpdateMesh : " <<
name() <<
endl;
310 Pout<<
"cyclicACMIPolyPatch::updateMesh : " <<
name() <<
endl;
320 Pout<<
"cyclicACMIPolyPatch::clearGeom : " <<
name() <<
endl;
347 const word& patchType,
353 nonOverlapPatchID_(-1),
358 AMIRequireMatch_ =
false;
371 const word& patchType
375 nonOverlapPatchName_(
dict.
lookup(
"nonOverlapPatch")),
376 nonOverlapPatchID_(-1),
381 AMIRequireMatch_ =
false;
383 if (nonOverlapPatchName_ ==
name)
386 <<
"Non-overlapping patch name " << nonOverlapPatchName_
387 <<
" cannot be the same as this patch " <<
name
403 nonOverlapPatchName_(pp.nonOverlapPatchName_),
404 nonOverlapPatchID_(-1),
409 AMIRequireMatch_ =
false;
422 const label newStart,
423 const word& nbrPatchName,
424 const word& nonOverlapPatchName
428 nonOverlapPatchName_(nonOverlapPatchName),
429 nonOverlapPatchID_(-1),
434 AMIRequireMatch_ =
false;
436 if (nonOverlapPatchName_ ==
name())
439 <<
"Non-overlapping patch name " << nonOverlapPatchName_
440 <<
" cannot be the same as this patch " <<
name()
459 nonOverlapPatchName_(pp.nonOverlapPatchName_),
460 nonOverlapPatchID_(-1),
465 AMIRequireMatch_ =
false;
480 return refCast<const cyclicACMIPolyPatch>(pp);
486 if (nonOverlapPatchID_ == -1)
491 if (nonOverlapPatchID_ == -1)
494 <<
"Illegal non-overlapping patch name " << nonOverlapPatchName_
495 <<
nl <<
"Valid patch names are "
500 if (nonOverlapPatchID_ < index())
503 <<
"Boundary ordering error: " <<
type()
504 <<
" patch must be defined prior to its non-overlapping patch"
506 <<
type() <<
" patch: " <<
name() <<
", ID:" << index() <<
nl
507 <<
"Non-overlap patch: " << nonOverlapPatchName_
508 <<
", ID:" << nonOverlapPatchID_ <<
nl
516 if (size() == noPp.size())
523 scalar ratio =
mag(magSf[facei]/(noMagSf[facei] + ROOTVSMALL));
525 if (ratio - 1 > tolerance_)
540 <<
"Inconsistent ACMI patches " <<
name() <<
" and "
541 << noPp.
name() <<
". Patches should have identical topology"
546 return nonOverlapPatchID_;
576 os.
writeEntry(
"nonOverlapPatch", nonOverlapPatchName_);
int debug
Static debugging option.
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
interpolationMethod
Enumeration specifying interpolation method.
virtual bool order(PstreamBuffers &, const primitivePatch &, labelList &faceMap, labelList &rotation) const
Return new ordering for primitivePatch.
const bMesh & mesh() const
virtual ~cyclicACMIPolyPatch()
Destructor.
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)
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.
const volScalarField & cp
virtual void initOrder(PstreamBuffers &, const primitivePatch &) const
Initialize ordering for primitivePatch. Does not.
const scalarField & tgtWeightsSum() const
virtual void initGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
const scalarField & srcWeightsSum() const
Ostream & endl(Ostream &os)
Add newline and flush stream.
prefixOSstream Pout
An Ostream wrapper for parallel output to std::cout.
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
const scalarListList & tgtWeights() const
Return const access to target patch weights.
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 coupled patch) components.
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.
const Field< PointType > & faceAreas() const
Return face area vectors for patch.
SubField is a Field obtained as a section of another Field.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
virtual void updateMesh(PstreamBuffers &)
Update of the patch topology.
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
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 calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
virtual void resetAMI(const AMIPatchToPatchInterpolation::interpolationMethod &AMIMethod=AMIPatchToPatchInterpolation::imFaceAreaWeight) const
Reset the AMI interpolator.
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
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.
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.
ITstream & lookup(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
virtual label nonOverlapPatchID() const
Non-overlapping patch ID.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual void initMovePoints(PstreamBuffers &pBufs, const pointField &)
Initialise the patches for moving points.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual const cyclicACMIPolyPatch & neighbPatch() const
Return a reference to the neighbour patch.
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)
label ListType::const_reference const label start
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...
const dimensionedScalar e
Elementary charge.
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.
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)
defineTypeNameAndDebug(combustionModel, 0)
const word & name() const
Return the patch name.
const scalarListList & srcWeights() const
Return const access to source patch weights.
A list of faces which address into the list of points.
virtual void initGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
Cyclic patch for Arbitrary Mesh Interface (AMI)