77 uniqueMeshPointLabels,
87 globalFaces().gather(wghtSum, mergedWeights);
97 (directory/prefix +
"_" + inst.name()),
120 const auto* cpp = isA<cyclicAMIPolyPatch>(
pp);
122 if (cpp && cpp->owner())
124 const auto& cycPatch = *cpp;
125 const auto& nbrPatch = cycPatch.neighbPatch();
129 Info<<
"Calculating AMI weights between owner patch: " 130 << cycPatch.name() <<
" and neighbour patch: " 131 << nbrPatch.name() <<
endl;
157 int main(
int argc,
char *argv[])
161 "Mesh motion and topological mesh changes utility" 169 "Check AMI weights and write VTK files of the AMI patches" 176 const bool checkAMI =
args.
found(
"checkAMI");
180 Info<<
"Writing VTK files with weights of AMI patches." <<
nl <<
endl;
183 const bool overwrite =
args.
found(
"overwrite");
const Type & value() const noexcept
Return const reference to value.
static void addNote(const string ¬e)
Add extra notes for the usage information.
A class for handling file names.
vtk::lineWriter writer(edgeCentres, edgeList::null(), fileName(aMesh.time().globalPath()/"finiteArea-edgesCentres"))
constexpr char nl
The newline '\n' character (0x0a)
Write faces/points (optionally with fields) as a vtp file or a legacy vtk file.
virtual bool loop()
Return true if run should continue and if so increment time.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
const Time & time() const
Return the top-level database.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
void write(const word &fieldName, const UList< Type > &field)
Write primitive field of CellData (Poly or Line) or PointData values.
A list of faces which address into the list of points.
const fileName & pointsInstance() const
Return the current instance directory for points.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
fileName globalPath() const
Return global path for the case = rootPath/globalCaseName. Same as TimePaths::globalPath() ...
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
A class for handling words, derived from Foam::string.
virtual bool loop()
PIMPLE loop.
virtual bool checkMesh(const bool report=false) const
Check mesh for correctness. Returns false for no error.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
const scalarField & tgtWeightsSum() const
Return const access to normalisation factor of target patch weights (i.e. the sum before normalisatio...
virtual bool beginCellData(label nFields=0)
Begin CellData output section for specified number of fields.
virtual bool update()=0
Update the mesh for both mesh motion and topology change.
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
virtual const dictionary dict() const
Return the solution dictionary.
Ostream & printExecutionTime(OSstream &os) const
Print the elapsed ExecutionTime (cpu-time), ClockTime.
const scalarField & srcWeightsSum() const
Return const access to normalisation factor of source patch weights (i.e. the sum before normalisatio...
virtual void setTime(const instant &inst)
Define a time name/value for the output.
An instant of time. Contains the time value and name. Uses Foam::Time when formatting the name...
Calculates points shared by more than two processor patches or cyclic patches.
void setInstance(const fileName &instance, const IOobjectOption::writeOption wOpt=IOobject::AUTO_WRITE)
Set the instance for mesh files.
bool firstIter() const
Return true for first PIMPLE (outer) iteration.
PIMPLE control class to supply convergence information/checks for the PIMPLE loop.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
static word outputPrefix
Directory prefix.
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
const std::string patch
OpenFOAM patch number as a std::string.
messageStream Info
Information stream (stdout output on master, null elsewhere)
virtual bool writeGeometry()
Write patch topology.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Mesh consisting of general polyhedral cells.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
void writeTimeValue()
Write the currently set time as "TimeValue" FieldData.
A patch is a list of labels that address the faces in the global face list.
Foam::argList args(argc, argv)
bool found(const word &optName) const
Return true if the named option is found.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())