From bfb20e1f5078c8c32c5b2c84206228fd76522626 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Sat, 1 Aug 2015 23:46:40 -0400 Subject: [PATCH] Consistently use vector_fp and vector_int typedefs --- include/cantera/base/Array.h | 2 +- include/cantera/base/ctml.h | 2 +- include/cantera/base/utilities.h | 4 +- include/cantera/equil/vcs_SpeciesProperties.h | 5 +- include/cantera/equil/vcs_VolPhase.h | 24 +++--- include/cantera/equil/vcs_internal.h | 2 +- include/cantera/equil/vcs_prob.h | 20 ++--- include/cantera/equil/vcs_solve.h | 76 +++++++++---------- include/cantera/kinetics/Group.h | 4 +- include/cantera/kinetics/InterfaceKinetics.h | 2 +- include/cantera/kinetics/ReactionPath.h | 2 +- include/cantera/numerics/ResidEval.h | 2 +- include/cantera/numerics/SquareMatrix.h | 2 +- include/cantera/thermo/GeneralSpeciesThermo.h | 2 +- include/cantera/thermo/GibbsExcessVPSSTP.h | 14 ++-- include/cantera/thermo/HMWSoln.h | 2 +- .../cantera/thermo/IonsFromNeutralVPSSTP.h | 16 ++-- include/cantera/thermo/LatticeSolidPhase.h | 2 +- include/cantera/thermo/MixtureFugacityTP.h | 2 +- include/cantera/thermo/MolarityIonicVPSSTP.h | 4 +- include/cantera/thermo/PDSS_IonsFromNeutral.h | 4 +- include/cantera/thermo/ThermoPhase.h | 2 +- samples/cxx/flamespeed/flamespeed.cpp | 2 +- src/base/ctml.cpp | 2 +- src/equil/MultiPhaseEquil.cpp | 16 ++-- src/equil/vcs_MultiPhaseEquil.cpp | 20 ++--- src/equil/vcs_VolPhase.cpp | 8 +- src/equil/vcs_elem.cpp | 2 +- src/equil/vcs_inest.cpp | 8 +- src/equil/vcs_phaseStability.cpp | 20 ++--- src/equil/vcs_prep.cpp | 4 +- src/equil/vcs_prob.cpp | 12 +-- src/equil/vcs_report.cpp | 6 +- src/equil/vcs_setMolesLinProg.cpp | 14 ++-- src/equil/vcs_solve.cpp | 2 +- src/equil/vcs_solve_TP.cpp | 4 +- src/equil/vcs_solve_phaseStability.cpp | 10 +-- src/equil/vcs_util.cpp | 4 +- src/kinetics/InterfaceKinetics.cpp | 2 +- src/thermo/IonsFromNeutralVPSSTP.cpp | 12 +-- src/thermo/LatticeSolidPhase.cpp | 2 +- src/thermo/ThermoFactory.cpp | 4 +- src/thermo/ThermoPhase.cpp | 8 +- src/transport/HighPressureGasTransport.cpp | 10 +-- src/transport/LiquidTranInteraction.cpp | 4 +- test/thermo/MaskellSolidSolnPhase_Test.cpp | 18 ++--- test/thermo/ThermoPhase_Test.cpp | 6 +- test/thermo/nasapoly.cpp | 2 +- .../ChemEquil_ionizedGas/ionizedGasEquil.cpp | 2 +- 49 files changed, 199 insertions(+), 200 deletions(-) diff --git a/include/cantera/base/Array.h b/include/cantera/base/Array.h index 4875cdec1..1f7afa2b7 100644 --- a/include/cantera/base/Array.h +++ b/include/cantera/base/Array.h @@ -127,7 +127,7 @@ public: /*! * This operation will add a column onto the existing matrix. * - * @param c This vector is the entries in the + * @param c This vector is the entries in the * column to be added. It must have a length * equal to m_nrows or greater. */ diff --git a/include/cantera/base/ctml.h b/include/cantera/base/ctml.h index 0ea1bac42..58d05c718 100644 --- a/include/cantera/base/ctml.h +++ b/include/cantera/base/ctml.h @@ -291,7 +291,7 @@ void addString(XML_Node& node, const std::string& titleString, * The default value for the node name is floatArray * @return Returns the number of floats read into v. */ -size_t getFloatArray(const XML_Node& node, std::vector & v, +size_t getFloatArray(const XML_Node& node, vector_fp & v, const bool convert=true, const std::string& unitsString="", const std::string& nodeName = "floatArray"); diff --git a/include/cantera/base/utilities.h b/include/cantera/base/utilities.h index 32bb6d76b..ff042173d 100644 --- a/include/cantera/base/utilities.h +++ b/include/cantera/base/utilities.h @@ -308,8 +308,8 @@ inline void sum_each(OutputIter x_begin, OutputIter x_end, * Example: * * \code - * vector x(3), y(20); - * vector index(3); + * vector_fp x(3), y(20); + * vector_int index(3); * index[0] = 9; * index[1] = 2; * index[3] = 16; diff --git a/include/cantera/equil/vcs_SpeciesProperties.h b/include/cantera/equil/vcs_SpeciesProperties.h index e2aad611b..03dbbd1b9 100644 --- a/include/cantera/equil/vcs_SpeciesProperties.h +++ b/include/cantera/equil/vcs_SpeciesProperties.h @@ -2,8 +2,7 @@ #ifndef VCS_SPECIES_PROPERTIES_H #define VCS_SPECIES_PROPERTIES_H -#include -#include +#include "cantera/base/ct_defs.h" namespace Cantera { @@ -29,7 +28,7 @@ public: //! Column of the formula matrix, comprising the //! element composition of the species */ - std::vector FormulaMatrixCol; + vector_fp FormulaMatrixCol; double Charge; /* Charge state of the species -> This may be duplication of what's in the diff --git a/include/cantera/equil/vcs_VolPhase.h b/include/cantera/equil/vcs_VolPhase.h index ca520b214..721e39ee2 100644 --- a/include/cantera/equil/vcs_VolPhase.h +++ b/include/cantera/equil/vcs_VolPhase.h @@ -343,7 +343,7 @@ private: public: //! Return a const reference to the mole fractions stored in the object. - const std::vector & moleFractions() const; + const vector_fp & moleFractions() const; double moleFraction(size_t klocal) const; @@ -357,7 +357,7 @@ public: /*! * @return Returns a const reference to the vector of creationMoleNumbers */ - const std::vector & creationMoleNumbers(std::vector &creationGlobalRxnNumbers) const; + const vector_fp & creationMoleNumbers(std::vector &creationGlobalRxnNumbers) const; //! Returns whether the phase is an ideal solution phase bool isIdealSoln() const; @@ -648,7 +648,7 @@ private: //! boolean indicating whether an element constraint is active //! for the current problem - std::vector m_elementActive; + vector_int m_elementActive; //! Type of the element constraint /*! @@ -661,7 +661,7 @@ private: * a species has neg 0 or pos value of that constraint (other than * charge) */ - std::vector m_elementType; + vector_int m_elementType; //! Formula Matrix for the phase /*! @@ -678,7 +678,7 @@ private: * - metal electron -> VCS_SPECIES_INTERFACIALVOLTAGE. * (unknown is the interfacial voltage (volts)) */ - std::vector m_speciesUnknownType; + vector_int m_speciesUnknownType; //! Index of the element number in the global list of elements //! stored in VCS_PROB or VCS_SOLVE @@ -750,13 +750,13 @@ private: double v_totalMoles; //! Vector of the current mole fractions for species in the phase - std::vector Xmol_; + vector_fp Xmol_; //! Vector of current creationMoleNumbers_ /*! * These are the actual unknowns in the phase stability problem */ - std::vector creationMoleNumbers_; + vector_fp creationMoleNumbers_; //! Vector of creation global reaction numbers for the phase stability problem /*! @@ -791,7 +791,7 @@ private: * * Units -> depends on VCS_UnitsFormat variable. Cantera -> J/kmol */ - mutable std::vector SS0ChemicalPotential; + mutable vector_fp SS0ChemicalPotential; //! Vector of calculated Star chemical potentials for the //! current Temperature and pressure. @@ -801,20 +801,20 @@ private: * * Units -> depends on VCS_UnitsFormat variable. Cantera -> J/kmol. */ - mutable std::vector StarChemicalPotential; + mutable vector_fp StarChemicalPotential; //! Vector of the Star molar Volumes of the species. units m3 / kmol - mutable std::vector StarMolarVol; + mutable vector_fp StarMolarVol; //! Vector of the Partial molar Volumes of the species. units m3 / kmol - mutable std::vector PartialMolarVol; + mutable vector_fp PartialMolarVol; //! Vector of calculated activity coefficients for the current state /*! * Whether or not this vector is current is determined by * the bool #m_UpToDate_AC. */ - mutable std::vector ActCoeff; + mutable vector_fp ActCoeff; //! Vector of the derivatives of the ln activity coefficient wrt to the //! current mole number multiplied by the current phase moles diff --git a/include/cantera/equil/vcs_internal.h b/include/cantera/equil/vcs_internal.h index 755a119b5..4e3eaec8c 100644 --- a/include/cantera/equil/vcs_internal.h +++ b/include/cantera/equil/vcs_internal.h @@ -111,7 +111,7 @@ typedef double(*VCS_FUNC_PTR)(double xval, double Vtarget, * * @return Returns the l2 norm of the vector */ -double vcs_l2norm(const std::vector vec); +double vcs_l2norm(const vector_fp vec); //! Finds the location of the maximum component in a double vector /*! diff --git a/include/cantera/equil/vcs_prob.h b/include/cantera/equil/vcs_prob.h index 4d6fe43ef..64f74a4b7 100644 --- a/include/cantera/equil/vcs_prob.h +++ b/include/cantera/equil/vcs_prob.h @@ -54,7 +54,7 @@ public: * This is a calculated output quantity. length = number of species. * units = m_VCS_UnitsFormat */ - std::vector m_gibbsSpecies; + vector_fp m_gibbsSpecies; //! Total number of moles of the kth species. /*! @@ -67,21 +67,21 @@ public: * * units = m_VCS_UnitsFormat */ - std::vector w; + vector_fp w; //! Mole fraction vector /*! * This is a calculated vector, calculated from w[]. * length number of species. */ - std::vector mf; + vector_fp mf; //! Element abundances for jth element /*! * This is input from the input file and is considered a constant from * thereon within the vcs_solve_TP(). units = m_VCS_UnitsFormat */ - std::vector gai; + vector_fp gai; //! Formula Matrix for the problem /*! @@ -100,7 +100,7 @@ public: * interfacial current, which is set to zero in this initial treatment. * Later we may have non-zero interfacial currents. */ - std::vector SpeciesUnknownType; + vector_int SpeciesUnknownType; //! Temperature (Kelvin) /*! @@ -127,7 +127,7 @@ public: * This is a calculated vector, calculated from w[]. * length number of species. */ - std::vector VolPM; + vector_fp VolPM; //! Units for the chemical potential data, pressure data, volume, //! and species amounts @@ -171,23 +171,23 @@ public: std::vector ElName; //! vector of Element types - std::vector m_elType; + vector_int m_elType; //! Specifies whether an element constraint is active /*! * The default is true * Length = nelements */ - std::vector ElActive; + vector_int ElActive; //! Molecular weight of species /*! * WtSpecies[k] = molecular weight of species in gm/mol */ - std::vector WtSpecies; + vector_fp WtSpecies; //! Charge of each species - std::vector Charge; + vector_fp Charge; //! Array of phase structures std::vector VPhaseList; diff --git a/include/cantera/equil/vcs_solve.h b/include/cantera/equil/vcs_solve.h index 2f00242cb..5783c5d9f 100644 --- a/include/cantera/equil/vcs_solve.h +++ b/include/cantera/equil/vcs_solve.h @@ -1420,11 +1420,11 @@ private: int& rangeErrorFound); // data used by vcs_solve_TP and it's helper functions - std::vector m_sm; - std::vector m_ss; - std::vector m_sa; - std::vector m_aw; - std::vector m_wx; + vector_fp m_sm; + vector_fp m_ss; + vector_fp m_sa; + vector_fp m_aw; + vector_fp m_wx; public: //! value of the number of species used to malloc data structures @@ -1503,14 +1503,14 @@ public: * handled by the alt_min treatment or * should be handled as a major species. */ - std::vector m_scSize; + vector_fp m_scSize; //! total size of the species /*! * This is used as a multiplier to the mole number in figuring out which * species should be components. */ - std::vector m_spSize; + vector_fp m_spSize; //! Standard state chemical potentials for species K at the current //! temperature and pressure. @@ -1518,14 +1518,14 @@ public: * The first NC entries are for components. The following NR entries are * for the current non-component species in the mechanism. */ - std::vector m_SSfeSpecies; + vector_fp m_SSfeSpecies; //! Free energy vector from the start of the current iteration /*! * The free energies are saved at the start of the current iteration. * Length = number of species */ - std::vector m_feSpecies_old; + vector_fp m_feSpecies_old; //! Dimensionless new free energy for all the species in the mechanism //! at the new tentatite T, P, and mole numbers. @@ -1534,7 +1534,7 @@ public: * NR entries are for the current non-component species in the mechanism. * Length = number of species */ - std::vector m_feSpecies_new; + vector_fp m_feSpecies_new; //! Setting for whether to do an initial estimate /*! @@ -1553,7 +1553,7 @@ public: * Total number of moles of the kth species. * Length = Total number of species = m */ - std::vector m_molNumSpecies_old; + vector_fp m_molNumSpecies_old; //! Specifies the species unknown type /*! @@ -1566,7 +1566,7 @@ public: * interfacial current, which is set to zero in this initial treatment. * Later we may have non-zero interfacial currents. */ - std::vector m_speciesUnknownType; + vector_int m_speciesUnknownType; //! Change in the number of moles of phase, iphase, due to the //! noncomponent formation reaction, irxn, for species, k: @@ -1580,11 +1580,11 @@ public: Array2D m_phaseParticipation; //! electric potential of the iph phase - std::vector m_phasePhi; + vector_fp m_phasePhi; //! Tentative value of the mole number vector. It's also used to store the //! mole fraction vector. - std::vector m_molNumSpecies_new; + vector_fp m_molNumSpecies_new; //! Delta G(irxn) for the noncomponent species in the mechanism. /*! @@ -1594,27 +1594,27 @@ public: * of noncomponent species in the mechanism. It starts with * the first current noncomponent species in the mechanism. */ - std::vector m_deltaGRxn_new; + vector_fp m_deltaGRxn_new; //! Last deltag[irxn] from the previous step - std::vector m_deltaGRxn_old; + vector_fp m_deltaGRxn_old; //! Last deltag[irxn] from the previous step with additions for //! possible births of zeroed phases. - std::vector m_deltaGRxn_Deficient; + vector_fp m_deltaGRxn_Deficient; //! Temporary vector of Rxn DeltaG's /*! * This is used from time to time, for printing purposes */ - std::vector m_deltaGRxn_tmp; + vector_fp m_deltaGRxn_tmp; //! Reaction Adjustments for each species during the current step /*! * delta Moles for each species during the current step. * Length = number of species */ - std::vector m_deltaMolNumSpecies; + vector_fp m_deltaMolNumSpecies; //! Element abundances vector /*! @@ -1626,7 +1626,7 @@ public: * is considered a constant from thereon. * units = kmoles */ - std::vector m_elemAbundances; + vector_fp m_elemAbundances; //! Element abundances vector Goals /*! @@ -1635,7 +1635,7 @@ public: * are added to this vector. This is input from the input file and is * considered a constant from thereon. units = kmoles */ - std::vector m_elemAbundancesGoal; + vector_fp m_elemAbundancesGoal; //! Total number of kmoles in all phases /*! @@ -1650,7 +1650,7 @@ public: * * Length = number of phases */ - std::vector m_tPhaseMoles_old; + vector_fp m_tPhaseMoles_old; //! total kmols of species in each phase in the tentative soln vector /*! @@ -1659,19 +1659,19 @@ public: * * Length = number of phases */ - std::vector m_tPhaseMoles_new; + vector_fp m_tPhaseMoles_new; //! Temporary vector of length NPhase - mutable std::vector m_TmpPhase; + mutable vector_fp m_TmpPhase; //! Temporary vector of length NPhase - mutable std::vector m_TmpPhase2; + mutable vector_fp m_TmpPhase2; //! Change in the total moles in each phase /*! * Length number of phases. */ - std::vector m_deltaPhaseMoles; + vector_fp m_deltaPhaseMoles; //! Temperature (Kelvin) double m_temperature; @@ -1695,7 +1695,7 @@ public: * TPhInertMoles[iph] = Total kmoles of inert to add to each phase * length = number of phases */ - std::vector TPhInertMoles; + vector_fp TPhInertMoles; //! Tolerance requirement for major species double m_tolmaj; @@ -1769,7 +1769,7 @@ public: * is `kspec = irxn + m_numComponents`. For possible values and their * meanings, see vcs_evaluate_speciesType(). */ - std::vector m_speciesStatus; + vector_int m_speciesStatus; //! Mapping from the species number to the phase number std::vector m_phaseID; @@ -1800,13 +1800,13 @@ public: * that a species has neg 0 or pos value of that constraint (other than * charge) */ - std::vector m_elType; + vector_int m_elType; //! Specifies whether an element constraint is active /*! * The default is true. Length = nelements */ - std::vector m_elementActive; + vector_int m_elementActive; //! Array of Phase Structures. Length = number of phases. std::vector m_VolPhaseList; @@ -1837,7 +1837,7 @@ public: * * length = number of species */ - std::vector m_actConventionSpecies; + vector_int m_actConventionSpecies; //! specifies the activity convention of the phase. /*! @@ -1846,25 +1846,25 @@ public: * * length = number of phases */ - std::vector m_phaseActConvention; + vector_int m_phaseActConvention; //! specifies the ln(Mnaught) used to calculate the chemical potentials /*! * For molar based activity conventions this will be equal to 0.0. * length = number of species. */ - std::vector m_lnMnaughtSpecies; + vector_fp m_lnMnaughtSpecies; //! Molar-based Activity Coefficients for Species. //! Length = number of species - std::vector m_actCoeffSpecies_new; + vector_fp m_actCoeffSpecies_new; //! Molar-based Activity Coefficients for Species based on old mole numbers /*! * These activity coefficients are based on the m_molNumSpecies_old * values Molar based activity coeffients. Length = number of species */ - std::vector m_actCoeffSpecies_old; + vector_fp m_actCoeffSpecies_old; //! Change in the log of the activity coefficient with respect to the mole number //! multiplied by the phase mole number @@ -1882,10 +1882,10 @@ public: * * note: this is a candidate for removal. I don't think we use it. */ - std::vector m_wtSpecies; + vector_fp m_wtSpecies; //! Charge of each species. Length = number of species. - std::vector m_chargeSpecies; + vector_fp m_chargeSpecies; std::vector > phasePopProblemLists_; @@ -1913,7 +1913,7 @@ public: * units = mks (m^3/kmol) -determined by m_VCS_UnitsFormat * Length = number of species */ - std::vector m_PMVolumeSpecies; + vector_fp m_PMVolumeSpecies; //! dimensionless value of Faraday's constant, F / RT (1/volt) double m_Faraday_dim; diff --git a/include/cantera/kinetics/Group.h b/include/cantera/kinetics/Group.h index f613e12f5..454a847f8 100644 --- a/include/cantera/kinetics/Group.h +++ b/include/cantera/kinetics/Group.h @@ -23,7 +23,7 @@ public: Group(size_t n) : m_sign(0) { m_comp.resize(n,0); } - Group(const std::vector& elnumbers) : + Group(const vector_int& elnumbers) : m_comp(elnumbers), m_sign(0) { validate(); } @@ -130,7 +130,7 @@ public: const Group& g); private: - std::vector m_comp; + vector_int m_comp; int m_sign; }; diff --git a/include/cantera/kinetics/InterfaceKinetics.h b/include/cantera/kinetics/InterfaceKinetics.h index dcc4ab4f5..4e6ede1bf 100644 --- a/include/cantera/kinetics/InterfaceKinetics.h +++ b/include/cantera/kinetics/InterfaceKinetics.h @@ -639,7 +639,7 @@ protected: * * length = number of phases in the object. By default all phases are stable. */ - std::vector m_phaseIsStable; + vector_int m_phaseIsStable; //! Vector of vector of booleans indicating whether a phase participates in a //! reaction as a reactant diff --git a/include/cantera/kinetics/ReactionPath.h b/include/cantera/kinetics/ReactionPath.h index 88be82144..94e08e4a2 100644 --- a/include/cantera/kinetics/ReactionPath.h +++ b/include/cantera/kinetics/ReactionPath.h @@ -320,7 +320,7 @@ protected: std::vector > m_reac; std::vector > m_prod; DenseMatrix m_elatoms; - std::vector > m_groups; + std::vector m_groups; std::vector m_sgroup; std::vector m_elementSymbols; std::map > > m_transfer; diff --git a/include/cantera/numerics/ResidEval.h b/include/cantera/numerics/ResidEval.h index 8bc1c93b3..915c2415f 100644 --- a/include/cantera/numerics/ResidEval.h +++ b/include/cantera/numerics/ResidEval.h @@ -166,7 +166,7 @@ protected: * The first index is the equation number. The second index is 1 if it is a DAE, * and zero if it is not. */ - std::vector m_alg; + vector_int m_alg; std::map m_constrain; }; diff --git a/include/cantera/numerics/SquareMatrix.h b/include/cantera/numerics/SquareMatrix.h index d816115eb..1e9b1d42f 100644 --- a/include/cantera/numerics/SquareMatrix.h +++ b/include/cantera/numerics/SquareMatrix.h @@ -123,7 +123,7 @@ public: vector_fp work; //! Integer work vector for QR algorithms - std::vector iwork_; + vector_int iwork_; protected: //! 1-norm of the matrix. This is determined immediately before every factorization doublereal a1norm_; diff --git a/include/cantera/thermo/GeneralSpeciesThermo.h b/include/cantera/thermo/GeneralSpeciesThermo.h index aefec16e0..dac100f0d 100644 --- a/include/cantera/thermo/GeneralSpeciesThermo.h +++ b/include/cantera/thermo/GeneralSpeciesThermo.h @@ -102,7 +102,7 @@ private: protected: typedef std::pair > index_STIT; typedef std::map > STIT_map; - typedef std::map > tpoly_map; + typedef std::map tpoly_map; /** * This is the main data structure, which contains the * SpeciesThermoInterpType objects, sorted by the parameterization type. diff --git a/include/cantera/thermo/GibbsExcessVPSSTP.h b/include/cantera/thermo/GibbsExcessVPSSTP.h index 78a73a4a6..513fa26e5 100644 --- a/include/cantera/thermo/GibbsExcessVPSSTP.h +++ b/include/cantera/thermo/GibbsExcessVPSSTP.h @@ -453,31 +453,31 @@ protected: * Note in order to do this, the setState functions are redefined to always * keep this vector current. */ - mutable std::vector moleFractions_; + mutable vector_fp moleFractions_; //! Storage for the current values of the activity coefficients of the //! species - mutable std::vector lnActCoeff_Scaled_; + mutable vector_fp lnActCoeff_Scaled_; //! Storage for the current derivative values of the //! gradients with respect to temperature of the //! log of the activity coefficients of the species - mutable std::vector dlnActCoeffdT_Scaled_; + mutable vector_fp dlnActCoeffdT_Scaled_; //! Storage for the current derivative values of the //! gradients with respect to temperature of the //! log of the activity coefficients of the species - mutable std::vector d2lnActCoeffdT2_Scaled_; + mutable vector_fp d2lnActCoeffdT2_Scaled_; //! Storage for the current derivative values of the //! gradients with respect to logarithm of the mole fraction of the //! log of the activity coefficients of the species - mutable std::vector dlnActCoeffdlnN_diag_; + mutable vector_fp dlnActCoeffdlnN_diag_; //! Storage for the current derivative values of the //! gradients with respect to logarithm of the mole fraction of the //! log of the activity coefficients of the species - mutable std::vector dlnActCoeffdlnX_diag_; + mutable vector_fp dlnActCoeffdlnX_diag_; //! Storage for the current derivative values of the gradients with respect to logarithm of the species mole number of the //! log of the activity coefficients of the species @@ -487,7 +487,7 @@ protected: mutable Array2D dlnActCoeffdlnN_; //! Temporary storage space that is fair game - mutable std::vector m_pp; + mutable vector_fp m_pp; }; } diff --git a/include/cantera/thermo/HMWSoln.h b/include/cantera/thermo/HMWSoln.h index cbc93e606..df7fc7dd1 100644 --- a/include/cantera/thermo/HMWSoln.h +++ b/include/cantera/thermo/HMWSoln.h @@ -2922,7 +2922,7 @@ private: * * 2 = In a cropped regime where there is no temperature * or pressure dependence */ - mutable std::vector CROP_speciesCropped_; + mutable vector_int CROP_speciesCropped_; //! @} //! Initialize all of the species-dependent lengths in the object diff --git a/include/cantera/thermo/IonsFromNeutralVPSSTP.h b/include/cantera/thermo/IonsFromNeutralVPSSTP.h index ab8265811..5c75b0611 100644 --- a/include/cantera/thermo/IonsFromNeutralVPSSTP.h +++ b/include/cantera/thermo/IonsFromNeutralVPSSTP.h @@ -636,7 +636,7 @@ protected: * This is the number of ions of type i in the neutral * molecule jNeut. */ - std::vector fm_neutralMolec_ions_; + vector_fp fm_neutralMolec_ions_; //! Mapping between ion species and neutral molecule for quick invert. /*! @@ -667,7 +667,7 @@ protected: std::vector fm_invert_ionForNeutral; //! Mole fractions using the Neutral Molecule Mole fraction basis - mutable std::vector NeutralMolecMoleFractions_; + mutable vector_fp NeutralMolecMoleFractions_; //! List of the species in this ThermoPhase which are cation species std::vector cationList_; @@ -705,7 +705,7 @@ private: bool IOwnNThermoPhase_; //! Temporary mole fraction vector - mutable std::vector moleFractionsTmp_; + mutable vector_fp moleFractionsTmp_; //! Storage vector for the neutral molecule chemical potentials /*! @@ -715,7 +715,7 @@ private: * - Units = Joules/kmol * - Length = numNeutralMoleculeSpecies_ */ - mutable std::vector muNeutralMolecule_; + mutable vector_fp muNeutralMolecule_; //! Storage vector for the neutral molecule ln activity coefficients /*! @@ -725,7 +725,7 @@ private: * - Units = none * - Length = numNeutralMoleculeSpecies_ */ - mutable std::vector lnActCoeff_NeutralMolecule_; + mutable vector_fp lnActCoeff_NeutralMolecule_; //! Storage vector for the neutral molecule d ln activity coefficients dT /*! @@ -734,7 +734,7 @@ private: * - Units = 1/Kelvin * - Length = numNeutralMoleculeSpecies_ */ - mutable std::vector dlnActCoeffdT_NeutralMolecule_; + mutable vector_fp dlnActCoeffdT_NeutralMolecule_; //! Storage vector for the neutral molecule d ln activity coefficients dX - diagonal component /*! @@ -743,7 +743,7 @@ private: * - Units = none * - Length = numNeutralMoleculeSpecies_ */ - mutable std::vector dlnActCoeffdlnX_diag_NeutralMolecule_; + mutable vector_fp dlnActCoeffdlnX_diag_NeutralMolecule_; //! Storage vector for the neutral molecule d ln activity coefficients dlnN - diagonal component /*! @@ -752,7 +752,7 @@ private: * - Units = none * - Length = numNeutralMoleculeSpecies_ */ - mutable std::vector dlnActCoeffdlnN_diag_NeutralMolecule_; + mutable vector_fp dlnActCoeffdlnN_diag_NeutralMolecule_; //! Storage vector for the neutral molecule d ln activity coefficients dlnN /*! diff --git a/include/cantera/thermo/LatticeSolidPhase.h b/include/cantera/thermo/LatticeSolidPhase.h index 9e71816da..9659d6218 100644 --- a/include/cantera/thermo/LatticeSolidPhase.h +++ b/include/cantera/thermo/LatticeSolidPhase.h @@ -646,7 +646,7 @@ protected: mutable vector_fp m_x; //! Lattice stoichiometric coefficients - std::vector theta_; + vector_fp theta_; //! Temporary vector mutable vector_fp tmpV_; diff --git a/include/cantera/thermo/MixtureFugacityTP.h b/include/cantera/thermo/MixtureFugacityTP.h index fdc5f2cd4..ec0e88517 100644 --- a/include/cantera/thermo/MixtureFugacityTP.h +++ b/include/cantera/thermo/MixtureFugacityTP.h @@ -797,7 +797,7 @@ protected: /*! * This vector is kept up-to-date when some the setState functions are called. */ - std::vector moleFractions_; + vector_fp moleFractions_; //! Current state of the fluid /*! diff --git a/include/cantera/thermo/MolarityIonicVPSSTP.h b/include/cantera/thermo/MolarityIonicVPSSTP.h index f8e820c79..4b6c5822e 100644 --- a/include/cantera/thermo/MolarityIonicVPSSTP.h +++ b/include/cantera/thermo/MolarityIonicVPSSTP.h @@ -335,7 +335,7 @@ protected: //! index of special species size_t indexSpecialSpecies_; - mutable std::vector PBMoleFractions_; + mutable vector_fp PBMoleFractions_; //! Vector of cation indices in the mixture std::vector cationList_; @@ -345,7 +345,7 @@ protected: std::vector passThroughList_; size_t neutralPBindexStart; - mutable std::vector moleFractionsTmp_; + mutable vector_fp moleFractionsTmp_; }; #define PBTYPE_PASSTHROUGH 0 diff --git a/include/cantera/thermo/PDSS_IonsFromNeutral.h b/include/cantera/thermo/PDSS_IonsFromNeutral.h index 3192db725..ca3cf8a98 100644 --- a/include/cantera/thermo/PDSS_IonsFromNeutral.h +++ b/include/cantera/thermo/PDSS_IonsFromNeutral.h @@ -194,7 +194,7 @@ public: //! Stoichiometric coefficient for this species using the Neutral Molecule Species //! in the vector idNeutralMoleculeVec - std::vector factorVec; + vector_fp factorVec; //! Add 2RTln2 to the entropy and Gibbs free energies for this species /*! @@ -203,7 +203,7 @@ public: bool add2RTln2_; //! Vector of length equal to the number of species in the neutral molecule phase - mutable std::vector tmpNM; + mutable vector_fp tmpNM; //! True if this species is the special species int specialSpecies_; diff --git a/include/cantera/thermo/ThermoPhase.h b/include/cantera/thermo/ThermoPhase.h index eba0eb6cf..9f14ffd0b 100644 --- a/include/cantera/thermo/ThermoPhase.h +++ b/include/cantera/thermo/ThermoPhase.h @@ -1694,7 +1694,7 @@ protected: * The algorithm will pick up the mole fraction vector that is applied from * the state XML file in the input file */ - std::vector xMol_Ref; + vector_fp xMol_Ref; //! last value of the temperature processed by reference state mutable doublereal m_tlast; diff --git a/samples/cxx/flamespeed/flamespeed.cpp b/samples/cxx/flamespeed/flamespeed.cpp index 9af2edac9..75eba82f9 100644 --- a/samples/cxx/flamespeed/flamespeed.cpp +++ b/samples/cxx/flamespeed/flamespeed.cpp @@ -198,7 +198,7 @@ int flamespeed(double phi) flame.value(flowdomain,flow.componentIndex("u"),0) << " m/s" << endl; int np=flow.nPoints(); - std::vector zvec,Tvec,COvec,CO2vec,Uvec; + vector_fp zvec,Tvec,COvec,CO2vec,Uvec; printf("\n%9s\t%8s\t%5s\t%7s\n","z (m)", "T (K)", "U (m/s)", "Y(CO)"); for (int n=0; n & v, +size_t getFloatArray(const XML_Node& node, vector_fp & v, const bool convert, const std::string& unitsString, const std::string& nodeName) { diff --git a/src/equil/MultiPhaseEquil.cpp b/src/equil/MultiPhaseEquil.cpp index d90af79b2..8d8d5d465 100644 --- a/src/equil/MultiPhaseEquil.cpp +++ b/src/equil/MultiPhaseEquil.cpp @@ -709,14 +709,14 @@ void MultiPhaseEquil::reportCSV(const std::string& reportFile) } double Temp = m_mix->temperature(); double pres = m_mix->pressure(); - vector mf(m_nsp_mix, 1.0); - vector fe(m_nsp_mix, 0.0); - std::vector VolPM; - std::vector activity; - std::vector ac; - std::vector mu; - std::vector mu0; - std::vector molalities; + vector_fp mf(m_nsp_mix, 1.0); + vector_fp fe(m_nsp_mix, 0.0); + vector_fp VolPM; + vector_fp activity; + vector_fp ac; + vector_fp mu; + vector_fp mu0; + vector_fp molalities; vol = 0.0; for (size_t iphase = 0; iphase < nphase; iphase++) { diff --git a/src/equil/vcs_MultiPhaseEquil.cpp b/src/equil/vcs_MultiPhaseEquil.cpp index e1dd20180..c1db55003 100644 --- a/src/equil/vcs_MultiPhaseEquil.cpp +++ b/src/equil/vcs_MultiPhaseEquil.cpp @@ -594,12 +594,12 @@ void vcs_MultiPhaseEquil::reportCSV(const std::string& reportFile) #ifdef DEBUG_MODE double* fe = &m_vprob.m_gibbsSpecies[0]; #endif - std::vector VolPM; - std::vector activity; - std::vector ac; - std::vector mu; - std::vector mu0; - std::vector molalities; + vector_fp VolPM; + vector_fp activity; + vector_fp ac; + vector_fp mu; + vector_fp mu0; + vector_fp molalities; vol = 0.0; for (size_t iphase = 0; iphase < nphase; iphase++) { @@ -861,7 +861,7 @@ int vcs_Cantera_to_vprob(MultiPhase* mphase, VCS_PROB* vprob) */ vprob->addPhaseElements(VolPhase); VolPhase->setState_TP(vprob->T, vprob->PresPA); - vector muPhase(tPhase->nSpecies(),0.0); + vector_fp muPhase(tPhase->nSpecies(),0.0); tPhase->getChemPotentials(&muPhase[0]); double tMoles = 0.0; /* @@ -993,7 +993,7 @@ int vcs_Cantera_to_vprob(MultiPhase* mphase, VCS_PROB* vprob) ts_ptr->SSStar_Vol0 = 82.05 * 273.15 / 1.0; } else { - std::vector phaseTermCoeff(nSpPhase, 0.0); + vector_fp phaseTermCoeff(nSpPhase, 0.0); int nCoeff; tPhase->getParameters(nCoeff, &phaseTermCoeff[0]); ts_ptr->SSStar_Vol_Model = VCS_SSVOL_CONSTANT; @@ -1101,7 +1101,7 @@ int vcs_Cantera_update_vprob(MultiPhase* mphase, VCS_PROB* vprob) { size_t totNumPhases = mphase->nPhases(); size_t kT = 0; - std::vector tmpMoles; + vector_fp tmpMoles; // Problem type has yet to be worked out. vprob->prob_type = 0; // Whether we have an estimate or not gets overwritten on @@ -1121,7 +1121,7 @@ int vcs_Cantera_update_vprob(MultiPhase* mphase, VCS_PROB* vprob) volPhase->setElectricPotential(tPhase->electricPotential()); volPhase->setState_TP(vprob->T, vprob->PresPA); - vector muPhase(tPhase->nSpecies(),0.0); + vector_fp muPhase(tPhase->nSpecies(),0.0); tPhase->getChemPotentials(&muPhase[0]); /* * Loop through each species in the current phase diff --git a/src/equil/vcs_VolPhase.cpp b/src/equil/vcs_VolPhase.cpp index 0af9649e3..b7c490fdd 100644 --- a/src/equil/vcs_VolPhase.cpp +++ b/src/equil/vcs_VolPhase.cpp @@ -359,7 +359,7 @@ void vcs_VolPhase::_updateMoleFractionDependencies() } } -const std::vector & vcs_VolPhase::moleFractions() const +const vector_fp & vcs_VolPhase::moleFractions() const { return Xmol_; } @@ -670,8 +670,8 @@ void vcs_VolPhase::_updateLnActCoeffJac() double deltaMoles_j = 0.0; // Make copies of ActCoeff and Xmol_ for use in taking differences - std::vector ActCoeff_Base(ActCoeff); - std::vector Xmol_Base(Xmol_); + vector_fp ActCoeff_Base(ActCoeff); + vector_fp Xmol_Base(Xmol_); double TMoles_base = phaseTotalMoles; /* @@ -809,7 +809,7 @@ void vcs_VolPhase::setCreationMoleNumbers(const double* const n_k, } } -const std::vector & vcs_VolPhase::creationMoleNumbers(std::vector &creationGlobalRxnNumbers) const +const vector_fp& vcs_VolPhase::creationMoleNumbers(std::vector &creationGlobalRxnNumbers) const { creationGlobalRxnNumbers = creationGlobalRxnNumbers_; return creationMoleNumbers_; diff --git a/src/equil/vcs_elem.cpp b/src/equil/vcs_elem.cpp index c3037c744..f81cb7ba9 100644 --- a/src/equil/vcs_elem.cpp +++ b/src/equil/vcs_elem.cpp @@ -101,7 +101,7 @@ int VCS_SOLVE::vcs_elcorr(double aa[], double x[]) int retn = 0; #ifdef DEBUG_MODE - std::vector ga_save(m_elemAbundances); + vector_fp ga_save(m_elemAbundances); if (m_debug_print_lvl >= 2) { plogf(" --- vcsc_elcorr: Element abundances correction routine"); if (m_numElemConstraints != m_numComponents) { diff --git a/src/equil/vcs_inest.cpp b/src/equil/vcs_inest.cpp index 79f1bb3c5..e71152519 100644 --- a/src/equil/vcs_inest.cpp +++ b/src/equil/vcs_inest.cpp @@ -347,10 +347,10 @@ int VCS_SOLVE::vcs_inest_TP() * sa[ne] * aw[m] */ - std::vector sm(m_numElemConstraints*m_numElemConstraints, 0.0); - std::vector ss(m_numElemConstraints, 0.0); - std::vector sa(m_numElemConstraints, 0.0); - std::vector aw(m_numSpeciesTot+ m_numElemConstraints, 0.0); + vector_fp sm(m_numElemConstraints*m_numElemConstraints, 0.0); + vector_fp ss(m_numElemConstraints, 0.0); + vector_fp sa(m_numElemConstraints, 0.0); + vector_fp aw(m_numSpeciesTot+ m_numElemConstraints, 0.0); /* * Go get the estimate of the solution */ diff --git a/src/equil/vcs_phaseStability.cpp b/src/equil/vcs_phaseStability.cpp index a9a62d942..05c492d00 100644 --- a/src/equil/vcs_phaseStability.cpp +++ b/src/equil/vcs_phaseStability.cpp @@ -144,7 +144,7 @@ int VCS_SOLVE::vcs_phasePopDeterminePossibleList() * Cut out components which have a pos stoichiometric value with another species in the phase. */ std::vector< std::vector > zeroedPhaseLinkedZeroComponents(m_numPhases); - std::vector linkedPhases; + vector_int linkedPhases; /* * The logic below calculates zeroedPhaseLinkedZeroComponents */ @@ -376,8 +376,8 @@ int VCS_SOLVE::vcs_popPhaseRxnStepSizes(const size_t iphasePop) m_deltaMolNumSpecies[kspec] = -m_molNumSpecies_old[kspec]; } } else { - vector fracDelta(Vphase->nSpecies()); - vector X_est(Vphase->nSpecies()); + vector_fp fracDelta(Vphase->nSpecies()); + vector_fp X_est(Vphase->nSpecies()); fracDelta = Vphase->creationMoleNumbers(creationGlobalRxnNumbers); double sumFrac = 0.0; @@ -472,15 +472,15 @@ double VCS_SOLVE::vcs_phaseStabilityTest(const size_t iph) // We will do a full Newton calculation later, but for now, ... bool doSuccessiveSubstitution = true; double funcPhaseStability; - vector X_est(nsp, 0.0); - vector delFrac(nsp, 0.0); - vector E_phi(nsp, 0.0); - vector fracDelta_new(nsp, 0.0); - vector fracDelta_old(nsp, 0.0); - vector fracDelta_raw(nsp, 0.0); + vector_fp X_est(nsp, 0.0); + vector_fp delFrac(nsp, 0.0); + vector_fp E_phi(nsp, 0.0); + vector_fp fracDelta_new(nsp, 0.0); + vector_fp fracDelta_old(nsp, 0.0); + vector_fp fracDelta_raw(nsp, 0.0); vector creationGlobalRxnNumbers(nsp, npos); m_deltaGRxn_Deficient = m_deltaGRxn_old; - vector m_feSpecies_Deficient(m_numComponents, 0.0); + vector_fp m_feSpecies_Deficient(m_numComponents, 0.0); doublereal damp = 1.0; doublereal dampOld = 1.0; doublereal normUpdate = 1.0; diff --git a/src/equil/vcs_prep.cpp b/src/equil/vcs_prep.cpp index 5d351af5c..152243eed 100644 --- a/src/equil/vcs_prep.cpp +++ b/src/equil/vcs_prep.cpp @@ -17,7 +17,7 @@ namespace Cantera { void VCS_SOLVE::vcs_SSPhase() { - std::vector numPhSpecies(m_numPhases, 0); + vector_int numPhSpecies(m_numPhases, 0); for (size_t kspec = 0; kspec < m_numSpeciesTot; ++kspec) { numPhSpecies[m_phaseID[kspec]]++; } @@ -145,7 +145,7 @@ int VCS_SOLVE::vcs_prep_oneTime(int printLvl) * This call to BASOPT doesn't calculate the stoichiometric * reaction matrix. */ - std::vector awSpace(m_numSpeciesTot + (m_numElemConstraints + 2)*(m_numElemConstraints), 0.0); + vector_fp awSpace(m_numSpeciesTot + (m_numElemConstraints + 2)*(m_numElemConstraints), 0.0); double* aw = &awSpace[0]; if (aw == NULL) { plogf("vcs_prep_oneTime: failed to get memory: global bailout\n"); diff --git a/src/equil/vcs_prob.cpp b/src/equil/vcs_prob.cpp index 0562036ec..d0ee5555a 100644 --- a/src/equil/vcs_prob.cpp +++ b/src/equil/vcs_prob.cpp @@ -355,12 +355,12 @@ void VCS_PROB::reportCSV(const std::string& reportFile) throw CanteraError("VCS_PROB::reportCSV", "Failure to open file"); } - std::vector volPM(nspecies, 0.0); - std::vector activity(nspecies, 0.0); - std::vector ac(nspecies, 0.0); - std::vector mu(nspecies, 0.0); - std::vector mu0(nspecies, 0.0); - std::vector molalities(nspecies, 0.0); + vector_fp volPM(nspecies, 0.0); + vector_fp activity(nspecies, 0.0); + vector_fp ac(nspecies, 0.0); + vector_fp mu(nspecies, 0.0); + vector_fp mu0(nspecies, 0.0); + vector_fp molalities(nspecies, 0.0); double vol = 0.0; size_t iK = 0; for (size_t iphase = 0; iphase < NPhase; iphase++) { diff --git a/src/equil/vcs_report.cpp b/src/equil/vcs_report.cpp index 381693b48..2d1e8c78b 100644 --- a/src/equil/vcs_report.cpp +++ b/src/equil/vcs_report.cpp @@ -17,7 +17,7 @@ int VCS_SOLVE::vcs_report(int iconv) size_t nspecies = m_numSpeciesTot; char originalUnitsState = m_unitsState; std::vector sortindex(nspecies,0); - std::vector xy(nspecies,0.0); + vector_fp xy(nspecies,0.0); /* ************************************************************** */ /* **** SORT DEPENDENT SPECIES IN DECREASING ORDER OF MOLES ***** */ @@ -189,8 +189,8 @@ int VCS_SOLVE::vcs_report(int iconv) /* * ------------------ TABLE OF PHASE INFORMATION --------------------- */ - std::vector gaPhase(m_numElemConstraints, 0.0); - std::vector gaTPhase(m_numElemConstraints, 0.0); + vector_fp gaPhase(m_numElemConstraints, 0.0); + vector_fp gaTPhase(m_numElemConstraints, 0.0); double totalMoles = 0.0; double gibbsPhase = 0.0; double gibbsTotal = 0.0; diff --git a/src/equil/vcs_setMolesLinProg.cpp b/src/equil/vcs_setMolesLinProg.cpp index 5f90e744f..43065df24 100644 --- a/src/equil/vcs_setMolesLinProg.cpp +++ b/src/equil/vcs_setMolesLinProg.cpp @@ -15,8 +15,8 @@ namespace Cantera { static void printProgress(const vector &spName, - const vector &soln, - const vector &ff) + const vector_fp &soln, + const vector_fp &ff) { double sum = 0.0; plogf(" --- Summary of current progress:\n"); @@ -51,11 +51,11 @@ int VCS_SOLVE::vcs_setMolesLinProg() int iter = 0; bool abundancesOK = true; bool usedZeroedSpecies; - std::vector sm(m_numElemConstraints*m_numElemConstraints, 0.0); - std::vector ss(m_numElemConstraints, 0.0); - std::vector sa(m_numElemConstraints, 0.0); - std::vector wx(m_numElemConstraints, 0.0); - std::vector aw(m_numSpeciesTot, 0.0); + vector_fp sm(m_numElemConstraints*m_numElemConstraints, 0.0); + vector_fp ss(m_numElemConstraints, 0.0); + vector_fp sa(m_numElemConstraints, 0.0); + vector_fp wx(m_numElemConstraints, 0.0); + vector_fp aw(m_numSpeciesTot, 0.0); for (ik = 0; ik < m_numSpeciesTot; ik++) { if (m_speciesUnknownType[ik] != VCS_SPECIES_INTERFACIALVOLTAGE) { diff --git a/src/equil/vcs_solve.cpp b/src/equil/vcs_solve.cpp index 295ba912a..df98c3c08 100644 --- a/src/equil/vcs_solve.cpp +++ b/src/equil/vcs_solve.cpp @@ -891,7 +891,7 @@ int VCS_SOLVE::vcs_prob_update(VCS_PROB* pub) pubPhase->setMoleFractionsState(vPhase->totalMoles(), &vPhase->moleFractions()[0], VCS_STATECALC_TMP); - const std::vector & mfVector = pubPhase->moleFractions(); + const vector_fp & mfVector = pubPhase->moleFractions(); for (size_t k = 0; k < pubPhase->nSpecies(); k++) { kT = pubPhase->spGlobalIndexVCS(k); pub->mf[kT] = mfVector[k]; diff --git a/src/equil/vcs_solve_TP.cpp b/src/equil/vcs_solve_TP.cpp index ecb2d1205..54c482430 100644 --- a/src/equil/vcs_solve_TP.cpp +++ b/src/equil/vcs_solve_TP.cpp @@ -29,7 +29,7 @@ namespace Cantera void VCS_SOLVE::checkDelta1(double* const dsLocal, double* const delTPhMoles, size_t kspec) { - std::vector dchange(m_numPhases, 0.0); + vector_fp dchange(m_numPhases, 0.0); for (size_t k = 0; k < kspec; k++) { if (m_speciesUnknownType[k] != VCS_SPECIES_TYPE_INTERFACIALVOLTAGE) { size_t iph = m_phaseID[k]; @@ -3568,7 +3568,7 @@ void VCS_SOLVE::vcs_printSpeciesChemPot(const int stateCalc) const #ifdef DEBUG_MODE void VCS_SOLVE::prneav() const { - std::vector eav(m_numElemConstraints, 0.0); + vector_fp eav(m_numElemConstraints, 0.0); for (size_t j = 0; j < m_numElemConstraints; ++j) { for (size_t i = 0; i < m_numSpeciesTot; ++i) { diff --git a/src/equil/vcs_solve_phaseStability.cpp b/src/equil/vcs_solve_phaseStability.cpp index ca1bb8ed5..025779d87 100644 --- a/src/equil/vcs_solve_phaseStability.cpp +++ b/src/equil/vcs_solve_phaseStability.cpp @@ -138,11 +138,11 @@ int VCS_SOLVE::vcs_solve_phaseStability(const int iph, const int ifunc, bool usedZeroedSpecies; int iStab = 0; - std::vector sm(m_numElemConstraints*m_numElemConstraints, 0.0); - std::vector ss(m_numElemConstraints, 0.0); - std::vector sa(m_numElemConstraints, 0.0); - std::vector aw(m_numSpeciesTot, 0.0); - std::vector wx(m_numElemConstraints, 0.0); + vector_fp sm(m_numElemConstraints*m_numElemConstraints, 0.0); + vector_fp ss(m_numElemConstraints, 0.0); + vector_fp sa(m_numElemConstraints, 0.0); + vector_fp aw(m_numSpeciesTot, 0.0); + vector_fp wx(m_numElemConstraints, 0.0); vcs_basopt(false, &aw[0], &sa[0], &sm[0], &ss[0], test, &usedZeroedSpecies); diff --git a/src/equil/vcs_util.cpp b/src/equil/vcs_util.cpp index 76b28d859..2221cf339 100644 --- a/src/equil/vcs_util.cpp +++ b/src/equil/vcs_util.cpp @@ -20,14 +20,14 @@ using namespace std; namespace Cantera { -double vcs_l2norm(const std::vector vec) +double vcs_l2norm(const vector_fp vec) { size_t len = vec.size(); if (len == 0) { return 0.0; } double sum = 0.0; - std::vector::const_iterator pos; + vector_fp::const_iterator pos; for (pos = vec.begin(); pos != vec.end(); ++pos) { sum += (*pos) * (*pos); } diff --git a/src/kinetics/InterfaceKinetics.cpp b/src/kinetics/InterfaceKinetics.cpp index 40bda7bbd..419cd0797 100644 --- a/src/kinetics/InterfaceKinetics.cpp +++ b/src/kinetics/InterfaceKinetics.cpp @@ -1023,7 +1023,7 @@ void InterfaceKinetics::setPhaseStability(const size_t iphase, const int isStabl } } -void InterfaceKinetics::determineFwdOrdersBV(ElectrochemicalReaction& r, std::vector& fwdFullOrders) +void InterfaceKinetics::determineFwdOrdersBV(ElectrochemicalReaction& r, vector_fp& fwdFullOrders) { // Start out with the full ROP orders vector. // This vector will have the BV exchange current density orders in it. diff --git a/src/thermo/IonsFromNeutralVPSSTP.cpp b/src/thermo/IonsFromNeutralVPSSTP.cpp index 707466efa..b3bdf357f 100644 --- a/src/thermo/IonsFromNeutralVPSSTP.cpp +++ b/src/thermo/IonsFromNeutralVPSSTP.cpp @@ -755,10 +755,10 @@ void IonsFromNeutralVPSSTP::initLengths() * @param nElementsI */ static double factorOverlap(const std::vector& elnamesVN , - const std::vector& elemVectorN, + const vector_fp& elemVectorN, const size_t nElementsN, const std::vector& elnamesVI , - const std::vector& elemVectorI, + const vector_fp& elemVectorI, const size_t nElementsI) { double fMax = 1.0E100; @@ -862,14 +862,14 @@ void IonsFromNeutralVPSSTP::initThermoXML(XML_Node& phaseNode, const std::string size_t nElementsN = neutralMoleculePhase_->nElements(); const std::vector& elnamesVN = neutralMoleculePhase_->elementNames(); - std::vector elemVectorN(nElementsN); - std::vector elemVectorN_orig(nElementsN); + vector_fp elemVectorN(nElementsN); + vector_fp elemVectorN_orig(nElementsN); size_t nElementsI = nElements(); const std::vector& elnamesVI = elementNames(); - std::vector elemVectorI(nElementsI); + vector_fp elemVectorI(nElementsI); - vector fm_tmp(m_kk); + vector_fp fm_tmp(m_kk); for (size_t k = 0; k < m_kk; k++) { fm_invert_ionForNeutral[k] = npos; } diff --git a/src/thermo/LatticeSolidPhase.cpp b/src/thermo/LatticeSolidPhase.cpp index d59adc77f..616042447 100644 --- a/src/thermo/LatticeSolidPhase.cpp +++ b/src/thermo/LatticeSolidPhase.cpp @@ -335,7 +335,7 @@ void LatticeSolidPhase::installSlavePhases(XML_Node* phaseNode) std::vector lattices = la.getChildren("phase"); for (size_t n = 0; n < m_nlattice; n++) { LatticePhase* lp = m_lattice[n]; - vector constArr(lp->nElements()); + vector_fp constArr(lp->nElements()); const vector_fp& aws = lp->atomicWeights(); for (size_t es = 0; es < lp->nElements(); es++) { addElement(lp->elementName(es), aws[es], lp->atomicNumber(es), diff --git a/src/thermo/ThermoFactory.cpp b/src/thermo/ThermoFactory.cpp index c23d5594d..e55738634 100644 --- a/src/thermo/ThermoFactory.cpp +++ b/src/thermo/ThermoFactory.cpp @@ -211,7 +211,7 @@ ThermoPhase* newPhase(const std::string& infile, std::string id) */ static void formSpeciesXMLNodeList(std::vector &spDataNodeList, std::vector &spNamesList, - std::vector &spRuleList, + vector_int &spRuleList, const std::vector spArray_names, const std::vector spArray_dbases, const vector_int sprule) @@ -437,7 +437,7 @@ void importPhase(XML_Node& phase, ThermoPhase* th) // The logic is complicated enough that we put it in a separate routine. std::vector spDataNodeList; std::vector spNamesList; - std::vector spRuleList; + vector_int spRuleList; formSpeciesXMLNodeList(spDataNodeList, spNamesList, spRuleList, sparrays, dbases, sprule); diff --git a/src/thermo/ThermoPhase.cpp b/src/thermo/ThermoPhase.cpp index 1ae9dbcdb..6b7c873cd 100644 --- a/src/thermo/ThermoPhase.cpp +++ b/src/thermo/ThermoPhase.cpp @@ -837,14 +837,14 @@ void ThermoPhase::getdlnActCoeffdlnN_numderiv(const size_t ld, doublereal* const /* * Evaluate the current base activity coefficients if necessary */ - std::vector ActCoeff_Base(m_kk); + vector_fp ActCoeff_Base(m_kk); getActivityCoefficients(DATA_PTR(ActCoeff_Base)); - std::vector Xmol_Base(m_kk); + vector_fp Xmol_Base(m_kk); getMoleFractions(DATA_PTR(Xmol_Base)); // Make copies of ActCoeff and Xmol_ for use in taking differences - std::vector ActCoeff(m_kk); - std::vector Xmol(m_kk); + vector_fp ActCoeff(m_kk); + vector_fp Xmol(m_kk); double v_totalMoles = 1.0; double TMoles_base = v_totalMoles; diff --git a/src/transport/HighPressureGasTransport.cpp b/src/transport/HighPressureGasTransport.cpp index eed66e07f..e675f16bd 100755 --- a/src/transport/HighPressureGasTransport.cpp +++ b/src/transport/HighPressureGasTransport.cpp @@ -42,10 +42,10 @@ double HighPressureGasTransport::thermalConductivity() vector_fp cp_0_R(nsp); m_thermo->getCp_R_ref(&cp_0_R[0]); - std::vector L_i(nsp); - std::vector f_i(nsp); - std::vector h_i(nsp); - std::vector V_k(nsp); + vector_fp L_i(nsp); + vector_fp f_i(nsp); + vector_fp h_i(nsp); + vector_fp V_k(nsp); m_thermo -> getPartialMolarVolumes(&V_k[0]); doublereal L_i_min = BigNumber; @@ -135,7 +135,7 @@ void HighPressureGasTransport::getThermalDiffCoeffs(doublereal* const dt) void HighPressureGasTransport::getBinaryDiffCoeffs(const size_t ld, doublereal* const d) { doublereal P_corr_ij, Tr_ij, Pr_ij; - std::vector PcP(5); + vector_fp PcP(5); size_t nsp = m_thermo->nSpecies(); vector_fp molefracs(nsp); m_thermo->getMoleFractions(&molefracs[0]); diff --git a/src/transport/LiquidTranInteraction.cpp b/src/transport/LiquidTranInteraction.cpp index ef23a13ef..d788ad14d 100644 --- a/src/transport/LiquidTranInteraction.cpp +++ b/src/transport/LiquidTranInteraction.cpp @@ -560,8 +560,8 @@ void LTI_StefanMaxwell_PPN::getMatrixTransProp(DenseMatrix& mat, doublereal* spe ions_thermo->getAnionList(anion); // Reaction Coeffs and Charges - std::vector viS(6); - std::vector charges(3); + vector_fp viS(6); + vector_fp charges(3); std::vector neutMolIndex(3); ions_thermo->getDissociationCoeffs(viS,charges,neutMolIndex); diff --git a/test/thermo/MaskellSolidSolnPhase_Test.cpp b/test/thermo/MaskellSolidSolnPhase_Test.cpp index 5110c81f9..f75046d1e 100644 --- a/test/thermo/MaskellSolidSolnPhase_Test.cpp +++ b/test/thermo/MaskellSolidSolnPhase_Test.cpp @@ -22,7 +22,7 @@ public: } void set_r(const double r) { - std::vector moleFracs(2); + vector_fp moleFracs(2); moleFracs[0] = r; moleFracs[1] = 1-r; test_phase->setMoleFractions(&moleFracs[0]); @@ -30,7 +30,7 @@ public: void check_chemPotentials(const double expected_result[9]) { - std::vector chemPotentials(2); + vector_fp chemPotentials(2); for(int i=0; i < 9; ++i) { const double r = 0.1 * (i+1); @@ -83,7 +83,7 @@ TEST_F(MaskellSolidSolnPhase_Test, partialMolarVolumes) initializeTestPhaseWithXML(valid_file); ASSERT_TRUE(dynamic_cast(test_phase) != NULL); - std::vector pmv(2); + vector_fp pmv(2); test_phase->getPartialMolarVolumes(&pmv[0]); EXPECT_EQ(0.005, pmv[0]); EXPECT_EQ(0.01, pmv[1]); @@ -101,9 +101,9 @@ TEST_F(MaskellSolidSolnPhase_Test, activityCoeffs) // Test that mu0 + RT log(activityCoeff * MoleFrac) == mu const double RT = GasConstant * 298.; - std::vector mu0(2); - std::vector activityCoeffs(2); - std::vector chemPotentials(2); + vector_fp mu0(2); + vector_fp activityCoeffs(2); + vector_fp chemPotentials(2); for(int i=0; i < 9; ++i) { const double r = 0.1 * (i+1); @@ -133,9 +133,9 @@ TEST_F(MaskellSolidSolnPhase_Test, activityConcentrations) ASSERT_TRUE(dynamic_cast(test_phase) != NULL); // Check to make sure activityConcentration_i == standardConcentration_i * gamma_i * X_i - std::vector standardConcs(2); - std::vector activityCoeffs(2); - std::vector activityConcentrations(2); + vector_fp standardConcs(2); + vector_fp activityCoeffs(2); + vector_fp activityConcentrations(2); for(int i=0; i < 9; ++i) { const double r = 0.1 * (i+1); diff --git a/test/thermo/ThermoPhase_Test.cpp b/test/thermo/ThermoPhase_Test.cpp index a092e1c90..b2bd84fc4 100644 --- a/test/thermo/ThermoPhase_Test.cpp +++ b/test/thermo/ThermoPhase_Test.cpp @@ -28,13 +28,13 @@ TEST_F(ThermoPhase_Fixture, SetAndGetElementPotentials) initializeElements(); // Check that getElementPotentials returns false if no element potentials have been set yet. - std::vector getLambda(3); + vector_fp getLambda(3); EXPECT_FALSE(test_phase.getElementPotentials(&getLambda[0])); - std::vector tooSmall(2); + vector_fp tooSmall(2); EXPECT_THROW(test_phase.setElementPotentials(tooSmall), CanteraError); - std::vector setLambda(3); + vector_fp setLambda(3); setLambda[0] = 1.; setLambda[1] = 2.; setLambda[2] = 3.; diff --git a/test/thermo/nasapoly.cpp b/test/thermo/nasapoly.cpp index c226b09c6..8864d9c57 100644 --- a/test/thermo/nasapoly.cpp +++ b/test/thermo/nasapoly.cpp @@ -48,7 +48,7 @@ protected: } NasaPoly1 poly; - std::vector tpow_; + vector_fp tpow_; }; TEST_F(NasaPoly1Test, Initialization) diff --git a/test_problems/ChemEquil_ionizedGas/ionizedGasEquil.cpp b/test_problems/ChemEquil_ionizedGas/ionizedGasEquil.cpp index 24d69a9ca..1a6e4908e 100644 --- a/test_problems/ChemEquil_ionizedGas/ionizedGasEquil.cpp +++ b/test_problems/ChemEquil_ionizedGas/ionizedGasEquil.cpp @@ -34,7 +34,7 @@ int main(int argc, char** argv) int ni = 7; FILE* FF = fopen("table.csv","w"); size_t kk = gas->nSpecies(); - std::vector Xmol(kk, 0.0); + vector_fp Xmol(kk, 0.0); const std::vector &snames = gas->speciesNames(); fprintf(FF,"Temperature, Pressure,"); for (size_t k = 0; k < kk; k++) {