42 const string& ensightType,
43 const word& fieldName,
44 const fileName& dataMask,
45 const fileName& local,
50 caseFile.setf(ios_base::left);
52 fileName dirName(dataMask);
55 dirName = dirName/local;
68 << ensightType.c_str()
69 <<
" per measured node: " << ts <<
" " 71 << (
"c" +
Foam::name(cloudNo) + fieldName).c_str()
73 << (dirName/fieldName).c_str()
79 << ensightType.c_str()
81 <<
setw(15) << fieldName
83 << (dirName/fieldName).c_str()
92 const fileName& dataDir,
93 const fileName& subDir,
94 const word& cloudName,
95 IOstream::streamFormat format
98 Cloud<passiveParticle> parcels(mesh, cloudName,
false);
100 fileName cloudDir = subDir/cloud::prefix/
cloudName;
101 fileName postFileName = cloudDir/
"positions";
104 mkDir(dataDir/cloudDir);
105 ensightFile os(dataDir/postFileName, format);
108 os.writeBinaryHeader();
109 os.write(postFileName);
111 os.write(
"particle coordinates");
113 os.write(parcels.size(), 8);
117 if (format == IOstream::BINARY)
126 const vector& p = elmnt().position();
139 const vector& p = elmnt().position();
141 os.write(++nParcels, 8);
155 const IOobject& fieldObject,
156 const fileName& dataDir,
157 const fileName& subDir,
158 const word& cloudName,
159 IOstream::streamFormat format
162 Info<<
" " << fieldObject.name() <<
flush;
164 fileName cloudDir = subDir/cloud::prefix/
cloudName;
165 fileName postFileName = cloudDir/fieldObject.name();
168 postFileName +
" with " + pTraits<Type>::typeName +
" values";
170 ensightFile os(dataDir/postFileName, format);
174 IOField<Type>
field(fieldObject);
183 if (
mag(val) < 1.0
e-90)
188 for (
direction cmpt=0; cmpt < pTraits<Type>::nComponents; cmpt++)
193 count += pTraits<Type>::nComponents;
212 const ensightParts& partsList,
213 const IOobject& fieldObject,
215 const fileName& dataDir,
216 const fileName& subDir,
217 IOstream::streamFormat format
220 Info<<
" " << fieldObject.name() <<
flush;
222 fileName postFileName = subDir/fieldObject.
name();
224 ensightFile os(dataDir/postFileName, format);
225 os.write(postFileName);
232 GeometricField<Type, fvPatchField, volMesh>
#define forAll(list, i)
Loop across all elements in list.
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 ensightParticlePositions(const polyMesh &mesh, const fileName &dataDir, const fileName &subDir, const word &cloudName, IOstream::streamFormat format)
void ensightVolField(const ensightParts &partsList, const IOobject &fieldObject, const fvMesh &mesh, const fileName &dataDir, const fileName &subDir, IOstream::streamFormat format)
Write generalised field components.
void ensightCaseEntry(OFstream &caseFile, const string &ensightType, const word &fieldName, const fileName &dataMask, const fileName &local=fileName::null, const label cloudNo=-1, const label timeSet=1)
Vector< scalar > vector
A scalar version of the templated Vector.
virtual const fileName & name() const
Return the name of the stream.
Miscellaneous collection of functions and template related to Ensight data.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Istream and Ostream manipulators taking arguments.
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
word name(const complex &)
Return a string representation of a complex.
Ostream & flush(Ostream &os)
Flush stream.
void ensightLagrangianField(const IOobject &fieldObject, const fileName &dataDir, const fileName &subDir, const word &cloudName, IOstream::streamFormat format)
Write lagrangian parcels.
dimensioned< scalar > mag(const dimensioned< Type > &)
const word cloudName(propsDict.lookup("cloudName"))
Omanip< int > setw(const int i)
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
const dimensionedScalar e
Elementary charge.