Skip to content
Snippets Groups Projects
Select Git revision
  • master default
  • cgnsUnstructured
  • partitioning
  • poppler
  • HighOrderBLCurving
  • gmsh_3_0_4
  • gmsh_3_0_3
  • gmsh_3_0_2
  • gmsh_3_0_1
  • gmsh_3_0_0
  • gmsh_2_16_0
  • gmsh_2_15_0
  • gmsh_2_14_1
  • gmsh_2_14_0
  • gmsh_2_13_2
  • gmsh_2_13_1
  • gmsh_2_12_0
  • gmsh_2_11_0
  • gmsh_2_10_1
  • gmsh_2_10_0
  • gmsh_2_9_3
  • gmsh_2_9_2
  • gmsh_2_9_1
  • gmsh_2_9_0
  • gmsh_2_8_6
25 results

Generator.h

Forked from gmsh / gmsh
Source project has a limited visibility.
  • Christophe Geuzaine's avatar
    9139fe13
    · 9139fe13
    Christophe Geuzaine authored
    - new GmshInitialize(argc, argv) and GmshFinalize() for library version,
      now also used throughout
    
    - GModel::mesh(dimension)
    
    We now have a simple API to do basic stuff. We'll interface more as we go (optimize, adapt, etc.).
    
    #include <stdio.h>
    #include <gmsh/Gmsh.h>
    #include <gmsh/GModel.h>
    #include <gmsh/MElement.h>
    
    int main(int argc, char **argv)
    {
      GmshInitialize(argc, argv);
      GModel *m = new GModel();
      m->readGEO("./tutorial/t5.geo");
      m->mesh(3);
      for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it){
        printf("volume %d contains %d elements:\n", (*it)->tag(), (*it)->getNumMeshElements());
        for(unsigned int i = 0; i < (*it)->getNumMeshElements(); i++)
          printf(" %d", (*it)->getMeshElement(i)->getNum());
        printf("\n");
      }
      m->writeMSH("test.msh");
      m->writeUNV("test.unv");
      GmshFinalize();
    }
    9139fe13
    History
    Christophe Geuzaine authored
    - new GmshInitialize(argc, argv) and GmshFinalize() for library version,
      now also used throughout
    
    - GModel::mesh(dimension)
    
    We now have a simple API to do basic stuff. We'll interface more as we go (optimize, adapt, etc.).
    
    #include <stdio.h>
    #include <gmsh/Gmsh.h>
    #include <gmsh/GModel.h>
    #include <gmsh/MElement.h>
    
    int main(int argc, char **argv)
    {
      GmshInitialize(argc, argv);
      GModel *m = new GModel();
      m->readGEO("./tutorial/t5.geo");
      m->mesh(3);
      for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it){
        printf("volume %d contains %d elements:\n", (*it)->tag(), (*it)->getNumMeshElements());
        for(unsigned int i = 0; i < (*it)->getNumMeshElements(); i++)
          printf(" %d", (*it)->getMeshElement(i)->getNum());
        printf("\n");
      }
      m->writeMSH("test.msh");
      m->writeUNV("test.unv");
      GmshFinalize();
    }