File: exportNeutral.py

package info (click to toggle)
netgen 6.2.2501%2Bdfsg1-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 12,980 kB
  • sloc: cpp: 165,197; tcl: 6,310; python: 2,804; sh: 522; makefile: 87
file content (26 lines) | stat: -rw-r--r-- 546 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import sys

def Export (mesh, filename):
    """ export Netgen mesh to neutral format """
    
    print ("export mesh in neutral format to file = ", filename)

    f = open (filename, 'w')

    points = mesh.Points()
    print (len(points), file=f)
    for p in points:
        print (p.p[0], p.p[1], p.p[2], file=f)


    volels = mesh.Elements3D();
    print (len(volels), file=f)
    for el in volels:
        print (el.index, end="   ", file=f)
        for p in el.points:
            print (p.nr, end=" ", file=f)
        print(file=f)