Skip to content

Commit 0c88c9e

Browse files
authored
Change default coefficient of ImplicitSourceTerm to 1 (#984)
Fixes #512
1 parent 2764950 commit 0c88c9e

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

fipy/terms/implicitSourceTerm.py

+13
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@ class ImplicitSourceTerm(SourceTerm):
2020
where :math:`S` is the `coeff` value.
2121
"""
2222

23+
def __init__(self, coeff=1., var=None):
24+
r"""
25+
Parameters
26+
----------
27+
coeff : float or ~fipy.variables.cellVariable.CellVariable
28+
Proportionality coefficient :math:`S` (default: 1)
29+
var : ~fipy.variables.cellVariable.CellVariable
30+
Variable :math:`\phi` that
31+
:class:`~fipy.terms.implicitSourceTerm.ImplicitSourceTerm` is
32+
implicit in.
33+
"""
34+
super(ImplicitSourceTerm, self).__init__(coeff=coeff, var=var)
35+
2336
def _getWeight(self, var, transientGeomCoeff=None, diffusionGeomCoeff=None):
2437
"""
2538
Test for a bug due to the sign operator not being updating

fipy/terms/sourceTerm.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,18 @@ class SourceTerm(CellTerm):
1515
.. attention:: This class is abstract. Always create one of its subclasses.
1616
"""
1717
def __init__(self, coeff=0., var=None):
18+
r"""
19+
Parameters
20+
----------
21+
coeff : float or ~fipy.variables.cellVariable.CellVariable
22+
Coefficient of source (default: 0)
23+
var : ~fipy.variables.cellVariable.CellVariable
24+
Variable :math:`\phi` that
25+
:class:`~fipy.terms.sourceTerm.SourceTerm` is implicit in.
26+
"""
1827
if self.__class__ is SourceTerm:
1928
raise AbstractBaseClassError
20-
CellTerm.__init__(self, coeff=coeff, var=var)
29+
super(SourceTerm, self).__init__(coeff=coeff, var=var)
2130

2231
def _calcGeomCoeff(self, var):
2332
self._checkCoeff(var)

0 commit comments

Comments
 (0)