Consistently use vector_fp and vector_int typedefs
This commit is contained in:
parent
ceefc5ecb0
commit
bfb20e1f50
49 changed files with 199 additions and 200 deletions
|
|
@ -127,7 +127,7 @@ public:
|
|||
/*!
|
||||
* This operation will add a column onto the existing matrix.
|
||||
*
|
||||
* @param c This vector<doublereal> 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.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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<doublereal> & v,
|
||||
size_t getFloatArray(const XML_Node& node, vector_fp & v,
|
||||
const bool convert=true, const std::string& unitsString="",
|
||||
const std::string& nodeName = "floatArray");
|
||||
|
||||
|
|
|
|||
|
|
@ -308,8 +308,8 @@ inline void sum_each(OutputIter x_begin, OutputIter x_end,
|
|||
* Example:
|
||||
*
|
||||
* \code
|
||||
* vector<double> x(3), y(20);
|
||||
* vector<int> index(3);
|
||||
* vector_fp x(3), y(20);
|
||||
* vector_int index(3);
|
||||
* index[0] = 9;
|
||||
* index[1] = 2;
|
||||
* index[3] = 16;
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
#ifndef VCS_SPECIES_PROPERTIES_H
|
||||
#define VCS_SPECIES_PROPERTIES_H
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#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<double> FormulaMatrixCol;
|
||||
vector_fp FormulaMatrixCol;
|
||||
|
||||
double Charge; /* Charge state of the species -> This may
|
||||
be duplication of what's in the
|
||||
|
|
|
|||
|
|
@ -343,7 +343,7 @@ private:
|
|||
|
||||
public:
|
||||
//! Return a const reference to the mole fractions stored in the object.
|
||||
const std::vector<double> & 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<double> & creationMoleNumbers(std::vector<size_t> &creationGlobalRxnNumbers) const;
|
||||
const vector_fp & creationMoleNumbers(std::vector<size_t> &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<int> 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<int> 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<int> 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<double> Xmol_;
|
||||
vector_fp Xmol_;
|
||||
|
||||
//! Vector of current creationMoleNumbers_
|
||||
/*!
|
||||
* These are the actual unknowns in the phase stability problem
|
||||
*/
|
||||
std::vector<double> 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<double> 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<double> StarChemicalPotential;
|
||||
mutable vector_fp StarChemicalPotential;
|
||||
|
||||
//! Vector of the Star molar Volumes of the species. units m3 / kmol
|
||||
mutable std::vector<double> StarMolarVol;
|
||||
mutable vector_fp StarMolarVol;
|
||||
|
||||
//! Vector of the Partial molar Volumes of the species. units m3 / kmol
|
||||
mutable std::vector<double> 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<double> 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
|
||||
|
|
|
|||
|
|
@ -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<double> vec);
|
||||
double vcs_l2norm(const vector_fp vec);
|
||||
|
||||
//! Finds the location of the maximum component in a double vector
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public:
|
|||
* This is a calculated output quantity. length = number of species.
|
||||
* units = m_VCS_UnitsFormat
|
||||
*/
|
||||
std::vector<double> 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<double> w;
|
||||
vector_fp w;
|
||||
|
||||
//! Mole fraction vector
|
||||
/*!
|
||||
* This is a calculated vector, calculated from w[].
|
||||
* length number of species.
|
||||
*/
|
||||
std::vector<double> 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<double> 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<int> 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<double> VolPM;
|
||||
vector_fp VolPM;
|
||||
|
||||
//! Units for the chemical potential data, pressure data, volume,
|
||||
//! and species amounts
|
||||
|
|
@ -171,23 +171,23 @@ public:
|
|||
std::vector<std::string> ElName;
|
||||
|
||||
//! vector of Element types
|
||||
std::vector<int> m_elType;
|
||||
vector_int m_elType;
|
||||
|
||||
//! Specifies whether an element constraint is active
|
||||
/*!
|
||||
* The default is true
|
||||
* Length = nelements
|
||||
*/
|
||||
std::vector<int> ElActive;
|
||||
vector_int ElActive;
|
||||
|
||||
//! Molecular weight of species
|
||||
/*!
|
||||
* WtSpecies[k] = molecular weight of species in gm/mol
|
||||
*/
|
||||
std::vector<double> WtSpecies;
|
||||
vector_fp WtSpecies;
|
||||
|
||||
//! Charge of each species
|
||||
std::vector<double> Charge;
|
||||
vector_fp Charge;
|
||||
|
||||
//! Array of phase structures
|
||||
std::vector<vcs_VolPhase*> VPhaseList;
|
||||
|
|
|
|||
|
|
@ -1420,11 +1420,11 @@ private:
|
|||
int& rangeErrorFound);
|
||||
|
||||
// data used by vcs_solve_TP and it's helper functions
|
||||
std::vector<double> m_sm;
|
||||
std::vector<double> m_ss;
|
||||
std::vector<double> m_sa;
|
||||
std::vector<double> m_aw;
|
||||
std::vector<double> 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<double> 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<double> 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<double> 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<double> 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<double> 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<double> 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<int> 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<double> 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<double> 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<double> m_deltaGRxn_new;
|
||||
vector_fp m_deltaGRxn_new;
|
||||
|
||||
//! Last deltag[irxn] from the previous step
|
||||
std::vector<double> 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<double> 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<double> 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<double> m_deltaMolNumSpecies;
|
||||
vector_fp m_deltaMolNumSpecies;
|
||||
|
||||
//! Element abundances vector
|
||||
/*!
|
||||
|
|
@ -1626,7 +1626,7 @@ public:
|
|||
* is considered a constant from thereon.
|
||||
* units = kmoles
|
||||
*/
|
||||
std::vector<double> 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<double> m_elemAbundancesGoal;
|
||||
vector_fp m_elemAbundancesGoal;
|
||||
|
||||
//! Total number of kmoles in all phases
|
||||
/*!
|
||||
|
|
@ -1650,7 +1650,7 @@ public:
|
|||
*
|
||||
* Length = number of phases
|
||||
*/
|
||||
std::vector<double> 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<double> m_tPhaseMoles_new;
|
||||
vector_fp m_tPhaseMoles_new;
|
||||
|
||||
//! Temporary vector of length NPhase
|
||||
mutable std::vector<double> m_TmpPhase;
|
||||
mutable vector_fp m_TmpPhase;
|
||||
|
||||
//! Temporary vector of length NPhase
|
||||
mutable std::vector<double> m_TmpPhase2;
|
||||
mutable vector_fp m_TmpPhase2;
|
||||
|
||||
//! Change in the total moles in each phase
|
||||
/*!
|
||||
* Length number of phases.
|
||||
*/
|
||||
std::vector<double> 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<double> 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<int> m_speciesStatus;
|
||||
vector_int m_speciesStatus;
|
||||
|
||||
//! Mapping from the species number to the phase number
|
||||
std::vector<size_t> m_phaseID;
|
||||
|
|
@ -1800,13 +1800,13 @@ public:
|
|||
* that a species has neg 0 or pos value of that constraint (other than
|
||||
* charge)
|
||||
*/
|
||||
std::vector<int> m_elType;
|
||||
vector_int m_elType;
|
||||
|
||||
//! Specifies whether an element constraint is active
|
||||
/*!
|
||||
* The default is true. Length = nelements
|
||||
*/
|
||||
std::vector<int> m_elementActive;
|
||||
vector_int m_elementActive;
|
||||
|
||||
//! Array of Phase Structures. Length = number of phases.
|
||||
std::vector<vcs_VolPhase*> m_VolPhaseList;
|
||||
|
|
@ -1837,7 +1837,7 @@ public:
|
|||
*
|
||||
* length = number of species
|
||||
*/
|
||||
std::vector<int> m_actConventionSpecies;
|
||||
vector_int m_actConventionSpecies;
|
||||
|
||||
//! specifies the activity convention of the phase.
|
||||
/*!
|
||||
|
|
@ -1846,25 +1846,25 @@ public:
|
|||
*
|
||||
* length = number of phases
|
||||
*/
|
||||
std::vector<int> 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<double> m_lnMnaughtSpecies;
|
||||
vector_fp m_lnMnaughtSpecies;
|
||||
|
||||
//! Molar-based Activity Coefficients for Species.
|
||||
//! Length = number of species
|
||||
std::vector<double> 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<double> 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<double> m_wtSpecies;
|
||||
vector_fp m_wtSpecies;
|
||||
|
||||
//! Charge of each species. Length = number of species.
|
||||
std::vector<double> m_chargeSpecies;
|
||||
vector_fp m_chargeSpecies;
|
||||
|
||||
std::vector<std::vector<size_t> > phasePopProblemLists_;
|
||||
|
||||
|
|
@ -1913,7 +1913,7 @@ public:
|
|||
* units = mks (m^3/kmol) -determined by m_VCS_UnitsFormat
|
||||
* Length = number of species
|
||||
*/
|
||||
std::vector<double> m_PMVolumeSpecies;
|
||||
vector_fp m_PMVolumeSpecies;
|
||||
|
||||
//! dimensionless value of Faraday's constant, F / RT (1/volt)
|
||||
double m_Faraday_dim;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public:
|
|||
Group(size_t n) : m_sign(0) {
|
||||
m_comp.resize(n,0);
|
||||
}
|
||||
Group(const std::vector<int>& elnumbers) :
|
||||
Group(const vector_int& elnumbers) :
|
||||
m_comp(elnumbers), m_sign(0) {
|
||||
validate();
|
||||
}
|
||||
|
|
@ -130,7 +130,7 @@ public:
|
|||
const Group& g);
|
||||
|
||||
private:
|
||||
std::vector<int> m_comp;
|
||||
vector_int m_comp;
|
||||
int m_sign;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -639,7 +639,7 @@ protected:
|
|||
*
|
||||
* length = number of phases in the object. By default all phases are stable.
|
||||
*/
|
||||
std::vector<int> m_phaseIsStable;
|
||||
vector_int m_phaseIsStable;
|
||||
|
||||
//! Vector of vector of booleans indicating whether a phase participates in a
|
||||
//! reaction as a reactant
|
||||
|
|
|
|||
|
|
@ -320,7 +320,7 @@ protected:
|
|||
std::vector<std::vector<size_t> > m_reac;
|
||||
std::vector<std::vector<size_t> > m_prod;
|
||||
DenseMatrix m_elatoms;
|
||||
std::vector<std::vector<int> > m_groups;
|
||||
std::vector<vector_int> m_groups;
|
||||
std::vector<Group> m_sgroup;
|
||||
std::vector<std::string> m_elementSymbols;
|
||||
std::map<size_t, std::map<size_t, std::map<size_t, Group> > > m_transfer;
|
||||
|
|
|
|||
|
|
@ -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<int> m_alg;
|
||||
vector_int m_alg;
|
||||
std::map<int, int> m_constrain;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ public:
|
|||
vector_fp work;
|
||||
|
||||
//! Integer work vector for QR algorithms
|
||||
std::vector<int> iwork_;
|
||||
vector_int iwork_;
|
||||
protected:
|
||||
//! 1-norm of the matrix. This is determined immediately before every factorization
|
||||
doublereal a1norm_;
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ private:
|
|||
protected:
|
||||
typedef std::pair<size_t, shared_ptr<SpeciesThermoInterpType> > index_STIT;
|
||||
typedef std::map<int, std::vector<index_STIT> > STIT_map;
|
||||
typedef std::map<int, std::vector<double> > tpoly_map;
|
||||
typedef std::map<int, vector_fp> tpoly_map;
|
||||
/**
|
||||
* This is the main data structure, which contains the
|
||||
* SpeciesThermoInterpType objects, sorted by the parameterization type.
|
||||
|
|
|
|||
|
|
@ -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<doublereal> moleFractions_;
|
||||
mutable vector_fp moleFractions_;
|
||||
|
||||
//! Storage for the current values of the activity coefficients of the
|
||||
//! species
|
||||
mutable std::vector<doublereal> 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<doublereal> 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<doublereal> 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<doublereal> 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<doublereal> 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<doublereal> m_pp;
|
||||
mutable vector_fp m_pp;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2922,7 +2922,7 @@ private:
|
|||
* * 2 = In a cropped regime where there is no temperature
|
||||
* or pressure dependence
|
||||
*/
|
||||
mutable std::vector<int> CROP_speciesCropped_;
|
||||
mutable vector_int CROP_speciesCropped_;
|
||||
//! @}
|
||||
|
||||
//! Initialize all of the species-dependent lengths in the object
|
||||
|
|
|
|||
|
|
@ -636,7 +636,7 @@ protected:
|
|||
* This is the number of ions of type i in the neutral
|
||||
* molecule jNeut.
|
||||
*/
|
||||
std::vector<double> 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<size_t> fm_invert_ionForNeutral;
|
||||
|
||||
//! Mole fractions using the Neutral Molecule Mole fraction basis
|
||||
mutable std::vector<doublereal> NeutralMolecMoleFractions_;
|
||||
mutable vector_fp NeutralMolecMoleFractions_;
|
||||
|
||||
//! List of the species in this ThermoPhase which are cation species
|
||||
std::vector<size_t> cationList_;
|
||||
|
|
@ -705,7 +705,7 @@ private:
|
|||
bool IOwnNThermoPhase_;
|
||||
|
||||
//! Temporary mole fraction vector
|
||||
mutable std::vector<doublereal> 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<doublereal> 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<doublereal> 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<doublereal> 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<doublereal> 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<doublereal> dlnActCoeffdlnN_diag_NeutralMolecule_;
|
||||
mutable vector_fp dlnActCoeffdlnN_diag_NeutralMolecule_;
|
||||
|
||||
//! Storage vector for the neutral molecule d ln activity coefficients dlnN
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -646,7 +646,7 @@ protected:
|
|||
mutable vector_fp m_x;
|
||||
|
||||
//! Lattice stoichiometric coefficients
|
||||
std::vector<doublereal> theta_;
|
||||
vector_fp theta_;
|
||||
|
||||
//! Temporary vector
|
||||
mutable vector_fp tmpV_;
|
||||
|
|
|
|||
|
|
@ -797,7 +797,7 @@ protected:
|
|||
/*!
|
||||
* This vector is kept up-to-date when some the setState functions are called.
|
||||
*/
|
||||
std::vector<doublereal> moleFractions_;
|
||||
vector_fp moleFractions_;
|
||||
|
||||
//! Current state of the fluid
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -335,7 +335,7 @@ protected:
|
|||
//! index of special species
|
||||
size_t indexSpecialSpecies_;
|
||||
|
||||
mutable std::vector<doublereal> PBMoleFractions_;
|
||||
mutable vector_fp PBMoleFractions_;
|
||||
|
||||
//! Vector of cation indices in the mixture
|
||||
std::vector<size_t> cationList_;
|
||||
|
|
@ -345,7 +345,7 @@ protected:
|
|||
std::vector<size_t> passThroughList_;
|
||||
size_t neutralPBindexStart;
|
||||
|
||||
mutable std::vector<doublereal> moleFractionsTmp_;
|
||||
mutable vector_fp moleFractionsTmp_;
|
||||
};
|
||||
|
||||
#define PBTYPE_PASSTHROUGH 0
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ public:
|
|||
|
||||
//! Stoichiometric coefficient for this species using the Neutral Molecule Species
|
||||
//! in the vector idNeutralMoleculeVec
|
||||
std::vector<double> 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<double> tmpNM;
|
||||
mutable vector_fp tmpNM;
|
||||
|
||||
//! True if this species is the special species
|
||||
int specialSpecies_;
|
||||
|
|
|
|||
|
|
@ -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<doublereal> xMol_Ref;
|
||||
vector_fp xMol_Ref;
|
||||
|
||||
//! last value of the temperature processed by reference state
|
||||
mutable doublereal m_tlast;
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ int flamespeed(double phi)
|
|||
flame.value(flowdomain,flow.componentIndex("u"),0) << " m/s" << endl;
|
||||
|
||||
int np=flow.nPoints();
|
||||
std::vector<doublereal> 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<np; n++) {
|
||||
|
|
|
|||
|
|
@ -301,7 +301,7 @@ int getInteger(const XML_Node& parent, const std::string& name)
|
|||
return x;
|
||||
}
|
||||
|
||||
size_t getFloatArray(const XML_Node& node, std::vector<doublereal> & v,
|
||||
size_t getFloatArray(const XML_Node& node, vector_fp & v,
|
||||
const bool convert, const std::string& unitsString,
|
||||
const std::string& nodeName)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -709,14 +709,14 @@ void MultiPhaseEquil::reportCSV(const std::string& reportFile)
|
|||
}
|
||||
double Temp = m_mix->temperature();
|
||||
double pres = m_mix->pressure();
|
||||
vector<double> mf(m_nsp_mix, 1.0);
|
||||
vector<double> fe(m_nsp_mix, 0.0);
|
||||
std::vector<double> VolPM;
|
||||
std::vector<double> activity;
|
||||
std::vector<double> ac;
|
||||
std::vector<double> mu;
|
||||
std::vector<double> mu0;
|
||||
std::vector<double> 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++) {
|
||||
|
|
|
|||
|
|
@ -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<double> VolPM;
|
||||
std::vector<double> activity;
|
||||
std::vector<double> ac;
|
||||
std::vector<double> mu;
|
||||
std::vector<double> mu0;
|
||||
std::vector<double> 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<double> 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<double> 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<double> 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<double> muPhase(tPhase->nSpecies(),0.0);
|
||||
vector_fp muPhase(tPhase->nSpecies(),0.0);
|
||||
tPhase->getChemPotentials(&muPhase[0]);
|
||||
/*
|
||||
* Loop through each species in the current phase
|
||||
|
|
|
|||
|
|
@ -359,7 +359,7 @@ void vcs_VolPhase::_updateMoleFractionDependencies()
|
|||
}
|
||||
}
|
||||
|
||||
const std::vector<double> & 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<double> ActCoeff_Base(ActCoeff);
|
||||
std::vector<double> 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<double> & vcs_VolPhase::creationMoleNumbers(std::vector<size_t> &creationGlobalRxnNumbers) const
|
||||
const vector_fp& vcs_VolPhase::creationMoleNumbers(std::vector<size_t> &creationGlobalRxnNumbers) const
|
||||
{
|
||||
creationGlobalRxnNumbers = creationGlobalRxnNumbers_;
|
||||
return creationMoleNumbers_;
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ int VCS_SOLVE::vcs_elcorr(double aa[], double x[])
|
|||
int retn = 0;
|
||||
|
||||
#ifdef DEBUG_MODE
|
||||
std::vector<double> 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) {
|
||||
|
|
|
|||
|
|
@ -347,10 +347,10 @@ int VCS_SOLVE::vcs_inest_TP()
|
|||
* sa[ne]
|
||||
* aw[m]
|
||||
*/
|
||||
std::vector<double> sm(m_numElemConstraints*m_numElemConstraints, 0.0);
|
||||
std::vector<double> ss(m_numElemConstraints, 0.0);
|
||||
std::vector<double> sa(m_numElemConstraints, 0.0);
|
||||
std::vector<double> 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
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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<size_t> > zeroedPhaseLinkedZeroComponents(m_numPhases);
|
||||
std::vector<int> 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<doublereal> fracDelta(Vphase->nSpecies());
|
||||
vector<doublereal> 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<doublereal> X_est(nsp, 0.0);
|
||||
vector<doublereal> delFrac(nsp, 0.0);
|
||||
vector<doublereal> E_phi(nsp, 0.0);
|
||||
vector<doublereal> fracDelta_new(nsp, 0.0);
|
||||
vector<doublereal> fracDelta_old(nsp, 0.0);
|
||||
vector<doublereal> 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<size_t> creationGlobalRxnNumbers(nsp, npos);
|
||||
m_deltaGRxn_Deficient = m_deltaGRxn_old;
|
||||
vector<doublereal> 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;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace Cantera
|
|||
{
|
||||
void VCS_SOLVE::vcs_SSPhase()
|
||||
{
|
||||
std::vector<int> 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<double> 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");
|
||||
|
|
|
|||
|
|
@ -355,12 +355,12 @@ void VCS_PROB::reportCSV(const std::string& reportFile)
|
|||
throw CanteraError("VCS_PROB::reportCSV", "Failure to open file");
|
||||
}
|
||||
|
||||
std::vector<double> volPM(nspecies, 0.0);
|
||||
std::vector<double> activity(nspecies, 0.0);
|
||||
std::vector<double> ac(nspecies, 0.0);
|
||||
std::vector<double> mu(nspecies, 0.0);
|
||||
std::vector<double> mu0(nspecies, 0.0);
|
||||
std::vector<double> 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++) {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ int VCS_SOLVE::vcs_report(int iconv)
|
|||
size_t nspecies = m_numSpeciesTot;
|
||||
char originalUnitsState = m_unitsState;
|
||||
std::vector<size_t> sortindex(nspecies,0);
|
||||
std::vector<double> 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<double> gaPhase(m_numElemConstraints, 0.0);
|
||||
std::vector<double> 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;
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ namespace Cantera
|
|||
{
|
||||
|
||||
static void printProgress(const vector<string> &spName,
|
||||
const vector<double> &soln,
|
||||
const vector<double> &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<double> sm(m_numElemConstraints*m_numElemConstraints, 0.0);
|
||||
std::vector<double> ss(m_numElemConstraints, 0.0);
|
||||
std::vector<double> sa(m_numElemConstraints, 0.0);
|
||||
std::vector<double> wx(m_numElemConstraints, 0.0);
|
||||
std::vector<double> 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) {
|
||||
|
|
|
|||
|
|
@ -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<double> & 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];
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ namespace Cantera
|
|||
void VCS_SOLVE::checkDelta1(double* const dsLocal,
|
||||
double* const delTPhMoles, size_t kspec)
|
||||
{
|
||||
std::vector<double> 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<double> 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) {
|
||||
|
|
|
|||
|
|
@ -138,11 +138,11 @@ int VCS_SOLVE::vcs_solve_phaseStability(const int iph, const int ifunc,
|
|||
bool usedZeroedSpecies;
|
||||
int iStab = 0;
|
||||
|
||||
std::vector<double> sm(m_numElemConstraints*m_numElemConstraints, 0.0);
|
||||
std::vector<double> ss(m_numElemConstraints, 0.0);
|
||||
std::vector<double> sa(m_numElemConstraints, 0.0);
|
||||
std::vector<double> aw(m_numSpeciesTot, 0.0);
|
||||
std::vector<double> 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);
|
||||
|
|
|
|||
|
|
@ -20,14 +20,14 @@ using namespace std;
|
|||
namespace Cantera
|
||||
{
|
||||
|
||||
double vcs_l2norm(const std::vector<double> 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<double>::const_iterator pos;
|
||||
vector_fp::const_iterator pos;
|
||||
for (pos = vec.begin(); pos != vec.end(); ++pos) {
|
||||
sum += (*pos) * (*pos);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1023,7 +1023,7 @@ void InterfaceKinetics::setPhaseStability(const size_t iphase, const int isStabl
|
|||
}
|
||||
}
|
||||
|
||||
void InterfaceKinetics::determineFwdOrdersBV(ElectrochemicalReaction& r, std::vector<doublereal>& 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.
|
||||
|
|
|
|||
|
|
@ -755,10 +755,10 @@ void IonsFromNeutralVPSSTP::initLengths()
|
|||
* @param nElementsI
|
||||
*/
|
||||
static double factorOverlap(const std::vector<std::string>& elnamesVN ,
|
||||
const std::vector<double>& elemVectorN,
|
||||
const vector_fp& elemVectorN,
|
||||
const size_t nElementsN,
|
||||
const std::vector<std::string>& elnamesVI ,
|
||||
const std::vector<double>& 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<std::string>& elnamesVN = neutralMoleculePhase_->elementNames();
|
||||
std::vector<double> elemVectorN(nElementsN);
|
||||
std::vector<double> elemVectorN_orig(nElementsN);
|
||||
vector_fp elemVectorN(nElementsN);
|
||||
vector_fp elemVectorN_orig(nElementsN);
|
||||
|
||||
size_t nElementsI = nElements();
|
||||
const std::vector<std::string>& elnamesVI = elementNames();
|
||||
std::vector<double> elemVectorI(nElementsI);
|
||||
vector_fp elemVectorI(nElementsI);
|
||||
|
||||
vector<doublereal> fm_tmp(m_kk);
|
||||
vector_fp fm_tmp(m_kk);
|
||||
for (size_t k = 0; k < m_kk; k++) {
|
||||
fm_invert_ionForNeutral[k] = npos;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -335,7 +335,7 @@ void LatticeSolidPhase::installSlavePhases(XML_Node* phaseNode)
|
|||
std::vector<XML_Node*> lattices = la.getChildren("phase");
|
||||
for (size_t n = 0; n < m_nlattice; n++) {
|
||||
LatticePhase* lp = m_lattice[n];
|
||||
vector<doublereal> 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),
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ ThermoPhase* newPhase(const std::string& infile, std::string id)
|
|||
*/
|
||||
static void formSpeciesXMLNodeList(std::vector<XML_Node*> &spDataNodeList,
|
||||
std::vector<std::string> &spNamesList,
|
||||
std::vector<int> &spRuleList,
|
||||
vector_int &spRuleList,
|
||||
const std::vector<XML_Node*> spArray_names,
|
||||
const std::vector<XML_Node*> 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<XML_Node*> spDataNodeList;
|
||||
std::vector<std::string> spNamesList;
|
||||
std::vector<int> spRuleList;
|
||||
vector_int spRuleList;
|
||||
formSpeciesXMLNodeList(spDataNodeList, spNamesList, spRuleList,
|
||||
sparrays, dbases, sprule);
|
||||
|
||||
|
|
|
|||
|
|
@ -837,14 +837,14 @@ void ThermoPhase::getdlnActCoeffdlnN_numderiv(const size_t ld, doublereal* const
|
|||
/*
|
||||
* Evaluate the current base activity coefficients if necessary
|
||||
*/
|
||||
std::vector<double> ActCoeff_Base(m_kk);
|
||||
vector_fp ActCoeff_Base(m_kk);
|
||||
getActivityCoefficients(DATA_PTR(ActCoeff_Base));
|
||||
std::vector<double> 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<double> ActCoeff(m_kk);
|
||||
std::vector<double> Xmol(m_kk);
|
||||
vector_fp ActCoeff(m_kk);
|
||||
vector_fp Xmol(m_kk);
|
||||
double v_totalMoles = 1.0;
|
||||
double TMoles_base = v_totalMoles;
|
||||
|
||||
|
|
|
|||
|
|
@ -42,10 +42,10 @@ double HighPressureGasTransport::thermalConductivity()
|
|||
vector_fp cp_0_R(nsp);
|
||||
m_thermo->getCp_R_ref(&cp_0_R[0]);
|
||||
|
||||
std::vector<doublereal> L_i(nsp);
|
||||
std::vector<doublereal> f_i(nsp);
|
||||
std::vector<doublereal> h_i(nsp);
|
||||
std::vector<doublereal> 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<double> PcP(5);
|
||||
vector_fp PcP(5);
|
||||
size_t nsp = m_thermo->nSpecies();
|
||||
vector_fp molefracs(nsp);
|
||||
m_thermo->getMoleFractions(&molefracs[0]);
|
||||
|
|
|
|||
|
|
@ -560,8 +560,8 @@ void LTI_StefanMaxwell_PPN::getMatrixTransProp(DenseMatrix& mat, doublereal* spe
|
|||
ions_thermo->getAnionList(anion);
|
||||
|
||||
// Reaction Coeffs and Charges
|
||||
std::vector<double> viS(6);
|
||||
std::vector<double> charges(3);
|
||||
vector_fp viS(6);
|
||||
vector_fp charges(3);
|
||||
std::vector<size_t> neutMolIndex(3);
|
||||
ions_thermo->getDissociationCoeffs(viS,charges,neutMolIndex);
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public:
|
|||
}
|
||||
|
||||
void set_r(const double r) {
|
||||
std::vector<double> 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<double> 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<MaskellSolidSolnPhase *>(test_phase) != NULL);
|
||||
|
||||
std::vector<double> 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<double> mu0(2);
|
||||
std::vector<double> activityCoeffs(2);
|
||||
std::vector<double> 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<MaskellSolidSolnPhase *>(test_phase) != NULL);
|
||||
|
||||
// Check to make sure activityConcentration_i == standardConcentration_i * gamma_i * X_i
|
||||
std::vector<double> standardConcs(2);
|
||||
std::vector<double> activityCoeffs(2);
|
||||
std::vector<double> 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);
|
||||
|
|
|
|||
|
|
@ -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<double> getLambda(3);
|
||||
vector_fp getLambda(3);
|
||||
EXPECT_FALSE(test_phase.getElementPotentials(&getLambda[0]));
|
||||
|
||||
std::vector<double> tooSmall(2);
|
||||
vector_fp tooSmall(2);
|
||||
EXPECT_THROW(test_phase.setElementPotentials(tooSmall), CanteraError);
|
||||
|
||||
std::vector<double> setLambda(3);
|
||||
vector_fp setLambda(3);
|
||||
setLambda[0] = 1.;
|
||||
setLambda[1] = 2.;
|
||||
setLambda[2] = 3.;
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ protected:
|
|||
}
|
||||
|
||||
NasaPoly1 poly;
|
||||
std::vector<double> tpow_;
|
||||
vector_fp tpow_;
|
||||
};
|
||||
|
||||
TEST_F(NasaPoly1Test, Initialization)
|
||||
|
|
|
|||
|
|
@ -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<double> Xmol(kk, 0.0);
|
||||
vector_fp Xmol(kk, 0.0);
|
||||
const std::vector<string> &snames = gas->speciesNames();
|
||||
fprintf(FF,"Temperature, Pressure,");
|
||||
for (size_t k = 0; k < kk; k++) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue