66 <<
" patch:" << this->
name()
79 Pout<<
"cyclicACMIPolyPatch::updateAreas() :"
80 <<
" patch:" << this->
name()
82 <<
" AMITime_:" << AMITime_.
eventNo()
85 <<
" prevTimeIndex_:" << prevTimeIndex_
92 <<
"Topology changes and scaling currently not supported."
93 <<
" Patch " << this->
name() <<
endl;
121 Pout<<
"cyclicACMIPolyPatch::updateAreas : scaling masks"
122 <<
" for " <<
name() <<
" mask " <<
gAverage(srcScaledMask_)
148 return io.upToDate(AMITime_);
164 label nUncovered = 0;
166 for (
const scalar
sum : weightSum)
168 if (
sum < tolerance_)
172 else if (
sum > scalar(1) - tolerance_)
181 Info<<
"ACMI: Patch " <<
name <<
" uncovered/blended/covered = "
182 << nUncovered <<
", " << nTotal-nUncovered-nCovered
183 <<
", " << nCovered <<
endl;
197 const scalar maxTol = scalar(1) - tolerance_;
203 <<
"rescaling non-overlap patch areas for: "
209 <<
"Inconsistent sizes for patch: " << acmipp.
name()
210 <<
" - not manipulating patches" <<
nl
211 <<
" - size: " << size() <<
nl
212 <<
" - non-overlap patch size: " << noSf.
size() <<
nl
213 <<
" - mask size: " << mask.
size() <<
nl
214 <<
"This is OK for decomposition but"
215 <<
" should be considered fatal at run-time" <<
endl;
222 const scalar w =
min(maxTol,
max(tolerance_, mask[facei]));
223 noSf[facei] = noFaceArea[facei]*(scalar(1) - w);
226 if (!createAMIFaces_)
233 <<
"scaling coupled patch areas for: " << acmipp.
name() <<
endl;
240 Sf[facei] = faceArea[facei]*
max(tolerance_, mask[facei]);
252 scalar&
sum = weightsSum[i];
254 for (scalar& w : wghts)
295 const polyPatch& nonOverlapPatch = this->nonOverlapPatch();
298 <<
"cyclicACMIPolyPatch::resetAMI : recalculating weights"
299 <<
" for " <<
name() <<
" and " << nonOverlapPatch.
name()
310 <<
"primitiveMesh must already have face geometry"
337 Pout<<
"patch:" << patch.name() <<
" size:" << patch.size()
338 <<
" non-overlap patch: " << patch.nonOverlapPatch().name()
339 <<
" size:" << patch.nonOverlapPatch().size()
340 <<
" mask size:" << patch.srcMask().size() <<
endl;
344 Pout<<
"patch:" << patch.name() <<
" size:" << patch.size()
345 <<
" non-overlap patch: " << patch.nonOverlapPatch().name()
346 <<
" size:" << patch.nonOverlapPatch().size()
347 <<
" mask size:" << patch.neighbPatch().tgtMask().size()
356 if (!owner() || !canResetAMI())
361 const polyPatch& nonOverlapPatch = this->nonOverlapPatch();
370 thisSf_ = this->faceAreas();
373 nbrNoSf_ = nbrNonOverlapPatch.
faceAreas();
386 nonOverlapPatch.primitivePatch::faceAreas()
392 nbrPatch.primitivePatch::faceAreas(),
393 nbrNonOverlapPatch.primitivePatch::faceAreas()
401 const auto& acmipp = *
this;
405 Info<<
"cyclicACMI PP: " << acmipp.name()
408 <<
"cyclicACMI N-O PP: " << nonOverlapPatch.
name()
411 <<
"cyclicACMI NBR PP: " << nbrPatch.
name()
414 <<
"cyclicACMI NBR N-O PP: " << nbrNonOverlapPatch.
name()
417 <<
"cyclicACMI PP+N-O AREA: "
419 <<
"cyclicACMI NBR PP+N-O AREA: "
435 if (!createAMIFaces_ && canResetAMI())
440 scalePatchFaceAreas();
463 if (!createAMIFaces_ && canResetAMI())
468 scalePatchFaceAreas();
516 return srcScaledMask_;
532 return tgtScaledMask_;
550 const word& patchType,
552 const word& defaultAMIMethod
566 nonOverlapPatchName_(
word::null),
567 nonOverlapPatchID_(-1),
585 AMIPtr_->setRequireMatch(
false);
598 const word& patchType,
599 const word& defaultAMIMethod
603 nonOverlapPatchName_(
dict.get<
word>(
"nonOverlapPatch")),
604 nonOverlapPatchID_(-1),
628 AMIPtr_->setRequireMatch(
false);
630 if (nonOverlapPatchName_ ==
name)
633 <<
"Non-overlapping patch name " << nonOverlapPatchName_
634 <<
" cannot be the same as this patch " <<
name
650 nonOverlapPatchName_(pp.nonOverlapPatchName_),
651 nonOverlapPatchID_(-1),
654 srcScalePtr_(pp.srcScalePtr_.clone(*this)),
670 AMIPtr_->setRequireMatch(
false);
683 const label newStart,
684 const word& nbrPatchName,
685 const word& nonOverlapPatchName
689 nonOverlapPatchName_(nonOverlapPatchName),
690 nonOverlapPatchID_(-1),
693 srcScalePtr_(pp.srcScalePtr_.clone(*this)),
709 AMIPtr_->setRequireMatch(
false);
711 if (nonOverlapPatchName_ ==
name())
714 <<
"Non-overlapping patch name " << nonOverlapPatchName_
715 <<
" cannot be the same as this patch " <<
name()
734 nonOverlapPatchName_(pp.nonOverlapPatchName_),
735 nonOverlapPatchID_(-1),
738 srcScalePtr_(pp.srcScalePtr_.clone(*this)),
754 AMIPtr_->setRequireMatch(
false);
770 forAll(addSourceFaces, faceI)
772 if (fMask[faceI] > tolerance_)
774 const labelList& nbrFaceIs = addSourceFaces[faceI];
778 label nbrFaceI = nbrFaceIs[j];
780 if (nbrFaceI < neighbPatch().size())
806 if (fMask[faceI] > tolerance_)
808 dOverFaces[faceI].
setSize(srcFaces[faceI].size());
810 forAll(dOverFaces[faceI], subFaceI)
812 dOverFaces[faceI][subFaceI] = srcFaces[faceI][subFaceI];
825 if (!owner() && srcScalePtr_)
828 <<
"Ignoring \"scale\" setting in slave patch " <<
name()
830 srcScalePtr_.clear();
831 tgtScalePtr_.clear();
834 return refCast<const cyclicACMIPolyPatch>(pp);
840 if (nonOverlapPatchID_ == -1)
845 if (nonOverlapPatchID_ == -1)
848 <<
"Illegal non-overlapping patch name " << nonOverlapPatchName_
849 <<
nl <<
"Valid patch names are "
854 if (nonOverlapPatchID_ < index())
857 <<
"Boundary ordering error: " <<
type()
858 <<
" patch must be defined prior to its non-overlapping patch"
860 <<
type() <<
" patch: " <<
name() <<
", ID:" << index() <<
nl
861 <<
"Non-overlap patch: " << nonOverlapPatchName_
862 <<
", ID:" << nonOverlapPatchID_ <<
nl
870 if (size() == noPp.size())
877 scalar ratio =
mag(magSf[facei]/(noMagSf[facei] + ROOTVSMALL));
879 if (ratio - 1 > tolerance_)
894 <<
"Inconsistent ACMI patches " <<
name() <<
" and "
895 << noPp.
name() <<
". Patches should have identical topology"
900 return nonOverlapPatchID_;
932 if (owner() && srcScalePtr_)
934 srcScalePtr_->writeData(
os);
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
bool upToDate() const
Access to the up-to-date flag.
const scalarField & srcWeightsSum() const
const scalarField & tgtWeightsSum() const
Defines the attributes of an object for which implicit objectRegistry management is supported,...
void setSize(const label n)
Alias for resize()
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
A list of faces which address into the list of points.
const Field< point_type > & faceAreas() const
Return face area vectors for patch.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
SubField is a Field obtained as a section of another Field, without its own allocation....
scalar timeOutputValue() const
Return current time value.
label timeIndex() const noexcept
Return current time index.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void size(const label n)
Older name for setAddressableSize.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
const bMesh & mesh() const
Cyclic patch for Arbitrarily Coupled Mesh Interface (ACMI).
virtual void resetAMI() const
Reset the AMI interpolator, use current patch points.
virtual const scalarField & tgtMask() const
Return the mask/weighting for the target patch.
virtual void scalePatchFaceAreas()
Scale patch face areas to maintain physical area.
virtual refPtr< labelListList > mapCollocatedFaces() const
Return collocated faces.
const polyPatch & nonOverlapPatch() const
Return a const reference to the non-overlapping patch.
virtual void clearGeom()
Clear geometry.
virtual void newInternalProcFaces(label &, label &) const
Return number of new internal sub-faces and new proc faces.
virtual void initGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
virtual void initOrder(PstreamBuffers &, const primitivePatch &) const
Initialize ordering for primitivePatch. Does not.
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.
virtual label nonOverlapPatchID() const
Non-overlapping patch ID.
void reportCoverage(const word &name, const scalarField &weightSum) const
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
virtual bool updateAreas() const
Update the AMI and patch areas. Return true if anything.
Cyclic patch for Arbitrary Mesh Interface (AMI)
virtual void resetAMI() const
Reset the AMI interpolator, use current patch points.
bool createAMIFaces_
Flag to indicate that new AMI faces will created.
const scalarField & weightsSum() const
Helper function to return the weights sum.
const scalarListList & weights() const
Helper function to return the weights.
virtual bool owner() const
Does this side own the patch?
virtual void clearGeom()
Clear geometry.
virtual void initGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
virtual void initOrder(PstreamBuffers &, const primitivePatch &) const
static const scalar tolerance_
Tolerance used e.g. for area calculations/limits.
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
autoPtr< AMIPatchToPatchInterpolation > AMIPtr_
AMI interpolation class.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
void calcGeometry()
Calculate the geometry for the patches.
virtual bool write()
Write the output fields.
const Time & time() const
Return the top-level database.
virtual void initMovePoints()
Initialise the patches for moving points.
order
Enumeration specifying required accuracy.
void movePoints()
Update for new mesh geometry.
void updateMesh()
Update for new mesh topology.
const word & name() const noexcept
The patch name.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
Mesh consisting of general polyhedral cells.
const fileName & pointsInstance() const
Return the current instance directory for points.
virtual bool upToDatePoints(const regIOobject &io) const
Return true if io is up-to-date with points.
A patch is a list of labels that address the faces in the global face list.
const vectorField::subField faceAreas() const
Return face normals.
const labelUList & faceCells() const
Return face-cell addressing.
const vectorField & faceCentres() const
bool hasFaceAreas() const noexcept
const scalarField & cellVolumes() const
const vectorField & cellCentres() const
const vectorField & faceAreas() const
const cellList & cells() const
A class for managing references or pointers (no reference counting)
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
void setUpToDate()
Set as up-to-date.
label eventNo() const noexcept
Event number at last update.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
#define WarningInFunction
Report a warning using Foam::Warning.
#define DebugPout
Report an information message using Foam::Pout.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
List< T > uniqueSort(const UList< T > &input)
Return sorted list with removal of duplicates.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
messageStream Info
Information stream (stdout output on master, null elsewhere)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
List< labelList > labelListList
A List of labelList.
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
Type gAverage(const FieldField< Field, Type > &f)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.