from em_examples import sphereElectrostatic_example as electrostatic_sphere

sig0 = 10.**-3.          # conductivity of the whole-space in S/m
sig1 = 10.**-1.         # conductivity of the sphere in S/m
sig2 = 10.**-5.         # conductivity of the sphere in S/m
R    = 50.          # radius of the sphere in m
E0   = 1.           # inducing field strength in V/m
n = 50             #level of discretization
xr = np.linspace(-2.*R, 2.*R, n) # X-axis discretization
yr = xr.copy()      # Y-axis discretization
dx = xr[1]-xr[0]       # mesh spacing
dy = yr[1]-yr[0]       # mesh spacing
zr = np.r_[0]          # identical to saying `zr = np.array([0])`
XYZ = electrostatic_sphere.ndgrid(xr,yr,zr) # Space Definition

fig, ax = plt.subplots(2,2,figsize=(18,12))
ax = electrostatic_sphere.mkvc(ax)
ax[0] = electrostatic_sphere.Plot_Total_Potential(XYZ,sig0,sig1,R,E0,ax[0])
ax[0].set_title('Conductive Sphere: \n Total Potential',fontsize=electrostatic_sphere.ftsize_title)
ax[1] = electrostatic_sphere.Plot_Secondary_Potential(XYZ,sig0,sig1,R,E0,ax[1])
ax[1].set_title('Conductive Sphere: \n Secondary Potential',fontsize=electrostatic_sphere.ftsize_title)
ax[2] = electrostatic_sphere.Plot_Total_Potential(XYZ,sig0,sig2,R,E0,ax[2])
ax[2].set_title('Resistive Sphere: \n Total Potential',fontsize=electrostatic_sphere.ftsize_title)
ax[3] = electrostatic_sphere.Plot_Secondary_Potential(XYZ,sig0,sig2,R,E0,ax[3])
ax[3].set_title('Resistive Sphere: \n Secondary Potential',fontsize=electrostatic_sphere.ftsize_title)

plt.tight_layout()
plt.show()