minor cleanup

This commit is contained in:
Dave Goodwin 2005-09-27 12:12:05 +00:00
parent 518a4965dd
commit 14efd3f77c
7 changed files with 39 additions and 151 deletions

View file

@ -7,10 +7,13 @@
// Cantera includes
#include "config.h"
#include "oneD/Sim1D.h"
#include "oneD/StFlow.h"
#include "oneD/Inlet1D.h"
#include "DenseMatrix.h"
// local includes
#include "Cabinet.h"
#include "Storage.h"

View file

@ -23,17 +23,7 @@ using namespace std;
namespace Cantera {
//class ElementsFrozen : public CanteraError {
//public:
// ElementsFrozen(string func)
// : CanteraError(func,
// "elements cannot be added after species.") {}
//};
/********************************************************************
*
* Constituents():
*
/**
* Constructor sets all base variable types to zero. Also, it
* sets the pointer to the Elements object for this object to the
* default value of BaseElements. If the BaseElements Elements
@ -60,44 +50,17 @@ namespace Cantera {
Constituents::Constituents(Elements* ptr_Elements) :
m_kk(0),
m_speciesFrozen(false) ,
m_Elements(ptr_Elements)
{
/*
* Check to see that m_Elements is non-null.
*/
if (!m_Elements) {
m_Elements = new Elements();
}
m_Elements(ptr_Elements) {
// /*
// * Check to see if the default Elements Object has been
// * created. If it hasn't, create it.
// */
// if (Elements::Global_Elements_List.size() == 0) {
// Elements::Global_Elements_List.push_back(new Elements());
// }
// /*
// * Assign the default Elements object as the
// * Constituents's Elements object
// */
// m_Elements = Elements::Global_Elements_List[0];
// }
if (!m_Elements) m_Elements = new Elements();
/*
* Register subscription to Elements object whether or not we
* created it here.
*/
// Register subscription to Elements object whether or not we
// created it here.
m_Elements->subscribe();
}
/********************************************************************
*
* ~Constituents():
*
* Destructor For Constituents class.
*
* When the Elements subscription list hits zero, we delete the
* Elements object from here.
/**
* Destructor.
*/
Constituents::~Constituents()
{
@ -123,21 +86,15 @@ namespace Cantera {
int Constituents::nElements() const { return m_Elements->nElements(); }
/********************************************************************
*
* atomicWeight
*
/**
* Return the Atomic weight of element m.
* units = Kg / Kmol
* units = Kg / Kmol
*/
doublereal Constituents::atomicWeight(int m) const {
return m_Elements->atomicWeight(m);
}
/*******************************************************************
*
* atomicWeights()
*
/**
* returns a reference to the vector of atomic weights pertinent
* to this constituents object
* units = kg / Kmol
@ -147,44 +104,22 @@ namespace Cantera {
}
/********************************************************************
*
* atomicNumber
*
/**
* Return the atomic number of element m.
*/
int Constituents::atomicNumber(int m) const {
return m_Elements->atomicNumber(m);
}
#ifdef INCL_DEPRECATED_METHODS
/********************************************************************
* element():
*
* Returns an ElementData struct that contains the parameters for
* element m.
*
* -> Passthrough to the Element lvl.
*/
ElementData Constituents::element(int m) const {
return (m_Elements->element(m));
}
#endif
/*******************************************************************
*
* addElement():
*
/**
* Add an element to the set.
* @param symbol symbol string
* Optional:
* @param weight atomic weight in kg/mol.
*
*
* If weight is not given, then a lookup is performed in the
* element object
*
* -> Passthrough to the Element lvl.
*/
void Constituents::
addElement(const string& symbol, doublereal weight)
@ -198,16 +133,13 @@ namespace Cantera {
m_Elements->addElement(e);
}
/*******************************************************************
*
* addUniqueElement():
*
/**
* Add a unique element to the set. A check on the symbol is made
* If the symbol is already an element, then a new element is
* not created.
*
* @param symbol symbol string
* Optional:
* @param weight atomic weight in kg/mol.
*
* If weight is not given, then a lookup is performed in the
@ -231,33 +163,24 @@ namespace Cantera {
m_Elements->addElementsFromXML(phase);
}
/*******************************************************************
*
* freezeElements()
*
/**
* -> Passthrough to the Element lvl.
*/
void Constituents::freezeElements() {
m_Elements->freezeElements();
}
/*******************************************************************
*
* elementsFrozen()
*
/**
* -> Passthrough to the Element lvl.
*/
bool Constituents::elementsFrozen() {
return m_Elements->elementsFrozen();
}
/*******************************************************************
*
* elementIndex():
*
* Index of element named \c name. The index is an integer
/**
* Index of element named \a name. The index is an integer
* assigned to each element in the order it was added,
* beginning with 0 for the first element. If \c name is not
* beginning with 0 for the first element. If \a name is not
* the name of an element in the set, then the value -1 is
* returned.
*
@ -481,7 +404,8 @@ namespace Cantera {
return m_speciesNames;
}
/**********************************************************************
/**
*
* ready():
* True if both elements and species have been frozen
@ -490,7 +414,7 @@ namespace Cantera {
return (m_Elements->elementsFrozen() && m_speciesFrozen);
}
/**********************************************************************
/**
*
* nAtoms()
*
@ -506,7 +430,7 @@ namespace Cantera {
return m_speciesComp[m_mm * k + m];
}
/*********************************************************************
/**
*
* getAtoms()
*

View file

@ -67,7 +67,7 @@ namespace Cantera {
}
ThermoPhase* th=0;
map<string, double> d;
// map<string, double> d;
switch (ieos) {
case cIdealGas:

View file

@ -156,10 +156,6 @@ namespace Cantera {
typedef ct::ctvector_fp vector_fp;
typedef ct::ctvector_int array_int;
typedef ct::ctvector_int vector_int;
//typedef std::valarray<double> array_fp;
//typedef std::valarray<double> vector_fp;
//typedef std::valarray<int> array_int;
//typedef std::valarray<int> vector_int;
typedef vector_int group_t;
typedef std::vector<group_t> grouplist_t;
@ -167,26 +163,11 @@ namespace Cantera {
typedef vector_fp::const_iterator const_workPtr;
template<class A, class B>
inline doublereal operator*(const vector<A>& u, const vector<B>& v) {
return inner_product(u.begin(), u.end(), v.begin(), 0.0);
}
// template<class A, class B>
//inline doublereal operator*(const vector<A>& u, const vector<B>& v) {
// return inner_product(u.begin(), u.end(), v.begin(), 0.0);
// }
// inline ostream& operator<<(ostream& s, const vector_fp& v) {
// return ct::operator<<(s, v);
//}
// template<class A>
// inline ostream& operator<<(ostream& s, const vector<A>& v) {
// int n = v.size();
// s << "<";
// for (int i = 0; i < n; i++) {
// s << v[i];
// if (i < n-1) s << ", ";
// }
// s << ">";
// return s;
// }
} // namespace

View file

@ -6,8 +6,8 @@
* Simple vector classes. Classes ctvector_fp and ctvector_int are
* designed to be wrappers around double* and int* arrays,
* respectively. They provide a few convenient methods that function
* like those of std::vector<T>, but unlike the STL classes explicitly
* allow accessing a pointer to the underlying data array.
* like those of std::vector<T>, but unlike the STL classes, they
* explicitly allow accessing a pointer to the underlying data array.
*/
#include <math.h>
@ -15,7 +15,6 @@
#include <iostream>
using namespace std;
#include "ctvector.h"
//using namespace ct;
namespace ct {

View file

@ -1,21 +0,0 @@
// declarations for Fortran simplex routines from Numerical Recipes.
#ifndef NUM_RECIPES_H
#define NUM_RECIPES_H
extern "C" {
integer simplx_(doublereal *a, integer *m, integer *n, integer *
mp, integer *np, integer *m1, integer *m2, integer *m3, integer *
icase, integer *izrov, integer *iposv);
integer splin2_(doublereal *x1a, doublereal *x2a, doublereal *ya,
doublereal *y2a, integer *m, integer *n,
doublereal *x1, doublereal *x2, doublereal *y);
integer splie2_(doublereal *x1a, doublereal *x2a, doublereal *ya,
integer *m, integer *n, doublereal *y2a);
}
#endif

10
configure vendored
View file

@ -175,13 +175,15 @@ USER_SRC_DIR="Cantera/user" # don't change this
# thermodynamic properties
ENABLE_THERMO='y'
######################################################################
# optional phase types. These may not be needed by all users. Set them
# to 'n' to omit them from the kernel.
# optional phase types. These
WITH_LATTICE_SOLID='y'
WITH_METAL='y'
WITH_STOICH_SUBSTANCE='y'
WITH_METAL='y'
WITH_STOICH_SUBSTANCE='y'
WITH_PURE_FLUIDS='y'
######################################################################
# if set to 'y', the ck2cti program that converts Chemkin input files
# to Cantera format will be built. If you don't use Chemkin format
# files, or if you run ck2cti on some other machine, you can set this to 'n'.