Write a code that generates automatically a structured nite element mesh with 2N^2 triangles.
The code should generate two arrays triangle, nodes.
. nodes(k,1) is the x coordinate of the node number k.
. nodes(k,2) is the y coordinate of the node number k.
. nodes(k,3) is equal to -1 if the node is constrained (i.e. on the boundary of the domain) and +1 if
the node is a free node (i.e. interior to the domain).
. triangle(k,i) is the global number of the local node number i of element k, for i = 1; 2; 3. The local
numbering is done counterclockwise, starting with the node at the square angle of the triangle.
Test the code for N = 2 and N = 4: give the entries of the arrays described above and plot the grids.
Please reply as soon as possible. The deadline is 2-3 days from today.