Skip to content

Commit

Permalink
[Transport] Update signature of new newTransport function
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl authored and speth committed Nov 27, 2021
1 parent 1f23494 commit 0805854
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
6 changes: 3 additions & 3 deletions include/cantera/transport/TransportFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ Transport* newTransportMgr(const std::string& transportModel = "",

//! Create a new Transport instance.
/*!
* @param thermo the ThermoPhase object associated with the phase
* @param model name of transport model; if "default", the default
* transport model for the ThermoPhase object is created
* @param thermo the ThermoPhase object associated with the phase
* @returns a Transport object for the phase
* @ingroup tranprops
*/
inline shared_ptr<Transport> newTransport(const std::string& model = "",
ThermoPhase* thermo = 0) {
inline shared_ptr<Transport> newTransport(ThermoPhase* thermo,
const std::string& model = "default") {
Transport* tr;
if (model == "default") {
tr = TransportFactory::factory()->newTransport(thermo, 0);
Expand Down
3 changes: 1 addition & 2 deletions interfaces/cython/cantera/_cantera.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -890,8 +890,7 @@ cdef extern from "cantera/transport/TransportFactory.h" namespace "Cantera":
cdef CxxTransport* newDefaultTransportMgr(CxxThermoPhase*) except +translate_exception
cdef CxxTransport* newTransportMgr(string, CxxThermoPhase*) except +translate_exception
cdef CxxTransport* newTransportMgr(string) except +translate_exception
cdef shared_ptr[CxxTransport] newTransport(string) except +translate_exception
cdef shared_ptr[CxxTransport] newTransport(string, CxxThermoPhase*) except +translate_exception
cdef shared_ptr[CxxTransport] newTransport(CxxThermoPhase*, string) except +translate_exception

cdef extern from "cantera/oneD/Domain1D.h":
cdef cppclass CxxDomain1D "Cantera::Domain1D":
Expand Down
8 changes: 4 additions & 4 deletions interfaces/cython/cantera/transport.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@ cdef class Transport(_SolutionBase):
def __init__(self, *args, **kwargs):
if self.transport == NULL:
if 'transport_model' not in kwargs:
self.base.setTransport(newTransport(stringify("default"), self.thermo))
self.base.setTransport(newTransport(self.thermo, stringify("default")))
else:
model = kwargs['transport_model']
if not model:
model = 'None'
self.base.setTransport(newTransport(stringify(model), self.thermo))
self.base.setTransport(newTransport(self.thermo, stringify(model)))
self.transport = self.base.transport().get()

super().__init__(*args, **kwargs)
Expand All @@ -190,7 +190,7 @@ cdef class Transport(_SolutionBase):
return pystr(self.transport.transportType())

def __set__(self, model):
self.base.setTransport(newTransport(stringify(model), self.thermo))
self.base.setTransport(newTransport(self.thermo, stringify(model)))
self.transport = self.base.transport().get()

property CK_mode:
Expand Down Expand Up @@ -375,7 +375,7 @@ cdef class DustyGasTransport(Transport):
"""
# The signature of this function causes warnings for Sphinx documentation
def __init__(self, *args, **kwargs):
self.base.setTransport(newTransport(stringify("DustyGas"), self.thermo))
self.base.setTransport(newTransport(self.thermo, stringify("DustyGas")))
self.transport = self.base.transport().get()
super().__init__(*args, **kwargs)

Expand Down

0 comments on commit 0805854

Please sign in to comment.