You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a compound basis x (formed from d domains) is inputted the outputted basis is not of size factor*(x.base_grid_size), but rather d * factor * (x.base_grid_size).
I think this is resolved when n_hi is moved into the for loop like this:
def basis_from_basis(basis, factor):
"""duplicates input basis with number of modes multiplied by input factor.
the new number of modes will be cast to an integer
inputs
------
basis : a dedalus basis
factor : a float that will multiply the grid size by basis
"""
basis_type = basis.__class__.__name__
if type(basis) == de.Compound:
sub_bases = []
for sub_basis in basis.subbases:
sub_basis_type = sub_basis.__class__.__name__
try:
n_hi = int(sub_basis.base_grid_size * factor)
nb = bases_register[sub_basis_type](basis.name, n_hi, interval=sub_basis.interval)
except KeyError:
raise KeyError("Don't know how to make a basis of type {}".format(basis_type))
sub_bases.append(nb)
new_basis = de.Compound(basis.name, tuple(sub_bases))
else:
try:
n_hi = int(basis.base_grid_size * factor)
new_basis = bases_register[basis_type](basis.name, n_hi, interval=basis.interval)
except KeyError:
raise KeyError("Don't know how to make a basis of type {}".format(basis_type))
return new_basis
Sorry if I've got this wrong, but this seems to fix the problem for my code!!
The text was updated successfully, but these errors were encountered:
When a compound basis x (formed from d domains) is inputted the outputted basis is not of size factor*(x.base_grid_size), but rather d * factor * (x.base_grid_size).
I think this is resolved when n_hi is moved into the for loop like this:
def basis_from_basis(basis, factor):
"""duplicates input basis with number of modes multiplied by input factor.
Sorry if I've got this wrong, but this seems to fix the problem for my code!!
The text was updated successfully, but these errors were encountered: