fprintf('--------------- %s\n',mfilename())
fprintf('2D meshing: mesh and partitioned mesh using ''MshFileVersion''=''4.1''\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','4.1');
fprintf('   -> msh file : %s\n',fc_oogmsh.pathrep(meshfile));
fprintf('2. Reading the 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()
end
--------------- demo12
2D meshing: mesh and partitioned mesh using 'MshFileVersion'='4.1'
---------------
1. Building a mesh file by using :
   -> gmsh version 4.5.1
   -> 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 4.5.1
[fc-oogmsh]  Using command : gmsh -2 -setnumber N 20 -string "Mesh.MshFileVersion=4.1;"   <fc-oogmsh>/geodir/2d/condenser.geo -o <fc-oogmsh>/meshes/condenser-20.msh
 Be patient...
[fc-oogmsh] Using gmsh 4.5.1 to write MSH file format version 4.1 in <fc-oogmsh>/meshes/condenser-20.msh
   -> msh file : <fc-oogmsh>/meshes/condenser-20.msh
2. Reading the mesh file

Gh = 

  fc_oogmsh.ooGmsh4 with properties:
                      q: (2x31742 double)
                     nq: 31742 double
                    dim: 2 double
                      d: 2 double
               toGlobal: (1x31742 double)
               meshfile: (1x72 char)
       partitionnedfile: 0 logical
             MeshFormat: (1x1 struct)
          PhysicalNames: []
               Entities: (1x1 struct)
    PartitionedEntities: []
                  Nodes: (1x1 struct)
               Elements: (1x1 struct)
          PeriodicLinks: []
                   Info: (1x1 struct)
                 orders: 1 double
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 4.5.1
[fc-oogmsh]  Using command : gmsh -2 -part 5  -string "Mesh.MshFileVersion=4.1;"   -saveall  <fc-oogmsh>/meshes/condenser-20.msh -o <fc-oogmsh>/meshes/condenser-20-part5.msh
 Be patient...
[fc-oogmsh] Using gmsh 4.5.1 to write MSH file format version 4.1 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.ooGmsh4 with properties:
                      q: (2x31743 double)
                     nq: 31743 double
                    dim: 2 double
                      d: 2 double
               toGlobal: (1x31743 double)
               meshfile: (1x78 char)
       partitionnedfile: 1 logical
             MeshFormat: (1x1 struct)
          PhysicalNames: []
               Entities: (1x1 struct)
    PartitionedEntities: (1x1 struct)
                  Nodes: (1x1 struct)
               Elements: (1x1 struct)
          PeriodicLinks: []
                   Info: (1x1 struct)
                 orders: 1 double