@@ -3415,8 +3415,8 @@ class CartesianDivergence(Divergence):
34153415 @classmethod
34163416 def _preprocess_args (cls , operand , index = 0 , out = None ):
34173417 coordsys = operand .tensorsig [index ]
3418- if operand .domain .get_basis (coordsys ) is None :
3419- raise SkipDispatchException (output = 0 )
3418+ if not any ([ operand .domain .get_basis (cs ) for cs in coordsys . coords ]) :
3419+ raise SkipDispatchException (output = 0 )
34203420 return [operand ], {'index' : index , 'out' : out }
34213421
34223422 def __init__ (self , operand , index = 0 , out = None ):
@@ -3964,7 +3964,13 @@ def _preprocess_args(cls, operand, coordsys=None, out=None):
39643964 coordsys = operand .dist .single_coordsys
39653965 if coordsys is False :
39663966 raise ValueError ("coordsys must be specified." )
3967- elif not isinstance (coordsys , coords .DirectProduct ) and operand .domain .get_basis (coordsys ) is None :
3967+ elif isinstance (coordsys , coords .DirectProduct ):
3968+ if not any ([operand .domain .get_basis (cs ) for cs in coordsys .coordsystems ]):
3969+ raise SkipDispatchException (output = 0 )
3970+ elif isinstance (coordsys , coords .CartesianCoordinates ):
3971+ if not any ([operand .domain .get_basis (cs ) for cs in coordsys .coords ]):
3972+ raise SkipDispatchException (output = 0 )
3973+ elif operand .domain .get_basis (coordsys ) is None :
39683974 raise SkipDispatchException (output = 0 )
39693975 return [operand , coordsys ], {'out' : out }
39703976
0 commit comments