77 uniqueMeshPointLabels,
87 globalFaces().gather(wghtSum, mergedWeights);
97 (directory/prefix +
"_" + inst.name()),
106 writer.write(
"weightsSum", mergedWeights);
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;
157int 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");
184 const word oldInstance =
mesh.pointsInstance();
191 pimple.dict().getOrDefault(
"moveMeshOuterCorrectors",
false)
208 mesh.setInstance(oldInstance);
215 mesh.checkMesh(
true);
vtk::lineWriter writer(edgeCentres, edgeList::null(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edgesCentres")))
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
const scalarField & srcWeightsSum() const
Return const access to normalisation factor of source patch weights (i.e. the sum before normalisatio...
const scalarField & tgtWeightsSum() const
Return const access to normalisation factor of target patch weights (i.e. the sum before normalisatio...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
static void addNote(const string ¬e)
Add extra notes for the usage information.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A class for handling file names.
static word outputPrefix
Directory prefix.
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.
PIMPLE control class to supply convergence information/checks for the PIMPLE loop.
Mesh consisting of general polyhedral cells.
A patch is a list of labels that address the faces in the global face list.
Write faces/points (optionally with fields) as a vtp file or a legacy vtk file.
A class for handling words, derived from Foam::string.
const std::string patch
OpenFOAM patch number as a std::string.
List< label > labelList
A List of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere).
PrimitivePatch< SubList< face >, const pointField & > primitivePatch
A PrimitivePatch with a SubList addressing for the faces, const reference for the point field.
List< face > faceList
List of faces.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
AMIInterpolation AMIPatchToPatchInterpolation
Patch-to-patch interpolation == Foam::AMIInterpolation.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
vectorField pointField
pointField is a vectorField.
constexpr char nl
The newline '\n' character (0x0a).
Foam::argList args(argc, argv)