@@ -595,9 +595,7 @@ def __init__(self, child, region="entire"):
595
595
def set_id (self ):
596
596
""" See :meth:`pybamm.Symbol.set_id()` """
597
597
self ._id = hash (
598
- (self .__class__ , self .name )
599
- + (self .children [0 ].id ,)
600
- + tuple (self .domain )
598
+ (self .__class__ , self .name ) + (self .children [0 ].id ,) + tuple (self .domain )
601
599
)
602
600
603
601
def _unary_simplify (self , simplified_child ):
@@ -798,6 +796,7 @@ def grad_squared(expression):
798
796
799
797
return Gradient_Squared (expression )
800
798
799
+
801
800
#
802
801
# Method to call SurfaceValue
803
802
#
@@ -1009,17 +1008,8 @@ def r_average(symbol):
1009
1008
:class:`Symbol`
1010
1009
the new averaged symbol
1011
1010
"""
1012
- ok_domains = [['positive particle' ], ['negative particle' ], []]
1013
- # Symbol must have domain [] or ["current collector"]
1014
- if symbol .domain not in ok_domains :
1015
- raise pybamm .DomainError (
1016
- """r-average only implemented in the 'particle' domain,
1017
- but symbol has domains {}""" .format (
1018
- symbol .domain
1019
- )
1020
- )
1021
- # If symbol doesn't have a domain, its average value is itself
1022
- elif symbol .domain == []:
1011
+ # If symbol doesn't have a particle domain, its r-averaged value is itself
1012
+ if symbol .domain not in [["positive particle" ], ["negative particle" ]]:
1023
1013
new_symbol = symbol .new_copy ()
1024
1014
new_symbol .parent = None
1025
1015
return new_symbol
0 commit comments