39namespace functionObjects
91 const scalar srcMinWeight =
gMin(srcWeightsSum);
92 const scalar srcMaxWeight =
gMax(srcWeightsSum);
93 const scalar srcAveWeight =
gAverage(srcWeightsSum);
99 for (
const labelList& srcFace : srcAddress)
101 const label
n = srcFace.size();
103 srcMinNbr =
min(srcMinNbr,
n);
104 srcMaxNbr =
max(srcMaxNbr,
n);
115 const scalar tgtMinWeight =
gMin(tgtWeightsSum);
116 const scalar tgtMaxWeight =
gMax(tgtWeightsSum);
117 const scalar tgtAveWeight =
gAverage(tgtWeightsSum);
122 scalar tgtAveNbr = 0;
123 for (
const labelList& tgtFace : tgtAddress)
125 const label
n = tgtFace.size();
127 tgtMinNbr =
min(tgtMinNbr,
n);
128 tgtMaxNbr =
max(tgtMaxNbr,
n);
139 << mesh_.time().timeName() <<
tab
141 << nbrPatchName <<
tab;
146 file() << distributed <<
tab;
150 << srcMinWeight <<
tab
151 << srcMaxWeight <<
tab
152 << srcAveWeight <<
tab
156 << tgtMinWeight <<
tab
157 << tgtMaxWeight <<
tab
158 << tgtAveWeight <<
tab
164 Log <<
" Patches: " <<
nl
165 <<
" Source: " << pp.
name() <<
nl
166 <<
" Target: " << nbrPatchName <<
nl;
170 Log <<
" Parallel distributed: " << distributed <<
nl;
178 <<
" | " <<
setw(w) << nbrPatchName <<
" | " <<
nl
179 <<
" min(weight) | " <<
setw(w) << srcMinWeight
180 <<
" | " <<
setw(w) << tgtMinWeight <<
" | " <<
nl
181 <<
" max(weight) | " <<
setw(w) << srcMaxWeight
182 <<
" | " <<
setw(w) << tgtMaxWeight <<
" | " <<
nl
183 <<
" ave(weight) | " <<
setw(w) << srcAveWeight
184 <<
" | " <<
setw(w) << tgtAveWeight <<
" | " <<
nl
185 <<
" min(address) | " <<
setw(w) << srcMinNbr
186 <<
" | " <<
setw(w) << tgtMinNbr <<
" | " <<
nl
187 <<
" max(address) | " <<
setw(w) << srcMaxNbr
188 <<
" | " <<
setw(w) << tgtMaxNbr <<
" | " <<
nl
189 <<
" ave(address) | " <<
setw(w) << srcAveNbr
190 <<
" | " <<
setw(w) << tgtAveNbr <<
" | " <<
nl
193 setResult(pp.
name() +
":src", pp.
name());
194 setResult(pp.
name() +
":tgt", nbrPatchName);
195 setResult(pp.
name() +
":src:min(weight)", srcMinWeight);
196 setResult(pp.
name() +
":src:max(weight)", srcMaxWeight);
197 setResult(pp.
name() +
":src:ave(weight)", srcAveWeight);
198 setResult(pp.
name() +
":src:min(address)", srcMinNbr);
199 setResult(pp.
name() +
":src:max(address)", srcMaxNbr);
200 setResult(pp.
name() +
":src:ave(address)", srcAveNbr);
201 setResult(pp.
name() +
":tgt:min(weight)", tgtMinWeight);
202 setResult(pp.
name() +
":tgt:max(weight)", tgtMaxWeight);
203 setResult(pp.
name() +
":tgt:ave(weight)", tgtAveWeight);
204 setResult(pp.
name() +
":tgt:min(address)", tgtMinNbr);
205 setResult(pp.
name() +
":tgt:max(address)", tgtMaxNbr);
206 setResult(pp.
name() +
":tgt:ave(address)", tgtAveNbr);
232 uniqueMeshPointLabels,
242 globalFaces().gather(weightSum, mergedWeights);
244 const bool isACMI = isA<cyclicACMIPolyPatch>(cpp);
251 globalFaces().gather(pp.
mask(), mergedMask);
256 instant inst(mesh_.time().value(), mesh_.time().timeName());
262 (baseTimeDir()/cpp.
name() +
"_" + side),
270 writer.beginCellData(1 + (isACMI ? 1 : 0));
271 writer.write(
"weightsSum", mergedWeights);
275 writer.write(
"mask", mergedMask);
323 const auto* amicpp = isA<cyclicAMIPolyPatch>(pp);
325 if (amicpp && amicpp->owner())
333 writeFileHeader(file());
335 writeFields_ =
dict.get<
bool>(
"writeFields");
355 for (
const label patchi : patchIDs_)
364 writeWeightFields(cpp);
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
vtk::internalMeshWriter writer(topoMesh, topoCells, vtk::formatType::INLINE_ASCII, runTime.path()/"blockTopology")
label singlePatchProc() const
const scalarField & srcWeightsSum() const
const labelListList & srcAddress() const
Return const access to source patch addressing.
const scalarField & tgtWeightsSum() const
const labelListList & tgtAddress() const
Return const access to target patch addressing.
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
static unsigned int defaultPrecision() noexcept
Return the default precision.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const Map< label > & meshPointMap() const
Mesh point map.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
const List< face_type > & localFaces() const
Return patch faces addressing into local point list.
virtual bool read()
Re-read model coefficients if they have changed.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
void size(const label n)
Older name for setAddressableSize.
static bool & parRun() noexcept
Test if this a parallel run.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Cyclic patch for Arbitrarily Coupled Mesh Interface (ACMI).
const scalarField & mask() const
Mask field where 1 = overlap(coupled), 0 = no-overlap.
Cyclic patch for Arbitrary Mesh Interface (AMI)
const word & neighbPatchName() const
Neighbour patch name.
virtual bool owner() const
Does this side own the patch?
const AMIPatchToPatchInterpolation & AMI() const
Return a reference to the AMI interpolator.
virtual const cyclicAMIPolyPatch & neighbPatch() const
Return a reference to the neighbour patch.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Abstract base-class for Time/database function objects.
Computes the min/max/average weights of arbitrary mesh interface (AMI) patches, and optionally report...
void writeWeightFields(const cyclicAMIPolyPatch &cpp) const
Write weight fields if writeFields=true.
void writeWeightField(const cyclicAMIPolyPatch &cpp, const scalarField &weightSum, const word &side) const
Write weight field.
virtual void reportPatch(const cyclicAMIPolyPatch &pp)
Helper function to report patch information.
virtual void writeFileHeader(Ostream &os)
Output file header information.
virtual bool execute()
Execute, currently does nothing.
virtual bool write()
Write the AMIWeights.
labelList patchIDs_
List of AMI patch IDs.
virtual bool read(const dictionary &)
Read the field min/max data.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Base class for writing single files from the function objects.
virtual void writeTabbed(Ostream &os, const string &str) const
Write a tabbed string to stream.
virtual void writeHeader(Ostream &os, const string &str) const
Write a commented header to stream.
virtual void writeCommented(Ostream &os, const string &str) const
Write a commented string to stream.
Calculates points shared by more than two processor patches or cyclic patches.
An instant of time. Contains the time value and name. Uses Foam::Time when formatting the name.
const word & name() const noexcept
The patch name.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
A patch is a list of labels that address the faces in the global face list.
const polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
splitCell * master() const
Write faces/points (optionally with fields) as a vtp file or a legacy vtk file.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
OBJstream os(runTime.globalPath()/outputName)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Omanip< int > setw(const int i)
Ostream & endl(Ostream &os)
Add newline and flush stream.
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.
Type gAverage(const FieldField< Field, Type > &f)
Type gMin(const FieldField< Field, Type > &f)
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.
Type gMax(const FieldField< Field, Type > &f)
constexpr char nl
The newline '\n' character (0x0a)
constexpr char tab
The tab '\t' character(0x09)
#define forAll(list, i)
Loop across all elements in list.