From 904459c6b8708249e4ddb0bd7f842b7b8d89c9ca Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Thu, 23 Jan 2014 04:20:35 +0000 Subject: [PATCH] [1D] Remove unused 'importSolution' function --- include/cantera/oneD/StFlow.h | 12 --------- src/oneD/StFlow.cpp | 51 ----------------------------------- 2 files changed, 63 deletions(-) diff --git a/include/cantera/oneD/StFlow.h b/include/cantera/oneD/StFlow.h index 85a75c5df..8f58ebade 100644 --- a/include/cantera/oneD/StFlow.h +++ b/include/cantera/oneD/StFlow.h @@ -554,18 +554,6 @@ public: doublereal m_tfixed; }; -/** - * Import a previous solution to use as an initial estimate. The - * previous solution may have been computed using a different - * reaction mechanism. Species in the old and new mechanisms are - * matched by name, and any species in the new mechanism that were - * not in the old one are set to zero. The new solution is created - * with the same number of grid points as in the old solution. - * @deprecated Conversion is handled automatically when loading from XML - */ -void importSolution(size_t points, doublereal* oldSoln, IdealGasPhase& oldmech, - size_t size_new, doublereal* newSoln, IdealGasPhase& newmech); - } #endif diff --git a/src/oneD/StFlow.cpp b/src/oneD/StFlow.cpp index a0c8f9d2d..624e440ee 100644 --- a/src/oneD/StFlow.cpp +++ b/src/oneD/StFlow.cpp @@ -18,57 +18,6 @@ using namespace std; namespace Cantera { -void importSolution(size_t points, - doublereal* oldSoln, IdealGasPhase& oldmech, - size_t size_new, doublereal* newSoln, IdealGasPhase& newmech) -{ - // Number of components in old and new solutions - size_t nv_old = oldmech.nSpecies() + 4; - size_t nv_new = newmech.nSpecies() + 4; - - if (size_new < nv_new*points) { - throw CanteraError("importSolution", - "new solution array must have length "+ - int2str(nv_new*points)); - } - - size_t n, j, knew; - string nm; - - // copy u,V,T,lambda - for (j = 0; j < points; j++) - for (n = 0; n < 4; n++) { - newSoln[nv_new*j + n] = oldSoln[nv_old*j + n]; - } - - // copy mass fractions - size_t nsp0 = oldmech.nSpecies(); - //int nsp1 = newmech.nSpecies(); - - // loop over the species in the old mechanism - for (size_t k = 0; k < nsp0; k++) { - nm = oldmech.speciesName(k); // name - - // location of this species in the new mechanism. - // If < 0, then the species is not in the new mechanism. - knew = newmech.speciesIndex(nm); - - // copy this species from the old to the new solution vectors - if (knew != npos) { - for (j = 0; j < points; j++) { - newSoln[nv_new*j + 4 + knew] = oldSoln[nv_old*j + 4 + k]; - } - } - } - - - // normalize mass fractions - for (j = 0; j < points; j++) { - newmech.setMassFractions(&newSoln[nv_new*j + 4]); - newmech.getMassFractions(&newSoln[nv_new*j + 4]); - } -} - static void st_drawline() { writelog("\n-------------------------------------"