diff --git a/src/equil/ChemEquil.cpp b/src/equil/ChemEquil.cpp index 444cb2f69..dc501ab43 100644 --- a/src/equil/ChemEquil.cpp +++ b/src/equil/ChemEquil.cpp @@ -668,7 +668,7 @@ int ChemEquil::equilibrate(thermo_t& s, const char* XYstr, } } - copy(x.begin(), x.end(), oldx.begin()); + oldx = x; oldf = f; scale(res_trial.begin(), res_trial.end(), res_trial.begin(), -1.0); @@ -913,12 +913,11 @@ int ChemEquil::estimateEP_Brinkley(thermo_t& s, vector_fp& x, vector_fp n_i(m_kk,0.0); vector_fp n_i_calc(m_kk,0.0); vector_fp actCoeff(m_kk, 1.0); - vector_fp Xmol_i_calc(m_kk,0.0); double beta = 1.0; s.getMoleFractions(n_i.data()); double pressureConst = s.pressure(); - copy(n_i.begin(), n_i.end(), Xmol_i_calc.begin()); + vector_fp Xmol_i_calc = n_i; vector_fp x_old(m_mm+1, 0.0); vector_fp resid(m_mm+1, 0.0); diff --git a/src/equil/MultiPhaseEquil.cpp b/src/equil/MultiPhaseEquil.cpp index f29cf9027..d813fcce6 100644 --- a/src/equil/MultiPhaseEquil.cpp +++ b/src/equil/MultiPhaseEquil.cpp @@ -408,7 +408,7 @@ void MultiPhaseEquil::getComponents(const std::vector& order) void MultiPhaseEquil::unsort(vector_fp& x) { - copy(x.begin(), x.end(), m_work2.begin()); + m_work2 = x; size_t k; for (k = 0; k < m_nsp; k++) { x[m_order[k]] = m_work2[k]; diff --git a/src/kinetics/AqueousKinetics.cpp b/src/kinetics/AqueousKinetics.cpp index 21f59fef8..e46d38bd8 100644 --- a/src/kinetics/AqueousKinetics.cpp +++ b/src/kinetics/AqueousKinetics.cpp @@ -102,13 +102,13 @@ void AqueousKinetics::updateROP() } // copy rate coefficients into ropf - copy(m_rfn.begin(), m_rfn.end(), m_ropf.begin()); + m_ropf = m_rfn; // multiply by perturbation factor multiply_each(m_ropf.begin(), m_ropf.end(), m_perturb.begin()); // copy the forward rates to the reverse rates - copy(m_ropf.begin(), m_ropf.end(), m_ropr.begin()); + m_ropr = m_ropf; // for reverse rates computed from thermochemistry, multiply the forward // rates copied into m_ropr by the reciprocals of the equilibrium constants @@ -133,7 +133,7 @@ void AqueousKinetics::getFwdRateConstants(doublereal* kfwd) _update_rates_C(); // copy rate coefficients into ropf - copy(m_rfn.begin(), m_rfn.end(), m_ropf.begin()); + m_ropf = m_rfn; // multiply by perturbation factor multiply_each(m_ropf.begin(), m_ropf.end(), m_perturb.begin()); diff --git a/src/kinetics/GasKinetics.cpp b/src/kinetics/GasKinetics.cpp index 858d1213a..bd8b9769d 100644 --- a/src/kinetics/GasKinetics.cpp +++ b/src/kinetics/GasKinetics.cpp @@ -168,7 +168,7 @@ void GasKinetics::updateROP() } // copy rate coefficients into ropf - copy(m_rfn.begin(), m_rfn.end(), m_ropf.begin()); + m_ropf = m_rfn; // multiply ropf by enhanced 3b conc for all 3b rxns if (!concm_3b_values.empty()) { @@ -183,7 +183,7 @@ void GasKinetics::updateROP() multiply_each(m_ropf.begin(), m_ropf.end(), m_perturb.begin()); // copy the forward rates to the reverse rates - copy(m_ropf.begin(), m_ropf.end(), m_ropr.begin()); + m_ropr = m_ropf; // for reverse rates computed from thermochemistry, multiply the forward // rates copied into m_ropr by the reciprocals of the equilibrium constants @@ -216,7 +216,7 @@ void GasKinetics::getFwdRateConstants(doublereal* kfwd) update_rates_T(); // copy rate coefficients into ropf - copy(m_rfn.begin(), m_rfn.end(), m_ropf.begin()); + m_ropf = m_rfn; // multiply ropf by enhanced 3b conc for all 3b rxns if (!concm_3b_values.empty()) { diff --git a/src/kinetics/ImplicitSurfChem.cpp b/src/kinetics/ImplicitSurfChem.cpp index 897124f61..3e05f8ee9 100644 --- a/src/kinetics/ImplicitSurfChem.cpp +++ b/src/kinetics/ImplicitSurfChem.cpp @@ -224,13 +224,13 @@ void ImplicitSurfChem::solvePseudoSteadyStateProblem(int ifuncOverride, m_surfSolver->m_ioflag = m_ioFlag; // Save the current solution - copy(m_concSpecies.begin(), m_concSpecies.end(), m_concSpeciesSave.begin()); + m_concSpeciesSave = m_concSpecies; int retn = m_surfSolver->solveSurfProb(ifunc, time_scale, TKelvin, PGas, reltol, atol); if (retn != 1) { // reset the concentrations - copy(m_concSpeciesSave.begin(), m_concSpeciesSave.end(), m_concSpecies.begin()); + m_concSpecies = m_concSpeciesSave; setConcSpecies(m_concSpeciesSave.data()); ifunc = SFLUX_INITIALIZE; retn = m_surfSolver->solveSurfProb(ifunc, time_scale, TKelvin, PGas, diff --git a/src/kinetics/InterfaceKinetics.cpp b/src/kinetics/InterfaceKinetics.cpp index 468db10d1..33759b197 100644 --- a/src/kinetics/InterfaceKinetics.cpp +++ b/src/kinetics/InterfaceKinetics.cpp @@ -441,13 +441,13 @@ void InterfaceKinetics::updateROP() } // Copy the reaction rate coefficients, m_rfn, into m_ropf - copy(m_rfn.begin(), m_rfn.end(), m_ropf.begin()); + m_ropf = m_rfn; // Multiply by the perturbation factor multiply_each(m_ropf.begin(), m_ropf.end(), m_perturb.begin()); // Copy the forward rate constants to the reverse rate constants - copy(m_ropf.begin(), m_ropf.end(), m_ropr.begin()); + m_ropr = m_ropf; // For reverse rates computed from thermochemistry, multiply // the forward rates copied into m_ropr by the reciprocals of diff --git a/src/kinetics/solveSP.cpp b/src/kinetics/solveSP.cpp index fd5cda06d..5e3ac1f60 100644 --- a/src/kinetics/solveSP.cpp +++ b/src/kinetics/solveSP.cpp @@ -158,7 +158,7 @@ int solveSP::solveSurfProb(int ifunc, doublereal time_scale, doublereal TKelvin, } } - std::copy(m_CSolnSP.begin(), m_CSolnSP.end(), m_CSolnSPInit.begin()); + m_CSolnSPInit = m_CSolnSP; // Calculate the largest species in each phase evalSurfLarge(m_CSolnSP.data()); @@ -177,7 +177,7 @@ int solveSP::solveSurfProb(int ifunc, doublereal time_scale, doublereal TKelvin, while (not_converged && iter < iter_max) { iter++; // Store previous iteration's solution in the old solution vector - std::copy(m_CSolnSP.begin(), m_CSolnSP.end(), m_CSolnSPOld.begin()); + m_CSolnSPOld = m_CSolnSP; // Evaluate the largest surface species for each surface phase every // 5 iterations. diff --git a/src/numerics/BandMatrix.cpp b/src/numerics/BandMatrix.cpp index 134c60442..0e12055e4 100644 --- a/src/numerics/BandMatrix.cpp +++ b/src/numerics/BandMatrix.cpp @@ -229,7 +229,7 @@ void BandMatrix::leftMult(const doublereal* const b, doublereal* const prod) con int BandMatrix::factor() { int info=0; - copy(data.begin(), data.end(), ludata.begin()); + ludata = data; ct_dgbtrf(nRows(), nColumns(), nSubDiagonals(), nSuperDiagonals(), ludata.data(), ldim(), ipiv().data(), info); diff --git a/src/oneD/Sim1D.cpp b/src/oneD/Sim1D.cpp index 6d1fc252c..6c6cba4a2 100644 --- a/src/oneD/Sim1D.cpp +++ b/src/oneD/Sim1D.cpp @@ -194,7 +194,7 @@ int Sim1D::newtonSolve(int loglevel) { int m = OneDim::solve(m_x.data(), m_xnew.data(), loglevel); if (m >= 0) { - copy(m_xnew.begin(), m_xnew.end(), m_x.begin()); + m_x = m_xnew; return 0; } else if (m > -10) { return -1; @@ -385,8 +385,7 @@ int Sim1D::refine(int loglevel) } // Replace the current solution vector with the new one - m_x.resize(xnew.size()); - copy(xnew.begin(), xnew.end(), m_x.begin()); + m_x = xnew; // resize the work array m_xnew.resize(xnew.size()); @@ -478,12 +477,10 @@ int Sim1D::setFixedTemperature(doublereal t) } // Replace the current solution vector with the new one - m_x.resize(xnew.size()); - copy(xnew.begin(), xnew.end(), m_x.begin()); + m_x = xnew; // resize the work array - m_xnew.resize(xnew.size()); - copy(xnew.begin(), xnew.end(), m_xnew.begin()); + m_xnew = xnew; resize(); finalize(); return np; diff --git a/src/thermo/Phase.cpp b/src/thermo/Phase.cpp index 7372a6d7d..21469336f 100644 --- a/src/thermo/Phase.cpp +++ b/src/thermo/Phase.cpp @@ -498,11 +498,7 @@ doublereal Phase::molecularWeight(size_t k) const void Phase::getMolecularWeights(vector_fp& weights) const { - const vector_fp& mw = molecularWeights(); - if (weights.size() < mw.size()) { - weights.resize(mw.size()); - } - copy(mw.begin(), mw.end(), weights.begin()); + weights = molecularWeights(); } void Phase::getMolecularWeights(doublereal* weights) const diff --git a/src/thermo/SpeciesThermoFactory.cpp b/src/thermo/SpeciesThermoFactory.cpp index c1c821374..fc9bf5c50 100644 --- a/src/thermo/SpeciesThermoFactory.cpp +++ b/src/thermo/SpeciesThermoFactory.cpp @@ -125,8 +125,7 @@ static SpeciesThermoInterpType* newNasaThermoFromXML(vector nodes) getFloatArray(nodes[1]->child("floatArray"), c1, false); } else { // if there is no higher range data, then copy c0 to c1. - c1.resize(7,0.0); - copy(c0.begin(), c0.end(), c1.begin()); + c1 = c0; } } else if (fabs(tmax1 - tmin0) < 0.01) { // f1 has the lower T data, and f0 the higher T data diff --git a/src/transport/DustyGasTransport.cpp b/src/transport/DustyGasTransport.cpp index 26f57f43a..546842212 100644 --- a/src/transport/DustyGasTransport.cpp +++ b/src/transport/DustyGasTransport.cpp @@ -96,8 +96,7 @@ void DustyGasTransport::initialize(ThermoPhase* phase, Transport* gastr) } // make a local copy of the molecular weights - m_mw.resize(m_nsp); - copy(m_thermo->molecularWeights().begin(), m_thermo->molecularWeights().end(), m_mw.begin()); + m_mw = m_thermo->molecularWeights(); m_multidiff.resize(m_nsp, m_nsp); m_d.resize(m_nsp, m_nsp); diff --git a/src/transport/GasTransport.cpp b/src/transport/GasTransport.cpp index 499d1ffe6..4da6ef4d9 100644 --- a/src/transport/GasTransport.cpp +++ b/src/transport/GasTransport.cpp @@ -351,8 +351,7 @@ void GasTransport::init(thermo_t* thermo, int mode, int log_level) m_bdiff.resize(m_nsp, m_nsp); // make a local copy of the molecular weights - m_mw.assign(m_thermo->molecularWeights().begin(), - m_thermo->molecularWeights().end()); + m_mw = m_thermo->molecularWeights(); m_wratjk.resize(m_nsp, m_nsp, 0.0); m_wratkj1.resize(m_nsp, m_nsp, 0.0); diff --git a/src/transport/LiquidTransport.cpp b/src/transport/LiquidTransport.cpp index 3cc323f3d..029a54d1c 100644 --- a/src/transport/LiquidTransport.cpp +++ b/src/transport/LiquidTransport.cpp @@ -244,7 +244,7 @@ bool LiquidTransport::initLiquid(LiquidTransportParams& tr) m_radiusTempDep_Ns.resize(m_nsp, 0); // Make a local copy of the molecular weights - copy(m_thermo->molecularWeights().begin(), m_thermo->molecularWeights().end(), m_mw.begin()); + m_mw = m_thermo->molecularWeights(); // First populate mixing rules and indices (NOTE, we transfer pointers of // malloced quantities. We zero out pointers so that we only have one copy diff --git a/src/transport/MultiTransport.cpp b/src/transport/MultiTransport.cpp index 0bb41261d..04edceeb5 100644 --- a/src/transport/MultiTransport.cpp +++ b/src/transport/MultiTransport.cpp @@ -156,7 +156,7 @@ void MultiTransport::solveLMatrixEquation() // Solve it using GMRES or LU decomposition. The last solution in m_a should // provide a good starting guess, so convergence should be fast. - copy(m_b.begin(), m_b.end(), m_a.begin()); + m_a = m_b; try { solve(m_Lmatrix, m_a.data()); } catch (CanteraError& err) { diff --git a/src/transport/SimpleTransport.cpp b/src/transport/SimpleTransport.cpp index c73ea4792..5f5762625 100644 --- a/src/transport/SimpleTransport.cpp +++ b/src/transport/SimpleTransport.cpp @@ -170,8 +170,7 @@ bool SimpleTransport::initLiquid(LiquidTransportParams& tr) } // make a local copy of the molecular weights - m_mw.resize(m_nsp); - copy(m_thermo->molecularWeights().begin(), m_thermo->molecularWeights().end(), m_mw.begin()); + m_mw = m_thermo->molecularWeights(); // Get the input Viscosities m_viscSpecies.resize(m_nsp);