##########
# flange #
##########
#
# Jin Li ABB/ASY/FJT
#
# command line:
#
# t3d -d 10.0 -w 0.5
#

# circular top flange inner circle

# circle 1

vertex 1 xyz -20.0 0.0 45.0 weight 1.0 
vertex 2 xyz  20.0 0.0 45.0 weight 1.0 

curve 1 order 4 vertex 1 2 rate 1.0 size def
polygon 1 xyz  -20.0  40.0 45.0 weight 0.3333333333
polygon 2 xyz   20.0  40.0 45.0 weight 0.3333333333

curve 2 order 4 vertex 1 2 rate 1.0 size def
polygon 1 xyz  -20.0 -40.0 45.0 weight 0.3333333333
polygon 2 xyz   20.0 -40.0 45.0 weight 0.3333333333


# circular top flange surface loops

# circle 2

vertex 3 xyz -30.0 0.0 45.0 weight 1.0 
vertex 4 xyz  30.0 0.0 45.0 weight 1.0 

curve 3 order 4 vertex 3 4 rate 1.0 size def
polygon 1 xyz  -30.0  60.0 45.0 weight 0.3333333333
polygon 2 xyz   30.0  60.0 45.0 weight 0.3333333333

curve 4 order 4 vertex 3 4 rate 1.0 size def
polygon 1 xyz  -30.0 -60.0 45.0 weight 0.3333333333
polygon 2 xyz   30.0 -60.0 45.0 weight 0.3333333333

# circle 3

vertex 5 xyz -30.0 0.0 25.0 weight 1.0 
vertex 6 xyz  30.0 0.0 25.0 weight 1.0 

curve 5 order 4 vertex 5 6 rate 1.0 size def
polygon 1 xyz  -30.0  60.0 25.0 weight 0.3333333333
polygon 2 xyz   30.0  60.0 25.0 weight 0.3333333333

curve 6 order 4 vertex 5 6 rate 1.0 size def
polygon 1 xyz  -30.0 -60.0 25.0 weight 0.3333333333
polygon 2 xyz   30.0 -60.0 25.0 weight 0.3333333333

# circle 4

vertex 7 xyz -40.0 0.0 15.0 weight 1.0 
vertex 8 xyz  40.0 0.0 15.0 weight 1.0 

curve 7 order 4 vertex 7 8 rate 1.0 size def
polygon 1 xyz  -40.0  80.0 15.0 weight 0.3333333333
polygon 2 xyz   40.0  80.0 15.0 weight 0.3333333333

curve 8 order 4 vertex 7 8 rate 1.0 size def
polygon 1 xyz  -40.0 -80.0 15.0 weight 0.3333333333
polygon 2 xyz   40.0 -80.0 15.0 weight 0.3333333333

# circle 5

vertex  9 xyz -70.0 0.0 15.0 weight 1.0 
vertex 10 xyz  70.0 0.0 15.0 weight 1.0 

curve 9 order 4 vertex 9 10 rate 1.0 size def
polygon 1 xyz  -70.0  140.0 15.0 weight 0.3333333333
polygon 2 xyz   70.0  140.0 15.0 weight 0.3333333333

curve 10 order 4 vertex 9 10 rate 1.0 size def
polygon 1 xyz  -70.0 -140.0 15.0 weight 0.3333333333
polygon 2 xyz   70.0 -140.0 15.0 weight 0.3333333333

# circle 6

vertex 11 xyz -70.0 0.0 0.0 weight 1.0 
vertex 12 xyz  70.0 0.0 0.0 weight 1.0 

curve 11 order 4 vertex 11 12 rate 1.0 size def
polygon 1 xyz  -70.0  140.0 0.0 weight 0.3333333333
polygon 2 xyz   70.0  140.0 0.0 weight 0.3333333333

curve 12 order 4 vertex 11 12 rate 1.0 size def
polygon 1 xyz  -70.0 -140.0 0.0 weight 0.3333333333
polygon 2 xyz   70.0 -140.0 0.0 weight 0.3333333333

# circle 7

vertex 13 xyz -20.0 0.0 0.0 weight 1.0 
vertex 14 xyz  20.0 0.0 0.0 weight 1.0 

curve 13 order 4 vertex 13 14 rate 1.0 size def
polygon 1 xyz  -20.0  40.0 0.0 weight 0.3333333333
polygon 2 xyz   20.0  40.0 0.0 weight 0.3333333333

curve 14 order 4 vertex 13 14 rate 1.0 size def
polygon 1 xyz  -20.0 -40.0 0.0 weight 0.3333333333
polygon 2 xyz   20.0 -40.0 0.0 weight 0.3333333333


# six small holes

# small hole 1
# circle 8

vertex 15 xyz  50.0 0.0 0.0 weight 1.0 
vertex 16 xyz  60.0 0.0 0.0 weight 1.0 

curve 15 order 4 vertex 15 16 rate 1.0 size def
polygon 1 xyz  50.0  10.0 0.0 weight 0.3333333333
polygon 2 xyz  60.0  10.0 0.0 weight 0.3333333333

curve 16 order 4 vertex 15 16 rate 1.0 size def
polygon 1 xyz  50.0 -10.0 0.0 weight 0.3333333333
polygon 2 xyz  60.0 -10.0 0.0 weight 0.3333333333


# circle 9

vertex 17 xyz  50.0 0.0 15.0 weight 1.0 
vertex 18 xyz  60.0 0.0 15.0 weight 1.0 

curve 17 order 4 vertex 17 18 rate 1.0 size def
polygon 1 xyz  50.0  10.0 15.0 weight 0.3333333333
polygon 2 xyz  60.0  10.0 15.0 weight 0.3333333333

curve 18 order 4 vertex 17 18 rate 1.0 size def
polygon 1 xyz  50.0 -10.0 15.0 weight 0.3333333333
polygon 2 xyz  60.0 -10.0 15.0 weight 0.3333333333


# small hole 2
# circle 10

vertex 19 xyz -50.0 0.0 0.0 weight 1.0 
vertex 20 xyz -60.0 0.0 0.0 weight 1.0 

curve 19 order 4 vertex 19 20 rate 1.0 size def
polygon 1 xyz -50.0  10.0 0.0 weight 0.3333333333
polygon 2 xyz -60.0  10.0 0.0 weight 0.3333333333

curve 20 order 4 vertex 19 20 rate 1.0 size def
polygon 1 xyz -50.0 -10.0 0.0 weight 0.3333333333
polygon 2 xyz -60.0 -10.0 0.0 weight 0.3333333333


# circle 11

vertex 21 xyz -50.0 0.0 15.0 weight 1.0 
vertex 22 xyz -60.0 0.0 15.0 weight 1.0 

curve 21 order 4 vertex 21 22 rate 1.0 size def
polygon 1 xyz -50.0  10.0 15.0 weight 0.3333333333
polygon 2 xyz -60.0  10.0 15.0 weight 0.3333333333

curve 22 order 4 vertex 21 22 rate 1.0 size def
polygon 1 xyz -50.0 -10.0 15.0 weight 0.3333333333
polygon 2 xyz -60.0 -10.0 15.0 weight 0.3333333333


# small hole 3
# circle 12

vertex 23 xyz 25.0 43.3012701892219 0.0 weight 1.0 
vertex 24 xyz 30.0 51.96152422706630 0.0 weight 1.0 

curve 23 order 4 vertex 23 24 rate 1.0 size def
polygon 1 xyz 16.3397459621556  48.3012701892219 0.0 weight 0.3333333333
polygon 2 xyz 21.3397459621556  56.9615242270663 0.0 weight 0.3333333333

curve 24 order 4 vertex 23 24 rate 1.0 size def
polygon 1 xyz 33.6602540378444  38.3012701892219 0.0 weight 0.3333333333
polygon 2 xyz 38.6602540378444  46.9615242270663 0.0 weight 0.3333333333


# circle 13

vertex 25 xyz 25.0 43.3012701892219 15.0 weight 1.0 
vertex 26 xyz 30.0 51.96152422706630 15.0 weight 1.0 

curve 25 order 4 vertex 25 26 rate 1.0 size def
polygon 1 xyz 16.3397459621556  48.3012701892219 15.0 weight 0.3333333333
polygon 2 xyz 21.3397459621556  56.9615242270663 15.0 weight 0.3333333333

curve 26 order 4 vertex 25 26 rate 1.0 size def
polygon 1 xyz 33.6602540378444  38.3012701892219 15.0 weight 0.3333333333
polygon 2 xyz 38.6602540378444  46.9615242270663 15.0 weight 0.3333333333



# small hole 4
# circle 14

vertex 27 xyz 25.0 -43.3012701892219 0.0 weight 1.0 
vertex 28 xyz 30.0 -51.96152422706630 0.0 weight 1.0 

curve 27 order 4 vertex 27 28 rate 1.0 size def
polygon 1 xyz 16.3397459621556  -48.3012701892219 0.0 weight 0.3333333333
polygon 2 xyz 21.3397459621556  -56.9615242270663 0.0 weight 0.3333333333

curve 28 order 4 vertex 27 28 rate 1.0 size def
polygon 1 xyz 33.6602540378444  -38.3012701892219 0.0 weight 0.3333333333
polygon 2 xyz 38.6602540378444  -46.9615242270663 0.0 weight 0.3333333333

# circle 15

vertex 29 xyz 25.0 -43.3012701892219 15.0 weight 1.0 
vertex 30 xyz 30.0 -51.96152422706630 15.0 weight 1.0 

curve 29 order 4 vertex 29 30 rate 1.0 size def
polygon 1 xyz 16.3397459621556  -48.3012701892219 15.0 weight 0.3333333333
polygon 2 xyz 21.3397459621556  -56.9615242270663 15.0 weight 0.3333333333

curve 30 order 4 vertex 29 30 rate 1.0 size def
polygon 1 xyz 33.6602540378444  -38.3012701892219 15.0 weight 0.3333333333
polygon 2 xyz 38.6602540378444  -46.9615242270663 15.0 weight 0.3333333333


# small hole 5
# circle 16

vertex 31 xyz -25.0 43.3012701892219 0.0 weight 1.0 
vertex 32 xyz -30.0 51.96152422706630 0.0 weight 1.0 

curve 31 order 4 vertex 31 32 rate 1.0 size def
polygon 1 xyz -16.3397459621556  48.3012701892219 0.0 weight 0.3333333333
polygon 2 xyz -21.3397459621556  56.9615242270663 0.0 weight 0.3333333333

curve 32 order 4 vertex 31 32 rate 1.0 size def
polygon 1 xyz -33.6602540378444  38.3012701892219 0.0 weight 0.3333333333
polygon 2 xyz -38.6602540378444  46.9615242270663 0.0 weight 0.3333333333


# circle 17

vertex 33 xyz -25.0 43.3012701892219 15.0 weight 1.0 
vertex 34 xyz -30.0 51.96152422706630 15.0 weight 1.0 

curve 33 order 4 vertex 33 34 rate 1.0 size def
polygon 1 xyz -16.3397459621556  48.3012701892219 15.0 weight 0.3333333333
polygon 2 xyz -21.3397459621556  56.9615242270663 15.0 weight 0.3333333333

curve 34 order 4 vertex 33 34 rate 1.0 size def
polygon 1 xyz -33.6602540378444  38.3012701892219 15.0 weight 0.3333333333
polygon 2 xyz -38.6602540378444  46.9615242270663 15.0 weight 0.3333333333


# small hole 6
# circle 18

vertex 35 xyz -25.0 -43.3012701892219 0.0 weight 1.0 
vertex 36 xyz -30.0 -51.96152422706630 0.0 weight 1.0 

curve 35 order 4 vertex 35 36 rate 1.0 size def
polygon 1 xyz -16.3397459621556  -48.3012701892219 0.0 weight 0.3333333333
polygon 2 xyz -21.3397459621556  -56.9615242270663 0.0 weight 0.3333333333

curve 36 order 4 vertex 35 36 rate 1.0 size def
polygon 1 xyz -33.6602540378444  -38.3012701892219 0.0 weight 0.3333333333
polygon 2 xyz -38.6602540378444  -46.9615242270663 0.0 weight 0.3333333333


# circle 19

vertex 37 xyz -25.0 -43.3012701892219 15.0 weight 1.0 
vertex 38 xyz -30.0 -51.96152422706630 15.0 weight 1.0 

curve 37 order 4 vertex 37 38 rate 1.0 size def
polygon 1 xyz -16.3397459621556  -48.3012701892219 15.0 weight 0.3333333333
polygon 2 xyz -21.3397459621556  -56.9615242270663 15.0 weight 0.3333333333

curve 38 order 4 vertex 37 38 rate 1.0 size def
polygon 1 xyz -33.6602540378444  -38.3012701892219 15.0 weight 0.3333333333
polygon 2 xyz -38.6602540378444  -46.9615242270663 15.0 weight 0.3333333333


# vertical lines

curve 39 order 2 vertex 1 13 rate 1.0 size def
curve 40 order 2 vertex 2 14 rate 1.0 size def
curve 41 order 2 vertex 3 5 rate 1.0 size def
curve 42 order 2 vertex 4 6 rate 1.0 size def
curve 43 order 2 vertex 9 11 rate 1.0 size def
curve 44 order 2 vertex 10 12 rate 1.0 size def

curve 45 order 2 vertex 15 17 rate 1.0 size def
curve 46 order 2 vertex 16 18 rate 1.0 size def
curve 47 order 2 vertex 23 25 rate 1.0 size def
curve 48 order 2 vertex 24 26 rate 1.0 size def
curve 49 order 2 vertex 31 33 rate 1.0 size def
curve 50 order 2 vertex 32 34 rate 1.0 size def
curve 51 order 2 vertex 19 21 rate 1.0 size def
curve 52 order 2 vertex 20 22 rate 1.0 size def
curve 53 order 2 vertex 35 37 rate 1.0 size def
curve 54 order 2 vertex 36 38 rate 1.0 size def
curve 55 order 2 vertex 27 29 rate 1.0 size def
curve 56 order 2 vertex 28 30 rate 1.0 size def


curve 57 order 3 vertex 5 7 rate 1.0 size def
polygon 1 xyz -30 0 15 weight 0.707

curve 58 order 3 vertex 6 8 rate 1.0 size def
polygon 1 xyz 30 0 15 weight 0.707


# surface definition

surface 1 order 3 4 curve 58 5 57 7 rate 1.0
polygon 1 1 xyz 30.0 60.0 15.0 weight 0.23570226
polygon 1 2 xyz -30.0 60.0 15.0 weight 0.23570226

surface 2 order 3 4 curve 58 8 57 6 rate 1.0
polygon 1 1 xyz 30.0 -60.0 15.0 weight 0.23570226
polygon 1 2 xyz -30.0 -60.0 15.0 weight 0.23570226

# cylinder surfaces

surface 3 order 2 4 curve 42 6 41 4 rate 1.0
surface 4 order 2 4 curve 42 3 41 5 rate 1.0

surface 5 order 2 4 curve 40 13 39 1 rate 1.0
surface 6 order 2 4 curve 39 14 40 2 rate 1.0

surface 7 order 2 4 curve 43 11 44 9 rate 1.0
surface 8 order 2 4 curve 44 12 43 10 rate 1.0

surface 11 order 2 4 curve 45 15 46 17 rate 1.0
surface 12 order 2 4 curve 46 16 45 18 rate 1.0

surface 13 order 2 4 curve 51 20 52 22 rate 1.0
surface 14 order 2 4 curve 52 19 51 21 rate 1.0

surface 15 order 2 4 curve 47 23 48 25 rate 1.0
surface 16 order 2 4 curve 48 24 47 26 rate 1.0

surface 17 order 2 4 curve 55 28 56 30 rate 1.0
surface 18 order 2 4 curve 56 27 55 29 rate 1.0

surface 19 order 2 4 curve 49 32 50 34 rate 1.0
surface 20 order 2 4 curve 50 31 49 33 rate 1.0

surface 21 order 2 4 curve 53 35 54 37 rate 1.0
surface 22 order 2 4 curve 54 36 53 38 rate 1.0


patch 1 normal 0 0 1 size def boundary curve \
  -9 10 17 -18 25 -26 -33 34 -21 22 37 -38 -29 30 7 -8
patch 2 normal 0 0 1 size def boundary curve \
  -11 12 15 -16 23 -24 -31 32 -19 20 35 -36 -27 28 13 -14 
patch 3 normal 0 0 1 size def boundary curve \
  1 -2 -3 4


# volume

region 1 size def boundary patch 1 -2 3 boundary surface \
  1 2 3 4 5 6 7 8 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22



