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
I'm a new user trying to use dedalus to calculate some integrals with spherical harmonics. I was testing the following simple code snippet to see if the normalization is consistent.
In the code snippet below I attempt to integrate the square of l=2, m=0 spherical harmonics over theta and phi.
importnumpyasnpimportdedalus.publicasd3fromscipy.specialimportsph_harmNphi,Ntheta=256,128dealias=1dtype=np.complex128mesh=Nonecoords=d3.S2Coordinates('phi','theta')dist=d3.Distributor(coords,dtype=dtype,mesh=mesh)sphere=d3.SphereBasis(coords,shape=(Nphi,Ntheta),dealias=dealias,radius=1,dtype=dtype)phi,theta=dist.local_grids(sphere)phigrid,thetagrid=np.meshgrid(phi[:,0],theta[0, :],indexing='ij')Y20=dist.Field(name='Y20',bases=sphere)Y20['g']=sph_harm(0,2,phigrid,thetagrid)[...]Y20_sq=Y20*Y20norm=d3.Integrate(Y20_sq,coords).evaluate()['g']# should give 1
And I get the following error message.
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
Cell In[122], line 1
----> 1 d3.Integrate(Y20_sq, coords).evaluate()['g']
File /usr/local/lib/python3.11/site-packages/dedalus/tools/dispatch.py:35, in MultiClass.__call__(cls, *args, **kw)
32 return exception.output
34 if len(passlist) == 0:
---> 35 raise NotImplementedError("No subclasses of {} found for the supplied arguments: {}, {}".format(cls, args, kw))
36 elif len(passlist) > 1:
37 raise ValueError("Degenerate subclasses of {} found for the supplied arguments {}, {}: {}".format(cls, args, kw, passlist))
NotImplementedError: No subclasses of <class 'dedalus.core.operators.Integrate'> found for the supplied arguments: (Mul(<Field 4825733392>, <Field 4825733392>), <dedalus.core.coords.S2Coordinates object at 0x11f34d450>), {}
Is the integration on 2-sphere not supported?
The text was updated successfully, but these errors were encountered:
Hi!
I'm a new user trying to use dedalus to calculate some integrals with spherical harmonics. I was testing the following simple code snippet to see if the normalization is consistent.
In the code snippet below I attempt to integrate the square of l=2, m=0 spherical harmonics over
theta
andphi
.And I get the following error message.
Is the integration on 2-sphere not supported?
The text was updated successfully, but these errors were encountered: