Skip to content
Snippets Groups Projects
Select Git revision
  • dd5f11d27a97316f68de194a887ba38950285c10
  • master default protected
  • dof-renumbering
  • gdemesy-master-patch-30528
  • eval-space-time
  • oscillating_multiharm
  • MH_movement
  • axisqu
  • write_vtu_and_ensight_formats
  • movingband
  • CP_1972_add_vtu_file_writing
  • mortar
  • fast_freq_sweep_Resolution
  • applyresolvent_again
  • marteaua-master-patch-54323
  • patch-1
  • binde-master-patch-08072
  • binde-master-patch-52461
  • BCGSL
  • resolvent
  • TreeElementsOf
  • getdp_3_5_0
  • getdp_3_4_0
  • getdp_3_3_0
  • getdp_3_2_0
  • getdp_3_1_0
  • getdp_3_0_4
  • getdp_3_0_3
  • getdp_3_0_2
  • getdp_3_0_1
  • getdp_3_0_0
  • onelab_mobile_2.1.0
  • getdp_2_11_3 protected
  • getdp_2_11_2 protected
  • getdp_2_11_1 protected
  • getdp_2_11_0 protected
  • getdp_2_10_0 protected
  • getdp_2_9_2 protected
  • getdp_2_9_1 protected
  • getdp_2_9_0 protected
  • getdp_2_8_0 protected
41 results

TreeUtils.cpp

Blame
  • gui.py 1.28 KiB
    import gmsh
    import sys
    
    if '-nopopup' in sys.argv:
        exit(0)
    
    gmsh.initialize(sys.argv)
    
    # creates the FLTK user interface; this could also be called after the geometry
    # is created (or not at all - fltk.run() will do it automatically)
    gmsh.fltk.initialize()
    
    # Copied from boolean.py...
    gmsh.model.add("boolean")
    gmsh.option.setNumber("Mesh.Algorithm", 6)
    gmsh.option.setNumber("Mesh.MeshSizeMin", 0.4)
    gmsh.option.setNumber("Mesh.MeshSizeMax", 0.4)
    R = 1.4
    Rs = R * .7
    Rt = R * 1.25
    gmsh.model.occ.addBox(-R, -R, -R, 2 * R, 2 * R, 2 * R, 1)
    gmsh.model.occ.addSphere(0, 0, 0, Rt, 2)
    gmsh.model.occ.intersect([(3, 1)], [(3, 2)], 3)
    gmsh.model.occ.addCylinder(-2 * R, 0, 0, 4 * R, 0, 0, Rs, 4)
    gmsh.model.occ.addCylinder(0, -2 * R, 0, 0, 4 * R, 0, Rs, 5)
    gmsh.model.occ.addCylinder(0, 0, -2 * R, 0, 0, 4 * R, Rs, 6)
    gmsh.model.occ.fuse([(3, 4), (3, 5)], [(3, 6)], 7)
    gmsh.model.occ.cut([(3, 3)], [(3, 7)], 8)
    gmsh.model.occ.synchronize()
    # ...end of copy
    
    # hide volume
    gmsh.model.setVisibility(gmsh.model.getEntities(3), 0)
    # color all surfaces gold
    gmsh.model.setColor(gmsh.model.getEntities(2), 249, 166, 2)
    
    # this would be equivalent to gmsh.fltk.run():
    #
    # gmsh.graphics.draw()
    # while True:
    #     gmsh.fltk.wait()
    #     print("just treated an event in the interface")
    
    gmsh.fltk.run()
    
    gmsh.finalize()