58 os <<
"v " << pt.
x() <<
' ' << pt.
y() <<
' ' << pt.
z() <<
nl;
66 Info<<
"Writing mesh points and edges to " << pointFile <<
endl;
79 pointStream <<
"l " <<
e.start() + 1 <<
' ' <<
e.end() + 1 <<
nl;
94 Info<<
"Writing mesh points and edges to " << fName <<
endl;
106 label celli = cellLabels[i];
118 if (e0Fnd == pointToObj.end())
122 pointToObj.insert(
e[0], v0);
133 if (e1Fnd == pointToObj.end())
137 pointToObj.insert(
e[1], v1);
145 str <<
"l " << v0+1 <<
' ' << v1+1 <<
nl;
165 Info<<
"Writing mesh points and edges to " << fName <<
endl;
169 const cell& cFaces = mesh.
cells()[celli];
182 /
"meshFaceCentres_" +
timeName +
".obj"
185 Info<<
"Writing mesh face centres to " << faceFile <<
endl;
203 Info<<
"Writing mesh cell centres to " << cellFile <<
endl;
214 void writePatchCentres
231 Info<<
"Writing patch face centres to " << faceFile <<
endl;
261 Info<<
"Writing patch faces to " << faceFile <<
endl;
274 patchFaceStream<<
'f';
278 patchFaceStream <<
' ' <<
f[fp]+1;
280 patchFaceStream <<
nl;
286 void writePatchBoundaryEdges
304 Info<<
"Writing patch edges to " << edgeFile <<
endl;
319 patchEdgeStream<<
"l " <<
e[0]+1 <<
' ' <<
e[1]+1 <<
nl;
343 allEdges.insert(cEdges[i]);
351 /
"pointEdges_" +
timeName +
'_' +
name(pointi) +
".obj"
354 Info<<
"Writing pointEdges to " << pFile <<
endl;
366 pointStream<<
"l " << vertI-1 <<
' ' << vertI <<
nl;
372 int main(
int argc,
char *argv[])
376 "for mesh debugging: write mesh as separate OBJ files"
383 "write patch faces edges"
388 "write patch boundary edges"
394 "write points for the specified cell"
400 "write specified face"
406 "write specified point"
412 "write points for specified cellSet"
418 "write points for specified faceSet"
434 Info<<
"Writing mesh objects as .obj files such that the object"
435 <<
" numbering" <<
endl
436 <<
"(for points, faces, cells) is consistent with"
437 <<
" Foam numbering (starting from 0)." <<
endl <<
endl;
445 runTime.setTime(
timeDirs[timeI], timeI);
447 Info<<
"Time = " << runTime.userTimeName() <<
endl;
455 writePatchFaces(mesh, runTime.name());
459 writePatchBoundaryEdges(mesh, runTime.name());
465 writePoints(mesh, celli, runTime.name());
471 writePointCells(mesh, pointi, runTime.name());
487 Info<<
"Writing mesh points and edges to " << fName <<
endl;
497 const word setName =
args[
"cellSet"];
501 Info<<
"Read " <<
cells.
size() <<
" cells from set " << setName
504 writePoints(mesh,
cells.toc(), runTime.name());
508 const word setName =
args[
"faceSet"];
512 Info<<
"Read " << faces.size() <<
" faces from set " << setName
525 Info<<
"Writing mesh points and edges to " << fName <<
endl;
549 writePoints(mesh, runTime.name());
552 writeFaceCentres(mesh, runTime.name());
555 writeCellCentres(mesh, runTime.name());
558 writePatchCentres(mesh, runTime.name());
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
void size(const label)
Override size to be inconsistent with allocated storage.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
label nEdges() const
Return number of edges in patch.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
label nInternalEdges() const
Number of internal edges.
const List< FaceType > & localFaces() const
Return patch faces addressing into local point list.
const labelListList & edgeFaces() const
Return edge-face addressing.
const Field< PointType > & localPoints() const
Return pointField of points in patch.
fileName path() const
Explicitly inherit path from TimePaths to disambiguate from.
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
static void addNote(const string &)
Add extra notes for the usage information.
T optionRead(const word &opt) const
Read a value from the named option.
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
bool optionFound(const word &opt) const
Return true if the named option is found.
A collection of cell labels.
A cell is defined as a list of faces with extra functionality.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
A face is a list of labels corresponding to mesh vertices.
A class for handling file names.
word name() const
Return file name (part beyond last /)
const Time & time() const
Return time.
const word & name() const
Return name.
Mesh consisting of general polyhedral cells.
virtual const faceList & faces() const
Return raw faces.
readUpdateState
Enumeration defining the state of the mesh after a read update.
readUpdateState readUpdate()
Update the mesh based on the mesh files saved in.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
virtual const pointField & points() const
Return raw points.
A patch is a list of labels that address the faces in the global face list.
const vectorField::subField faceCentres() const
Return face centres.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
const labelListList & cellEdges() const
const vectorField & faceCentres() const
const labelListList & pointCells() const
const vectorField & cellCentres() const
const cellList & cells() const
static void addOptions(const bool constant=true, const bool withZero=false)
Add the options handled by timeSelector to argList::validOptions.
static instantList select0(Time &runTime, const argList &args)
Return the set of times selected based on the argList options.
A class for handling words, derived from string.
int main(int argc, char *argv[])
static instantList timeDirs
const fvPatchList & patches
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
Foam::argList args(argc, argv)