Go to the documentation of this file.
69 os << xmlRoot <<
endl;
89 newPoints[i] =
points[addr[i]];
114 connectivity[edgeI] = 2*(edgeI+1);
117 xmlTag xmlRoot(
"VTKFile");
140 xmlEdgeData << edges;
146 xmlConnectData << connectivity;
149 os << xmlRoot <<
endl;
171 label edgeI = addr[addrI];
173 const edge& curEdge = edges[edgeI];
174 edge& newEdge = newEdges[addrI];
178 label pointId = curEdge[i];
180 if (newPointAddr[pointId] == -1)
183 newPointAddr[pointId] = newPoints.size()-1;
186 newEdge[i] = newPointAddr[pointId];
213 connectivity[faceI] = 3*(faceI+1);
220 regionData[faceI] = facets[faceI].region();
223 xmlTag xmlRoot(
"VTKFile");
246 xmlPolyDataArray << facets;
252 xmlConnectData << connectivity;
260 xmlCellDataArray << regionData;
263 os << xmlRoot <<
endl;
287 label faceI = addr[addrI];
295 label pointId = pointIds[i];
297 if (newPointAddr[pointId] == -1)
300 newPointAddr[pointId] = newPoints.size()-1;
303 newPointIds[i] = newPointAddr[pointId];
325 int main(
int argc,
char *argv[])
350 mkDir(outPrefix +
"/patches");
351 mkDir(outPrefix +
"/pointSubsets");
352 mkDir(outPrefix +
"/edgeSubsets");
353 mkDir(outPrefix +
"/faceSubsets");
356 xmlTag xmlRoot(
"VTKFile");
365 fileName fn = outPrefix /
"facets.vtp";
369 outPrefix /
"facets.vtp",
382 fileName fn = outPrefix /
"featureEdges.vtp";
386 outPrefix /
"featureEdges.vtp",
404 patchAddr[facets[faceI].region()].
append(faceI);
416 fileName fn = outPrefix /
"patches" / patchName +
".vtp";
450 fileName fn = outPrefix /
"pointSubsets" / subsetName +
".vtp";
483 fileName fn = outPrefix /
"edgeSubsets" / subsetName +
".vtp";
517 fileName fn = outPrefix /
"faceSubsets" / subsetName +
".vtp";
536 os << xmlRoot <<
endl;
538 Info <<
"Created " << outPrefix +
".vtm" <<
endl;
static SLList< string > validArgs
A list of valid (mandatory) arguments.
void pointsInSubset(const label, ListType &) const
word pointSubsetName(const label) const
A class for handling words, derived from string.
const stringList & args() const
Return arguments.
A class for handling file names.
#define forAll(list, i)
Loop across all elements in list.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void writeFacetsToVTK(const fileName &fn, const string &, const UList< point > &points, const LongList< labelledTri > &facets)
Write the supplied facet list in serial vtkPolyData format.
xmlTag & addChild(const xmlTag &tag)
Add a child.
const pointField & points() const
access to points
void edgesInSubset(const label, ListType &) const
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Extract command arguments and options from the supplied argc and argv parameters.
Ostream & endl(Ostream &os)
Add newline and flush stream.
label size() const
Size of the active part of the list.
const edgeLongList & featureEdges() const
access to feature edges
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
void append(const T &)
Append an element at the end of the list.
void writePointsToVTK(const fileName &fn, const string &, const UList< point > &points)
Write the supplied pointList in serial vtkPolyData format.
Simple XML tag class allowing child tags and attributes. Specialized output stream operators are prov...
const geometricSurfacePatchList & patches() const
access to patches
void writeEdgesToVTK(const fileName &fn, const string &, const UList< point > &points, const LongList< edge > &edges)
Write the supplied edgeList in serial vtkPolyData format.
void pointSubsetIndices(DynList< label > &) const
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
label region() const
Return region label.
void edgeSubsetIndices(DynList< label > &) const
void facetSubsetIndices(DynList< label > &) const
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Triangle with additional region number.
const LongList< labelledTri > & facets() const
access to facets
word facetSubsetName(const label) const
void facetsInSubset(const label, ListType &) const
static void noParallel()
Remove the parallel options.
word edgeSubsetName(const label) const
label size() const
Return the number of elements in the UList.
Foam::argList args(argc, argv)
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
int main(int argc, char *argv[])
word name(const complex &)
Return a string representation of a complex.
void addAttribute(const keyType &key, const T &value)
Add an attribute.