Go to the documentation of this file.
26 #include "writeFuns.H"
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++)
89 swapWords(fField.
size(),
reinterpret_cast<label*
>(fField.begin()));
93 reinterpret_cast<char*
>(fField.begin()),
94 fField.
size()*
sizeof(
float)
105 if (i > 0 && (i % 10) == 0)
123 DynamicList<floatScalar>& fField
142 swapWords(elems.size(),
reinterpret_cast<label*
>(elems.begin()));
146 reinterpret_cast<char*
>(elems.begin()),
147 elems.size()*
sizeof(
label)
158 if (i > 0 && (i % 10) == 0)
176 DynamicList<label>& elems
189 const std::string& title
192 os <<
"# vtk DataFile Version 2.0" <<
std::endl
213 os <<
"CELL_DATA " << nCells <<
std::endl
214 <<
"FIELD attributes " << nFields <<
std::endl;
226 <<
"FIELD attributes " << nFields <<
std::endl;
232 dest.append(
float(src));
240 dest.append(
float(src[cmpt]));
248 DynamicList<floatScalar>& dest
253 dest.append(
float(src[cmpt]));
261 DynamicList<floatScalar>& dest
264 dest.append(
float(src.xx()));
265 dest.append(
float(src.yy()));
266 dest.append(
float(src.zz()));
267 dest.append(
float(src.xy()));
268 dest.append(
float(src.yz()));
269 dest.append(
float(src.xz()));
275 for (
direction cmpt = 0; cmpt < tensor::nComponents; ++cmpt)
277 dest.append(
float(src[cmpt]));
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars.
static void writeCellDataHeader(std::ostream &, const label nCells, const label nFields)
List< label > labelList
A List of labels.
#define forAll(list, i)
Loop across all elements in list.
Tensor< scalar > tensor
Tensor of scalars.
@ 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.
SymmTensor< scalar > symmTensor
SymmTensor of scalars.
static void swapWord(int32_t &word32)
Swap halves of word.
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))
Vector< scalar > vector
A scalar version of the templated Vector.
static void insert(const point &, DynamicList< floatScalar > &dest)
Append point to given DynamicList.