Skip to content

Commit

Permalink
Consistently use vector_fp and vector_int typedefs
Browse files Browse the repository at this point in the history
  • Loading branch information
speth committed Aug 3, 2015
1 parent ceefc5e commit bfb20e1
Show file tree
Hide file tree
Showing 49 changed files with 199 additions and 200 deletions.
2 changes: 1 addition & 1 deletion include/cantera/base/Array.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class Array2D
/*!
* 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.
*/
Expand Down
2 changes: 1 addition & 1 deletion include/cantera/base/ctml.h
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
4 changes: 2 additions & 2 deletions include/cantera/base/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 2 additions & 3 deletions include/cantera/equil/vcs_SpeciesProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -29,7 +28,7 @@ class vcs_SpeciesProperties

//! 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
Expand Down
24 changes: 12 additions & 12 deletions include/cantera/equil/vcs_VolPhase.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ class vcs_VolPhase

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;

Expand All @@ -357,7 +357,7 @@ class vcs_VolPhase
/*!
* @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;
Expand Down Expand Up @@ -648,7 +648,7 @@ class vcs_VolPhase

//! 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
/*!
Expand All @@ -661,7 +661,7 @@ class vcs_VolPhase
* 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
/*!
Expand All @@ -678,7 +678,7 @@ class vcs_VolPhase
* - 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
Expand Down Expand Up @@ -750,13 +750,13 @@ class vcs_VolPhase
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
/*!
Expand Down Expand Up @@ -791,7 +791,7 @@ class vcs_VolPhase
*
* 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.
Expand All @@ -801,20 +801,20 @@ class vcs_VolPhase
*
* 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
Expand Down
2 changes: 1 addition & 1 deletion include/cantera/equil/vcs_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
/*!
Expand Down
20 changes: 10 additions & 10 deletions include/cantera/equil/vcs_prob.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class VCS_PROB
* 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.
/*!
Expand All @@ -67,21 +67,21 @@ class VCS_PROB
*
* 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
/*!
Expand All @@ -100,7 +100,7 @@ class VCS_PROB
* 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)
/*!
Expand All @@ -127,7 +127,7 @@ class VCS_PROB
* 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
Expand Down Expand Up @@ -171,23 +171,23 @@ class VCS_PROB
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;
Expand Down
Loading

0 comments on commit bfb20e1

Please sign in to comment.