from grains.dic import DIC
from grains.geometry import TriMesh
x_grid, y_grid = np.mgrid[-1:1:100j, 1:2:50j]
exact_solution = lambda x, y: 1 - (x + y**2) * np.sign(x)
grid = DIC(np.random.rand(*np.shape(x_grid.T)), np.random.rand(*np.shape(x_grid.T)))
grid.set_transformation((-1, 2), 50)
n_nodes = 100  # modify this to see how good the interpolated solution is
msh = TriMesh(*TriMesh.sample_mesh(1, n_nodes))
grid.plot_superimposedmesh(msh, linewidth=3, markerfacecolor='b')
plt.show()
