Go to the documentation of this file.
58 os <<
"v " << pt.
x() <<
' ' << pt.
y() <<
' ' << pt.
z() <<
nl;
82 pointStream <<
"l " <<
e.start() + 1 <<
' ' <<
e.end() + 1 <<
nl;
97 Info<<
"Writing mesh points and edges to " << fName <<
endl;
109 label cellI = cellLabels[i];
121 if (e0Fnd == pointToObj.end())
125 pointToObj.insert(
e[0], v0);
136 if (e1Fnd == pointToObj.end())
140 pointToObj.insert(
e[1], v1);
148 str <<
"l " << v0+1 <<
' ' << v1+1 <<
nl;
168 Info<<
"Writing mesh points and edges to " << fName <<
endl;
185 /
"meshFaceCentres_" +
timeName +
".obj"
188 Info<<
"Writing mesh face centres to " << faceFile <<
endl;
206 Info<<
"Writing mesh cell centres to " << cellFile <<
endl;
217 void writePatchCentres
234 Info<<
"Writing patch face centres to " << faceFile <<
endl;
264 Info<<
"Writing patch faces to " << faceFile <<
endl;
277 patchFaceStream<<
'f';
281 patchFaceStream <<
' ' <<
f[fp]+1;
283 patchFaceStream <<
nl;
289 void writePatchBoundaryEdges
307 Info<<
"Writing patch edges to " << edgeFile <<
endl;
322 patchEdgeStream<<
"l " <<
e[0]+1 <<
' ' <<
e[1]+1 <<
nl;
346 allEdges.insert(cEdges[i]);
354 /
"pointEdges_" +
timeName +
'_' +
name(pointI) +
".obj"
357 Info<<
"Writing pointEdges to " << pFile <<
endl;
369 pointStream<<
"l " << vertI-1 <<
' ' << vertI <<
nl;
375 int main(
int argc,
char *argv[])
379 "for mesh debugging: write mesh as separate OBJ files"
386 "write patch faces edges"
391 "write patch boundary edges"
397 "write points for the specified cell"
403 "write specified face"
409 "write specified point"
415 "write points for specified cellSet"
421 "write points for specified faceSet"
427 runTime.functionObjects().off();
438 Info<<
"Writing mesh objects as .obj files such that the object"
439 <<
" numbering" <<
endl
440 <<
"(for points, faces, cells) is consistent with"
441 <<
" Foam numbering (starting from 0)." <<
endl <<
endl;
449 runTime.setTime(
timeDirs[timeI], timeI);
451 Info<<
"Time = " << runTime.timeName() <<
endl;
459 writePatchFaces(
mesh, runTime.timeName());
463 writePatchBoundaryEdges(
mesh, runTime.timeName());
469 writePoints(
mesh, cellI, runTime.timeName());
475 writePointCells(
mesh, pointI, runTime.timeName());
491 Info<<
"Writing mesh points and edges to " << fName <<
endl;
501 const word setName =
args[
"cellSet"];
505 Info<<
"Read " <<
cells.
size() <<
" cells from set " << setName
508 writePoints(
mesh,
cells.toc(), runTime.timeName());
512 const word setName =
args[
"faceSet"];
516 Info<<
"Read " << faces.size() <<
" faces from set " << setName
529 Info<<
"Writing mesh points and edges to " << fName <<
endl;
553 writePoints(
mesh, runTime.timeName());
556 writeFaceCentres(
mesh, runTime.timeName());
559 writeCellCentres(
mesh, runTime.timeName());
562 writePatchCentres(
mesh, runTime.timeName());
virtual const pointField & points() const
Return raw points.
const labelListList & edgeFaces() const
Return edge-face addressing.
Inserts points at locations specified in a pointFile into the surfaces to be conformed to of the conf...
A class for handling words, derived from string.
A class for handling file names.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
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.
#define forAll(list, i)
Loop across all elements in list.
void writeOBJ(Ostream &os, label &vertI, const tetPoints &tet)
const Field< PointType > & localPoints() const
Return pointField of points in patch.
label nEdges() const
Return number of edges in patch.
const cellList & cells() const
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
labelList patchFaces(const polyBoundaryMesh &patches, const wordList &names)
Mesh consisting of general polyhedral cells.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
virtual readUpdateState readUpdate()
Update the mesh based on the mesh files saved in time.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const labelListList & cellEdges() const
A patch is a list of labels that address the faces in the global face list.
int main(int argc, char *argv[])
A collection of cell labels.
const double e
Elementary charge.
readUpdateState
Enumeration defining the state of the mesh after a read update.
label nInternalEdges() const
Number of internal edges.
static instantList timeDirs
const vectorField & cellCentres() const
virtual const faceList & faces() const
Return raw faces.
fileName path() const
Return path.
const vectorField::subField faceCentres() const
Return face centres.
static void addOptions(const bool constant=true, const bool withZero=false)
Add the options handled by timeSelector to argList::validOptions.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const vectorField & faceCentres() const
T optionRead(const word &opt) const
Read a value from the named option.
const labelListList & pointCells() const
bool optionFound(const word &opt) const
Return true if the named option is found.
const Time & time() const
Return the top-level database.
const List< Face > & localFaces() const
Return patch faces addressing into local point list.
A face is a list of labels corresponding to mesh vertices.
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,...
static instantList select0(Time &runTime, const argList &args)
Return the set of times selected based on the argList options.
Foam::argList args(argc, argv)
const word & name() const
Return name.
A cell is defined as a list of faces with extra functionality.
word name(const complex &)
Return a string representation of a complex.