Skip to content
Snippets Groups Projects
Select Git revision
  • 2b64e07c0b65051dec345bbefd090f77c12bb4fb
  • master default protected
  • devel
  • MC/hide_eigen_sol
  • compare_at_gauss_points
  • mixed_interface_fix
  • detect-gmsh-api-version
  • MC/mpi_support
  • MC/volsrcs
  • fix-gmsh-master
  • find-gmsh
  • MC/hipify
  • v0.3.0
  • v0.2.0
  • v0.1.0
15 results

lua_api.md

Blame
  • flatten2.py 621 B
    import gmsh
    import sys
    
    # script showing how the coordinates of the nodes of a mesh can be transformed,
    # here by setting all the z coordinates to 0; this is less general, but much
    # simpler, than the approach followed in `flatten.py'
    
    if len(sys.argv) < 2:
        print("Usage: " + sys.argv[0] + " file.msh")
        exit(0)
    
    gmsh.initialize()
    
    try:
        gmsh.open(sys.argv[1])
    except:
        exit(0)
    
    gmsh.model.mesh.affineTransform([1, 0, 0, 0,
                                     0, 1, 0, 0,
                                     0, 0, 0, 0])
    
    if '-nopopup' not in sys.argv:
        gmsh.fltk.run()
    #gmsh.write('flat.msh')
    
    gmsh.finalize()