fprintf('--------------- %s\n',mfilename())
fprintf('2D meshing: mesh and partitioned mesh using ''MshFileVersion''=''2.2''\n')
fprintf('---------------\n')
geofile='condenser.geo';
np=5; % number of partitions
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.buildmesh(geofile,20,'verbose',2,'force',true,'MshFileVersion','2.2');
fprintf('   -> msh file : %s\n',fc_oogmsh.pathrep(meshfile));
fprintf('2. Reading the mesh file\n')
Gh=fc_oogmsh.ooGmsh2(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','2.2');
fprintf('   -> partitioned msh file : %s\n',fc_oogmsh.pathrep(pmfile));
fprintf('4. Reading the partitioned mesh file\n')
pGh=fc_oogmsh.ooGmsh2(pmfile)

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

  pGh.plotPhysicalElements()
  pGh.plotElementaryElements()
  pGh.plotPartitionElements()
  pGh.plotInterfaceElements()
end
--------------- demo02
2D meshing: mesh and partitioned mesh using 'MshFileVersion'='2.2'
---------------
1. Building a mesh file by using :
   -> gmsh version 2.16.0
   -> geo file : condenser.geo
[fc-oogmsh] Input file : <fc-oogmsh>/geodir/2d/condenser.geo
[fc-oogmsh] Overwritting mesh file <fc-oogmsh>/meshes/condenser-20.msh
[fc-oogmsh] Starting building mesh <fc-oogmsh>/meshes/condenser-20.msh with gmsh 2.16.0
[fc-oogmsh]  Using command : gmsh -2 -setnumber N 20 -string "Mesh.MshFileVersion=2.2;"   <fc-oogmsh>/geodir/2d/condenser.geo -o <fc-oogmsh>/meshes/condenser-20.msh
 Be patient...
[fc-oogmsh] Using gmsh 2.16.0 to write MSH file format version 2.2 in <fc-oogmsh>/meshes/condenser-20.msh
   -> msh file : <fc-oogmsh>/meshes/condenser-20.msh
2. Reading the mesh file

Gh = 

  fc_oogmsh.ooGmsh2 with properties:
                   q: (2x35906 double)
                 dim: 2 double
                  nq: 35906 double
                   d: 2 double
               sElts: (3x1 struct)
            toGlobal: (1x35906 double)
    partitionnedfile: 0 logical
              orders: 1 double
               types: [ 1 2 15 ] (1x3 int32)
          MeshFormat: (1x1 struct)
            meshfile: (1x72 char)
                Info: (1x1 struct)
               debug: (1x1 struct)
3. Building partitioned mesh file
   -> number of partitions : 5
[fc-oogmsh] Input file : <fc-oogmsh>/meshes/condenser-20.msh
[fc-oogmsh] Overwritting mesh file <fc-oogmsh>/meshes/condenser-20-part5.msh
[fc-oogmsh] Starting building mesh <fc-oogmsh>/meshes/condenser-20-part5.msh with gmsh 2.16.0
[fc-oogmsh]  Using command : gmsh -2 -part 5  -string "Mesh.MshFileVersion=2.2;"   -saveall  <fc-oogmsh>/meshes/condenser-20.msh -o <fc-oogmsh>/meshes/condenser-20-part5.msh
 Be patient...
[fc-oogmsh] Using gmsh 2.16.0 to write MSH file format version 2.2 in <fc-oogmsh>/meshes/condenser-20-part5.msh
   -> partitioned msh file : <fc-oogmsh>/meshes/condenser-20-part5.msh
4. Reading the partitioned mesh file

pGh = 

  fc_oogmsh.ooGmsh2 with properties:
                   q: (2x35906 double)
                 dim: 2 double
                  nq: 35906 double
                   d: 2 double
               sElts: (3x1 struct)
            toGlobal: (1x35906 double)
    partitionnedfile: 1 logical
              orders: 1 double
               types: [ 1 2 15 ] (1x3 int32)
          MeshFormat: (1x1 struct)
            meshfile: (1x78 char)
                Info: (1x1 struct)
               debug: (1x1 struct)