29 #include <standards.h>
30 #include <sys/endian.h>
34 #ifdef __DARWIN_BYTE_ORDER
35 #if __DARWIN_BYTE_ORDER==__DARWIN_BIG_ENDIAN
42 #if defined(LITTLE_ENDIAN) \
43 || defined(_LITTLE_ENDIAN) \
44 || defined(__LITTLE_ENDIAN)
45 #define LITTLEENDIAN 1
46 #elif defined(BIG_ENDIAN) || defined(_BIG_ENDIAN) || defined(__BIG_ENDIAN)
49 #error "Cannot find LITTLE_ENDIAN or BIG_ENDIAN symbol defined."
50 #error "Please add to compilation options"
57 char* mem =
reinterpret_cast<char*
>(&word32);
71 for (
label i = 0; i < nWords; i++)
82 List<floatScalar>& fField
88 swapWords(fField.size(),
reinterpret_cast<label*
>(fField.begin()));
92 reinterpret_cast<char*
>(fField.begin()),
104 if (i > 0 && (i % 10) == 0)
122 DynamicList<floatScalar>& fField
125 List<floatScalar>&
fld = fField.shrink();
145 reinterpret_cast<char*
>(elems.begin()),
146 elems.size()*
sizeof(
label)
157 if (i > 0 && (i % 10) == 0)
175 DynamicList<label>& elems
188 const std::string& title
191 os <<
"# vtk DataFile Version 2.0" <<
std::endl
212 os <<
"CELL_DATA " << nCells <<
std::endl
213 <<
"FIELD attributes " << nFields <<
std::endl;
225 <<
"FIELD attributes " << nFields <<
std::endl;
231 dest.append(
cast(src));
238 DynamicList<floatScalar>& dest
243 dest.append(
cast(src[cmpt]));
251 DynamicList<floatScalar>& dest
256 dest.append(
cast(src[cmpt]));
264 DynamicList<floatScalar>& dest
267 dest.append(
cast(src.xx()));
268 dest.append(
cast(src.yy()));
269 dest.append(
cast(src.zz()));
270 dest.append(
cast(src.xy()));
271 dest.append(
cast(src.yz()));
272 dest.append(
cast(src.xz()));
279 DynamicList<floatScalar>& dest
284 dest.append(
cast(src[cmpt]));
298 const List<scalar>& source,
299 DynamicList<floatScalar>& dest
304 dest.append(
cast(source[map[i]]));
311 const List<point>& source,
312 DynamicList<floatScalar>& dest
325 const List<point>& source,
326 DynamicList<floatScalar>& dest
331 insert(source[map[i]], dest);
#define forAll(list, i)
Loop across all elements in list.
static const direction nComponents
Number of components in this vector space.
gmvFile<< "tracers "<< particles.size()<< nl;{ pointField positions(particles.size());label particlei=0;forAllConstIter(Cloud< passiveParticle >, particles, iter) { positions[particlei++]=iter().position(mesh);} for(i=0;i< pTraits< point >::nComponents;i++) { forAll(positions, particlei) { gmvFile<< component(positions[particlei], i)<< ' ';} gmvFile<< nl;}}forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
void writePointDataHeader(std::ostream &, const label nPoints, const label nFields)
Write point data header.
void writeCellDataHeader(std::ostream &, const label nCells, const label nFields)
Write cell data header.
void swapWord(label &word32)
Swap halves of word.
void swapWords(const label nWords, label *words32)
Swap halves of word.
void insert(const scalar, DynamicList< floatScalar > &)
Append scalar to given DynamicList.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
void writeHeader(std::ostream &, const bool isBinary, const std::string &title)
Write header.
label cast(const label &x)
Cast an integer to the corresponding VTK write type. Does nothing.
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars.
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Tensor< scalar > tensor
Tensor of scalars.
Ostream & endl(Ostream &os)
Add newline and flush stream.
SymmTensor< scalar > symmTensor
SymmTensor of scalars.
Vector< scalar > vector
A scalar version of the templated Vector.
float floatScalar
Float precision floating point scalar type.