File: ansurf.cmd

package info (click to toggle)
evolver 2.70+ds-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 17,148 kB
  • sloc: ansic: 127,395; makefile: 209; sh: 98
file content (86 lines) | stat: -rw-r--r-- 2,420 bytes parent folder | download | duplicates (2)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// ansurf.cmd
// Surface Evolver command to produce file of ANSYS input for 
//   vertices, edges,  and faces to produce a surface
//   for ANSYS meshing.  Beware this is a very simple-minded
//   translation to ANSYS format.
// Modified Feb. 2006 to not assume consecutive numbering of elements.
// Programmer: Ken Brakke, brakke@susqu.edu, http://www.susqu.edu/brakke

// usage:  ansurf >>> "filename"

// Attributes to hold ANSYS numbering of elements
define vertex attribute ansurf_knumber real
define edge attribute ansurf_lnumber real
define facet attribute ansurf_alnumber real

// vertices as ANSYS keypoints
ansurf_nodes := { 
       local knumber;
       knumber := 0;
       foreach vertex vv do
       { printf "k,,%20.15g,%20.15g,%20.15g\n",x,y,z;
         knumber += 1;
         vv.ansurf_knumber := knumber;
       }
     }

ansurf_edges := {
       local lnumber;
       lnumber := 0;
       if (quadratic) then 
       foreach edge ee do
       { printf "larc,%g,%g,%g\n",ee.vertex[1].ansurf_knumber,
           ee.vertex[2].ansurf_knumber,ee.vertex[3].ansurf_knumber;
         lnumber += 1;
         ee.ansurf_lnumber := lnumber;
       }
       else
       foreach edge ee do
       { printf "l,%g,%g\n",ee.vertex[1].ansurf_knumber,
             ee.vertex[2].ansurf_knumber;
         lnumber += 1;
         ee.ansurf_lnumber := lnumber;
       }
     }

ansurf_faces := {
       local alnumber;
       alnumber := 0;
       foreach facet ff do
       { printf "al,%g,%g,%g\n",
           ff.edge[1].ansurf_lnumber,ff.edge[2].ansurf_lnumber,
             ff.edge[3].ansurf_lnumber;
         alnumber += 1;
         ff.ansurf_alnumber := alnumber; 
       }
 }

// define volumes, one per body
ansurf_bodies := { foreach body bb do
     { // select areas
       local flag;
       flag := 0;
       foreach bb.facet ff do
       { if flag then printf "ASEL,A,AREA,,%g,%g\n",ff.ansurf_alnumber,
           ff.ansurf_alnumber
         else printf "ASEL,S,AREA,,%g,%g\n",ff.ansurf_alnumber,
           ff.ansurf_alnumber;
         flag := 1;
       };
       printf "VA,ALL\n";
     }
  }

// define areas
ansurf := { printf "/PREP7\n";
            printf "/NOPR\n";
            ansurf_nodes;
            ansurf_edges;
            ansurf_faces;
            ansurf_bodies;
        }

// Usage: ansurf >>> "ansys_file"