Update TransportFactory to allow the specification of the number of

dimensions in the problem and default it to 1. At present this is
only passed through to the LiquidTransport constructor.

Remove LiquidTransport member m_nDim since the base Transport class
already stores m_nDim.

Don't set m_nDim to 1 in LiquidTransport constructor, it is set by
the Transport constructor.
This commit is contained in:
Victor Brunini 2012-11-26 20:19:57 +00:00
parent 76a24eb9ce
commit c3233c1355
4 changed files with 10 additions and 16 deletions

View file

@ -1412,12 +1412,6 @@ private:
*/
bool m_debug;
//! Number of dimensions
/*!
* Either 1, 2, or 3
*/
size_t m_nDim;
//! Throw an exception if this method is invoked.
/*!
* This probably indicates something is not yet implemented.

View file

@ -116,8 +116,9 @@ public:
* @param model String name for the transport manager
* @param thermo ThermoPhase object
* @param log_level log level
* @param ndim Number of dimensions for fluxes
*/
virtual Transport* newTransport(const std::string& model, thermo_t* thermo, int log_level=0);
virtual Transport* newTransport(const std::string& model, thermo_t* thermo, int log_level=0, int ndim=1);
//! Build a new transport manager using the default transport manager
//! in the phase description and return a base class pointer to it
@ -384,11 +385,12 @@ private:
* @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.
* @param ndim Number of dimensions for transport fluxes
*
* @ingroup transportProps
*/
Transport* newTransportMgr(const std::string& transportModel = "", thermo_t* thermo = 0, int loglevel = 0,
TransportFactory* f = 0);
TransportFactory* f = 0, int ndim=1);
//====================================================================================================================
//! Create a new transport manager instance.
/*!

View file

@ -68,8 +68,7 @@ LiquidTransport::LiquidTransport(thermo_t* thermo, int ndim) :
m_lambda_temp_ok(false),
m_lambda_mix_ok(false),
m_mode(-1000),
m_debug(false),
m_nDim(1)
m_debug(false)
{
}
@ -113,8 +112,7 @@ LiquidTransport::LiquidTransport(const LiquidTransport& right) :
m_lambda_temp_ok(false),
m_lambda_mix_ok(false),
m_mode(-1000),
m_debug(false),
m_nDim(1)
m_debug(false)
{
/*
* Use the assignment operator to do the brunt

View file

@ -356,7 +356,7 @@ LiquidTranInteraction* TransportFactory::newLTI(const XML_Node& trNode,
pointer to it.
*/
Transport* TransportFactory::newTransport(const std::string& transportModel,
thermo_t* phase, int log_level)
thermo_t* phase, int log_level, int ndim)
{
if (transportModel == "") {
@ -411,7 +411,7 @@ Transport* TransportFactory::newTransport(const std::string& transportModel,
tr->setThermo(*phase);
break;
case cLiquidTransport:
tr = new LiquidTransport;
tr = new LiquidTransport(phase, ndim);
initLiquidTransport(tr, phase, log_level);
tr->setThermo(*phase);
break;
@ -1476,12 +1476,12 @@ void TransportFactory::fitProperties(GasTransportParams& tr,
*
* @ingroup transportProps
*/
Transport* newTransportMgr(const std::string& transportModel, thermo_t* thermo, int loglevel, TransportFactory* f)
Transport* newTransportMgr(const std::string& transportModel, thermo_t* thermo, int loglevel, TransportFactory* f, int ndim)
{
if (f == 0) {
f = TransportFactory::factory();
}
Transport* ptr = f->newTransport(transportModel, thermo, loglevel);
Transport* ptr = f->newTransport(transportModel, thermo, loglevel, ndim);
/*
* Note: We delete the static s_factory instance here, instead of in
* appdelete() in misc.cpp, to avoid linking problems involving