Skip to content

Commit

Permalink
Fix cross product basis instantiation with NCCs
Browse files Browse the repository at this point in the history
  • Loading branch information
kburns committed Jan 30, 2024
1 parent 6344389 commit b008633
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dedalus/core/arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ def __init__(self, arg0, arg1, out=None, **kw):
if arg0.tensorsig[0].dim != 3:
raise ValueError("CrossProduct requires 3-component vector fields.")
# FutureField requirements
self.domain = Domain(arg0.dist, self._build_bases(arg0, arg1))
self.domain = Domain(arg0.dist, self._build_bases(arg0, arg1, **kw))
self.tensorsig = arg0.tensorsig
self.dtype = np.result_type(arg0.dtype, arg1.dtype)
# Setup ghost broadcasting
Expand Down
6 changes: 4 additions & 2 deletions dedalus/core/basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,9 @@ def __mul__(self, other):
return self
if isinstance(other, Jacobi):
if self.grid_params == other.grid_params:
# Everything matches except size, a, b
# Take maximum size
size = max(self.size, other.size)
# Take grid (a0, b0) for minimal conversions
a = self.a0
b = self.b0
return self.clone_with(size=size, a=a, b=b)
Expand All @@ -548,8 +549,9 @@ def __rmatmul__(self, other):
return self
if isinstance(other, Jacobi):
if self.grid_params == other.grid_params:
# Everything matches except size, a, b
# Take maximum size
size = max(self.size, other.size)
# Take operand (a, b) for minimal conversions
a = self.a
b = self.b
return self.clone_with(size=size, a=a, b=b)
Expand Down

0 comments on commit b008633

Please sign in to comment.