17 const std::string& plotTitle,
18 const std::vector<std::string> &names,
24 throw CanteraError(
"writePlotFile",
"could not open file "+fname+
29 }
else if (
fmt ==
"XL" ||
fmt ==
"CSV") {
33 "unsupported plot type:" +
fmt);
37void outputTEC(std::ostream& s,
const std::string& title,
38 const std::vector<std::string>& names,
42 s <<
"TITLE = \"" + title +
"\"" << endl;
43 s <<
"VARIABLES = " << endl;
44 for (
size_t i = 0; i < data.
nRows(); i++) {
45 s <<
"\"" << names[i] <<
"\"" << endl;
47 s <<
"ZONE T=\"zone1\"" << endl;
48 s <<
" I=" << data.
nColumns() <<
",J=1,K=1,F=POINT" << endl;
50 for (
size_t i = 0; i < data.
nRows(); i++) {
54 for (
size_t i = 0; i < data.
nColumns(); i++) {
55 for (
size_t j = 0; j < data.
nRows(); j++) {
56 s << data(j,i) <<
" ";
63 const std::vector<std::string>& names,
68 s << title +
"," << endl;
70 for (
size_t i = 0; i < data.
nRows(); i++) {
72 if (i != data.
nRows()-1) {
77 for (
size_t i = 0; i < data.
nColumns(); i++) {
78 for (
size_t j = 0; j < data.
nRows(); j++) {
80 if (j != data.nRows()-1) {
A class for 2D arrays stored in column-major (Fortran-compatible) form.
size_t nRows() const
Number of rows.
size_t nColumns() const
Number of columns.
Base class for exceptions thrown by Cantera classes.
This file contains definitions for utility functions and text for modules, inputfiles,...
Namespace for the Cantera kernel.
void outputTEC(std::ostream &s, const std::string &title, const std::vector< std::string > &names, const Array2D &data)
Write a Tecplot data file.
void warn_deprecated(const std::string &source, const AnyBase &node, const std::string &message)
A deprecation warning for syntax in an input file.
void writePlotFile(const std::string &fname, const std::string &fmt, const std::string &plotTitle, const std::vector< std::string > &names, const Array2D &data)
Write a Plotting file.
void outputExcel(std::ostream &s, const std::string &title, const std::vector< std::string > &names, const Array2D &data)
Write an Excel spreadsheet in 'csv' form.
Versions 6.2.0 and 6.2.1 of fmtlib do not include this define before they include windows....
Contains declarations for utility functions for outputing to plotting programs.