36 const word& fieldName,
37 const IOobjectList& cloudObjects
40 const IOobject*
io = cloudObjects.cfindObject<IOField<Type>>(fieldName);
43 return tmp<IOField<Type>>::New(*
io);
47 <<
"Cloud field name " << fieldName
48 <<
" not found or the incorrect type"
59 for (label d=1; d < pTraits<Type>::nComponents; ++d)
70 const IOField<Type>&
field,
71 const List<labelList>& addr
74 const label step =
max(1, floor(8/pTraits<Type>::nComponents));
78 << int(pTraits<Type>::nComponents) <<
' '
79 <<
field.size() <<
" float" <<
nl;
82 for (
const labelList& ids : addr)
84 List<Type> data(UIndirectList<Type>(
field, ids));
85 label nData = data.size() - 1;
88 writeVTK<Type>(
os, data[i]);
89 if (((i + 1) % step == 0) || (i == nData))
107 const List<labelList>& addr,
108 const IOobjectList& cloudObjects
111 for (
const word& fldName : cloudObjects.sortedNames<IOField<Type>>())
113 const IOobject*
io = cloudObjects.cfindObject<IOField<Type>>(fldName);
118 <<
"Could not read field:" << fldName
119 <<
" type:" << IOField<Type>::typeName
120 <<
abort(FatalError);
124 Info<<
" reading field " << fldName <<
endl;
127 writeVTKField<Type>(
os,
field, addr);
A class for managing temporary objects.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
void writeVTK(OFstream &os, const Type &value)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
void processFields(OFstream &os, const List< labelList > &addr, const IOobjectList &cloudObjects)
errorManip< error > abort(error &err)
tmp< IOField< Type > > readParticleField(const word &fieldName, const IOobjectList &cloudObjects)
void writeVTKField(OFstream &os, const IOField< Type > &field, const List< labelList > &addr)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.