Actual source code: example2.edp
 1 /*******************************************************
 2  *  This file is part of the FreeFEM tutorial made by  *
 3  *      Pierre Jolivet <pierre@joliv.et>               *
 4  *                                                     *
 5  *  See https://joliv.et/FreeFem-tutorial for more     *
 6  *                                                     *
 7  *   Description: mesh manipulation                    *
 8  *******************************************************/
  
10 mesh sq = square(10, 10);
11 plot(sq, wait = true);
12 sq = square(10, 100, [x, 10 * y]);
13 plot(sq, wait = true);
 
15 include "cube.idp"
16 mesh3 cb = cube(10, 10, 10);
17 plot(cb, wait = true);
18 medit("Cube", cb);
 
20 load "gmsh"
21 // gmsh -2 square.geo
22 sq = gmshload("square.msh");
23 plot(sq, wait = true);
24 cout << labels(sq) << endl;
 
26 // gmsh -3 cube.geo -o cube.mesh
27 cb = readmesh3("cube.mesh");
28 plot(cb, wait = true);
29 cout << labels(cb) << endl;
 
31 cb = trunc(cb, true, split = 2);
32 plot(cb, wait = true);
33 cb = trunc(cb, x < 0.0);
34 plot(cb, wait = true);