File: exportNeutral.py

package info (click to toggle)
netgen 6.2.2601%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 13,076 kB
  • sloc: cpp: 166,627; tcl: 6,310; python: 2,868; sh: 522; makefile: 90
file content (26 lines) | stat: -rw-r--r-- 546 bytes parent folder | download | duplicates (7)
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)