fillSammAddressingTable.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "sammMesh.H"
27 
28 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
29 
30 void Foam::sammMesh::fillSammAddressingTable()
31 {
32  // SAMM trim type 1: 8 models
33  static label SammTrim1Rot0[10] = {1, 5, 6, 2, 8, 10, 4, 7, 3, 9};
34  static label SammTrim1Rot1[10] = {2, 6, 7, 3, 8, 10, 5, 4, 0, 9};
35  static label SammTrim1Rot2[10] = {3, 7, 4, 0, 8, 10, 6, 5, 1, 9};
36  static label SammTrim1Rot3[10] = {0, 4, 5, 1, 8, 10, 7, 6, 2, 9};
37  static label SammTrim1Rot4[10] = {7, 3, 2, 6, 8, 10, 0, 1, 5, 9};
38  static label SammTrim1Rot5[10] = {4, 0, 3, 7, 8, 10, 1, 2, 6, 9};
39  static label SammTrim1Rot6[10] = {5, 1, 0, 4, 8, 10, 2, 3, 7, 9};
40  static label SammTrim1Rot7[10] = {6, 2, 1, 5, 8, 10, 3, 0, 4, 9};
41 
42  sammAddressingTable[1] = SammTrim1Rot0;
43  sammAddressingTable[2] = SammTrim1Rot1;
44  sammAddressingTable[4] = SammTrim1Rot2;
45  sammAddressingTable[8] = SammTrim1Rot3;
46  sammAddressingTable[16] = SammTrim1Rot4;
47  sammAddressingTable[32] = SammTrim1Rot5;
48  sammAddressingTable[64] = SammTrim1Rot6;
49  sammAddressingTable[128] = SammTrim1Rot7;
50 
51 
52  // SAMM trim type 2: 12 models
53  static label SammTrim2Rot0[10] = {9, 3, 7, 4, 10, 8, 2, 6, 5, 11};
54  static label SammTrim2Rot1[10] = {9, 1, 5, 6, 10, 8, 0, 4, 7, 11};
55  static label SammTrim2Rot2[10] = {9, 2, 1, 5, 10, 8, 3, 0, 4, 11};
56  static label SammTrim2Rot3[10] = {9, 0, 3, 7, 10, 8, 1, 2, 6, 11};
57 
58  static label SammTrim2Rot4[10] = {9, 4, 5, 1, 10, 8, 7, 6, 2, 11};
59  static label SammTrim2Rot5[10] = {9, 5, 1, 0, 10, 8, 6, 2, 3, 11};
60  static label SammTrim2Rot6[10] = {9, 1, 0, 4, 10, 8, 2, 3, 7, 11};
61  static label SammTrim2Rot7[10] = {9, 0, 4, 5, 10, 8, 3, 7, 6, 11};
62 
63  static label SammTrim2Rot8[10] = {9, 1, 2, 3, 10, 8, 5, 6, 7, 11};
64  static label SammTrim2Rot9[10] = {9, 2, 3, 0, 10, 8, 6, 7, 4, 11};
65  static label SammTrim2Rot10[10] = {9, 3, 0, 1, 10, 8, 7, 4, 5, 11};
66  static label SammTrim2Rot11[10] = {9, 0, 1, 2, 10, 8, 4, 5, 6, 11};
67 
68  sammAddressingTable[3] = SammTrim2Rot0;
69  sammAddressingTable[12] = SammTrim2Rot1;
70  sammAddressingTable[192] = SammTrim2Rot2;
71  sammAddressingTable[48] = SammTrim2Rot3;
72  sammAddressingTable[9] = SammTrim2Rot4;
73  sammAddressingTable[144] = SammTrim2Rot5;
74  sammAddressingTable[96] = SammTrim2Rot6;
75  sammAddressingTable[6] = SammTrim2Rot7;
76  sammAddressingTable[17] = SammTrim2Rot8;
77  sammAddressingTable[34] = SammTrim2Rot9;
78  sammAddressingTable[68] = SammTrim2Rot10;
79  sammAddressingTable[136] = SammTrim2Rot11;
80 
81 
82  // SAMM trim type 3: 24 models
83  static label SammTrim3Rot0[10] = {5, 4, 7, 6, 11, 10, 9, 3, 8, 12};
84  static label SammTrim3Rot1[10] = {6, 5, 4, 7, 11, 10, 9, 0, 8, 12};
85  static label SammTrim3Rot2[10] = {7, 6, 5, 4, 11, 10, 9, 1, 8, 12};
86  static label SammTrim3Rot3[10] = {4, 7, 6, 5, 11, 10, 9, 2, 8, 12};
87  static label SammTrim3Rot4[10] = {1, 2, 3, 0, 11, 10, 9, 7, 8, 12};
88  static label SammTrim3Rot5[10] = {2, 3, 0, 1, 11, 10, 9, 4, 8, 12};
89  static label SammTrim3Rot6[10] = {3, 0, 1, 2, 11, 10, 9, 5, 8, 12};
90  static label SammTrim3Rot7[10] = {0, 1, 2, 3, 11, 10, 9, 6, 8, 12};
91  static label SammTrim3Rot8[10] = {0, 3, 7, 4, 11, 10, 9, 6, 8, 12};
92  static label SammTrim3Rot9[10] = {3, 7, 4, 0, 11, 10, 9, 5, 8, 12};
93  static label SammTrim3Rot10[10] = {7, 4, 0, 3, 11, 10, 9, 1, 8, 12};
94  static label SammTrim3Rot11[10] = {4, 0, 3, 7, 11, 10, 9, 2, 8, 12};
95  static label SammTrim3Rot12[10] = {1, 5, 6, 2, 11, 10, 9, 7, 8, 12};
96  static label SammTrim3Rot13[10] = {2, 1, 5, 6, 11, 10, 9, 4, 8, 12};
97  static label SammTrim3Rot14[10] = {6, 2, 1, 5, 11, 10, 9, 0, 8, 12};
98  static label SammTrim3Rot15[10] = {5, 6, 1, 2, 11, 10, 9, 3, 8, 12};
99  static label SammTrim3Rot16[10] = {7, 3, 2, 6, 11, 10, 9, 1, 8, 12};
100  static label SammTrim3Rot17[10] = {6, 7, 3, 2, 11, 10, 9, 0, 8, 12};
101  static label SammTrim3Rot18[10] = {2, 6, 7, 3, 11, 10, 9, 4, 8, 12};
102  static label SammTrim3Rot19[10] = {3, 2, 6, 7, 11, 10, 9, 5, 8, 12};
103  static label SammTrim3Rot20[10] = {4, 5, 1, 0, 11, 10, 9, 2, 8, 12};
104  static label SammTrim3Rot21[10] = {5, 1, 0, 4, 11, 10, 9, 3, 8, 12};
105  static label SammTrim3Rot22[10] = {1, 0, 4, 5, 11, 10, 9, 7, 8, 12};
106  static label SammTrim3Rot23[10] = {0, 4, 5, 1, 11, 10, 9, 6, 8, 12};
107 
108  sammAddressingTable[7] = SammTrim3Rot0;
109  sammAddressingTable[14] = SammTrim3Rot1;
110  sammAddressingTable[13] = SammTrim3Rot2;
111  sammAddressingTable[11] = SammTrim3Rot3;
112  sammAddressingTable[112] = SammTrim3Rot4;
113  sammAddressingTable[224] = SammTrim3Rot5;
114  sammAddressingTable[208] = SammTrim3Rot6;
115  sammAddressingTable[176] = SammTrim3Rot7;
116  sammAddressingTable[38] = SammTrim3Rot8;
117  sammAddressingTable[70] = SammTrim3Rot9;
118  sammAddressingTable[100] = SammTrim3Rot10;
119  sammAddressingTable[98] = SammTrim3Rot11;
120  sammAddressingTable[25] = SammTrim3Rot12;
121  sammAddressingTable[137] = SammTrim3Rot13;
122  sammAddressingTable[152] = SammTrim3Rot14;
123  sammAddressingTable[145] = SammTrim3Rot15;
124  sammAddressingTable[49] = SammTrim3Rot16;
125  sammAddressingTable[50] = SammTrim3Rot17;
126  sammAddressingTable[35] = SammTrim3Rot18;
127  sammAddressingTable[19] = SammTrim3Rot19;
128  sammAddressingTable[200] = SammTrim3Rot20;
129  sammAddressingTable[196] = SammTrim3Rot21;
130  sammAddressingTable[76] = SammTrim3Rot22;
131  sammAddressingTable[140] = SammTrim3Rot23;
132 
133 
134  // SAMM trim type 4: 8 models
135  static label SammTrim4Rot0[10] = {6, 7, 2, 5, 13, 12 ,11, 10, 9, 8};
136  static label SammTrim4Rot1[10] = {7, 4, 3, 6, 13, 12 ,11, 10, 9, 8};
137  static label SammTrim4Rot2[10] = {4, 5, 6, 7, 13, 12 ,11, 10, 9, 8};
138  static label SammTrim4Rot3[10] = {5, 6, 1, 4, 13, 12 ,11, 10, 9, 8};
139  static label SammTrim4Rot4[10] = {2, 1, 6, 3, 13, 12 ,11, 10, 9, 8};
140  static label SammTrim4Rot5[10] = {3, 2, 7, 0, 13, 12 ,11, 10, 9, 8};
141  static label SammTrim4Rot6[10] = {0, 3, 4, 1, 13, 12 ,11, 10, 9, 8};
142  static label SammTrim4Rot7[10] = {1, 0, 5, 2, 13, 12 ,11, 10, 9, 8};
143 
144  sammAddressingTable[27] = SammTrim4Rot0;
145  sammAddressingTable[39] = SammTrim4Rot1;
146  sammAddressingTable[78] = SammTrim4Rot2;
147  sammAddressingTable[141] = SammTrim4Rot3;
148  sammAddressingTable[177] = SammTrim4Rot4;
149  sammAddressingTable[114] = SammTrim4Rot5;
150  sammAddressingTable[228] = SammTrim4Rot6;
151  sammAddressingTable[216] = SammTrim4Rot7;
152 
153 
154  // SAMM trim type 5: 24 models
155  static label SammTrim5Rot0[8] = {12, 0, 1, 2, 8, 11, 10, 9};
156  static label SammTrim5Rot1[8] = {12, 1, 2, 3, 8, 11, 10, 9};
157  static label SammTrim5Rot2[8] = {12, 2, 3, 0, 8, 11, 10, 9};
158  static label SammTrim5Rot3[8] = {12, 3, 0, 1, 8, 11, 10, 9};
159  static label SammTrim5Rot4[8] = {12, 6, 5, 4, 8, 11, 10, 9};
160  static label SammTrim5Rot5[8] = {12, 7, 6, 5, 8, 11, 10, 9};
161  static label SammTrim5Rot6[8] = {12, 4, 7, 6, 8, 11, 10, 9};
162  static label SammTrim5Rot7[8] = {12, 5, 4, 7, 8, 11, 10, 9};
163  static label SammTrim5Rot8[8] = {12, 2, 1, 5, 8, 11, 10, 9};
164  static label SammTrim5Rot9[8] = {12, 6, 2, 1, 8, 11, 10, 9};
165  static label SammTrim5Rot10[8] = {12, 5, 6, 2, 8, 11, 10, 9};
166  static label SammTrim5Rot11[8] = {12, 1, 5, 6, 8, 11, 10, 9};
167  static label SammTrim5Rot12[8] = {12, 4, 0, 3, 8, 11, 10, 9};
168  static label SammTrim5Rot13[8] = {12, 0, 3, 7, 8, 11, 10, 9};
169  static label SammTrim5Rot14[8] = {12, 3, 7, 4, 8, 11, 10, 9};
170  static label SammTrim5Rot15[8] = {12, 7, 4, 0, 8, 11, 10, 9};
171  static label SammTrim5Rot16[8] = {12, 0, 4, 5, 8, 11, 10, 9};
172  static label SammTrim5Rot17[8] = {12, 4, 5, 1, 8, 11, 10, 9};
173  static label SammTrim5Rot18[8] = {12, 5, 1, 0, 8, 11, 10, 9};
174  static label SammTrim5Rot19[8] = {12, 1, 0, 4, 8, 11, 10, 9};
175  static label SammTrim5Rot20[8] = {12, 6, 7, 3, 8, 11, 10, 9};
176  static label SammTrim5Rot21[8] = {12, 2, 6, 7, 8, 11, 10, 9};
177  static label SammTrim5Rot22[8] = {12, 3, 2, 6, 8, 11, 10, 9};
178  static label SammTrim5Rot23[8] = {12, 7, 3, 2, 8, 11, 10, 9};
179 
180  sammAddressingTable[248] = SammTrim5Rot0;
181  sammAddressingTable[241] = SammTrim5Rot1;
182  sammAddressingTable[242] = SammTrim5Rot2;
183  sammAddressingTable[244] = SammTrim5Rot3;
184  sammAddressingTable[143] = SammTrim5Rot4;
185  sammAddressingTable[31] = SammTrim5Rot5;
186  sammAddressingTable[47] = SammTrim5Rot6;
187  sammAddressingTable[79] = SammTrim5Rot7;
188  sammAddressingTable[217] = SammTrim5Rot8;
189  sammAddressingTable[185] = SammTrim5Rot9;
190  sammAddressingTable[155] = SammTrim5Rot10;
191  sammAddressingTable[157] = SammTrim5Rot11;
192  sammAddressingTable[230] = SammTrim5Rot12;
193  sammAddressingTable[118] = SammTrim5Rot13;
194  sammAddressingTable[103] = SammTrim5Rot14;
195  sammAddressingTable[110] = SammTrim5Rot15;
196  sammAddressingTable[206] = SammTrim5Rot16;
197  sammAddressingTable[205] = SammTrim5Rot17;
198  sammAddressingTable[220] = SammTrim5Rot18;
199  sammAddressingTable[236] = SammTrim5Rot19;
200  sammAddressingTable[55] = SammTrim5Rot20;
201  sammAddressingTable[59] = SammTrim5Rot21;
202  sammAddressingTable[179] = SammTrim5Rot22;
203  sammAddressingTable[115] = SammTrim5Rot23;
204 
205 
206  // SAMM trim type 8: 1 model
207  static label SammTrim8[12] = {8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
208 
209  sammAddressingTable[255] = SammTrim8;
210 }
211 
212 
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 
215 
216 // ************************************************************************* //
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.