We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dba62be commit 21c3766Copy full SHA for 21c3766
1 file changed
devito/types/array.py
@@ -558,7 +558,11 @@ def dtype(self):
558
559
@cacheit
560
def sort_key(self, order=None):
561
- return self.base.sort_key(order=order)
+ # Ensure that the ComponentAccess is sorted as the base
562
+ # Also ensure that e.g. `fg[x+1].x` appears before `fg[x+1].y`
563
+ class_key, args, exp, coeff = self.base.sort_key(order=order)
564
+ args = (len(args[1]) + 1, args[1] + (self.index,))
565
+ return class_key, args, exp, coeff
566
567
# Default assumptions correspond to those of the `base`
568
for i in ('is_real', 'is_imaginary', 'is_commutative'):
0 commit comments