43 os <<
"# The irregular positions" <<
nl
44 <<
"object 1 class array type float rank 1 shape 3 items "
45 << points.size() <<
" data follows" <<
nl;
49 const point& pt = points[pointI];
51 os << float(pt.x()) <<
' ' <<
float(pt.y()) <<
' ' <<
float(pt.z())
58 os <<
"# The irregular connections (triangles)" << nl
59 <<
"object 2 class array type int rank 1 shape 3 items "
60 << faces.size() <<
" data follows" <<
nl;
64 const face&
f = faces[faceI];
70 "writeGeometry(Ostream&, const pointField&, const faceList&)"
71 ) <<
"Face " << faceI <<
" vertices " << f
72 <<
" is not a triangle."
76 os << f[0] <<
' ' << f[1] <<
' ' << f[2] <<
nl;
78 os <<
"attribute \"element type\" string \"triangles\"" << nl
79 <<
"attribute \"ref\" string \"positions\"" << nl <<
nl;
90 const Field<scalar>& values
94 os <<
"object 3 class array type float rank 0 items "
95 << values.size() <<
" data follows" <<
nl;
99 os << float(values[elemI]) <<
nl;
109 const Field<vector>& values
113 os <<
"object 3 class array type float rank 1 shape 3 items "
114 << values.size() <<
" data follows" <<
nl;
118 os << float(values[elemI].x()) <<
' '
119 << float(values[elemI].
y()) <<
' '
120 << float(values[elemI].z()) <<
nl;
130 const Field<sphericalTensor>& values
134 os <<
"object 3 class array type float rank 0 items "
135 << values.size() <<
" data follows" <<
nl;
139 os << float(values[elemI][0]) <<
nl;
149 const Field<symmTensor>& values
153 os <<
"object 3 class array type float rank 2 shape 3 items "
154 << values.size() <<
" data follows" <<
nl;
160 os << float(t.xx()) <<
' ' <<
float(t.xy()) <<
' ' <<
float(t.xz())
161 <<
float(t.xy()) <<
' ' <<
float(t.yy()) <<
' ' <<
float(t.yz())
162 <<
float(t.xz()) <<
' ' <<
float(t.yz()) <<
' ' <<
float(t.zz())
173 const Field<tensor>& values
177 os <<
"object 3 class array type float rank 2 shape 3 items "
178 << values.size() <<
" data follows" <<
nl;
182 const tensor& t = values[elemI];
184 os << float(t.xx()) <<
' ' <<
float(t.xy()) <<
' ' <<
float(t.xz())
185 <<
float(t.yx()) <<
' ' <<
float(t.yy()) <<
' ' <<
float(t.yz())
186 <<
float(t.zx()) <<
' ' <<
float(t.zy()) <<
' ' <<
float(t.zz())
197 const Field<Type>& values
201 os <<
"object 3 class array type float rank 0 items "
202 << values.size() <<
" data follows" <<
nl;
206 os << float(0.0) <<
nl;
215 os <<
"# the field, with three components: \"positions\","
216 <<
" \"connections\", and \"data\"" << nl
217 <<
"object \"irregular positions irregular "
218 <<
"connections\" class field"
220 <<
"component \"positions\" value 1" << nl
221 <<
"component \"connections\" value 2" << nl
222 <<
"component \"data\" value 3" <<
nl;
256 if (!
isDir(outputDir))
263 outputDir/fieldName +
'_' + surfaceName +
".dx"
268 Info<<
"Writing field " << fieldName <<
" to " << os.
name() <<
endl;
271 writeGeometry(os, points, faces);
273 writeData(os, values);
277 os << nl <<
"attribute \"dep\" string \"positions\""
282 os << nl <<
"attribute \"dep\" string \"connections\""