48 void Foam::ensightSurfaceWriter::writeTemplate
50 const fileName& outputDir,
51 const fileName& surfaceName,
54 const word& fieldName,
55 const Field<Type>& values,
56 const bool isNodeValues,
60 if (!
isDir(outputDir/fieldName))
62 mkDir(outputDir/fieldName);
66 const scalar timeValue = 0.0;
68 OFstream osCase(outputDir/fieldName/surfaceName +
".case");
71 outputDir/fieldName/surfaceName +
".000.mesh",
76 outputDir/fieldName/surfaceName +
".000." + fieldName,
82 Info<<
"Writing case file to " << osCase.name() <<
endl;
87 <<
"type: ensight gold" << nl
90 <<
"model: 1 " << osGeom.
name().
name() << nl
94 << word(isNodeValues ?
"node:" :
"element:") <<
setw(10) << 1
96 <<
" " << surfaceName.c_str() <<
".***." << fieldName << nl
99 <<
"time set: 1" << nl
100 <<
"number of steps: 1" << nl
101 <<
"filename start number: 0" << nl
102 <<
"filename increment: 1" << nl
103 <<
"time values:" << nl
107 ensightPartFaces ensPart(0, osGeom.name().name(),
points, faces,
true);
112 ensPart.writeField(osField, values, isNodeValues);
131 if (options.
found(
"format"))
155 if (!
isDir(outputDir))
161 const scalar timeValue = 0.0;
163 OFstream osCase(outputDir/surfaceName +
".case");
166 outputDir/surfaceName +
".000.mesh",
172 Info<<
"Writing case file to " << osCase.
name() <<
endl;
177 <<
"type: ensight gold" << nl
180 <<
"model: 1 " << osGeom.
name().
name() << nl
183 <<
"time set: 1" << nl
184 <<
"number of steps: 1" << nl
185 <<
"filename start number: 0" << nl
186 <<
"filename increment: 1" << nl
187 <<
"time values:" << nl
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
static streamFormat formatEnum(const word &)
Return stream format of given format name.
A class for handling file names.
A list of keyword definitions, which are a keyword followed by any number of values (e...
virtual void write(const fileName &outputDir, const fileName &surfaceName, const pointField &points, const faceList &faces, const bool verbose=false) const
Write single surface geometry to file.
Ostream & endl(Ostream &os)
Add newline and flush stream.
ensightSurfaceWriter()
Construct null.
Specialized Ensight output with extra geometry file header.
const fileName & name() const
Return the name of the stream.
virtual ~ensightSurfaceWriter()
Destructor.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
vectorField pointField
pointField is a vectorField.
bool isDir(const fileName &, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
virtual const fileName & name() const
Return the name of the stream.
Convenience macros for instantiating writer methods for surfaceWriter classes.
word name() const
Return file name (part beyond last /)
defineSurfaceWriterWriteFields(nastranSurfaceWriter)
Istream and Ostream manipulators taking arguments.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
A surfaceWriter for Ensight format.
An IOstream is an abstract base class for all input/output systems; be they streams, files, token lists etc.
An implementation of ensightPart to hold volume mesh faces.
Base class for surface writers.
static const char *const typeName
Omanip< int > setw(const int i)
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
makeSurfaceWriterType(dxSurfaceWriter)