Go to the documentation of this file.
63 os <<
"v " << pt.
x() <<
' ' << pt.
y() <<
' ' << pt.
z() <<
nl;
88 pointStream <<
"l " <<
e.start() + 1 <<
' ' <<
e.end() + 1 <<
nl;
103 Info<<
"Writing mesh points and edges to " << fName <<
endl;
115 label celli = cellLabels[i];
125 const auto e0Fnd = pointToObj.cfind(
e[0]);
135 pointToObj.insert(
e[0], v0);
140 const auto e1Fnd = pointToObj.cfind(
e[1]);
150 pointToObj.insert(
e[1], v1);
154 str <<
"l " << v0+1 <<
' ' << v1+1 <<
nl;
174 Info<<
"Writing mesh points and edges to " << fName <<
endl;
191 /
"meshFaceCentres_" +
timeName +
".obj"
194 Info<<
"Writing mesh face centres to " << faceFile <<
endl;
212 Info<<
"Writing mesh cell centres to " << cellFile <<
endl;
223 void writePatchCentres
240 Info<<
"Writing patch face centres to " << faceFile <<
endl;
270 Info<<
"Writing patch faces to " << faceFile <<
endl;
283 patchFaceStream<<
'f';
287 patchFaceStream <<
' ' <<
f[fp]+1;
289 patchFaceStream <<
nl;
295 void writePatchBoundaryEdges
313 Info<<
"Writing patch edges to " << edgeFile <<
endl;
328 patchEdgeStream<<
"l " <<
e[0]+1 <<
' ' <<
e[1]+1 <<
nl;
350 allEdges.insert(cEdges);
357 /
"pointEdges_" +
timeName +
'_' +
name(pointi) +
".obj"
360 Info<<
"Writing pointEdges to " << pFile <<
endl;
366 for (
const label edgei : allEdges)
372 pointStream<<
"l " << vertI-1 <<
' ' << vertI <<
nl;
378 int main(
int argc,
char *argv[])
382 "For mesh debugging: write mesh as separate OBJ files"
389 "Write patch faces edges"
394 "Write patch boundary edges"
400 "Write points for the specified cell"
406 "Write specified face"
412 "Write specified point"
418 "Write points for specified cellSet"
424 "Write points for specified faceSet"
433 const bool patchFaces =
args.
found(
"patchFaces");
434 const bool patchEdges =
args.
found(
"patchEdges");
436 const bool doPoint =
args.
found(
"point");
438 const bool doCellSet =
args.
found(
"cellSet");
439 const bool doFaceSet =
args.
found(
"faceSet");
442 Info<<
"Writing mesh objects as .obj files such that the object"
443 <<
" numbering" <<
endl
444 <<
"(for points, faces, cells) is consistent with"
445 <<
" Foam numbering (starting from 0)." <<
endl <<
endl;
471 const label celli =
args.
get<label>(
"cell");
477 const label pointi =
args.
get<label>(
"point");
483 const label facei =
args.
get<label>(
"face");
495 Info<<
"Writing mesh points and edges to " << fName <<
endl;
505 const word setName =
args[
"cellSet"];
509 Info<<
"Read " <<
cells.size() <<
" cells from set " << setName
516 const word setName =
args[
"faceSet"];
520 Info<<
"Read " << faces.size() <<
" faces from set " << setName
533 Info<<
"Writing mesh points and edges to " << fName <<
endl;
virtual const pointField & points() const
Return raw points.
const Cmpt & x() const
Access to the vector x component.
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 Foam::string.
A class for handling file names.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
label nEdges() const
Number of edges in patch.
static word timeName(const scalar t, const int precision=precision_)
const cellList & cells() const
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
static void addNote(const string ¬e)
Add extra notes for the 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.
T get(const label index) const
Get a value from the argument at index.
const Cmpt & z() const
Access to the vector z component.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
virtual readUpdateState readUpdate()
Update the mesh based on the mesh files saved in time.
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
const labelListList & cellEdges() const
messageStream Info
Information stream (stdout output on master, null elsewhere)
A patch is a list of labels that address the faces in the global face list.
OBJstream os(runTime.globalPath()/outputName)
const List< face_type > & localFaces() const
Return patch faces addressing into local point list.
A collection of cell labels.
const Field< point_type > & localPoints() const
Return pointField of points in patch.
Output to file stream, using an OSstream.
readUpdateState
Enumeration defining the state of the mesh after a read update.
label nInternalEdges() const
Number of internal edges.
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
const Cmpt & y() const
Access to the vector y component.
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.
List< face > faceList
A List of faces.
static void addOptions(const bool constant=true, const bool withZero=false)
Add timeSelector options to argList::validOptions.
virtual void setTime(const Time &t)
Reset the time and time-index to those of the given time.
const vectorField & faceCentres() const
const dimensionedScalar e
Elementary charge.
const labelListList & pointCells() const
const polyBoundaryMesh & patches
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
const Time & time() const
Return the top-level database.
A face is a list of labels corresponding to mesh vertices.
const word & name() const noexcept
The patch name.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static instantList select0(Time &runTime, const argList &args)
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
Foam::argList args(argc, argv)
A cell is defined as a list of faces with extra functionality.
bool found(const word &optName) const
Return true if the named option is found.