Go to the documentation of this file.
29 #include "triSurface.H"
42 const bool writeSorted,
50 os <<
"# Patches:" <<
endl;
53 os <<
"# " << patchI <<
" "
54 << myPatches[patchI].name() <<
endl;
60 os <<
"# The irregular positions" <<
endl
61 <<
"object 1 class array type float rank 1 shape 3 items "
63 forAll(localPoints(), pointI)
65 const point& pt = localPoints()[pointI];
66 os << pt.
x() <<
' ' << pt.
y() <<
' ' << pt.
z() <<
endl;
70 os <<
"# The irregular connections (triangles)" <<
endl
71 <<
"object 2 class array type int rank 1 shape 3 items "
72 << size() <<
" data follows" <<
endl;
85 patchFaceI < myPatches[patchI].
size();
93 os <<
f[0] <<
' ' <<
f[1] <<
' ' <<
f[2] <<
endl;
103 os <<
f[0] <<
' ' <<
f[1] <<
' ' <<
f[2] <<
endl;
106 os <<
"attribute \"element type\" string \"triangles\"" <<
endl
107 <<
"attribute \"ref\" string \"positions\"" <<
endl <<
endl;
114 os <<
"# the field, with three components: \"positions\", \"connections\""
115 <<
", and \"data\"" <<
endl
116 <<
"object \"irregular positions irregular connections\" class field"
118 <<
"component \"positions\" value 1" <<
endl
119 <<
"component \"connections\" value 2" <<
endl
120 <<
"component \"data\" value 3" <<
endl;
129 os <<
"object 3 class array type float rank 0 items " <<
size()
130 <<
" data follows" <<
endl;
140 forAll(myPatches[patchI], patchFaceI)
142 os << patchI <<
endl;
156 os <<
endl <<
"attribute \"dep\" string \"connections\"" <<
endl <<
endl;
169 if (field.size() ==
size())
172 os <<
"object 3 class array type float rank 0 items " << field.size()
173 <<
" data follows" <<
endl;
176 os << field[faceI] <<
endl;
179 <<
"attribute \"dep\" string \"connections\"" <<
endl <<
endl;
181 else if (field.size() ==
nPoints())
184 os <<
"object 3 class array type float rank 0 items " << field.size()
185 <<
" data follows" <<
endl;
188 os << field[pointI] <<
endl;
191 <<
"attribute \"dep\" string \"positions\"" <<
endl <<
endl;
197 "writeDX(const scalarField&, Ostream&)"
198 ) <<
"Illegal field size " << field.size() <<
" is not equal "
199 <<
" to number of faces " <<
size() <<
" or to number "
214 if (field.size() ==
size())
217 os <<
"object 3 class array type float rank 1 shape 3 items "
218 << field.size() <<
" data follows" <<
endl;
221 os << field[faceI].x() <<
' '
222 << field[faceI].y() <<
' '
223 << field[faceI].z() <<
endl;
226 <<
"attribute \"dep\" string \"connections\"" <<
endl <<
endl;
228 else if (field.size() ==
nPoints())
231 os <<
"object 3 class array type float rank 1 shape 3 items "
232 << field.size() <<
" data follows" <<
endl;
235 os << field[pointI].x() <<
' '
236 << field[pointI].y() <<
' '
237 << field[pointI].z() <<
endl;
240 <<
"attribute \"dep\" string \"positions\"" <<
endl <<
endl;
246 "writeDX(const vectorField&, Ostream&)"
247 ) <<
"Illegal field size " << field.size() <<
" is not equal "
248 <<
" to number of faces " <<
size() <<
" or to number "
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
#define forAll(list, i)
Loop across all elements in list.
void writeDX(const bool, Ostream &) const
For DX writing.
Ostream & endl(Ostream &os)
Add newline and flush stream.
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 writeDXGeometry(const bool, Ostream &) const
label nPoints() const
Return number of points supporting patch faces.
void writeDXTrailer(Ostream &) const
errorManipArg< error, int > exit(error &err, const int errNo=1)
label size() const
Return the number of elements in the UList.
surfacePatchList calcPatches(labelList &faceMap) const
Sort faces according to region. Returns patch list.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Triangle with additional region number.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
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,...