Simple gridgen

[1]:
%matplotlib inline
import numpy as np
from cem_gridtools.cem_gridtools import CGrid
[2]:
# Define boundary points
x = np.array([0, 1, 1, 0], dtype='d')
y = np.array([0, 0, 1, 1], dtype='d')
# Make all points external
beta = np.ones(x.shape, dtype='d')
[3]:
# Create, generate and plot resulting grid
CG = CGrid(x,y,beta)
CG.gen_grid(5, 8)
CG.plot()
../_images/examples_cgrids_3_0.png
[4]:
# Plot full grid
CG.plot(dd=True)
../_images/examples_cgrids_4_0.png

Grid with channels

[6]:
pts = np.loadtxt('grid_points.txt')
CG = CGrid(pts[:,0],pts[:,1],pts[:,2])
CG.gen_grid(30,42)
CG.plot(legend=True)
../_images/examples_cgrids_6_0.png