diff --git a/test_problems/cxx_ex/example_utils.h b/test_problems/cxx_ex/example_utils.h index 7e45cb293..6b949ee62 100644 --- a/test_problems/cxx_ex/example_utils.h +++ b/test_problems/cxx_ex/example_utils.h @@ -55,4 +55,26 @@ void plotSoln(const std::string& fname, const std::string& fmt, writePlotFile(fname, fmt, title, names, soln); } +template +void makeTransportDataLabels(const G& gas, V& names) +{ + size_t nsp = gas.nSpecies(); + names.resize(nsp + 3); + names[0] = "Temperature (K)"; + names[1] = "Viscosity ()"; + names[2] = "Thermal Conductivity (W/m-K)"; + for (size_t k = 0; k < nsp; k++) { + names[3+k] = gas.speciesName(k); + } +} + +template +void plotTransportSoln(const std::string& fname, const std::string& fmt, + const std::string& title, const G& gas, const A& soln) +{ + std::vector names; + makeTransportDataLabels(gas, names); + writePlotFile(fname, fmt, title, names, soln); +} + #endif diff --git a/test_problems/cxx_ex/transport_example1.cpp b/test_problems/cxx_ex/transport_example1.cpp index 52d44e49d..1bd5d8989 100644 --- a/test_problems/cxx_ex/transport_example1.cpp +++ b/test_problems/cxx_ex/transport_example1.cpp @@ -14,29 +14,6 @@ using namespace Cantera; using std::cout; using std::endl; -template -void makeTransportDataLabels(const G& gas, V& names) -{ - size_t nsp = gas.nSpecies(); - names.resize(nsp + 3); - names[0] = "Temperature (K)"; - names[1] = "Viscosity ()"; - names[2] = "Thermal Conductivity (W/m-K)"; - for (size_t k = 0; k < nsp; k++) { - names[3+k] = gas.speciesName(k); - } -} - -template -void plotTransportSoln(const std::string& fname, const std::string& fmt, - const std::string& title, const G& gas, const A& soln) -{ - std::vector names; - makeTransportDataLabels(gas, names); - writePlotFile(fname, fmt, title, names, soln); -} - - int transport_example1(int job) { try { diff --git a/test_problems/cxx_ex/transport_example2.cpp b/test_problems/cxx_ex/transport_example2.cpp index e4466b512..92d6fa395 100644 --- a/test_problems/cxx_ex/transport_example2.cpp +++ b/test_problems/cxx_ex/transport_example2.cpp @@ -15,29 +15,6 @@ using namespace Cantera; using std::cout; using std::endl; -template -void makeTransportDataLabels(const G& gas, V& names) -{ - size_t nsp = gas.nSpecies(); - names.resize(nsp + 3); - names[0] = "Temperature (K)"; - names[1] = "Viscosity ()"; - names[2] = "Thermal Conductivity (W/m-K)"; - for (size_t k = 0; k < nsp; k++) { - names[3+k] = gas.speciesName(k); - } -} - -template -void plotTransportSoln(const std::string& fname, const std::string& fmt, - const std::string& title, const G& gas, const A& soln) -{ - std::vector names; - makeTransportDataLabels(gas, names); - writePlotFile(fname, fmt, title, names, soln); -} - - int transport_example2(int job) { try {