
//====================================================================================================================================
// Assing the index to the points that determine the contraint
int m = 0;
for (k=0; k<3; k++) {
	for (j=0; j<Ny; j++) {
		for (i=0; i<Nx; i++) {
			id_tmp = Ver_Id(i, j, k, Nx, Ny);
			
			// First set all of them to -1
			for (m=0; m<48; m++) {
				Plane_test_p1[id_tmp][m] = -1;Plane_test_p2[id_tmp][m] = -1;Plane_test_p3[id_tmp][m] = -1;
			}
			
			
			if (i < Nx/2) { // left side
				if (k==0) { // For the top sheet
					
					// Left side
					// Top plane
					Plane_test_p1[id_tmp][0] = Ver_Id(i-1, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][0] = Ver_Id(i-1, j, 0, Nx, Ny);
					Plane_test_p3[id_tmp][0] = Ver_Id(i-1, j-1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][1] = Ver_Id(i-1, j-1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][1] = Ver_Id(i-1, j, 1, Nx, Ny);
					Plane_test_p3[id_tmp][1] = Ver_Id(i-1, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][2] = Ver_Id(i-1, j+1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][2] = Ver_Id(i-1, j, 1, Nx, Ny);
					Plane_test_p3[id_tmp][2] = Ver_Id(i-1, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][3] = Ver_Id(i-1, j, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][3] = Ver_Id(i-1, j+1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][3] = Ver_Id(i-1, j+1, 0, Nx, Ny);
					
					// Forward side
					// Top plane
					Plane_test_p1[id_tmp][16] = Ver_Id(i-1, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][16] = Ver_Id(i-1, j+1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][16] = Ver_Id(i, j+1, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][17] = Ver_Id(i, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][17] = Ver_Id(i, j+1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][17] = Ver_Id(i-1, j+1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][18] = Ver_Id(i, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][18] = Ver_Id(i, j+1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][18] = Ver_Id(i+1, j+1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][19] = Ver_Id(i, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][19] = Ver_Id(i+1, j+1, 0, Nx, Ny);
					Plane_test_p3[id_tmp][19] = Ver_Id(i+1, j+1, 1, Nx, Ny);
					
					// Back side
					// Top plane
					Plane_test_p1[id_tmp][24] = Ver_Id(i-1, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][24] = Ver_Id(i-1, j-1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][24] = Ver_Id(i, j-1, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][25] = Ver_Id(i, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][25] = Ver_Id(i, j-1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][25] = Ver_Id(i-1, j-1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][26] = Ver_Id(i, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][26] = Ver_Id(i, j-1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][26] = Ver_Id(i+1, j-1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][27] = Ver_Id(i, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][27] = Ver_Id(i+1, j-1, 0, Nx, Ny);
					Plane_test_p3[id_tmp][27] = Ver_Id(i+1, j-1, 1, Nx, Ny);
					
					// include the bottom
					Plane_test_p1[id_tmp][40] = Ver_Id(i-1, j-1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][40] = Ver_Id(i, j-1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][40] = Ver_Id(i-1, j, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][41] = Ver_Id(i-1, j, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][41] = Ver_Id(i, j-1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][41] = Ver_Id(i, j, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][42] = Ver_Id(i, j+1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][42] = Ver_Id(i-1, j, 2, Nx, Ny);
					Plane_test_p3[id_tmp][42] = Ver_Id(i, j, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][43] = Ver_Id(i-1, j, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][43] = Ver_Id(i-1, j+1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][43] = Ver_Id(i, j+1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][44] = Ver_Id(i+1, j-1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][44] = Ver_Id(i+1, j, 2, Nx, Ny);
					Plane_test_p3[id_tmp][44] = Ver_Id(i, j-1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][45] = Ver_Id(i, j, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][45] = Ver_Id(i, j-1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][45] = Ver_Id(i+1, j, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][46] = Ver_Id(i+1, j+1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][46] = Ver_Id(i+1, j, 2, Nx, Ny);
					Plane_test_p3[id_tmp][46] = Ver_Id(i, j, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][47] = Ver_Id(i+1, j+1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][47] = Ver_Id(i, j, 2, Nx, Ny);
					Plane_test_p3[id_tmp][47] = Ver_Id(i, j+1, 2, Nx, Ny);
				}
				else if (k==1){ // Middle plane
					
					// Left side
					// Top plane
					Plane_test_p1[id_tmp][0] = Ver_Id(i-1, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][0] = Ver_Id(i-1, j, 0, Nx, Ny);
					Plane_test_p3[id_tmp][0] = Ver_Id(i-1, j-1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][1] = Ver_Id(i-1, j-1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][1] = Ver_Id(i-1, j, 1, Nx, Ny);
					Plane_test_p3[id_tmp][1] = Ver_Id(i-1, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][2] = Ver_Id(i-1, j+1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][2] = Ver_Id(i-1, j, 1, Nx, Ny);
					Plane_test_p3[id_tmp][2] = Ver_Id(i-1, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][3] = Ver_Id(i-1, j, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][3] = Ver_Id(i-1, j+1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][3] = Ver_Id(i-1, j+1, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][4] = Ver_Id(i-1, j-1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][4] = Ver_Id(i-1, j, 1, Nx, Ny);
					Plane_test_p3[id_tmp][4] = Ver_Id(i-1, j-1, 2, Nx, Ny);
					
					// Bottom plane
					Plane_test_p1[id_tmp][5] = Ver_Id(i-1, j-1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][5] = Ver_Id(i-1, j, 2, Nx, Ny);
					Plane_test_p3[id_tmp][5] = Ver_Id(i-1, j, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][6] = Ver_Id(i-1, j+1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][6] = Ver_Id(i-1, j, 2, Nx, Ny);
					Plane_test_p3[id_tmp][6] = Ver_Id(i-1, j, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][7] = Ver_Id(i-1, j, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][7] = Ver_Id(i-1, j+1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][7] = Ver_Id(i-1, j+1, 1, Nx, Ny);
					
					// Forward side
					// Top plane
					Plane_test_p1[id_tmp][16] = Ver_Id(i-1, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][16] = Ver_Id(i-1, j+1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][16] = Ver_Id(i, j+1, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][17] = Ver_Id(i, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][17] = Ver_Id(i, j+1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][17] = Ver_Id(i-1, j+1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][18] = Ver_Id(i, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][18] = Ver_Id(i, j+1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][18] = Ver_Id(i+1, j+1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][19] = Ver_Id(i, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][19] = Ver_Id(i+1, j+1, 0, Nx, Ny);
					Plane_test_p3[id_tmp][19] = Ver_Id(i+1, j+1, 1, Nx, Ny);
					
					// Bottom plane
					Plane_test_p1[id_tmp][20] = Ver_Id(i-1, j+1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][20] = Ver_Id(i-1, j+1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][20] = Ver_Id(i, j+1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][21] = Ver_Id(i, j+1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][21] = Ver_Id(i, j+1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][21] = Ver_Id(i-1, j+1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][22] = Ver_Id(i, j+1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][22] = Ver_Id(i, j+1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][22] = Ver_Id(i+1, j+1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][23] = Ver_Id(i, j+1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][23] = Ver_Id(i+1, j+1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][23] = Ver_Id(i+1, j+1, 2, Nx, Ny);
					
					// Back side
					// Top plane
					Plane_test_p1[id_tmp][24] = Ver_Id(i-1, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][24] = Ver_Id(i-1, j-1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][24] = Ver_Id(i, j-1, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][25] = Ver_Id(i, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][25] = Ver_Id(i, j-1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][25] = Ver_Id(i-1, j-1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][26] = Ver_Id(i, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][26] = Ver_Id(i, j-1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][26] = Ver_Id(i+1, j-1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][27] = Ver_Id(i, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][27] = Ver_Id(i+1, j-1, 0, Nx, Ny);
					Plane_test_p3[id_tmp][27] = Ver_Id(i+1, j-1, 1, Nx, Ny);
					
					// Bottom plane
					Plane_test_p1[id_tmp][28] = Ver_Id(i-1, j-1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][28] = Ver_Id(i-1, j-1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][28] = Ver_Id(i, j-1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][29] = Ver_Id(i, j-1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][29] = Ver_Id(i, j-1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][29] = Ver_Id(i-1, j-1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][30] = Ver_Id(i, j-1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][30] = Ver_Id(i, j-1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][30] = Ver_Id(i+1, j-1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][31] = Ver_Id(i, j-1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][31] = Ver_Id(i+1, j-1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][31] = Ver_Id(i+1, j-1, 2, Nx, Ny);
					
					// include top and bottom
					Plane_test_p1[id_tmp][32] = Ver_Id(i-1, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][32] = Ver_Id(i, j-1, 0, Nx, Ny);
					Plane_test_p3[id_tmp][32] = Ver_Id(i-1, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][33] = Ver_Id(i-1, j, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][33] = Ver_Id(i, j-1, 0, Nx, Ny);
					Plane_test_p3[id_tmp][33] = Ver_Id(i, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][34] = Ver_Id(i, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][34] = Ver_Id(i-1, j, 0, Nx, Ny);
					Plane_test_p3[id_tmp][34] = Ver_Id(i, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][35] = Ver_Id(i-1, j, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][35] = Ver_Id(i-1, j+1, 0, Nx, Ny);
					Plane_test_p3[id_tmp][35] = Ver_Id(i, j+1, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][36] = Ver_Id(i+1, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][36] = Ver_Id(i+1, j, 0, Nx, Ny);
					Plane_test_p3[id_tmp][36] = Ver_Id(i, j-1, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][37] = Ver_Id(i, j, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][37] = Ver_Id(i, j-1, 0, Nx, Ny);
					Plane_test_p3[id_tmp][37] = Ver_Id(i+1, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][38] = Ver_Id(i+1, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][38] = Ver_Id(i+1, j, 0, Nx, Ny);
					Plane_test_p3[id_tmp][38] = Ver_Id(i, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][39] = Ver_Id(i+1, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][39] = Ver_Id(i, j, 0, Nx, Ny);
					Plane_test_p3[id_tmp][39] = Ver_Id(i, j+1, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][40] = Ver_Id(i-1, j-1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][40] = Ver_Id(i, j-1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][40] = Ver_Id(i-1, j, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][41] = Ver_Id(i-1, j, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][41] = Ver_Id(i, j-1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][41] = Ver_Id(i, j, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][42] = Ver_Id(i, j+1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][42] = Ver_Id(i-1, j, 2, Nx, Ny);
					Plane_test_p3[id_tmp][42] = Ver_Id(i, j, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][43] = Ver_Id(i-1, j, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][43] = Ver_Id(i-1, j+1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][43] = Ver_Id(i, j+1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][44] = Ver_Id(i+1, j-1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][44] = Ver_Id(i+1, j, 2, Nx, Ny);
					Plane_test_p3[id_tmp][44] = Ver_Id(i, j-1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][45] = Ver_Id(i, j, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][45] = Ver_Id(i, j-1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][45] = Ver_Id(i+1, j, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][46] = Ver_Id(i+1, j+1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][46] = Ver_Id(i+1, j, 2, Nx, Ny);
					Plane_test_p3[id_tmp][46] = Ver_Id(i, j, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][47] = Ver_Id(i+1, j+1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][47] = Ver_Id(i, j, 2, Nx, Ny);
					Plane_test_p3[id_tmp][47] = Ver_Id(i, j+1, 2, Nx, Ny);
					
				}
				else{ // Bottom plane
					
					// Left side
					
					// Bottom plane
					Plane_test_p1[id_tmp][4] = Ver_Id(i-1, j-1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][4] = Ver_Id(i-1, j, 1, Nx, Ny);
					Plane_test_p3[id_tmp][4] = Ver_Id(i-1, j-1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][5] = Ver_Id(i-1, j-1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][5] = Ver_Id(i-1, j, 2, Nx, Ny);
					Plane_test_p3[id_tmp][5] = Ver_Id(i-1, j, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][6] = Ver_Id(i-1, j+1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][6] = Ver_Id(i-1, j, 2, Nx, Ny);
					Plane_test_p3[id_tmp][6] = Ver_Id(i-1, j, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][7] = Ver_Id(i-1, j, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][7] = Ver_Id(i-1, j+1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][7] = Ver_Id(i-1, j+1, 1, Nx, Ny);
					
					// Right side
					
					// Forward side
					
					// Bottom plane
					Plane_test_p1[id_tmp][20] = Ver_Id(i-1, j+1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][20] = Ver_Id(i-1, j+1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][20] = Ver_Id(i, j+1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][21] = Ver_Id(i, j+1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][21] = Ver_Id(i, j+1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][21] = Ver_Id(i-1, j+1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][22] = Ver_Id(i, j+1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][22] = Ver_Id(i, j+1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][22] = Ver_Id(i+1, j+1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][23] = Ver_Id(i, j+1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][23] = Ver_Id(i+1, j+1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][23] = Ver_Id(i+1, j+1, 2, Nx, Ny);
					
					// Back side
					
					// Bottom plane
					Plane_test_p1[id_tmp][28] = Ver_Id(i-1, j-1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][28] = Ver_Id(i-1, j-1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][28] = Ver_Id(i, j-1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][29] = Ver_Id(i, j-1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][29] = Ver_Id(i, j-1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][29] = Ver_Id(i-1, j-1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][30] = Ver_Id(i, j-1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][30] = Ver_Id(i, j-1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][30] = Ver_Id(i+1, j-1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][31] = Ver_Id(i, j-1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][31] = Ver_Id(i+1, j-1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][31] = Ver_Id(i+1, j-1, 2, Nx, Ny);
					
					// include Top side
					Plane_test_p1[id_tmp][32] = Ver_Id(i-1, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][32] = Ver_Id(i, j-1, 0, Nx, Ny);
					Plane_test_p3[id_tmp][32] = Ver_Id(i-1, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][33] = Ver_Id(i-1, j, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][33] = Ver_Id(i, j-1, 0, Nx, Ny);
					Plane_test_p3[id_tmp][33] = Ver_Id(i, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][34] = Ver_Id(i, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][34] = Ver_Id(i-1, j, 0, Nx, Ny);
					Plane_test_p3[id_tmp][34] = Ver_Id(i, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][35] = Ver_Id(i-1, j, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][35] = Ver_Id(i-1, j+1, 0, Nx, Ny);
					Plane_test_p3[id_tmp][35] = Ver_Id(i, j+1, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][36] = Ver_Id(i+1, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][36] = Ver_Id(i+1, j, 0, Nx, Ny);
					Plane_test_p3[id_tmp][36] = Ver_Id(i, j-1, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][37] = Ver_Id(i, j, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][37] = Ver_Id(i, j-1, 0, Nx, Ny);
					Plane_test_p3[id_tmp][37] = Ver_Id(i+1, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][38] = Ver_Id(i+1, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][38] = Ver_Id(i+1, j, 0, Nx, Ny);
					Plane_test_p3[id_tmp][38] = Ver_Id(i, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][39] = Ver_Id(i+1, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][39] = Ver_Id(i, j, 0, Nx, Ny);
					Plane_test_p3[id_tmp][39] = Ver_Id(i, j+1, 0, Nx, Ny);
					
				}
			}
			else { // right half
				if (k==0) { // For the top sheet
					
					
					// Right side
					// Top plane
					Plane_test_p1[id_tmp][8] = Ver_Id(i+1, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][8] = Ver_Id(i+1, j, 0, Nx, Ny);
					Plane_test_p3[id_tmp][8] = Ver_Id(i+1, j-1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][9] = Ver_Id(i+1, j-1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][9] = Ver_Id(i+1, j, 1, Nx, Ny);
					Plane_test_p3[id_tmp][9] = Ver_Id(i+1, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][10] = Ver_Id(i+1, j+1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][10] = Ver_Id(i+1, j, 1, Nx, Ny);
					Plane_test_p3[id_tmp][10] = Ver_Id(i+1, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][11] = Ver_Id(i+1, j, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][11] = Ver_Id(i+1, j+1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][11] = Ver_Id(i+1, j+1, 0, Nx, Ny);
					
					// Forward side
					// Top plane
					Plane_test_p1[id_tmp][16] = Ver_Id(i-1, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][16] = Ver_Id(i-1, j+1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][16] = Ver_Id(i, j+1, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][17] = Ver_Id(i, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][17] = Ver_Id(i, j+1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][17] = Ver_Id(i-1, j+1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][18] = Ver_Id(i, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][18] = Ver_Id(i, j+1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][18] = Ver_Id(i+1, j+1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][19] = Ver_Id(i, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][19] = Ver_Id(i+1, j+1, 0, Nx, Ny);
					Plane_test_p3[id_tmp][19] = Ver_Id(i+1, j+1, 1, Nx, Ny);
					
					// Back side
					// Top plane
					Plane_test_p1[id_tmp][24] = Ver_Id(i-1, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][24] = Ver_Id(i-1, j-1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][24] = Ver_Id(i, j-1, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][25] = Ver_Id(i, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][25] = Ver_Id(i, j-1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][25] = Ver_Id(i-1, j-1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][26] = Ver_Id(i, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][26] = Ver_Id(i, j-1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][26] = Ver_Id(i+1, j-1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][27] = Ver_Id(i, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][27] = Ver_Id(i+1, j-1, 0, Nx, Ny);
					Plane_test_p3[id_tmp][27] = Ver_Id(i+1, j-1, 1, Nx, Ny);
					
					// include the bottom
					Plane_test_p1[id_tmp][40] = Ver_Id(i-1, j-1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][40] = Ver_Id(i, j-1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][40] = Ver_Id(i-1, j, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][41] = Ver_Id(i-1, j, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][41] = Ver_Id(i, j-1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][41] = Ver_Id(i, j, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][42] = Ver_Id(i, j+1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][42] = Ver_Id(i-1, j, 2, Nx, Ny);
					Plane_test_p3[id_tmp][42] = Ver_Id(i, j, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][43] = Ver_Id(i-1, j, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][43] = Ver_Id(i-1, j+1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][43] = Ver_Id(i, j+1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][44] = Ver_Id(i+1, j-1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][44] = Ver_Id(i+1, j, 2, Nx, Ny);
					Plane_test_p3[id_tmp][44] = Ver_Id(i, j-1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][45] = Ver_Id(i, j, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][45] = Ver_Id(i, j-1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][45] = Ver_Id(i+1, j, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][46] = Ver_Id(i+1, j+1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][46] = Ver_Id(i+1, j, 2, Nx, Ny);
					Plane_test_p3[id_tmp][46] = Ver_Id(i, j, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][47] = Ver_Id(i+1, j+1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][47] = Ver_Id(i, j, 2, Nx, Ny);
					Plane_test_p3[id_tmp][47] = Ver_Id(i, j+1, 2, Nx, Ny);
				}
				else if (k==1){ // Middle plane
					
					// Right side
					// Top plane
					Plane_test_p1[id_tmp][8] = Ver_Id(i+1, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][8] = Ver_Id(i+1, j, 0, Nx, Ny);
					Plane_test_p3[id_tmp][8] = Ver_Id(i+1, j-1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][9] = Ver_Id(i+1, j-1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][9] = Ver_Id(i+1, j, 1, Nx, Ny);
					Plane_test_p3[id_tmp][9] = Ver_Id(i+1, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][10] = Ver_Id(i+1, j+1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][10] = Ver_Id(i+1, j, 1, Nx, Ny);
					Plane_test_p3[id_tmp][10] = Ver_Id(i+1, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][11] = Ver_Id(i+1, j, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][11] = Ver_Id(i+1, j+1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][11] = Ver_Id(i+1, j+1, 0, Nx, Ny);
					
					// Bottom plane
					Plane_test_p1[id_tmp][12] = Ver_Id(i+1, j-1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][12] = Ver_Id(i+1, j, 1, Nx, Ny);
					Plane_test_p3[id_tmp][12] = Ver_Id(i+1, j-1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][13] = Ver_Id(i+1, j-1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][13] = Ver_Id(i+1, j, 2, Nx, Ny);
					Plane_test_p3[id_tmp][13] = Ver_Id(i+1, j, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][14] = Ver_Id(i+1, j+1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][14] = Ver_Id(i+1, j, 2, Nx, Ny);
					Plane_test_p3[id_tmp][14] = Ver_Id(i+1, j, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][15] = Ver_Id(i+1, j, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][15] = Ver_Id(i+1, j+1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][15] = Ver_Id(i+1, j+1, 1, Nx, Ny);
					
					// Forward side
					// Top plane
					Plane_test_p1[id_tmp][16] = Ver_Id(i-1, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][16] = Ver_Id(i-1, j+1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][16] = Ver_Id(i, j+1, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][17] = Ver_Id(i, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][17] = Ver_Id(i, j+1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][17] = Ver_Id(i-1, j+1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][18] = Ver_Id(i, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][18] = Ver_Id(i, j+1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][18] = Ver_Id(i+1, j+1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][19] = Ver_Id(i, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][19] = Ver_Id(i+1, j+1, 0, Nx, Ny);
					Plane_test_p3[id_tmp][19] = Ver_Id(i+1, j+1, 1, Nx, Ny);
					
					// Bottom plane
					Plane_test_p1[id_tmp][20] = Ver_Id(i-1, j+1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][20] = Ver_Id(i-1, j+1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][20] = Ver_Id(i, j+1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][21] = Ver_Id(i, j+1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][21] = Ver_Id(i, j+1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][21] = Ver_Id(i-1, j+1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][22] = Ver_Id(i, j+1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][22] = Ver_Id(i, j+1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][22] = Ver_Id(i+1, j+1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][23] = Ver_Id(i, j+1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][23] = Ver_Id(i+1, j+1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][23] = Ver_Id(i+1, j+1, 2, Nx, Ny);
					
					// Back side
					// Top plane
					Plane_test_p1[id_tmp][24] = Ver_Id(i-1, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][24] = Ver_Id(i-1, j-1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][24] = Ver_Id(i, j-1, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][25] = Ver_Id(i, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][25] = Ver_Id(i, j-1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][25] = Ver_Id(i-1, j-1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][26] = Ver_Id(i, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][26] = Ver_Id(i, j-1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][26] = Ver_Id(i+1, j-1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][27] = Ver_Id(i, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][27] = Ver_Id(i+1, j-1, 0, Nx, Ny);
					Plane_test_p3[id_tmp][27] = Ver_Id(i+1, j-1, 1, Nx, Ny);
					
					// Bottom plane
					Plane_test_p1[id_tmp][28] = Ver_Id(i-1, j-1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][28] = Ver_Id(i-1, j-1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][28] = Ver_Id(i, j-1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][29] = Ver_Id(i, j-1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][29] = Ver_Id(i, j-1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][29] = Ver_Id(i-1, j-1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][30] = Ver_Id(i, j-1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][30] = Ver_Id(i, j-1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][30] = Ver_Id(i+1, j-1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][31] = Ver_Id(i, j-1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][31] = Ver_Id(i+1, j-1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][31] = Ver_Id(i+1, j-1, 2, Nx, Ny);
					
					// include top and bottom
					Plane_test_p1[id_tmp][32] = Ver_Id(i-1, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][32] = Ver_Id(i, j-1, 0, Nx, Ny);
					Plane_test_p3[id_tmp][32] = Ver_Id(i-1, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][33] = Ver_Id(i-1, j, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][33] = Ver_Id(i, j-1, 0, Nx, Ny);
					Plane_test_p3[id_tmp][33] = Ver_Id(i, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][34] = Ver_Id(i, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][34] = Ver_Id(i-1, j, 0, Nx, Ny);
					Plane_test_p3[id_tmp][34] = Ver_Id(i, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][35] = Ver_Id(i-1, j, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][35] = Ver_Id(i-1, j+1, 0, Nx, Ny);
					Plane_test_p3[id_tmp][35] = Ver_Id(i, j+1, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][36] = Ver_Id(i+1, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][36] = Ver_Id(i+1, j, 0, Nx, Ny);
					Plane_test_p3[id_tmp][36] = Ver_Id(i, j-1, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][37] = Ver_Id(i, j, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][37] = Ver_Id(i, j-1, 0, Nx, Ny);
					Plane_test_p3[id_tmp][37] = Ver_Id(i+1, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][38] = Ver_Id(i+1, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][38] = Ver_Id(i+1, j, 0, Nx, Ny);
					Plane_test_p3[id_tmp][38] = Ver_Id(i, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][39] = Ver_Id(i+1, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][39] = Ver_Id(i, j, 0, Nx, Ny);
					Plane_test_p3[id_tmp][39] = Ver_Id(i, j+1, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][40] = Ver_Id(i-1, j-1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][40] = Ver_Id(i, j-1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][40] = Ver_Id(i-1, j, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][41] = Ver_Id(i-1, j, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][41] = Ver_Id(i, j-1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][41] = Ver_Id(i, j, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][42] = Ver_Id(i, j+1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][42] = Ver_Id(i-1, j, 2, Nx, Ny);
					Plane_test_p3[id_tmp][42] = Ver_Id(i, j, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][43] = Ver_Id(i-1, j, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][43] = Ver_Id(i-1, j+1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][43] = Ver_Id(i, j+1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][44] = Ver_Id(i+1, j-1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][44] = Ver_Id(i+1, j, 2, Nx, Ny);
					Plane_test_p3[id_tmp][44] = Ver_Id(i, j-1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][45] = Ver_Id(i, j, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][45] = Ver_Id(i, j-1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][45] = Ver_Id(i+1, j, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][46] = Ver_Id(i+1, j+1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][46] = Ver_Id(i+1, j, 2, Nx, Ny);
					Plane_test_p3[id_tmp][46] = Ver_Id(i, j, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][47] = Ver_Id(i+1, j+1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][47] = Ver_Id(i, j, 2, Nx, Ny);
					Plane_test_p3[id_tmp][47] = Ver_Id(i, j+1, 2, Nx, Ny);
					
				}
				else{ // Bottom plane
					
					// Left side
					
					// Right side
					
					// Bottom plane
					Plane_test_p1[id_tmp][12] = Ver_Id(i+1, j-1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][12] = Ver_Id(i+1, j, 1, Nx, Ny);
					Plane_test_p3[id_tmp][12] = Ver_Id(i+1, j-1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][13] = Ver_Id(i+1, j-1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][13] = Ver_Id(i+1, j, 2, Nx, Ny);
					Plane_test_p3[id_tmp][13] = Ver_Id(i+1, j, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][14] = Ver_Id(i+1, j+1, 2, Nx, Ny); 
					Plane_test_p2[id_tmp][14] = Ver_Id(i+1, j, 2, Nx, Ny);
					Plane_test_p3[id_tmp][14] = Ver_Id(i+1, j, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][15] = Ver_Id(i+1, j, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][15] = Ver_Id(i+1, j+1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][15] = Ver_Id(i+1, j+1, 1, Nx, Ny);
					
					// Forward side
					
					// Bottom plane
					Plane_test_p1[id_tmp][20] = Ver_Id(i-1, j+1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][20] = Ver_Id(i-1, j+1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][20] = Ver_Id(i, j+1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][21] = Ver_Id(i, j+1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][21] = Ver_Id(i, j+1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][21] = Ver_Id(i-1, j+1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][22] = Ver_Id(i, j+1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][22] = Ver_Id(i, j+1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][22] = Ver_Id(i+1, j+1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][23] = Ver_Id(i, j+1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][23] = Ver_Id(i+1, j+1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][23] = Ver_Id(i+1, j+1, 2, Nx, Ny);
					
					// Back side
					
					// Bottom plane
					Plane_test_p1[id_tmp][28] = Ver_Id(i-1, j-1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][28] = Ver_Id(i-1, j-1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][28] = Ver_Id(i, j-1, 1, Nx, Ny);
					
					Plane_test_p1[id_tmp][29] = Ver_Id(i, j-1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][29] = Ver_Id(i, j-1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][29] = Ver_Id(i-1, j-1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][30] = Ver_Id(i, j-1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][30] = Ver_Id(i, j-1, 2, Nx, Ny);
					Plane_test_p3[id_tmp][30] = Ver_Id(i+1, j-1, 2, Nx, Ny);
					
					Plane_test_p1[id_tmp][31] = Ver_Id(i, j-1, 1, Nx, Ny); 
					Plane_test_p2[id_tmp][31] = Ver_Id(i+1, j-1, 1, Nx, Ny);
					Plane_test_p3[id_tmp][31] = Ver_Id(i+1, j-1, 2, Nx, Ny);
					
					// include Top side
					Plane_test_p1[id_tmp][32] = Ver_Id(i-1, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][32] = Ver_Id(i, j-1, 0, Nx, Ny);
					Plane_test_p3[id_tmp][32] = Ver_Id(i-1, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][33] = Ver_Id(i-1, j, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][33] = Ver_Id(i, j-1, 0, Nx, Ny);
					Plane_test_p3[id_tmp][33] = Ver_Id(i, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][34] = Ver_Id(i, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][34] = Ver_Id(i-1, j, 0, Nx, Ny);
					Plane_test_p3[id_tmp][34] = Ver_Id(i, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][35] = Ver_Id(i-1, j, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][35] = Ver_Id(i-1, j+1, 0, Nx, Ny);
					Plane_test_p3[id_tmp][35] = Ver_Id(i, j+1, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][36] = Ver_Id(i+1, j-1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][36] = Ver_Id(i+1, j, 0, Nx, Ny);
					Plane_test_p3[id_tmp][36] = Ver_Id(i, j-1, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][37] = Ver_Id(i, j, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][37] = Ver_Id(i, j-1, 0, Nx, Ny);
					Plane_test_p3[id_tmp][37] = Ver_Id(i+1, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][38] = Ver_Id(i+1, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][38] = Ver_Id(i+1, j, 0, Nx, Ny);
					Plane_test_p3[id_tmp][38] = Ver_Id(i, j, 0, Nx, Ny);
					
					Plane_test_p1[id_tmp][39] = Ver_Id(i+1, j+1, 0, Nx, Ny); 
					Plane_test_p2[id_tmp][39] = Ver_Id(i, j, 0, Nx, Ny);
					Plane_test_p3[id_tmp][39] = Ver_Id(i, j+1, 0, Nx, Ny);
					
				}
			}

			
			



			
		}
	}
}


