29 #if defined(__mips) && !defined(__SICORTEX__)
30 #include <standards.h>
31 #include <sys/endian.h>
35 #ifdef __DARWIN_BYTE_ORDER
36 #if __DARWIN_BYTE_ORDER==__DARWIN_BIG_ENDIAN
43 #if defined(LITTLE_ENDIAN) \
44 || defined(_LITTLE_ENDIAN) \
45 || defined(__LITTLE_ENDIAN)
46 # define LITTLEENDIAN 1
47 #elif defined(BIG_ENDIAN) || defined(_BIG_ENDIAN) || defined(__BIG_ENDIAN)
50 # error "Cannot find LITTLE_ENDIAN or BIG_ENDIAN symbol defined."
51 # error "Please add to compilation options"
56 void Foam::writeFuns::swapWord(label& word32)
58 char* mem =
reinterpret_cast<char*
>(&word32);
70 void Foam::writeFuns::swapWords(
const label nWords, label* words32)
72 for (label i = 0; i < nWords; i++)
83 List<floatScalar>& fField
89 swapWords(fField.size(),
reinterpret_cast<label*
>(fField.begin()));
93 reinterpret_cast<char*>(fField.begin()),
94 fField.size()*
sizeof(float)
103 os << fField[i] <<
' ';
105 if (i > 0 && (i % 10) == 0)
119 DynamicList<floatScalar>& fField
122 List<floatScalar>& fld = fField.shrink();
124 write(os, binary, fld);
138 swapWords(elems.size(),
reinterpret_cast<label*
>(elems.begin()));
142 reinterpret_cast<char*>(elems.begin()),
143 elems.size()*
sizeof(label)
152 os << elems[i] <<
' ';
154 if (i > 0 && (i % 10) == 0)
168 DynamicList<label>& elems
173 write(os, binary, fld);
184 os <<
"# vtk DataFile Version 2.0" <<
std::endl
205 os <<
"CELL_DATA " << nCells << std::endl
206 <<
"FIELD attributes " << nFields <<
std::endl;
217 os <<
"POINT_DATA " << nPoints << std::endl
218 <<
"FIELD attributes " << nFields <<
std::endl;
224 dest.append(
float(pt));
232 dest.append(
float(pt[cmpt]));
240 DynamicList<floatScalar>& dest
245 dest.append(
float(pt[cmpt]));
253 DynamicList<floatScalar>& dest
256 dest.append(
float(src.xx()));
257 dest.append(
float(src.yy()));
258 dest.append(
float(src.zz()));
259 dest.append(
float(src.xy()));
260 dest.append(
float(src.yz()));
261 dest.append(
float(src.xz()));
269 dest.append(
float(pt[cmpt]));
278 dest.append(source[i]);