[Cython] Allow creation of Mixture objects without quantities for each phase
This commit is contained in:
parent
8793fc3bcb
commit
a60e10c3de
1 changed files with 4 additions and 0 deletions
|
|
@ -36,6 +36,10 @@ cdef class Mixture:
|
|||
self._phases = []
|
||||
|
||||
cdef _SolutionBase phase
|
||||
if isinstance(phases[0], _SolutionBase):
|
||||
# Assign default composition to the list of phases
|
||||
phases = [(p, 1 if i == 0 else 0) for i,p in enumerate(phases)]
|
||||
|
||||
for phase,moles in phases:
|
||||
self.mix.addPhase(phase.thermo, moles)
|
||||
self._phases.append(phase)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue