Go to the documentation of this file.
44 const word& fieldName,
46 const bool isNodeValues,
50 if (!
isDir(outputDir/fieldName))
52 mkDir(outputDir/fieldName);
56 const scalar timeValue = 0.0;
58 OFstream osCase(outputDir/fieldName/surfaceName +
".case");
61 outputDir/fieldName/surfaceName +
".0000.mesh",
66 outputDir/fieldName/surfaceName +
".0000." + fieldName,
77 <<
"type: ensight gold" <<
nl
84 <<
word(isNodeValues ?
"node:" :
"element:") <<
setw(10) << 1
86 <<
" " << surfaceName.c_str() <<
".****." << fieldName <<
nl
89 <<
"time set: 1" <<
nl
90 <<
"number of steps: 1" <<
nl
91 <<
"filename start number: 0" <<
nl
92 <<
"filename increment: 1" <<
nl
93 <<
"time values:" <<
nl
102 ensPart.writeField(osField, values, isNodeValues);
104 return osCase.
name();
115 const word& fieldName,
117 const bool isNodeValues,
130 const fileName meshFile(baseDir/surfaceName +
".0000.mesh");
139 bool stateChanged =
false;
141 if (
isFile(baseDir/
"fieldsDict"))
146 dict.lookup(
"times") >> times;
166 dict.set(
"times", times);
167 if (
dict.found(
"fields"))
170 if (!fieldsDict.
found(fieldName))
174 fieldsDict.
set(fieldName, fieldDict);
185 fieldsDict.
set(fieldName, fieldDict);
187 dict.set(
"fields", fieldsDict);
198 Info<<
"Writing state file to fieldsDict" <<
endl;
204 OFstream osCase(baseDir/surfaceName +
".case");
208 Info<<
"Writing case file to " << osCase.
name() <<
endl;
213 <<
"type: ensight gold" <<
nl
216 <<
"model: 1 " << meshFile.
name() <<
nl
222 const word& fieldName = iter().keyword();
226 << fieldType <<
" per "
227 <<
word(isNodeValues ?
"node:" :
"element:")
229 <<
setw(15) << fieldName
230 <<
" " << surfaceName.c_str() <<
".****." << fieldName
237 <<
"time set: 1" <<
nl
239 <<
"filename start number: 0" <<
nl
240 <<
"filename increment: 1" <<
nl
241 <<
"time values:" <<
nl;
244 osCase <<
setw(12) << times[timeI] <<
" ";
246 if (timeI != 0 && (timeI % 6) == 0)
262 Info<<
"Writing mesh file to " << meshFile.
name() <<
endl;
275 timeString = os.
str();
281 baseDir/surfaceName +
"." + timeString +
"." + fieldName,
286 Info<<
"Writing field file to " << osField.
name() <<
endl;
289 ensPart.
writeField(osField, values, isNodeValues);
291 return baseDir/surfaceName +
".case";
302 const word& fieldName,
304 const bool isNodeValues,
324 return writeUncollated
fileName writeCollated(const fileName &outputDir, const fileName &surfaceName, const pointField &points, const faceList &faces, const word &fieldName, const Field< Type > &values, const bool isNodeValues, const bool verbose) const
Templated write operation - one file per timestep.
fileName writeTemplate(const fileName &outputDir, const fileName &surfaceName, const pointField &points, const faceList &faces, const word &fieldName, const Field< Type > &values, const bool isNodeValues, const bool verbose) const
Templated write operation.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
A class for handling words, derived from string.
A class for handling file names.
bool exists(const fileName &, const bool checkGzip=true)
Does the name exist (as DIRECTORY or FILE) in the file system?
#define forAll(list, i)
Loop across all elements in list.
fileName writeUncollated(const fileName &outputDir, const fileName &surfaceName, const pointField &points, const faceList &faces, const word &fieldName, const Field< Type > &values, const bool isNodeValues, const bool verbose) const
Templated write operation - all time steps in single file.
fileName path() const
Return directory path name (part before last /)
virtual ostream & stdStream()
Access to underlying std::ostream.
Ostream & endl(Ostream &os)
Add newline and flush stream.
string str() const
Return the string.
word name() const
Return file name (part beyond last /)
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Conversion of OpenFOAM pTraits into the Ensight equivalent.
Specialized Ensight output with extra geometry file header.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Pre-declare SubField and related Field type.
Istream and Ostream manipulators taking arguments.
label findLower(const ListType &, typename ListType::const_reference, const label start, const BinaryOp &bop)
Find last element < given value in sorted list and return index,.
virtual Ostream & writeKeyword(const string &key)
Write element keyword with trailing newline, optionally with undef.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Ensight output with specialized write() for strings, integers and floats. Correctly handles binary wr...
Input from memory buffer stream.
bool isFile(const fileName &, const bool checkGzip=true)
Does the name exist as a FILE in the file system?
bool isDir(const fileName &)
Does the name exist as a DIRECTORY in the file system?
Omanip< int > setw(const int i)
void setSize(const label)
Reset size of List.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Output to memory buffer stream.
An implementation of ensightPart to hold volume mesh faces.
const fileName & name() const
Return the name of the stream.
bool good() const
Return true if next operation might succeed.
void writeField(ensightFile &, const Field< Type > &, const bool perNode=false) const
Write generalized field components.
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
stressControl lookup("compactNormalStress") >> compactNormalStress
void set(entry *)
Assign a new entry, overwrite any existing entry.