Go to the documentation of this file.
41 const UList<Face>& faces
45 label nConnectivity = 0;
46 for (
const Face&
f : faces)
48 nConnectivity +=
f.size();
62 for (
const Face&
f : faces)
98 <<
"Cannot read file " << filename
113 "vtk::surfaceFormat",
128 for (
auto fieldName : {
"region",
"STLSolidLabeling" })
136 for (
const auto& region : *lptr)
138 zones[i++] =
label(region);
149 for (
const auto& region : *sptr)
151 zones[i++] =
label(region);
171 for (
const face&
f : faces)
173 nTri +=
f.nTriangles();
177 if (nTri > faces.size())
187 const face&
f = faces[facei];
188 for (
label fp1 = 1; fp1 <
f.size() - 1; fp1++)
190 const label fp2 =
f.fcIndex(fp1);
192 dynFaces.
append(Face{
f[0],
f[fp1],
f[fp2]});
193 dynZones.
append(zones[facei]);
200 for (
const label zonei : dynZones)
205 this->sortFacesAndStore(dynFaces, dynZones, sorted);
208 this->addZones(zoneSizes, zoneNames);
215 for (
const face&
f : faces)
217 dynFaces.append(Face(
f));
222 for (
const label zonei : zones)
227 this->sortFacesAndStore(dynFaces, dynZones, sorted);
230 this->addZones(zoneSizes, zoneNames);
232 this->addZonesToFaces();
235 this->storedPoints().transfer(reader.
points());
256 ? surfaceFormatsCore::oneZone(faceLst)
260 const bool useFaceMap = (surf.
useFaceMap() && zones.size() > 1);
264 std::ofstream os(filename, std::ios::binary);
273 label nConnectivity = 0;
274 for (
const Face&
f : faceLst)
276 nConnectivity +=
f.size();
291 const Face&
f = faceLst[
faceMap[faceIndex++]];
303 writePolys(
format(), faceLst);
307 if (zones.size() > 1)
309 writeCellData(
format(), zones);
324 std::ofstream os(filename, std::ios::binary);
331 writePolys(
format(), surf.surfFaces());
Encapsulated combinations of output format options. This is primarily useful when defining the output...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
A class for handling file names.
const faceList & faces() const
2D cells (=faces)
A primitive field of type <T> with automated input and output.
const objectRegistry & cellData() const
Cell based fields.
bool useFaceMap() const
Use faceMap?
static constexpr const zero Zero
Global zero.
Input from file stream, using an ISstream.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Reader for vtk UNSTRUCTURED_GRID legacy files. Supports single CELLS, POINTS etc. entry only.
const pointField & points() const
Points.
Base class for mesh zones.
void beginPolys(std::ostream &os, label nPolys, label nConnectivity)
Emit header for POLYGONS (with trailing newline).
autoPtr< formatter > newFormatter(std::ostream &os) const
Return new formatter based on the selected output options.
const pointField & points() const
Return const access to the points.
static void writeHeader(Ostream &os, const word &fieldName)
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
const labelUList & faceMap() const
Const access to the faceMap, zero-sized when unused.
#define forAll(list, i)
Loop across all elements in list.
Registry of regIOobjects.
virtual const labelList & zoneIds() const
Return const access to the zone ids.
word format(conversionProperties.get< word >("format"))
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
word name(const complex &c)
Return string representation of complex.
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
void writeList(vtk::formatter &fmt, const UList< uint8_t > &values)
Write a list of uint8_t values.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
errorManipArg< error, int > exit(error &err, const int errNo=1)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const Type * findObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
A surface zone on a MeshedSurface.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
A face is a list of labels corresponding to mesh vertices.
const UList< Face > & surfFaces() const
Return const access to the faces.
bool good() const
Return true if next operation might succeed.
const UList< surfZone > & surfZones() const
Const access to the surface zones.