40 void triSurface::writeDXGeometry
42 const bool writeSorted,
50 os <<
"# Patches:" <<
endl;
53 os <<
"# " <<
patchi <<
" " 60 os <<
"# The irregular positions" << endl
61 <<
"object 1 class array type float rank 1 shape 3 items " 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;
89 const label facei = faceMap[faceIndex++];
92 os << f[0] <<
' ' << f[1] <<
' ' << f[2] <<
endl;
102 os << f[0] <<
' ' << f[1] <<
' ' << f[2] <<
endl;
105 os <<
"attribute \"element type\" string \"triangles\"" << endl
106 <<
"attribute \"ref\" string \"positions\"" << endl <<
endl;
111 void triSurface::writeDXTrailer(Ostream& os)
const 113 os <<
"# the field, with three components: \"positions\", \"connections\"" 114 <<
", and \"data\"" << endl
115 <<
"object \"irregular positions irregular connections\" class field" 117 <<
"component \"positions\" value 1" << endl
118 <<
"component \"connections\" value 2" << endl
119 <<
"component \"data\" value 3" <<
endl;
124 void triSurface::writeDX(
const bool writeSorted, Ostream& os)
const 126 writeDXGeometry(writeSorted, os);
128 os <<
"object 3 class array type float rank 0 items " <<
size()
129 <<
" data follows" <<
endl;
141 os << patchi <<
endl;
155 os << endl <<
"attribute \"dep\" string \"connections\"" << endl <<
endl;
166 writeDXGeometry(
false, os);
171 os <<
"object 3 class array type float rank 0 items " << field.
size()
172 <<
" data follows" <<
endl;
175 os << field[facei] <<
endl;
178 <<
"attribute \"dep\" string \"connections\"" << endl <<
endl;
183 os <<
"object 3 class array type float rank 0 items " << field.
size()
184 <<
" data follows" <<
endl;
187 os << field[pointi] <<
endl;
190 <<
"attribute \"dep\" string \"positions\"" << endl <<
endl;
195 <<
"Illegal field size " << field.
size() <<
" is not equal " 196 <<
" to number of faces " <<
size() <<
" or to number " 209 writeDXGeometry(
false, os);
214 os <<
"object 3 class array type float rank 1 shape 3 items " 215 << field.
size() <<
" data follows" <<
endl;
218 os << field[facei].x() <<
' ' 219 << field[facei].y() <<
' ' 220 << field[facei].z() <<
endl;
223 <<
"attribute \"dep\" string \"connections\"" << endl <<
endl;
228 os <<
"object 3 class array type float rank 1 shape 3 items " 229 << field.
size() <<
" data follows" <<
endl;
232 os << field[pointi].x() <<
' ' 233 << field[pointi].y() <<
' ' 234 << field[pointi].z() <<
endl;
237 <<
"attribute \"dep\" string \"positions\"" << endl <<
endl;
242 <<
"Illegal field size " << field.
size() <<
" is not equal " 243 <<
" to number of faces " <<
size() <<
" or to number " label nPoints() const
Return number of points supporting patch faces.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const List< labelledTri > & localFaces() const
Return patch faces addressing into local point list.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
List< surfacePatch > surfacePatchList
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
const geometricSurfacePatchList & patches() const
List< label > labelList
A List of labels.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
label size() const
Return the number of elements in the UList.
vector point
Point is a vector.
const Field< point > & localPoints() const
Return pointField of points in patch.