From 7b4aeeb4290b2e28a8e5788c25a1bc790abc67d0 Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Fri, 18 Jun 2010 20:54:59 +0000 Subject: [PATCH] Doxygen update Beat down a few warnings from doxygen Moved some definitions from .h files to .cpp files. There is no change in functionality in this update --- Cantera/src/transport/Makefile.in | 3 +- Cantera/src/transport/TransportFactory.cpp | 85 +++++++++----- Cantera/src/transport/TransportFactory.h | 104 ++++++++---------- Cantera/src/transport/TransportParams.cpp | 85 ++++++++++++++ Cantera/src/transport/TransportParams.h | 122 +++++++++------------ 5 files changed, 241 insertions(+), 158 deletions(-) create mode 100644 Cantera/src/transport/TransportParams.cpp diff --git a/Cantera/src/transport/Makefile.in b/Cantera/src/transport/Makefile.in index 2bab492c7..208b7e055 100644 --- a/Cantera/src/transport/Makefile.in +++ b/Cantera/src/transport/Makefile.in @@ -36,7 +36,8 @@ CXX_FLAGS = @CXXFLAGS@ $(CXX_OPT) $(PIC_FLAG) $(DEBUG_FLAG) # Base Transport Object Files TRAN_OBJ = TransportFactory.o MultiTransport.o MixTransport.o MMCollisionInt.o \ SolidTransport.o DustyGasTransport.o TransportBase.o WaterTransport.o \ - SimpleTransport.o LiquidTransportData.o LiquidTransportParams.o LiquidTranInteraction.o + SimpleTransport.o LiquidTransportData.o LiquidTransportParams.o LiquidTranInteraction.o \ + TransportParams.o TRAN_H = TransportFactory.h MultiTransport.h MixTransport.h \ MMCollisionInt.h SolidTransport.h DustyGasTransport.h \ diff --git a/Cantera/src/transport/TransportFactory.cpp b/Cantera/src/transport/TransportFactory.cpp index 3ae2482ee..3daa32f84 100644 --- a/Cantera/src/transport/TransportFactory.cpp +++ b/Cantera/src/transport/TransportFactory.cpp @@ -298,44 +298,27 @@ namespace Cantera { single transport property as a function of temperature and possibly composition. */ - LTPspecies* TransportFactory::newLTP( const XML_Node &trNode, - std::string &name, - TransportPropertyList tp_ind, - thermo_t* thermo) { + LTPspecies* TransportFactory::newLTP(const XML_Node &trNode, std::string &name, + TransportPropertyList tp_ind, thermo_t* thermo) + { LTPspecies* ltps = 0; - std::string model = lowercase(trNode["model"]); - switch ( m_LTRmodelMap[model] ) { + switch (m_LTRmodelMap[model]) { case LTR_MODEL_CONSTANT: - ltps = new LTPspecies_Const( trNode, - name, - tp_ind, - thermo ); + ltps = new LTPspecies_Const(trNode, name, tp_ind, thermo); break; case LTR_MODEL_ARRHENIUS: - ltps = new LTPspecies_Arrhenius( trNode, - name, - tp_ind, - thermo ); + ltps = new LTPspecies_Arrhenius(trNode, name, tp_ind, thermo); break; case LTR_MODEL_POLY: - ltps = new LTPspecies_Poly( trNode, - name, - tp_ind, - thermo ); + ltps = new LTPspecies_Poly(trNode, name, tp_ind, thermo); break; case LTR_MODEL_EXPT: - ltps = new LTPspecies_ExpT( trNode, - name, - tp_ind, - thermo ); + ltps = new LTPspecies_ExpT(trNode, name, tp_ind, thermo); break; default: - throw CanteraError("newLTP","unknown transport model: " + model ); - ltps = new LTPspecies( trNode, - name, - tp_ind, - thermo ); + throw CanteraError("newLTP","unknown transport model: " + model); + ltps = new LTPspecies(trNode, name, tp_ind, thermo); } return ltps; } @@ -1549,5 +1532,53 @@ namespace Cantera { } #endif } + //==================================================================================================================== + // Create a new transport manager instance. + /* + * @param transportModel String identifying the transport model to be instantiated, defaults to the empty string + * @param thermo ThermoPhase object associated with the phase, defaults to null pointer + * @param loglevel int containing the Loglevel, defaults to zero + * @param f ptr to the TransportFactory object if it's been malloced. + * + * @ingroup transportProps + */ + Transport* newTransportMgr(std::string transportModel, thermo_t* thermo, int loglevel, TransportFactory* f) + { + if (f == 0) { + f = TransportFactory::factory(); + } + Transport* ptr = f->newTransport(transportModel, thermo, loglevel); + /* + * Note: We delete the static s_factory instance here, instead of in + * appdelete() in misc.cpp, to avoid linking problems involving + * the need for multiple cantera and transport library statements + * for applications that don't have transport in them. + */ + return ptr; + } + //==================================================================================================================== + // Create a new transport manager instance. + /* + * @param thermo ThermoPhase object associated with the phase, defaults to null pointer + * @param loglevel int containing the Loglevel, defaults to zero + * @param f ptr to the TransportFactory object if it's been malloced. + * + * @ingroup transportProps + */ + Transport* newDefaultTransportMgr(thermo_t* thermo, int loglevel, TransportFactory* f) + { + if (f == 0) { + f = TransportFactory::factory(); + } + Transport* ptr = f->newTransport(thermo, loglevel); + /* + * Note: We delete the static s_factory instance here, instead of in + * appdelete() in misc.cpp, to avoid linking problems involving + * the need for multiple cantera and transport library statements + * for applications that don't have transport in them. + */ + return ptr; + } + //==================================================================================================================== } diff --git a/Cantera/src/transport/TransportFactory.h b/Cantera/src/transport/TransportFactory.h index 504c727c9..1945b6e37 100644 --- a/Cantera/src/transport/TransportFactory.h +++ b/Cantera/src/transport/TransportFactory.h @@ -40,12 +40,10 @@ #if defined(THREAD_SAFE_CANTERA) #include #endif - +//====================================================================================================================== namespace Cantera { - - /** - * Struct to hold data read from a transport property database file. - */ + //==================================================================================================================== + //! Struct to hold data read from a transport property database file. struct GasTransportData { GasTransportData() : speciesName("-"), geometry(-1), wellDepth(-1.0), @@ -63,27 +61,25 @@ namespace Cantera { doublereal rotRelaxNumber; }; - + //==================================================================================================================== // forward references class MMCollisionInt; class GasTransportParams; class LiquidTransportParams; class XML_Node; - - //! The purpose of TransportFactory is to create new instances of + //==================================================================================================================== + //! The purpose of the TransportFactory class is to create new instances of //! 'transport managers', which are classes that provide transport - //! properties and are derived from base class Transport. + //! properties and which are derived from the base class, %Transport. /*! - * TransportFactory handles all initialization - * required, including evaluation of collision integrals and - * generating polynomial fits. Transport managers can also be - * created in other ways. + * TransportFactory handles all initialization required, including evaluation of collision integrals and + * generating polynomial fits. Transport managers can also be created in other ways. * * @ingroup transportgroup * @ingroup transportProps */ - class TransportFactory : FactoryBase { + class TransportFactory : public FactoryBase { public: @@ -127,15 +123,19 @@ namespace Cantera { virtual ~TransportFactory(); - /** - * make one of several transport models, and return a base class - * pointer to it. This method operates at the level of a - * single transport property as a function of temperature - * and possibly composition. + + //! Make one of several transport models, and return a base class pointer to it. + /*! + * This method operates at the level of a single transport property as a function of temperature + * and possibly composition. It's a factory for LTPspecies classes. + * + * @param trNode XML node + * @param name reference to the name + * @param tp_ind TransportPropertyList class + * @param thermo Pointer to the %ThermoPhase class */ - virtual LTPspecies* - newLTP( const XML_Node &trNode, std::string &name, - TransportPropertyList tp_ind, thermo_t* thermo) ; + virtual LTPspecies* newLTP(const XML_Node &trNode, std::string &name, + TransportPropertyList tp_ind, thermo_t* thermo); //! Factory function for the construction of new LiquidTranInteraction @@ -368,46 +368,32 @@ namespace Cantera { std::map m_LTImodelMap; }; - - /** - * Create a new transport manager instance. + //==================================================================================================================== + //! Create a new transport manager instance. + /*! + * @param transportModel String identifying the transport model to be instantiated, defaults to the empty string + * @param thermo ThermoPhase object associated with the phase, defaults to null pointer + * @param loglevel int containing the Loglevel, defaults to zero + * @param f ptr to the TransportFactory object if it's been malloced. + * * @ingroup transportProps */ - inline Transport* newTransportMgr(std::string transportModel = "", - thermo_t* thermo = 0, int loglevel=0, - TransportFactory* f=0) { - if (f == 0) { - f = TransportFactory::factory(); - } - Transport* ptr = f->newTransport(transportModel, thermo, loglevel); - /* - * Note: We delete the static s_factory instance here, instead of in - * appdelete() in misc.cpp, to avoid linking problems involving - * the need for multiple cantera and transport library statements - * for applications that don't have transport in them. - */ - return ptr; - } - - /** - * Create a new transport manager instance. + Transport* newTransportMgr(std::string transportModel = "", thermo_t* thermo = 0, int loglevel = 0, + TransportFactory* f = 0); + //==================================================================================================================== + //! Create a new transport manager instance. + /*! + * @param thermo ThermoPhase object associated with the phase, defaults to null pointer + * @param loglevel int containing the Loglevel, defaults to zero + * @param f ptr to the TransportFactory object if it's been malloced. + * + * @return Returns a transport manager for the phase + * * @ingroup transportProps */ - inline Transport* newDefaultTransportMgr(thermo_t* thermo, int loglevel=0, - TransportFactory* f=0) { - if (f == 0) { - f = TransportFactory::factory(); - } - Transport* ptr = f->newTransport(thermo, loglevel); - /* - * Note: We delete the static s_factory instance here, instead of in - * appdelete() in misc.cpp, to avoid linking problems involving - * the need for multiple cantera and transport library statements - * for applications that don't have transport in them. - */ - return ptr; - } + Transport* newDefaultTransportMgr(thermo_t* thermo, int loglevel = 0, TransportFactory* f = 0); - -} + //==================================================================================================================== +} // End of namespace Cantera +//====================================================================================================================== #endif diff --git a/Cantera/src/transport/TransportParams.cpp b/Cantera/src/transport/TransportParams.cpp new file mode 100644 index 000000000..330d6266b --- /dev/null +++ b/Cantera/src/transport/TransportParams.cpp @@ -0,0 +1,85 @@ +/** + * @file TransportParams.h + * Class that holds the data that is read in from the xml file, and which is used for + * processing of the transport object + * (see \ref tranprops and \link Cantera::TransportParams TransportParams \endlink). + */ +/* + * Latest Checkin: + * $Author: hkmoffa $ + * $Date: 2010-04-02 11:40:52 -0600 (Fri, 02 Apr 2010) $ + * $Revision: 429 $ + */ + +#include "TransportParams.h" + +#ifdef DEBUG_MODE +#include "XML_Writer.h" +#endif +using namespace std; + + +namespace Cantera { + //==================================================================================================================== + NotImplemented::NotImplemented(std::string method) : + CanteraError("Transport", + "\n\n**** Method " + method + " not implemented. ****\n" + "(Did you forget to specify a transport model?)\n\n") + { + } + //==================================================================================================================== + TransportParams::TransportParams() : + nsp_(0), + thermo(0), + mw(0), + velocityBasis_(VB_MASSAVG), + tmax(1000000.), + tmin(10.), + mode_(0), + xml(0), + log_level(-1) + { + } + //==================================================================================================================== + // Destructor + TransportParams::~TransportParams() + { +#ifdef DEBUG_MODE + delete xml; +#endif + } + //==================================================================================================================== + // Constructor + GasTransportParams::GasTransportParams() : + TransportParams(), + visccoeffs(0), + condcoeffs(0), + diffcoeffs(0), + poly(0), + omega22_poly(0), + astar_poly(0), + bstar_poly(0), + cstar_poly(0), + zrot(0), + crot(0), + polar(0), + alpha(0), + fitlist(0), + eps(0), + sigma(0), + reducedMass(0, 0), + diam(0, 0), + epsilon(0, 0), + dipole(0, 0), + delta(0, 0) + { + } + //==================================================================================================================== + GasTransportParams:: ~GasTransportParams() + { + } + + + //==================================================================================================================== +} // End of namespace Cantera +//====================================================================================================================== diff --git a/Cantera/src/transport/TransportParams.h b/Cantera/src/transport/TransportParams.h index 9eb85bd9c..786dd099b 100644 --- a/Cantera/src/transport/TransportParams.h +++ b/Cantera/src/transport/TransportParams.h @@ -1,52 +1,57 @@ +/** + * @file TransportParams.h + * Class that holds the data that is read in from the xml file, and which is used for + * processing of the transport object + * (see \ref tranprops and \link Cantera::TransportParams TransportParams \endlink). + */ +/* + * Latest Checkin: + * $Date$ + * $Revision$ + */ + #ifndef CT_TRANSPORTPARAMS_H #define CT_TRANSPORTPARAMS_H #include #include "ct_defs.h" -#include "TransportBase.h" -#include "xml.h" -#include "XML_Writer.h" #include "DenseMatrix.h" +#include "TransportBase.h" namespace Cantera { + class XML_Writer; + + + //==================================================================================================================== + //! Error class to indicate an unimplemented method + /*! + * This class is used by transport objects + */ class NotImplemented : public CanteraError { public: - NotImplemented(std::string method) : CanteraError("Transport", - "\n\n**** Method "+method+" not implemented. ****\n" - "(Did you forget to specify a transport model?)\n\n") {} + + //! Constructor for error class + /*! + * @param method Single string indicating a method that is not implemented + */ + NotImplemented(std::string method); }; - - /** - * Base class to hold transport model parameters. - * Used by TransportFactory. + //==================================================================================================================== + //! Base structure to hold transport model parameters. + /*! + * This structure is used by TransportFactory. */ class TransportParams { public: //! Default Constructor - TransportParams() : - nsp_(0), - thermo(0), - mw(0), - velocityBasis_(VB_MASSAVG), - tmax(1000000.), - tmin(10.), - mode_(0), - xml(0), - log_level(-1) - { - } + TransportParams(); //! Destructor - virtual ~TransportParams() - { -#ifdef DEBUG_MODE - delete xml; -#endif - } + virtual ~TransportParams(); //! Local storage of the number of species int nsp_; @@ -58,7 +63,7 @@ namespace Cantera { /*! * Length is nsp_ and units are kg kmol-1. */ - vector_fp mw; + vector_fp mw; //! A basis for the average velocity can be specified. /*! @@ -80,47 +85,23 @@ namespace Cantera { //! Log level int log_level; - }; - - /** - * Holds transport model parameters relevant to transport in ideal - * gases with a kinetic theory of gases derived transport model. - * Used by TransportFactory. + //==================================================================================================================== + //! This structure holds transport model parameters relevant to transport in ideal + //! gases with a kinetic theory of gases derived transport model. + /*! + * This structure is used by TransportFactory object. */ class GasTransportParams : public TransportParams { public: //! Constructor - GasTransportParams() : - TransportParams(), - visccoeffs(0), - condcoeffs(0), - diffcoeffs(0), - poly(0), - omega22_poly(0), - astar_poly(0), - bstar_poly(0), - cstar_poly(0), - zrot(0), - crot(0), - polar(0), - alpha(0), - fitlist(0), - eps(0), - sigma(0), - reducedMass(0, 0), - diam(0, 0), - epsilon(0, 0), - dipole(0, 0), - delta(0, 0) - { - } + GasTransportParams(); //! Destructor - virtual ~GasTransportParams() {} + virtual ~GasTransportParams(); // polynomial fits @@ -143,8 +124,7 @@ namespace Cantera { * The outer loop the number of species, nsp * The inner loop is over degree + 1, which is the polynomial order of the collision integral fit. */ - std::vector diffcoeffs; - + std::vector diffcoeffs; //! This is vector of vectors containing the integer ookup value for the (i,j) interaction /*! @@ -222,7 +202,7 @@ namespace Cantera { * Length = nsp * Units = m^3 */ - vector_fp alpha; + vector_fp alpha; //! This is vector containing the values of delta(i,j) that are used in the collision integral fits. /*! @@ -256,7 +236,7 @@ namespace Cantera { * * Length nsp * nsp. This is a symmetric matrix */ - DenseMatrix reducedMass; + DenseMatrix reducedMass; //! hard-sphere diameter for (i,j) collision /*! @@ -265,7 +245,7 @@ namespace Cantera { * * Length nsp * nsp. This is a symmetric matrix. */ - DenseMatrix diam; + DenseMatrix diam; //! The effective well depth for (i,j) collisions /*! @@ -274,7 +254,7 @@ namespace Cantera { * * Length nsp * nsp. This is a symmetric matrix. */ - DenseMatrix epsilon; + DenseMatrix epsilon; //! The effective dipole moment for (i,j) collisions /*! @@ -286,7 +266,7 @@ namespace Cantera { * * Length nsp * nsp. This is a symmetric matrix. */ - DenseMatrix dipole; + DenseMatrix dipole; //! Matrix containing the reduced dipole moment of the interaction between two species /*! @@ -295,10 +275,10 @@ namespace Cantera { * * Length nsp * nsp .This is a symmetric matrix */ - DenseMatrix delta; - + DenseMatrix delta; }; - -} + //==================================================================================================================== +} // End of namespace Cantera +//====================================================================================================================== #endif //CT_TRANSPORTPARAMS_H