41 namespace coordSetWriters
62 precision_(
IOstream::defaultPrecision())
78 options.getOrDefault(
"precision",
IOstream::defaultPrecision())
94 open(coords, outputPath);
107 open(tracks, outputPath);
123 const bool old(buffering_);
134 return getExpectedPath(
"gplt");
157 OFstream
os(outputFile, streamOpt_);
158 os.precision(precision_);
160 os <<
"set term pngcairo" <<
nl 161 <<
"set output \"" << outputFile.
stem() <<
".png\"" <<
nl;
167 #define doLocalCode(Type) \ 168 for (const word& fldName : Type##Names_) \ 170 os << (nplots++ ? ", \\" : "plot \\") << nl; \ 171 os << " '-' title \"" << fldName << "\" with lines"; \ 189 #define doLocalCode(Type) \ 190 for (const Field<Type>& fld : Type##Fields_) \ 192 writeTable(os, coords_[0], fld, " \t"); \ 193 os << "end_data" << nl << nl; \ 205 os <<
"# end plot" <<
nl;
214 Foam::fileName Foam::coordSetWriters::gnuplotWriter::writeTemplate
216 const word& fieldName,
226 if (useTracks_ || !buffering_)
229 return writeTemplate(fieldName, fieldPtrs);
234 appendField(fieldName,
values);
241 Foam::fileName Foam::coordSetWriters::gnuplotWriter::writeTemplate
243 const word& fieldName,
254 return writeTemplate(fieldName, fieldPtrs);
addToRunTimeSelectionTable(coordSetWriter, abaqusWriter, word)
virtual ~gnuplotWriter()
Destructor. Calls close()
A class for handling file names.
virtual fileName path() const
Characteristic output file name - information only.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
constexpr char nl
The newline '\n' character (0x0a)
static const fileName null
An empty fileName.
gnuplotWriter()
Default construct.
defineCoordSetWriterWriteFields(Foam::coordSetWriters::gnuplotWriter)
virtual bool buffering() const
True if the format uses internal buffering (eg, column output)
defineTypeName(abaqusWriter)
A simple container for options an IOstream can normally have.
static std::string path(const std::string &str)
Return directory path name (part before last /)
static std::string stem(const std::string &str)
Return the basename, without extension.
Macros for easy insertion into run-time selection tables.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
Convenience macros for instantiating coordSetWriter methods.
Holds list of sampling positions.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
Generic templated field type.
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
A class for handling words, derived from Foam::string.
Base class for writing coordSet(s) and tracks with fields.
bool buffering_
Writer with buffering output.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
OBJstream os(runTime.globalPath()/outputName)
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
An IOstream is an abstract base class for all input/output systems; be they streams, files, token lists etc.
#define doLocalCode(Type)
A coordSet(s) writer in gnuplot format.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars, i.e. SphericalTensor<scalar>.
virtual bool writeBuffered()
Write buffered data.