Go to the documentation of this file.
36 bool fieldOk(
const IOobjectList& cloudObjs,
const word&
name)
40 return (objects.lookup(
name) != NULL);
48 const IOobjectList cloudObjs
53 const IOobject* obj = objects.lookup(
name);
56 IOField<Type> newField(*obj);
57 return tmp<Field<Type> >(
new Field<Type>(newField.xfer()));
61 <<
"error: cloud field name " <<
name <<
" not found"
73 const IOobjectList& cloudObjs
80 const IOobject* obj = objects.lookup(
fieldNames[j]);
84 IOField<Type> newField(*obj);
85 values.set(j,
new List<Type>(newField.xfer()));
98 void writeVTK(OFstream& os,
const Type& value)
100 os << value.component(0);
101 for (
label i=1; i<pTraits<Type>::nComponents; i++)
103 os <<
' ' << value.component(i);
117 label step =
max(floor(8/pTraits<Type>::nComponents), 1);
122 os << nl << fieldNames[fieldI] << ' ' << pTraits<Type>::nComponents
123 <<
' ' << values[fieldI].size() <<
" float" <<
nl;
129 List<Type> data(UIndirectList<Type>(values[fieldI], ids));
130 label nData = data.size() - 1;
133 writeVTK<Type>(os, data[i]);
134 if (((i + 1) % step == 0) || (i == nData))
143 offset += ids.size();
155 const IOobjectList& cloudObjs
165 IOobject* obj = objects.lookup(userFieldNames[i]);
174 readFields<Type>(values,
fieldNames, cloudObjs);
#define forAll(list, i)
Loop across all elements in list.
static const char *const typeName
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< Field< Type > > readParticleField(const word &name, const IOobjectList cloudObjs)
void writeVTK(OFstream &os, const Type &value)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void append(const T &)
Append an element at the end of the list.
void writeVTKFields(OFstream &os, const PtrList< List< Type > > &values, const List< SortableList< scalar > > &agePerTrack, const List< word > &fieldNames)
bool fieldOk(const IOobjectList &cloudObjs, const word &name)
errorManip< error > abort(error &err)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
wordList fieldNames(const IOobjectList &objects, const bool syncPar)
Get sorted names of fields of type. If syncPar and running in parallel.
static const Field< Type > & null()
Return a null field.
void size(const label)
Override size to be inconsistent with allocated storage.
void processFields(OFstream &os, const List< SortableList< scalar > > &agePerTrack, const List< word > &userFieldNames, const IOobjectList &cloudObjs)
void readFields(const typename GeoMesh::Mesh &mesh, const IOobjectList &objects, PtrList< GeometricField< Type, PatchField, GeoMesh > > &fields, const bool readOldTime)
word name(const complex &)
Return a string representation of a complex.