Poisson Equation 2D

Essential Libraries


In [ ]:
# --------------------/
%matplotlib inline
# --------------------/
import h5py
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import axes3d

Load Data


In [ ]:
# --------------------/
name = 'poisson.h5'
# --------------------/
# data
with h5py.File(name,'r') as hf:  
    u = np.array( hf.get('solution/u') )
    x = np.array( hf.get('coordinates/x') )
    y = np.array( hf.get('coordinates/y') )
    hf.close()

Plots


In [ ]:
fig = plt.figure(figsize=(8,5))
axe = fig.add_subplot(111, projection='3d')
axe.plot_wireframe(x, y, u, alpha=0.75, color='darkturquoise', rstride=2, cstride=2)
axe.set_xlim(x.min() - 0.125, x.max() + 0.125)
axe.set_ylim(y.min() - 0.125, y.max() + 0.125)
axe.set_zlim(u.min() - 0.010, u.max() + 0.010)

NB property of FVNTS