// cube.fe
// Evolver data for cube of prescribed volume.

vertices
1  0.0 0.0 0.0 
2  1.0 0.0 0.0
3  1.0 1.0 0.0
4  0.0 1.0 0.0
5  0.0 0.0 1.0
6  1.0 0.0 1.0
7  1.0 1.0 1.0
8  0.0 1.0 1.0

edges  /* given by endpoints and attribute */
1   1 2   
2   2 3   
3   3 4  
4   4 1 
5   5 6
6   6 7  
7   7 8 
8   8 5
9   1 5   
10  2 6  
11  3 7 
12  4 8

faces  /* given by oriented edge loop */
1   1 10 -5  -9
2   2 11 -6 -10
3   3 12 -7 -11
4   4  9 -8 -12
5   5  6  7   8
6  -4 -3 -2  -1

bodies  /* one body, defined by its oriented faces */
1   1 2 3 4 5 6  volume 1

read

// Typical evolution to sphere
gogo := { g 5; r; g 5; hessian; r; g 5; hessian; }

// Evolution to very high accuracy, using higher-order Lagrange elements.
// To be run on original datafile.
gogo2 := { g 5; r; g 5; hessian; r; g 5; hessian;
           lagrange 2; g 5; hessian; 
           lagrange 4; g 5; hessian; 
           lagrange 6; g 5; hessian; 
           ideal_rad := (3*body[1].volume/4/pi)^(1/3);
           printf "Area error: %g\n",total_area - 4*pi*ideal_rad^2;
           printf "Vertex radius spread: %g\n",
             max(vertex,sqrt((x-.5)^2+(y-.5)^2+(z-.5)^2))
               - min(vertex,sqrt((x-.5)^2+(y-.5)^2+(z-.5)^2));
}
