fprintf('--------------- %s\n',mfilename())
fprintf('3D meshing: mesh and partitioned mesh using ''MshFileVersion''=''4.1''\n')
fprintf('---------------\n')
geofile='cylinderkey';np=5;
fprintf('1. Building a mesh file by using :\n')
fprintf('   -> gmsh version %s\n',fc_oogmsh.gmsh.version())
fprintf('   -> geo file : %s\n',geofile);
meshfile=fc_oogmsh.gmsh.buildmesh3d(geofile,10,'verbose',3,'force',true,'MshFileVersion','4.1');
fprintf('   -> msh file : %s\n',fc_oogmsh.pathrep(meshfile));
fprintf('2. Reading mesh file\n')
Gh=fc_oogmsh.ooGmsh4(meshfile);
fprintf('3. Building partitioned mesh file\n')
fprintf('   -> number of partitions : %d\n',np);
pmfile=fc_oogmsh.gmsh.buildpartmesh(meshfile,np,'verbose',2,'force',true,'MshFileVersion','4.1');
fprintf('   -> partitioned msh file : %s\n',fc_oogmsh.pathrep(pmfile));
fprintf('4. Reading the partitioned mesh file\n')
pGh=fc_oogmsh.ooGmsh4(pmfile);

if fc_oogmsh.isgraphics()
  Gh.plotPhysicalElements()
  Gh.plotElementaryElements()

  pGh.plotPhysicalElements()
  pGh.plotElementaryElements()
  pGh.plotPartitionElements()
  pGh.plotInterfaceElements()
end
--------------- demo14
3D meshing: mesh and partitioned mesh using 'MshFileVersion'='4.1'
---------------
1. Building a mesh file by using :
   -> gmsh version 4.5.1
   -> geo file : cylinderkey
[fc-oogmsh] Input file : <fc-oogmsh>/geodir/3d/cylinderkey.geo
[fc-oogmsh] Overwritting mesh file <fc-oogmsh>/meshes/cylinderkey-10.msh
[fc-oogmsh] Starting building mesh <fc-oogmsh>/meshes/cylinderkey-10.msh with gmsh 4.5.1
[fc-oogmsh]  Using command : gmsh -3 -setnumber N 10 -string "Mesh.MshFileVersion=4.1;"   <fc-oogmsh>/geodir/3d/cylinderkey.geo -o <fc-oogmsh>/meshes/cylinderkey-10.msh
 Be patient...
[fc-oogmsh] gmsh output :
Info    : Running '/fcopt/GMSH/64bit/4.5.1/bin/gmsh -3 -setnumber N 10 -string Mesh.MshFileVersion=4.1; <fc-oogmsh>/geodir/3d/cylinderkey.geo -o <fc-oogmsh>/meshes/cylinderkey-10.msh' [Gmsh 4.5.1, 1 node, max. 1 thread]
Info    : Started on Fri Mar 20 15:08:42 2020
Info    : Reading '<fc-oogmsh>/geodir/3d/cylinderkey.geo'...
Info    : Reading '<fc-oogmsh>/geodir/3d/options01_data.geo'...
Info    : Done reading '<fc-oogmsh>/geodir/3d/options01_data.geo'
Info    : '<fc-oogmsh>/geodir/3d/cylinderkey.geo', line 127 : 'Ruled Surface' command is deprecated: use 'Surface' instead
Info    : '<fc-oogmsh>/geodir/3d/cylinderkey.geo', line 131 : 'Ruled Surface' command is deprecated: use 'Surface' instead
Info    : '<fc-oogmsh>/geodir/3d/cylinderkey.geo', line 135 : 'Ruled Surface' command is deprecated: use 'Surface' instead
Info    : '<fc-oogmsh>/geodir/3d/cylinderkey.geo', line 139 : 'Ruled Surface' command is deprecated: use 'Surface' instead
Info    : '<fc-oogmsh>/geodir/3d/cylinderkey.geo', line 143 : 'Ruled Surface' command is deprecated: use 'Surface' instead
Info    : '<fc-oogmsh>/geodir/3d/cylinderkey.geo', line 147 : 'Ruled Surface' command is deprecated: use 'Surface' instead
Info    : Done reading '<fc-oogmsh>/geodir/3d/cylinderkey.geo'
Info    : Meshing 1D...
Info    : [  0 %] Meshing curve 3 (Circle)
Info    : [ 10 %] Meshing curve 4 (Circle)
Info    : [ 10 %] Meshing curve 5 (Circle)
Info    : [ 10 %] Meshing curve 6 (Circle)
Info    : [ 10 %] Meshing curve 7 (Circle)
Info    : [ 10 %] Meshing curve 8 (Line)
Info    : [ 20 %] Meshing curve 9 (Line)
Info    : [ 20 %] Meshing curve 10 (Line)
Info    : [ 20 %] Meshing curve 11 (Line)
Info    : [ 20 %] Meshing curve 12 (Line)
Info    : [ 20 %] Meshing curve 13 (Line)
Info    : [ 20 %] Meshing curve 14 (Circle)
Info    : [ 30 %] Meshing curve 15 (Circle)
Info    : [ 30 %] Meshing curve 16 (Circle)
Info    : [ 30 %] Meshing curve 17 (Circle)
Info    : [ 30 %] Meshing curve 18 (Circle)
Info    : [ 30 %] Meshing curve 19 (Circle)
Info    : [ 30 %] Meshing curve 20 (Circle)
Info    : [ 40 %] Meshing curve 29 (Circle)
Info    : [ 40 %] Meshing curve 30 (Circle)
Info    : [ 40 %] Meshing curve 31 (Circle)
Info    : [ 40 %] Meshing curve 32 (Circle)
Info    : [ 40 %] Meshing curve 65 (Line)
Info    : [ 40 %] Meshing curve 66 (Line)
Info    : [ 50 %] Meshing curve 67 (Line)
Info    : [ 50 %] Meshing curve 68 (Line)
Info    : [ 50 %] Meshing curve 69 (Line)
Info    : [ 50 %] Meshing curve 70 (Line)
Info    : [ 50 %] Meshing curve 71 (Line)
Info    : [ 50 %] Meshing curve 72 (Line)
Info    : [ 60 %] Meshing curve 73 (Line)
Info    : [ 60 %] Meshing curve 74 (Line)
Info    : [ 60 %] Meshing curve 75 (Line)
Info    : [ 60 %] Meshing curve 76 (Line)
Info    : [ 60 %] Meshing curve 1005 (Circle)
Info    : [ 70 %] Meshing curve 1007 (Circle)
Info    : [ 70 %] Meshing curve 1008 (Circle)
Info    : [ 70 %] Meshing curve 1009 (Circle)
Info    : [ 70 %] Meshing curve 1010 (Circle)
Info    : [ 70 %] Meshing curve 1011 (Circle)
Info    : [ 70 %] Meshing curve 1012 (Circle)
Info    : [ 80 %] Meshing curve 1013 (Circle)
Info    : [ 80 %] Meshing curve 1014 (Circle)
Info    : [ 80 %] Meshing curve 1015 (Circle)
Info    : [ 80 %] Meshing curve 1016 (Circle)
Info    : [ 80 %] Meshing curve 1017 (Circle)
Info    : [ 80 %] Meshing curve 1018 (Line)
Info    : [ 90 %] Meshing curve 1019 (Line)
Info    : [ 90 %] Meshing curve 1020 (Circle)
Info    : [ 90 %] Meshing curve 1021 (Line)
Info    : [ 90 %] Meshing curve 1022 (Line)
Info    : [ 90 %] Meshing curve 1023 (Line)
Info    : [ 90 %] Meshing curve 1024 (Circle)
Info    : [100 %] Meshing curve 1025 (Line)
Info    : [100 %] Meshing curve 1026 (Circle)
Info    : [100 %] Meshing curve 1027 (Circle)
Info    : [100 %] Meshing curve 1028 (Circle)
Info    : [100 %] Meshing curve 1029 (Circle)
Info    : Done meshing 1D (0.046588 s)
Info    : Meshing 2D...
Info    : [  0 %] Meshing surface 27 (Plane, Frontal)
Info    : [ 10 %] Meshing surface 28 (Plane, Frontal)
Info    : [ 20 %] Meshing surface 34 (Plane, Frontal)
Info    : [ 20 %] Meshing surface 1006 (Plane, Frontal)
Info    : [ 30 %] Meshing surface 1030 (Plane, Frontal)
Info    : [ 30 %] Meshing surface 1036 (Plane, Frontal)
Info    : [ 40 %] Meshing surface 1038 (Plane, Frontal)
Info    : [ 40 %] Meshing surface 1040 (Plane, Frontal)
Info    : [ 50 %] Meshing surface 1042 (Plane, Frontal)
Info    : [ 50 %] Meshing surface 1044 (Plane, Frontal)
Info    : [ 60 %] Meshing surface 1046 (Plane, Frontal)
Info    : [ 70 %] Meshing surface 1048 (Plane, Frontal)
Info    : [ 70 %] Meshing surface 1050 (Surface, Frontal)
Info    : [ 80 %] Meshing surface 1052 (Surface, Frontal)
Info    : [ 80 %] Meshing surface 1054 (Surface, Frontal)
Info    : [ 90 %] Meshing surface 1056 (Surface, Frontal)
Info    : [ 90 %] Meshing surface 1058 (Surface, Frontal)
Info    : [100 %] Meshing surface 1060 (Surface, Frontal)
Info    : Done meshing 2D (0.465403 s)
Info    : Meshing 3D...
Info    : 3D Meshing 1 volume with 1 connected component
Info    : Tetrahedrization of 3318 nodes in 0.041982 seconds
Info    : Reconstructing mesh...
Info    :  - Creating surface mesh
Info    :  - Identifying boundary edges
Info    :  - Recovering boundary
Info    : Done reconstructing mesh (0.095894 s)
Info    : Found volume 1062
Info    : It. 0 - 0 nodes created - worst tet radius 3.67875 (nodes removed 0 0)
Info    : It. 500 - 500 nodes created - worst tet radius 1.56204 (nodes removed 0 0)
Info    : It. 1000 - 1000 nodes created - worst tet radius 1.29036 (nodes removed 0 0)
Info    : It. 1500 - 1500 nodes created - worst tet radius 1.16878 (nodes removed 0 0)
Info    : It. 2000 - 2000 nodes created - worst tet radius 1.06982 (nodes removed 0 0)
Info    : It. 2500 - 2500 nodes created - worst tet radius 1.00348 (nodes removed 0 0)
Info    : 3D refinement terminated (5834 nodes total):
Info    :  - 0 Delaunay cavities modified for star shapeness
Info    :  - 0 nodes could not be inserted
Info    :  - 26100 tetrahedra created in 0.134631 sec. (193863 tets/s)
Info    : Done meshing 3D (0.32394 s)
Info    : Optimizing mesh...
Info    : Optimizing volume 1062
Info    : Optimization starts (volume = 5.27052) with worst = 0.00864879 / average = 0.767998:
Info    : 0.00 < quality < 0.10 :        61 elements
Info    : 0.10 < quality < 0.20 :       186 elements
Info    : 0.20 < quality < 0.30 :       291 elements
Info    : 0.30 < quality < 0.40 :       482 elements
Info    : 0.40 < quality < 0.50 :       682 elements
Info    : 0.50 < quality < 0.60 :      1404 elements
Info    : 0.60 < quality < 0.70 :      3148 elements
Info    : 0.70 < quality < 0.80 :      6441 elements
Info    : 0.80 < quality < 0.90 :      9148 elements
Info    : 0.90 < quality < 1.00 :      4257 elements
Info    : 536 edge swaps, 5 node relocations (volume = 5.27052): worst = 0.300291 / average = 0.78108 (0.014547 s)
Info    : No ill-shaped tets in the mesh :-)
Info    : 0.00 < quality < 0.10 :         0 elements
Info    : 0.10 < quality < 0.20 :         0 elements
Info    : 0.20 < quality < 0.30 :         0 elements
Info    : 0.30 < quality < 0.40 :       476 elements
Info    : 0.40 < quality < 0.50 :       645 elements
Info    : 0.50 < quality < 0.60 :      1391 elements
Info    : 0.60 < quality < 0.70 :      3112 elements
Info    : 0.70 < quality < 0.80 :      6466 elements
Info    : 0.80 < quality < 0.90 :      9264 elements
Info    : 0.90 < quality < 1.00 :      4251 elements
Info    : Done optimizing mesh (0.039985 s)
Info    : 5847 nodes 32860 elements
Info    : Writing '<fc-oogmsh>/meshes/cylinderkey-10.msh'...
Info    : Done writing '<fc-oogmsh>/meshes/cylinderkey-10.msh'
Info    : Stopped on Fri Mar 20 15:08:42 2020

[fc-oogmsh] Using gmsh 4.5.1 to write MSH file format version 4.1 in <fc-oogmsh>/meshes/cylinderkey-10.msh
   -> msh file : <fc-oogmsh>/meshes/cylinderkey-10.msh
2. Reading mesh file
3. Building partitioned mesh file
   -> number of partitions : 5
[fc-oogmsh] Input file : <fc-oogmsh>/meshes/cylinderkey-10.msh
[fc-oogmsh] Overwritting mesh file <fc-oogmsh>/meshes/cylinderkey-10-part5.msh
[fc-oogmsh] Starting building mesh <fc-oogmsh>/meshes/cylinderkey-10-part5.msh with gmsh 4.5.1
[fc-oogmsh]  Using command : gmsh -2 -part 5  -string "Mesh.MshFileVersion=4.1;"   -saveall  <fc-oogmsh>/meshes/cylinderkey-10.msh -o <fc-oogmsh>/meshes/cylinderkey-10-part5.msh
 Be patient...
[fc-oogmsh] Using gmsh 4.5.1 to write MSH file format version 4.1 in <fc-oogmsh>/meshes/cylinderkey-10-part5.msh
   -> partitioned msh file : <fc-oogmsh>/meshes/cylinderkey-10-part5.msh
4. Reading the partitioned mesh file