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];
115 const edge& e = mesh.
edges()[cEdges[cEdgeI]];
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;
165 /
"meshPoints_" + timeName +
'_' +
name(celli) +
".obj" 168 Info<<
"Writing mesh points and edges to " << fName <<
endl;
172 const cell& cFaces = mesh.
cells()[celli];
185 /
"meshFaceCentres_" + timeName +
".obj" 188 Info<<
"Writing mesh face centres to " << faceFile <<
endl;
203 mesh.
time().
path()/
"meshCellCentres_" + timeName +
".obj" 206 Info<<
"Writing mesh cell centres to " << cellFile <<
endl;
217 void writePatchCentres
231 mesh.
time().
path()/
"patch_" + pp.
name() +
'_' + timeName +
".obj" 234 Info<<
"Writing patch face centres to " << faceFile <<
endl;
261 /
"patchFaces_" + pp.
name() +
'_' + timeName +
".obj" 264 Info<<
"Writing patch faces to " << faceFile <<
endl;
277 patchFaceStream<<
'f';
281 patchFaceStream <<
' ' << f[fp]+1;
283 patchFaceStream <<
nl;
289 void writePatchBoundaryEdges
304 /
"patchEdges_" + pp.
name() +
'_' + timeName +
".obj" 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;
365 const edge& e = mesh.
edges()[iter.key()];
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.userTimeName() <<
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());
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
const labelListList & cellEdges() const
#define forAll(list, i)
Loop across all elements in list.
const word & name() const
Return name.
A class for handling file names.
A face is a list of labels corresponding to mesh vertices.
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool optionFound(const word &opt) const
Return true if the named option is found.
label nInternalEdges() const
Number of internal edges.
const cellList & cells() const
const Field< PointType > & localPoints() const
Return pointField of points in patch.
virtual const pointField & points() const
Return raw points.
iterator find(const label &)
Find and return an iterator set at the hashedEntry.
T optionRead(const word &opt) const
Read a value from the named option.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
A class for handling words, derived from string.
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
const labelListList & edgeFaces() const
Return edge-face addressing.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
virtual const faceList & faces() const
Return raw faces.
const vectorField & cellCentres() const
const labelListList & pointCells() const
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 Time & time() const
Return time.
static instantList select0(Time &runTime, const argList &args)
Return the set of times selected based on the argList options.
word name(const complex &)
Return a string representation of a complex.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
const vectorField & faceCentres() const
label end() const
Return end vertex label.
A cell is defined as a list of faces with extra functionality.
A collection of cell labels.
const List< FaceType > & localFaces() const
Return patch faces addressing into local point list.
Inserts points at locations specified in a pointFile into the surfaces to be conformed to of the conf...
Mesh consisting of general polyhedral cells.
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
static void addNote(const string &)
Add extra notes for the usage information.
readUpdateState
Enumeration defining the state of the mesh after a read update.
readUpdateState readUpdate()
Update the mesh based on the mesh files saved in.
A patch is a list of labels that address the faces in the global face list.
Foam::argList args(argc, argv)
fileName path() const
Return path.
static void addOptions(const bool constant=true, const bool withZero=false)
Add the options handled by timeSelector to argList::validOptions.
label start() const
Return start vertex label.
const vectorField::subField faceCentres() const
Return face centres.