Пример #1
0
 def spherical(x, y, z, V):
     rho, phi, theta = to_spherical_np((x, y, z), mode='radians')
     variables.update(dict(rho=rho, phi=phi, theta=theta, V=V))
     r = safe_eval_compiled(compiled, variables, allowed_names = safe_names_np)
     if not isinstance(r, np.ndarray):
         r = np.full_like(x, r)
     return r
Пример #2
0
 def spherical_in(x, y, z, V):
     rho, phi, theta = to_spherical_np((x, y, z), mode='radians')
     variables.update(dict(rho=rho, phi=phi, theta=theta, V=V))
     v1 = safe_eval_compiled(compiled1, variables, allowed_names = safe_names_np)
     v2 = safe_eval_compiled(compiled2, variables, allowed_names = safe_names_np)
     v3 = safe_eval_compiled(compiled3, variables, allowed_names = safe_names_np)
     if not isinstance(v1, np.ndarray):
         v1 = np.full_like(x, v1)
     if not isinstance(v2, np.ndarray):
         v2 = np.full_like(x, v2)
     if not isinstance(v3, np.ndarray):
         v3 = np.full_like(x, v3)
     return out_coordinates(v1, v2, v3)