-
Notifications
You must be signed in to change notification settings - Fork 0
/
Macro_SurfaceVolumeRetrievalSkewback.geo
executable file
·154 lines (138 loc) · 4.54 KB
/
Macro_SurfaceVolumeRetrievalSkewback.geo
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/******************************************************************************************************************************
*
* Macro SurfaceVolumeRetrievalSkewback
*
* Automatic retrieval of Surfaces & Volumes from the extruded (in +Y) skewbacks for the purpose of defining Physical entities
*
******************************************************************************************************************************/
// RETRIEVAL OF ALL SURFACES AT Y=extr.width FROM THE EXTRUDED SKEWBACKS, AS WELL AS THE GENERATED VOLUMES
// NOTES: * THIS MACRO FEEDS ORIGINALLY FROM MACRO Bridge3D3Span, HENCE
// ALL LIMITATIONS AND SPECIFICITIES NOTED THERE APPLY HERE AS WELL
Macro SurfaceVolumeRetrievalSkewback
/*
IN: *args from previous macros
INOUT: S_Yext[] = List of all Surfaces at Y>0 (with Y = width of extrusion)
(updated here with the skewbacks contribution)
V_SK[] = List of ALL Volumes forming the skewbacks in the current extrusion
V_SK20[] = List of WEDGE Volumes forming the skewbacks in the current extrusion
V_SK15[] = List of HEXAHEDRAL Volumes forming the skewbacks in the current extrusion
aux1 = Number of elements in 1 layer of each triangular part of the skewback
aux2sk = Number of elements in 1 layer of the central (rectangular)
part of the skewback should it be present
+ other aux variables
*/
//------------------------------------------------------------------------------
// INITIALISE AUX LISTS
If (L_x2 == 0)
aux2sk = 0;
Else
aux2sk = (TL1-1)*(TL2-1);
EndIf
aux1 = (TL1/2)*(TL1-1);
add[] = {5};
For (1:aux1-2)
add[] = {add[], 6};
EndFor
For j In {2:TL1-1}
add[{ (j/2*(j-1))-1 }] = 5;
EndFor
add2[] = {0};
addsum = 0;
For j In {1:aux1-1}
addsum = addsum + add[j-1];
add2[] = {add2[], addsum};
EndFor
//------------------------------------------------------------------------------
// SIMULTANEOUS UPDATE OF S_Yext[] AND V_SK[], SPLITTING INTO V_SK15[] AND V_SK20[]
//------------------------------------------------------------------------------
// 1st SKEWBACK (1/3)
suma = 0;
sumv = 1;
For j In {0:aux1-1}
S_Yext[] = {S_Yext[], extSK[suma+add2[j]]};
V_SK[] = {V_SK[], extSK[sumv+add2[j]]};
EndFor
// SPLIT V_SK[] INTO WEDGES AND HEXAHEDRONS
For j In {0:aux1-2}
If (add[j] == 5)
V_SK15[] = {V_SK15[], extSK[sumv+add2[j]]};
ElseIf (add[j] == 6)
V_SK20[] = {V_SK20[], extSK[sumv+add2[j]]};
EndIf
EndFor
V_SK15[] = {V_SK15[], extSK[sumv+add2[aux1-1]]};
//------------------------------------------------------------------------------
// 1st SKEWBACK (2/3) IF PRESENT
suma = suma+add2[aux1-1]+5;
sumv = sumv+add2[aux1-1]+5;
If (L_x2 != 0)
For (1:aux2sk)
S_Yext[] = {S_Yext[], extSK[suma]};
V_SK[] = {V_SK[], extSK[sumv]};
V_SK20[] = {V_SK20[], extSK[sumv]};
suma = suma+6;
sumv = sumv+6;
EndFor
EndIf
//------------------------------------------------------------------------------
// 1st SKEWBACK (3/3)
For step In {TL1-1:1:-1}
S_Yext[] = {S_Yext[], extSK[suma]};
suma = suma+5;
V_SK[] = {V_SK[], extSK[sumv]};
V_SK15[] = {V_SK15[], extSK[sumv]};
sumv = sumv+5;
For (1:step-1)
S_Yext[] = {S_Yext[], extSK[suma]};
suma = suma+6;
V_SK[] = {V_SK[], extSK[sumv]};
V_SK20[] = {V_SK20[], extSK[sumv]};
sumv = sumv+6;
EndFor
EndFor
//------------------------------------------------------------------------------
// 2nd SKEWBACK (1/3)
For j In {0:aux1-1}
S_Yext[] = {S_Yext[], extSK[suma+add2[j]]};
V_SK[] = {V_SK[], extSK[sumv+add2[j]]};
EndFor
// SPLIT V_SK[] INTO WEDGES AND HEXAHEDRONS
For j In {0:aux1-2}
If (add[j] == 5)
V_SK15[] = {V_SK15[], extSK[sumv+add2[j]]};
ElseIf (add[j] == 6)
V_SK20[] = {V_SK20[], extSK[sumv+add2[j]]};
EndIf
EndFor
V_SK15[] = {V_SK15[], extSK[sumv+add2[aux1-1]]};
//------------------------------------------------------------------------------
// 2nd SKEWBACK (2/3) IF PRESENT
suma = suma+add2[aux1-1]+5;
sumv = sumv+add2[aux1-1]+5;
If (L_x2 != 0)
For (1:aux2sk)
S_Yext[] = {S_Yext[], extSK[suma]};
V_SK[] = {V_SK[], extSK[sumv]};
V_SK20[] = {V_SK20[], extSK[sumv]};
suma = suma+6;
sumv = sumv+6;
EndFor
EndIf
//------------------------------------------------------------------------------
// 2nd SKEWBACK (3/3)
For step In {TL1-1:1:-1}
S_Yext[] = {S_Yext[], extSK[suma]};
suma = suma+5;
V_SK[] = {V_SK[], extSK[sumv]};
V_SK15[] = {V_SK15[], extSK[sumv]};
sumv = sumv+5;
For (1:step-1)
S_Yext[] = {S_Yext[], extSK[suma]};
suma = suma+6;
V_SK[] = {V_SK[], extSK[sumv]};
V_SK20[] = {V_SK20[], extSK[sumv]};
sumv = sumv+6;
EndFor
EndFor
//------------------------------------------------------------------------------
Return