Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default coefficient of ImplicitSourceTerm to 1 #984

Merged
merged 8 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions fipy/terms/implicitSourceTerm.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ class ImplicitSourceTerm(SourceTerm):
where :math:`S` is the `coeff` value.
"""

def __init__(self, coeff=1., var=None):
r"""
Parameters
----------
coeff : float or ~fipy.variables.cellVariable.CellVariable
Proportionality coefficient :math:`S` (default: 1)
var : ~fipy.variables.cellVariable.CellVariable
Variable :math:`\phi` that
:class:`~fipy.terms.sourcTerm.SourceTerm` is implicit in.
"""
super(ImplicitSourceTerm, self).__init__(coeff=coeff, var=var)

def _getWeight(self, var, transientGeomCoeff=None, diffusionGeomCoeff=None):
"""
Test for a bug due to the sign operator not being updating
Expand Down
9 changes: 9 additions & 0 deletions fipy/terms/sourceTerm.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ class SourceTerm(CellTerm):
.. attention:: This class is abstract. Always create one of its subclasses.
"""
def __init__(self, coeff=0., var=None):
r"""
Parameters
----------
coeff : float or ~fipy.variables.cellVariable.CellVariable
Coefficient of source (default: 0)
var : ~fipy.variables.cellVariable.CellVariable
Variable :math:`\phi` that
:class:`~fipy.terms.sourcTerm.SourceTerm` is implicit in.
"""
if self.__class__ is SourceTerm:
raise AbstractBaseClassError
CellTerm.__init__(self, coeff=coeff, var=var)
Expand Down