Skip to content

Commit

Permalink
Replace vector_int
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl authored and speth committed Aug 5, 2023
1 parent e0a2f11 commit 9adc594
Show file tree
Hide file tree
Showing 28 changed files with 58 additions and 57 deletions.
1 change: 1 addition & 0 deletions include/cantera/base/ct_defs.h
Expand Up @@ -187,6 +187,7 @@ typedef map<string, double> Composition;
//! Vector of doubles.
typedef vector<double> vector_fp;
//! Vector of ints
//! @deprecated To be removed after %Cantera 3.0
typedef vector<int> vector_int;

//! index returned by functions to indicate "no position"
Expand Down
2 changes: 1 addition & 1 deletion include/cantera/equil/MultiPhase.h
Expand Up @@ -602,7 +602,7 @@ class MultiPhase
std::vector<std::string> m_enames;

//! Atomic number of each global element.
vector_int m_atomicNumber;
vector<int> m_atomicNumber;

//! Vector of species names in the problem. Vector is over all species
//! defined in the object, the global species index.
Expand Down
6 changes: 3 additions & 3 deletions include/cantera/equil/MultiPhaseEquil.h
Expand Up @@ -178,9 +178,9 @@ class MultiPhaseEquil
vector_fp m_deltaG_RT, m_mu;
std::vector<bool> m_majorsp;
std::vector<size_t> m_sortindex;
vector_int m_lastsort;
vector_int m_dsoln;
vector_int m_incl_element, m_incl_species;
vector<int> m_lastsort;
vector<int> m_dsoln;
vector<int> m_incl_element, m_incl_species;

// Vector of indices for species that are included in the calculation.
// This is used to exclude pure-phase species with invalid thermo data
Expand Down
4 changes: 2 additions & 2 deletions include/cantera/equil/vcs_MultiPhaseEquil.h
Expand Up @@ -232,7 +232,7 @@ class vcs_MultiPhaseEquil
*
* `m_order[korig] = k_sorted`
*/
vector_int m_order;
vector<int> m_order;

//! Pointer to the MultiPhase mixture that will be equilibrated.
/*!
Expand Down Expand Up @@ -263,7 +263,7 @@ class vcs_MultiPhaseEquil

//! Vector of indices for species that are included in the calculation. This
//! is used to exclude pure-phase species with invalid thermo data
vector_int m_species;
vector<int> m_species;

//! The object that contains the problem statement and does all of the equilibration work
/*!
Expand Down
6 changes: 3 additions & 3 deletions include/cantera/equil/vcs_VolPhase.h
Expand Up @@ -583,7 +583,7 @@ class vcs_VolPhase

//! boolean indicating whether an element constraint is active
//! for the current problem
vector_int m_elementActive;
vector<int> m_elementActive;

//! Type of the element constraint
/*!
Expand All @@ -596,7 +596,7 @@ class vcs_VolPhase
* a species has neg 0 or pos value of that constraint (other than
* charge)
*/
vector_int m_elementType;
vector<int> m_elementType;

//! Formula Matrix for the phase
/*!
Expand All @@ -613,7 +613,7 @@ class vcs_VolPhase
* - metal electron -> VCS_SPECIES_INTERFACIALVOLTAGE.
* (unknown is the interfacial voltage (volts))
*/
vector_int m_speciesUnknownType;
vector<int> m_speciesUnknownType;

//! Index of the element number in the global list of elements stored in VCS_SOLVE
std::vector<size_t> m_elemGlobalIndex;
Expand Down
12 changes: 6 additions & 6 deletions include/cantera/equil/vcs_solve.h
Expand Up @@ -1163,7 +1163,7 @@ class VCS_SOLVE
* interfacial current, which is set to zero in this initial treatment.
* Later we may have non-zero interfacial currents.
*/
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:
Expand Down Expand Up @@ -1352,7 +1352,7 @@ class VCS_SOLVE
* is `kspec = irxn + m_numComponents`. For possible values and their
* meanings, see vcs_evaluate_speciesType().
*/
vector_int m_speciesStatus;
vector<int> m_speciesStatus;

//! Mapping from the species number to the phase number
std::vector<size_t> m_phaseID;
Expand Down Expand Up @@ -1383,13 +1383,13 @@ class VCS_SOLVE
* that a species has neg 0 or pos value of that constraint (other than
* charge)
*/
vector_int m_elType;
vector<int> m_elType;

//! Specifies whether an element constraint is active
/*!
* The default is true. Length = nelements
*/
vector_int m_elementActive;
vector<int> m_elementActive;

//! Array of Phase Structures. Length = number of phases.
std::vector<std::unique_ptr<vcs_VolPhase>> m_VolPhaseList;
Expand All @@ -1401,7 +1401,7 @@ class VCS_SOLVE
*
* length = number of species
*/
vector_int m_actConventionSpecies;
vector<int> m_actConventionSpecies;

//! specifies the activity convention of the phase.
/*!
Expand All @@ -1410,7 +1410,7 @@ class VCS_SOLVE
*
* length = number of phases
*/
vector_int m_phaseActConvention;
vector<int> m_phaseActConvention;

//! specifies the ln(Mnaught) used to calculate the chemical potentials
/*!
Expand Down
4 changes: 2 additions & 2 deletions include/cantera/kinetics/Group.h
Expand Up @@ -24,7 +24,7 @@ class Group
Group(size_t n) : m_sign(0) {
m_comp.resize(n,0);
}
Group(const vector_int& elnumbers) :
Group(const vector<int>& elnumbers) :
m_comp(elnumbers), m_sign(0) {
validate();
}
Expand Down Expand Up @@ -131,7 +131,7 @@ class Group
const Group& g);

private:
vector_int m_comp;
vector<int> m_comp;
int m_sign;
};

Expand Down
2 changes: 1 addition & 1 deletion include/cantera/kinetics/ImplicitSurfChem.h
Expand Up @@ -258,7 +258,7 @@ class ImplicitSurfChem : public FuncEval
size_t m_numTotalBulkSpecies = 0;
size_t m_numTotalSpecies = 0;

std::vector<vector_int> pLocVec;
std::vector<vector<int>> pLocVec;
//! Pointer to the CVODE integrator
std::unique_ptr<Integrator> m_integ;
doublereal m_atol, m_rtol; // tolerances
Expand Down
2 changes: 1 addition & 1 deletion include/cantera/kinetics/InterfaceKinetics.h
Expand Up @@ -475,7 +475,7 @@ class InterfaceKinetics : public Kinetics
*
* length = number of phases in the object. By default all phases are stable.
*/
vector_int m_phaseIsStable;
vector<int> m_phaseIsStable;

//! Vector of vector of booleans indicating whether a phase participates in
//! a reaction as a reactant
Expand Down
4 changes: 2 additions & 2 deletions include/cantera/kinetics/ReactionPath.h
Expand Up @@ -252,7 +252,7 @@ class ReactionPathDiagram
return m_exclude;
}
std::vector<size_t> species();
vector_int reactions();
vector<int> reactions();
void findMajorPaths(doublereal threshold, size_t lda, doublereal* a);
void setFont(const std::string& font) {
m_font = font;
Expand Down Expand Up @@ -322,7 +322,7 @@ class ReactionPathBuilder
std::vector<std::vector<size_t> > m_reac;
std::vector<std::vector<size_t> > m_prod;
DenseMatrix m_elatoms;
std::vector<vector_int> m_groups;
std::vector<vector<int>> m_groups;
std::vector<Group> m_sgroup;
std::vector<std::string> m_elementSymbols;

Expand Down
2 changes: 1 addition & 1 deletion include/cantera/numerics/BandMatrix.h
Expand Up @@ -291,7 +291,7 @@ class BandMatrix : public GeneralMatrix
std::vector<double*> m_lu_col_ptrs;

//! Extra work array needed - size = n
vector_int iwork_;
vector<int> iwork_;

//! Extra dp work array needed - size = 3n
vector_fp work_;
Expand Down
10 changes: 5 additions & 5 deletions include/cantera/numerics/DenseMatrix.h
Expand Up @@ -112,21 +112,21 @@ class DenseMatrix : public Array2D

//! Return a changeable value of the pivot vector
/*!
* @returns a reference to the pivot vector as a vector_int
* @returns a reference to the pivot vector as a vector<int>
*/
vector_int& ipiv();
vector<int>& ipiv();

//! Return a changeable value of the pivot vector
/*!
* @returns a reference to the pivot vector as a vector_int
* @returns a reference to the pivot vector as a vector<int>
*/
const vector_int& ipiv() const {
const vector<int>& ipiv() const {
return m_ipiv;
}

protected:
//! Vector of pivots. Length is equal to the max of m and n.
vector_int m_ipiv;
vector<int> m_ipiv;

//! Vector of column pointers
std::vector<doublereal*> m_colPts;
Expand Down
2 changes: 1 addition & 1 deletion include/cantera/numerics/ResidEval.h
Expand Up @@ -171,7 +171,7 @@ class ResidEval
* The first index is the equation number. The second index is 1 if it is a
* DAE, and zero if it is not.
*/
vector_int m_alg;
vector<int> m_alg;
std::map<int, int> m_constrain;
};

Expand Down
4 changes: 2 additions & 2 deletions include/cantera/oneD/MultiJac.h
Expand Up @@ -60,7 +60,7 @@ class MultiJac : public BandMatrix
m_age = age;
}

vector_int& transientMask() {
vector<int>& transientMask() {
return m_mask;
}

Expand All @@ -79,7 +79,7 @@ class MultiJac : public BandMatrix
double m_atol = sqrt(std::numeric_limits<double>::epsilon());
double m_elapsed = 0.0;
vector_fp m_ssdiag;
vector_int m_mask;
vector<int> m_mask;
int m_nevals = 0;
int m_age = 100000;
size_t m_size;
Expand Down
16 changes: 8 additions & 8 deletions include/cantera/oneD/OneDim.h
Expand Up @@ -206,7 +206,7 @@ class OneDim
//! Call after one or more grids has changed size, for example after being refined.
virtual void resize();

vector_int& transientMask() {
vector<int>& transientMask() {
return m_mask;
}

Expand Down Expand Up @@ -299,20 +299,20 @@ class OneDim
}

//! Return number of Jacobian evaluations made in each call to solve()
const vector_int& jacobianCountStats() {
const vector<int>& jacobianCountStats() {
saveStats();
return m_jacEvals;
}

//! Return number of non-Jacobian function evaluations made in each call to
//! solve()
const vector_int& evalCountStats() {
const vector<int>& evalCountStats() {
saveStats();
return m_funcEvals;
}

//! Return number of time steps taken in each call to solve()
const vector_int& timeStepStats() {
const vector<int>& timeStepStats() {
saveStats();
return m_timeSteps;
}
Expand Down Expand Up @@ -362,7 +362,7 @@ class OneDim
bool m_init = false;
std::vector<size_t> m_nvars;
std::vector<size_t> m_loc;
vector_int m_mask;
vector<int> m_mask;
size_t m_pts = 0;

// options
Expand All @@ -386,14 +386,14 @@ class OneDim
int m_nevals = 0;
double m_evaltime = 0;
std::vector<size_t> m_gridpts;
vector_int m_jacEvals;
vector<int> m_jacEvals;
vector_fp m_jacElapsed;
vector_int m_funcEvals;
vector<int> m_funcEvals;
vector_fp m_funcElapsed;

//! Number of time steps taken in each call to solve() (for example, for each
//! successive grid refinement)
vector_int m_timeSteps;
vector<int> m_timeSteps;
};

}
Expand Down
2 changes: 1 addition & 1 deletion include/cantera/oneD/Sim1D.h
Expand Up @@ -364,7 +364,7 @@ class Sim1D : public OneDim

//! array of number of steps to take before re-attempting the steady-state
//! solution
vector_int m_steps;
vector<int> m_steps;

//! User-supplied function called after a successful steady-state solve.
Func1* m_steady_callback;
Expand Down
2 changes: 1 addition & 1 deletion include/cantera/thermo/DebyeHuckel.h
Expand Up @@ -806,7 +806,7 @@ class DebyeHuckel : public MolalityVPSSTP
* - nonpolarNeutral
* .
*/
vector_int m_electrolyteSpeciesType;
vector<int> m_electrolyteSpeciesType;

//! a_k = Size of the ionic species in the DH formulation. units = meters
vector_fp m_Aionic;
Expand Down
4 changes: 2 additions & 2 deletions include/cantera/thermo/HMWSoln.h
Expand Up @@ -1780,7 +1780,7 @@ class HMWSoln : public MolalityVPSSTP
* n = m_kk*i + j
* m_CounterIJ[n] = counterIJ
*/
mutable vector_int m_CounterIJ;
mutable vector<int> m_CounterIJ;

//! This is elambda, MEC
mutable double elambda[17];
Expand Down Expand Up @@ -1949,7 +1949,7 @@ class HMWSoln : public MolalityVPSSTP
* * 2 = In a cropped regime where there is no temperature
* or pressure dependence
*/
mutable vector_int CROP_speciesCropped_;
mutable vector<int> CROP_speciesCropped_;
//! @}

//! Initialize all of the species-dependent lengths in the object
Expand Down
4 changes: 2 additions & 2 deletions include/cantera/thermo/Phase.h
Expand Up @@ -1028,9 +1028,9 @@ class Phase

size_t m_mm = 0; //!< Number of elements.
vector_fp m_atomicWeights; //!< element atomic weights (kg kmol-1)
vector_int m_atomicNumbers; //!< element atomic numbers
vector<int> m_atomicNumbers; //!< element atomic numbers
std::vector<std::string> m_elementNames; //!< element names
vector_int m_elem_type; //!< Vector of element types
vector<int> m_elem_type; //!< Vector of element types

//! Entropy at 298.15 K and 1 bar of stable state pure elements (J kmol-1)
vector_fp m_entropy298;
Expand Down
4 changes: 2 additions & 2 deletions include/cantera/transport/GasTransport.h
Expand Up @@ -406,7 +406,7 @@ class GasTransport : public Transport
* m_poly[i][j] contains the index for (i,j) interactions in
* #m_omega22_poly, #m_astar_poly, #m_bstar_poly, and #m_cstar_poly.
*/
std::vector<vector_int> m_poly;
std::vector<vector<int>> m_poly;

//! Fit for omega22 collision integral
/*!
Expand All @@ -418,7 +418,7 @@ class GasTransport : public Transport

//! Flag to indicate for which (i,j) interaction pairs the
//! actual temperature is used instead of the reduced temperature
std::vector<vector_int> m_star_poly_uses_actualT;
std::vector<vector<int>> m_star_poly_uses_actualT;

//! Fit for astar collision integral
/*!
Expand Down
2 changes: 1 addition & 1 deletion include/cantera/zeroD/ReactorBase.h
Expand Up @@ -265,7 +265,7 @@ class ReactorBase

//! Vector of length nWalls(), indicating whether this reactor is on the left (0)
//! or right (1) of each wall.
vector_int m_lr;
vector<int> m_lr;
std::string m_name;

//! The ReactorNet that this reactor is part of
Expand Down
2 changes: 1 addition & 1 deletion src/equil/ChemEquil.cpp
Expand Up @@ -849,7 +849,7 @@ int ChemEquil::estimateEP_Brinkley(ThermoPhase& s, vector_fp& x,

vector_fp x_old(m_mm+1, 0.0);
vector_fp resid(m_mm+1, 0.0);
vector_int lumpSum(m_mm+1, 0);
vector<int> lumpSum(m_mm+1, 0);

// Get the nondimensional Gibbs functions for the species at their standard
// states of solution at the current T and P of the solution.
Expand Down
2 changes: 1 addition & 1 deletion src/equil/vcs_solve.cpp
Expand Up @@ -3193,7 +3193,7 @@ void VCS_SOLVE::vcs_inest(double* const aw, double* const sa, double* const sm,

void VCS_SOLVE::vcs_SSPhase()
{
vector_int numPhSpecies(m_numPhases, 0);
vector<int> numPhSpecies(m_numPhases, 0);
for (size_t kspec = 0; kspec < m_nsp; ++kspec) {
numPhSpecies[m_phaseID[kspec]]++;
}
Expand Down

0 comments on commit 9adc594

Please sign in to comment.