Skip to content

Commit

Permalink
#3526 add missing argument docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
brosaplanella committed Apr 10, 2024
1 parent baa527c commit 11ea054
Showing 1 changed file with 1 addition and 66 deletions.
67 changes: 1 addition & 66 deletions pybamm/expression_tree/unary_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -985,63 +985,6 @@ class Downwind(UpwindDownwind):
def __init__(self, child):
super().__init__("downwind", child)


# class UpwindDownwindDivergence(SpatialOperator):
# """
# A node in the expression tree representing an upwinding or downwinding divergence
# operator. Usually to be used for better stability in convection-dominated equations.
# """

# def __init__(self, name, child):
# if child.domain == []:
# raise pybamm.DomainError(
# "Cannot take divergence of '{}' since its domain is empty. ".format(
# child
# )
# + "Try broadcasting the object first, e.g.\n\n"
# "\tpybamm.div(pybamm.PrimaryBroadcast(symbol, 'domain'))"
# )
# if child.evaluates_on_edges("primary") is False:
# raise TypeError(
# "Cannot take divergence of '{}' since it does not ".format(child)
# + "evaluate on edges. Usually, a gradient should be taken before the "
# "divergence."
# )
# super().__init__(name, child)

# def _evaluates_on_edges(self, dimension):
# """See :meth:`pybamm.Symbol._evaluates_on_edges()`."""
# return False

# def _sympy_operator(self, child):
# """Override :meth:`pybamm.UnaryOperator._sympy_operator`"""
# sympy_Divergence = have_optional_dependency("sympy.vector.operators", "Divergence")
# return sympy_Divergence(child)

# class UpwindDivergence(UpwindDownwindDivergence):
# """
# Upwinding divergence operator. To be used if flow velocity is positive
# (left to right).
# """
# def __init__(self, child):
# super().__init__("upwind div", child)

# def _unary_new_copy(self, child):
# """See :meth:`UnaryOperator._unary_new_copy()`."""
# return div(child, method="upwind")


# class DownwindDivergence(UpwindDownwindDivergence):
# """
# Downwinding divergence operator. To be used if flow velocity is positive
# (right to left).
# """
# def __init__(self, child):
# super().__init__("downwind div", child)

# def _unary_new_copy(self, child):
# """See :meth:`UnaryOperator._unary_new_copy()`."""
# return div(child, method="downwind")

class NotConstant(UnaryOperator):
"""Special class to wrap a symbol that should not be treated as a constant."""
Expand Down Expand Up @@ -1105,7 +1048,7 @@ def grad(symbol):
return Gradient(symbol)


def div(symbol, method="centred"):
def div(symbol):
"""
convenience function for creating a :class:`Divergence`
Expand Down Expand Up @@ -1140,14 +1083,6 @@ def div(symbol, method="centred"):

# Last resort
return Divergence(symbol)
# if method == "centred":
# return Divergence(symbol)
# elif method == "upwind":
# return UpwindDivergence(symbol)
# elif method == "downwind":
# return DownwindDivergence(symbol)
# else:
# raise ValueError(f"method {method} not recognised. It must be 'centred', 'upwind' or 'downwind'")


def laplacian(symbol):
Expand Down

0 comments on commit 11ea054

Please sign in to comment.