33 IOobjectList
objects(cloudObjs.lookupClass(IOField<Type>::typeName));
43 const IOobjectList cloudObjs
46 IOobjectList
objects(cloudObjs.lookupClass(IOField<Type>::typeName));
51 IOField<Type> newField(*obj);
52 return tmp<Field<Type>>(
new Field<Type>(move(newField)));
56 <<
"error: cloud field name " <<
name <<
" not found"
59 return Field<Type>::null();
66 PtrList<List<Type>>& values,
68 const IOobjectList& cloudObjs
71 IOobjectList
objects(cloudObjs.lookupClass(IOField<Type>::typeName));
79 IOField<Type> newField(*obj);
80 values.set(j,
new List<Type>(move(newField)));
95 os << value.component(0);
96 for (
label i=1; i<pTraits<Type>::nComponents; i++)
98 os <<
' ' << value.component(i);
107 const PtrList<List<Type>>& values,
108 const List<List<label>>& addr,
112 label step =
max(floor(8/pTraits<Type>::nComponents), 1);
118 os << nl << fieldNames[fieldi] << ' ' << pTraits<Type>::nComponents
119 <<
' ' << values[fieldi].size() <<
" float" <<
nl;
123 const List<label> ids(addr[trackI]);
125 List<Type> data(UIndirectList<Type>(values[fieldi], ids));
126 label nData = data.size() - 1;
129 writeVTK<Type>(os, data[i]);
130 if (((i + 1) % step == 0) || (i == nData))
148 const List<List<label>>& addr,
149 const List<word>& userFieldNames,
150 const IOobjectList& cloudObjs
153 IOobjectList
objects(cloudObjs.lookupClass(IOField<Type>::typeName));
160 IOobject* obj =
objects.lookup(userFieldNames[i]);
169 readFields<Type>(values,
fieldNames, cloudObjs);
#define forAll(list, i)
Loop across all elements in list.
void append(const T &)
Append an element at the end of the list.
void size(const label)
Override size to be inconsistent with allocated storage.
A class for managing temporary objects.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static List< word > fieldNames
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
tmp< Field< Type > > readParticleField(const word &name, const IOobjectList cloudObjs)
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const HashSet< word > &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the specified type.
errorManip< error > abort(error &err)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
bool fieldOk(const IOobjectList &cloudObjs, const word &name)
void processFields(OFstream &os, const List< List< label >> &addr, const List< word > &userFieldNames, const IOobjectList &cloudObjs)
void writeVTK(OFstream &os, const Type &value)
void writeVTKFields(OFstream &os, const PtrList< List< Type >> &values, const List< List< label >> &addr, const List< word > &fieldNames)