Salome HOME
Copyright update 2020
[plugins/ghs3dprlplugin.git] / src / tepal2med / tetrahpc2med.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 6e4d432..5a47586
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2020  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -471,9 +471,9 @@ if (mymailw->verbose>3){
 /*
 mg-tetra_hpc_mpi.exe --help
 
-    =================================================
-    MG-Tetra_HPC -- MeshGems 2.1-11 (September, 2015)
-    =================================================
+    =============================================
+    MG-Tetra_HPC -- MeshGems 2.9-6 (August, 2019)
+    =============================================
 
         Distene SAS
            Campus Teratec
@@ -483,11 +483,11 @@ mg-tetra_hpc_mpi.exe --help
         Phone: +33(0)970-650-219   Fax: +33(0)169-269-033
         EMail: <support@distene.com>
 
-        Running MG-Tetra_HPC (Copyright 2014 by Distene SAS)
-           date of run: 31-May-2016 AT 09:05:29
-           running on : Linux 2.6.32-431.11.2.el6.centos.plus.x86_64 x86_64
+        Running MG-Tetra_HPC (Copyright 2014-2019 by Distene SAS)
+           date of run: 25-Feb-2020 AT 08:47:20
+           running on : Linux 3.10.0-1062.9.1.el7.x86_64 x86_64
            using modules: 
-                MeshGems-Core 2.1-11
+                MeshGems-Core 2.9-6
 
         MeshGems is a Registered Trademark of Distene SAS
 
@@ -503,6 +503,14 @@ Options:
    |   |   /
    v   v  v
 
+     --components <components>
+          Selects which mesh components to process.
+          If <components> is:
+              all : all components are to be meshed.
+              outside_components : only the main (outermost) component is to be
+          meshed.
+                    Default: all
+
      --gradation <g>
           Sets the size gradation value.
           <gradation> is the desired maximum ratio between 2 adjacent
@@ -510,39 +518,128 @@ Options:
           will be.
           Default: 1.05
 
+     --gradation_mode <mode>
+          Sets the gradation behaviour.
+          Possible values for <mode> are :
+              without_size: apply gradation only when no size is provided by
+          the input sizemap(s)
+              always: always apply the gradation. This can partially smooth the
+          provided input sizemap(s)
+          Default: without_size
+
      --help
           Prints this help.
-          
+
      --in <input mesh file name>
           Sets the input file.
           (MANDATORY)
 
+     --max_edge_length <maximum edge length>
+          Sets the desired maximum accepted edge length.
+          Default: 0 (no maximum length).
+
      --max_size <maximum size>
           Sets the desired maximum cell size value.
           Default: 0 (no maximum size).
 
+     --metric <type>
+          Sets the type of metric governing the mesh generation.
+          Possible values for <type> are :
+              isotropic: the metric induces the same size in all directions.
+              anisotropic: the metric induces different sizes depending on the
+          directions.
+          Default: isotropic
+
+     --min_edge_length <minimum edge length>
+          Sets the desired minimum accepted edge length.
+          Default: 0 (no minimum length).
+
      --min_size <minimum size>
-          Default: 0 (no minimum size).
           Sets the desired minimum cell size value.
+          Default: 0 (no minimum size).
+
+     --optimisation <boolean>
+          Sets whether to optimise mesh quality or not.
+          Default: yes.
+
+     --optimisation_level <level>
+          Sets the desired optimisation level for mesh quality.
+          Possible values for <level> are (in increasing order of quality vs
+          speed ratio): light, standard, strong
+          Default: standard.
 
      --out <output mesh file name>
           Sets the output file.
+          Using an existing file is not allowed.
+          Using the same file as --in is not allowed.
           If unset, _tetra_hpc is appended to the input file basename.
-          Using an existing file is forbidden.
-          Using the same file as --in is forbidden.
           
+     --parallel_strategy <strategy>
+          Sets the desired parallel strategy, influencing the level of
+          reproducibility of the result and the potential performances.
+          Possible values for <strategy> are (in decreasing order for
+          reproducibility and increasing order for performances):
+              reproducible: result is entirely reproducible but performances
+          may not be optimal.
+              aggressive: result may not be reproducible but all parallel
+          optimizations are allowed.
+          Default: reproducible.
+
+     --sizemap <input sizemap file name>
+          Sets the optional input sizemap file. The sizemap must provide the
+          requested size at the input surface or volume mesh vertices.
+                    Default : none.
+
+     --split_overconstrained_edges <boolean>
+          Sets whether to split over-constrained edges or not. An edge is
+          considered as over-constrained when its two vertices belong to the
+          surface.
+          If <boolean> is:
+              yes: correction is applied upon mesh generation/optimisation
+              no: no correction is applied.
+          Default: no
+
+     --split_overconstrained_elements <boolean>
+          Sets whether to split over-constrained elements or not. An edge is
+          considered as over-constrained when its two vertices belong to the
+          surface. A tetrahedron is considered as over-constrained  when at
+          least two of its faces belong to the surface.
+          If <boolean> is:
+              yes: correction is applied upon mesh generation/optimisation
+              no: no correction is applied.
+          Default: no
+
+     --split_overconstrained_tetrahedra <boolean>
+          Sets whether to split over-constrained tetrahedra or not. A
+          tetrahedron is considered as over-constrained  when at least two of
+          its faces belong to the surface.
+          If <boolean> is:
+              yes: correction is applied upon mesh generation/optimisation
+              no: no correction is applied.
+          Default: no
+
      --verbose <verbose>
           Set the verbosity level, increasing from 0 to 10.
-           <verbose> values are increasing from 0 to 10 :
-             0 : no details
-            10 : very detailed
-          Default: 3
+          Possible <verbose> values are increasing from 0 to 10 :
+             0 : no details.
+            10 : very detailed.
+          Default: 3.
+
+     --volume_proximity_layers <minimum number of layers>
+          Sets the desired minimum number of tetrahedra layers inside the
+          volume.
+          Default: 0 (no minimum).
+
+     --write_sizemap <output sizemap file name>
+          Sets the optional output sizemap file.
+          Using an existing file is not allowed.
+          If unset, the output sizemap will not be written.
 
 
 ================================================================================
-               MG-Tetra_HPC -- MeshGems 2.1-11 (September, 2015)
-         END OF SESSION - MG-Tetra_HPC (Copyright 2014 by Distene SAS)
-                   compiled Sep  3 2015 12:50:47 on Linux_64
+                 MG-Tetra_HPC -- MeshGems 2.9-6 (August, 2019)
+       END OF SESSION - MG-Tetra_HPC (Copyright 2014-2019 by Distene SAS)
+                   compiled Sep  2 2019 09:58:40 on Linux_64
                MeshGems is a Registered Trademark of Distene SAS
 ================================================================================
        ( Distene SAS
@@ -555,7 +652,7 @@ Options:
 int main(int argc, char *argv[])
 {
    bool ok;
-   int i,nb,nbfiles,limit_swap,nbelem_limit_swap,limit_swap_defaut,verbose;
+   int i,nb,nbfiles,limit_swap,nbelem_limit_swap,limit_swap_defaut,verbose,res;
    float gradation,min_size,max_size;
    QString path,pathini,casename,casenamemed,fileskinmed,
            tmp,cmd,format,format_tetra,
@@ -785,7 +882,7 @@ int main(int argc, char *argv[])
          
    if (launchtetra=="yes"){
      
-      //call tetra_hpc.py is pthon script which assumes mpirun or else if no multithread
+      //call tetra_hpc.py is python script which assumes mpirun or else if no multithread
       //after compilation openmpi or else acrobatic DISTENE_LICENCE change...
       
       cmd="mg-tetra_hpc.py --number=" + QString::number(nbfiles)+
@@ -828,7 +925,12 @@ int main(int argc, char *argv[])
    if (launchtetra=="yes"){
       //sometimes it is better to wait flushing files on slow filesystem...
       system("sleep 3");
-      system(cmd.toLatin1().constData()); // run
+      res = system(cmd.toLatin1().constData()); // run
+      if (res>0) 
+      {
+        std::cout<<std::endl<<"===end KO PROBLEM of "<<argv[0]<<"==="<<std::endl;
+        return res; // KO
+      }
       system("sleep 3");
    }
    ghs3dprl_mesh_wrap *mymailw=new ghs3dprl_mesh_wrap;
@@ -882,31 +984,32 @@ int main(int argc, char *argv[])
       if (verbose>0)std::cout<<"Initial skin file <"<<fileskinmed.toLatin1().constData()<<"> does not exist\n"; }
    
 
-//if test quickly read all files before (or only small files)
- if (test=="yes"){
-   if (verbose>0) std::cout<<"\nReading output files of tetrahpc as input files of tetrahpc2med...\n";
-   //only read beginning of files .xxxxx.mesh
-   //supposed big files big arrays so only see first lines
-   mymailw->nbfiles=0;
-   for (int i=1; i<=nbfiles; i++){
-      mymailw->nofile=i;
-      tmp=pathini+casename+tmp.sprintf(format_tetra.toLatin1().constData(),i)+".mesh";
-      if (verbose>0) std::cout<<"FileName="<<tmp.toLatin1().constData()<<std::endl;
-      ok=mymailw->TestExistingFileMESHnew(tmp);
-   }
-   if (verbose>0)
-      std::cout<<"NumberOfFilesMESHTested="<<mymailw->nbfiles<<": ok\n\n";
-   if (mymailw->nbfiles != nbfiles){
-      std::cerr<<"NumberOfFiles != NumberOfFilesTested is unexpected\n\n";
-      return 1;
-   }
- }  //end if test
+   //if test quickly read all files before (or only small files)
  if (test=="yes"){
+     if (verbose>0) std::cout<<"\nReading output files of tetrahpc as input files of tetrahpc2med...\n";
+     //only read beginning of files .xxxxx.mesh
+     //supposed big files big arrays so only see first lines
+     mymailw->nbfiles=0;
+     for (int i=1; i<=nbfiles; i++){
+        mymailw->nofile=i;
+        tmp=pathini+casename+tmp.sprintf(format_tetra.toLatin1().constData(),i)+".mesh";
+        if (verbose>0) std::cout<<"FileName="<<tmp.toLatin1().constData()<<std::endl;
+        ok=mymailw->TestExistingFileMESHnew(tmp);
+     }
+     if (verbose>0)
+        std::cout<<"NumberOfFilesMESHTested="<<mymailw->nbfiles<<": ok\n\n";
+     if (mymailw->nbfiles != nbfiles){
+        std::cerr<<"NumberOfFiles != NumberOfFilesTested is unexpected\n\n";
+        return 1;
+     }
  }  //end if test
  
    ok=mymailw->Write_MEDfiles_v2(true); //deletekeys=true
    
    nb=mymailw->remove_all_keys_mesh_wrap();
    if (verbose>3)std::cout<<"***remove_all_key_mesh_wrap*** "<<nb<<" keys removed\n";
-   if (verbose>0)std::cout<<std::endl<<"===end of "<<argv[0]<<"==="<<std::endl;
+
+   if (verbose>=0)std::cout<<std::endl<<"===end OK of "<<argv[0]<<"==="<<std::endl;
 
    //for debug
    //int res=dumpMED("/home/wambeke/tmp/DOMAIN_1.med",1);