Skip to content
Snippets Groups Projects
Select Git revision
  • 86a0dffea462f27ff0eba09bf781939618ae7111
  • 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
26 results

Post.cpp

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    • Christophe Geuzaine's avatar
      86a0dffe
      · 86a0dffe
      Christophe Geuzaine authored
      moving to new post-processing database
      
                          *** WARNING ***
      
      do not upgrade if you need plugins or adaptive views: these have not
      been ported (yet) to the new database
      
                          *** WARNING ***
      86a0dffe
      History
      Christophe Geuzaine authored
      moving to new post-processing database
      
                          *** WARNING ***
      
      do not upgrade if you need plugins or adaptive views: these have not
      been ported (yet) to the new database
      
                          *** WARNING ***
    t7.cpp 1.07 KiB
    // This file reimplements gmsh/tutorial/t7.geo in C++.
    //
    // Background mesh
    
    #include <gmsh.h>
    
    namespace model = gmsh::model;
    namespace factory = gmsh::model::geo;
    
    int main(int argc, char **argv)
    {
      gmsh::initialize();
      gmsh::option::setNumber("General.Terminal", 1);
    
      model::add("t7");
    
      // Copied from t1.cpp...
      double lc = 1e-2;
      factory::addPoint(0, 0, 0, lc, 1);
      factory::addPoint(.1, 0,  0, lc, 2);
      factory::addPoint(.1, .3, 0, lc, 3);
      factory::addPoint(0,  .3, 0, lc, 4);
      factory::addLine(1, 2, 1);
      factory::addLine(3, 2, 2);
      factory::addLine(3, 4, 3);
      factory::addLine(4, 1, 4);
      factory::addCurveLoop({4, 1, -2, 3}, 1);
      factory::addPlaneSurface({1}, 1);
      factory::synchronize();
    
      // add the background mesh file as a view
      gmsh::merge("../t7_bgmesh.pos");
    
      // add the post-processing view as a new size field
      int bg_field = model::mesh::field::add("PostView");
      model::mesh::field::setAsBackgroundMesh(bg_field);
    
      model::mesh::generate(2);
      gmsh::write("t7.msh");
    
      // show the mesh file
      gmsh::fltk::run();
    
      gmsh::finalize();
      return 0;
    }