28 if (ibdr && jbdr && kbdr)
32 else if (jbdr && kbdr && lbdr)
36 else if (ibdr && kbdr && lbdr)
40 else if (ibdr && jbdr && lbdr)
47 return offset + i - 1;
49 else if (kbdr && lbdr)
51 return offset + ref - 1 + j - 1;
53 else if (ibdr && kbdr)
55 return offset + 2 * (ref - 1) + ref - j - 1;
57 else if (ibdr && jbdr)
59 return offset + 3 * (ref - 1) + ref - k - 1;
61 else if (ibdr && lbdr)
63 return offset + 4 * (ref - 1) + ref - k - 1;
65 else if (jbdr && lbdr)
67 return offset + 5 * (ref - 1) + ref - k - 1;
71 offset += 6 * (ref - 1);
77 b_out[2] = ref - i - j - 1;
85 b_out[2] = ref - i - k - 1;
86 offset += (ref - 1) * (ref - 2) / 2;
94 b_out[2] = ref - j - k - 1;
95 offset += (ref - 1) * (ref - 2);
101 b_out[0] = ref-j-k-1;
104 offset += 3 * (ref - 1) * (ref - 2) / 2;
114 b_out[3] = ref - i - j - k - 1;
115 offset += 2 * (ref - 1) * (ref - 2);
125 bool ibdr = (i == 0 || i == ref);
126 bool jbdr = (j == 0 || j == ref);
129 return (i ? (j ? 2 : 1) : (j ? 3 : 0));
134 return offset + (j ? 3*ref - 3 - i : i - 1);
138 return offset + (i ? ref - 1 + j - 1 : 4*ref - 4 - j);
145 offset += 4 * (ref - 1);
156 bool ibdr = (i == 0 || i == ref);
157 bool jbdr = (j == 0 || j == ref);
158 bool kbdr = (k == 0 || k == ref);
159 if (ibdr && jbdr && kbdr)
161 return (i ? (j ? (k ? 6 : 2) : (k ? 5 : 1)) :
162 (j ? (k ? 7 : 3) : (k ? 4 : 0)));
167 return offset + (j ? (k ? 12*ref-12-i: 6*ref-6-i) :
168 (k ? 8*ref-9+i: i-1));
170 else if (ibdr && kbdr)
172 return offset + (k ? (i ? 10*ref-11+j: 9*ref-10+j) :
173 (i ? 3*ref-4+j: ref-2+j));
175 else if (ibdr && jbdr)
177 return offset + (i ? (j ? 6*ref-7+k: 4*ref-5+k) :
178 (j ? 7*ref-8+k: 2*ref-3+k));
183 idx_out[0] = i ? j-1 : k-1;
184 idx_out[1] = i ? k-1 : j-1;
185 offset += (12 + (i ? 3 : 2) * (ref - 1)) * (ref - 1);
191 idx_out[0] = j ? ref-i-1 : i-1;
192 idx_out[1] = j ? k-1 : k-1;
193 offset += (12 + (j ? 4 : 1) * (ref - 1)) * (ref - 1);
199 idx_out[0] = k ? i-1 : j-1;
200 idx_out[1] = k ? j-1 : i-1;
201 offset += (12 + (k ? 5 : 0) * (ref - 1)) * (ref - 1);
211 offset += (12 + 6 * (ref - 1)) * (ref - 1);
222 bool ibdr = (i == 0);
223 bool jbdr = (j == 0);
224 bool kbdr = (k == 0 || k == ref);
225 bool lbdr = (l == 0);
226 if (ibdr && jbdr && kbdr)
230 else if (jbdr && lbdr && kbdr)
234 else if (ibdr && lbdr && kbdr)
241 return offset + (k ? 6 * (ref - 1) + i - 1: i - 1);
243 else if (ibdr && kbdr)
245 return offset + (k ? 7 * (ref -1) + j-1 : ref - 1 + j - 1);
247 else if (ibdr && jbdr)
249 return offset + 2 * (ref - 1) + k - 1;
251 else if (lbdr && kbdr)
253 return offset + (k ? 8 * (ref -1) + j - 1 : 3 * (ref - 1) + j - 1);
255 else if (jbdr && lbdr)
257 return offset + 4 * (ref - 1) + k - 1;
259 else if (ibdr && lbdr)
261 return offset + 5 * (ref - 1) + k - 1;
263 offset += 9 * (ref-1);
267 b_out[0] = k ? i-1 : j-1;
268 b_out[1] = k ? j-1 : i-1;
269 b_out[2] = ref - i - j - 1;
270 offset += k ? (ref-1)*(ref-2) / 2: 0;
273 offset += (ref-1)*(ref-2);
286 offset += (ref-1)*(ref-1);
294 offset += 2*(ref-1)*(ref-1);
297 offset += 3*(ref-1)*(ref-1);
304 b_out[2] = ref - i - j - 1;
306 int os = (k==1) ? 0 : (k == ref-1 ? 1 : k);
307 return offset + (ref-1) * ot + os;
317 bool ibdr = (i == 0 || i == ref-k);
318 bool jbdr = (j == 0 || j == ref-k);
319 bool kbdr = (k == 0);
320 if (ibdr && jbdr && kbdr)
322 return i ? (j ? 2 : 1): (j ? 3 : 0);
331 return offset + (j ? (6 * ref - 6 - i) : (i - 1));
333 else if (ibdr && kbdr)
335 return offset + (i ? (3 * ref - 4 + j) : (ref - 2 + j));
337 else if (ibdr && jbdr)
339 return offset + (i ? (j ? 6 : 4) : (j ? 7 : 2 )) * (ref-1) + k - 1;
345 b_out[0] = j ? ref - i - k - 1 : i - 1;
347 b_out[2] = (j ? i - 1 : ref - i - k - 1);
348 offset += (j ? 3 : 0) * (ref - 1) * (ref - 2) / 2;
354 b_out[0] = i ? j - 1: ref - j - k - 1;
356 b_out[2] = (i ? ref - j - k - 1: j - 1);
357 offset += (i ? 2 : 1) * (ref - 1) * (ref - 2) / 2;
363 idx_out[0] = k ? i-1 : j-1;
364 idx_out[1] = k ? j-1 : i-1;
365 offset += 2 * (ref - 1) * (ref - 2);
368 offset += (2 * (ref - 2) + (ref - 1)) * (ref - 1) ;
382 for (
int i=1; i<order; i++)
392 for (
b[1]=0;
b[1]<=order; ++
b[1])
394 for (
b[0]=0;
b[0]<=order-
b[1]; ++
b[0])
396 b[2] = order -
b[0] -
b[1];
407 for (
b[1]=0;
b[1]<=order;
b[1]++)
409 for (
b[0]=0;
b[0]<=order;
b[0]++)
421 for (
b[2]=0;
b[2]<=order; ++
b[2])
424 for (
b[1]=0;
b[1]<=order-
b[2]; ++
b[1])
426 for (
b[0]=0;
b[0]<=order-
b[1]-
b[2]; ++
b[0])
428 b[3] = order -
b[0] -
b[1] -
b[2];
440 for (
b[2]=0;
b[2]<=order;
b[2]++)
442 for (
b[1]=0;
b[1]<=order;
b[1]++)
444 for (
b[0]=0;
b[0]<=order;
b[0]++)
457 for (
b[2]=0;
b[2]<=order;
b[2]++)
459 for (
b[1]=0;
b[1]<=order;
b[1]++)
461 for (
b[0]=0;
b[0]<=order -
b[1];
b[0]++)
474 for (
b[2]=0;
b[2]<=order;
b[2]++)
476 for (
b[1]=0;
b[1]<=order -
b[2];
b[1]++)
478 for (
b[0]=0;
b[0]<=order -
b[2];
b[0]++)
int CartesianToGmshPyramid(int idx_in[], int ref)
int WedgeToGmshPri(int idx_in[], int ref)
void GmshHOWedgeMapping(int order, int *map)
Generate Gmsh vertex mapping for a Wedge.
void GmshHOTriangleMapping(int order, int *map)
Generate Gmsh vertex mapping for a Triangle.
int BarycentricToGmshTet(int *b, int ref)
int CartesianToGmshHex(int idx_in[], int ref)
int CartesianToGmshQuad(int idx_in[], int ref)
void GmshHOPyramidMapping(int order, int *map)
Generate Gmsh vertex mapping for a Pyramid.
void GmshHOTetrahedronMapping(int order, int *map)
Generate Gmsh vertex mapping for a Tetrahedron.
void GmshHOSegmentMapping(int order, int *map)
Generate Gmsh vertex mapping for a Segment.
void GmshHOQuadrilateralMapping(int order, int *map)
Generate Gmsh vertex mapping for a Quadrilateral.
void GmshHOHexahedronMapping(int order, int *map)
Generate Gmsh vertex mapping for a Hexahedron.
int BarycentricToVTKTriangle(int *b, int ref)
Return the VTK node index of the barycentric point b in a triangle with refinement level ref.