// Discussion: // // Generate a 3D mesh using the buildlayers() command, view it with medit. // // Location: // // http://people.sc.fsu.edu/~jburkardt/freefem_src/build_layers/build_layers.edp // // Licensing: // // This code is distributed under the MIT license. // // Modified: // // 22 May 2020 // // Author: // // John Burkardt // cout << "\n"; cout << "build_layers\n"; cout << " freefem++ version\n"; cout << " Generate a 3d mesh using the buildlayers() function.\n"; // // Create a 2D mesh on [0,1]x[0,1] into 5 by 5 elements. // mesh Th2d = square ( 5, 5 ); plot ( Th2d, wait = false, ps = "base_mesh.ps" ); // // Create a 3D mesh on [0,1]x[0,1]x[0,1] by stacking 5 element layers // using the 2D mesh. // // There is no command to save the display from MEDIT. // This may be done interactively, however. // load "medit" load "msh3" int nz = 5; mesh3 Th3d = buildlayers ( Th2d, nz, zbound = [ 0.0, 1.0 ] ); medit ( "Th3d", Th3d ); // // Terminate. // cout << "\n"; cout << "build_layers:\n"; cout << " Normal end of execution.\n"; exit ( 0 );