Go to the documentation of this file.
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"
58 char* mem =
reinterpret_cast<char*
>(&word32);
72 for (
label i = 0; i < nWords; i++)
90 swapWords(fField.
size(),
reinterpret_cast<label*
>(fField.begin()));
94 reinterpret_cast<char*
>(fField.begin()),
95 fField.
size()*
sizeof(
double)
106 if (i > 0 && (i % 10) == 0)
145 swapWords(elems.
size(),
reinterpret_cast<label*
>(elems.begin()));
149 reinterpret_cast<char*
>(elems.begin()),
161 if (i > 0 && (i % 10) == 0)
193 const std::string& title
196 os <<
"# vtk DataFile Version 2.0" <<
std::endl
217 os <<
"CELL_DATA " << nCells <<
std::endl
218 <<
"FIELD attributes " << nFields <<
std::endl;
230 <<
"FIELD attributes " << nFields <<
std::endl;
244 dest.
append(
double(src[cmpt]));
257 dest.
append(
double(src[cmpt]));
279 for (
direction cmpt = 0; cmpt < tensor::nComponents; ++cmpt)
281 dest.
append(
double(src[cmpt]));
Templated 3D tensor derived from VectorSpace adding construction from 9 components,...
static void writeCellDataHeader(std::ostream &, const label nCells, const label nFields)
#define forAll(list, i)
Loop across all elements in list.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
@ nComponents
Number of components in this vector space.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static void writePointDataHeader(std::ostream &, const label nPoints, const label nFields)
static void writeHeader(std::ostream &, const bool isBinary, const std::string &title)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
static void write(std::ostream &, const bool, DynamicList< floatScalar > &)
Write floats ascii or binary.
static void swapWord(int32_t &word32)
Swap halves of word.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
IOstream & fixed(IOstream &io)
static void swapWords(const label nWords, int32_t *words32)
Swap halves of word.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Templated 3D SphericalTensor derived from VectorSpace adding construction from 1 component,...
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void size(const label)
Override size to be inconsistent with allocated storage.
static void insert(const point &, DynamicList< floatScalar > &dest)
Append point to given DynamicList.