16 const std::string& plotTitle,
17 const std::vector<std::string> &names,
22 throw CanteraError(
"writePlotFile",
"could not open file "+fname+
27 }
else if (
fmt ==
"XL" ||
fmt ==
"CSV") {
31 "unsupported plot type:" +
fmt);
35 void outputTEC(std::ostream& s,
const std::string& title,
36 const std::vector<std::string>& names,
39 s <<
"TITLE = \"" + title +
"\"" << endl;
40 s <<
"VARIABLES = " << endl;
41 for (
size_t i = 0; i < data.
nRows(); i++) {
42 s <<
"\"" << names[i] <<
"\"" << endl;
44 s <<
"ZONE T=\"zone1\"" << endl;
45 s <<
" I=" << data.
nColumns() <<
",J=1,K=1,F=POINT" << endl;
47 for (
size_t i = 0; i < data.
nRows(); i++) {
51 for (
size_t i = 0; i < data.
nColumns(); i++) {
52 for (
size_t j = 0; j < data.
nRows(); j++) {
53 s << data(j,i) <<
" ";
60 const std::vector<std::string>& names,
64 s << title +
"," << endl;
66 for (
size_t i = 0; i < data.
nRows(); i++) {
68 if (i != data.
nRows()-1) {
73 for (
size_t i = 0; i < data.
nColumns(); i++) {
74 for (
size_t j = 0; j < data.
nRows(); j++) {
76 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.
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 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.