59 const IntTab& Face_sommets,
60 const IntTab& Face_voisins,
61 const IntTab& elem_faces,
62 const Domaine& domaine_geom)
const
66 for (
int num_Face=0; num_Face<nb_face_tot; num_Face++)
68 double x1, y1, z1, x2, y2, z2;
74 int n0 = Face_sommets(num_Face, 0);
75 int n1 = Face_sommets(num_Face, 1);
76 int n2 = Face_sommets(num_Face, 2);
77 int n3 = Face_sommets(num_Face, 3);
82 Face_normales(num_Face, 0) = 0;
83 Face_normales(num_Face, 1) = 0;
84 Face_normales(num_Face, 2) = 0;
88 x1 = les_coords(n0, 0) - les_coords(n1, 0);
89 y1 = les_coords(n0, 1) - les_coords(n1, 1);
90 z1 = les_coords(n0, 2) - les_coords(n1, 2);
92 x2 = les_coords(n3, 0) - les_coords(n1, 0);
93 y2 = les_coords(n3, 1) - les_coords(n1, 1);
94 z2 = les_coords(n3, 2) - les_coords(n1, 2);
96 nx = (y1 * z2 - y2 * z1) / 2;
97 ny = (-x1 * z2 + x2 * z1) / 2;
98 nz = (x1 * y2 - x2 * y1) / 2;
103 elem1 = Face_voisins(num_Face, 0);
105 if ((f0 = elem_faces(elem1, 0)) == num_Face)
106 f0 = elem_faces(elem1, 1);
108 if ((no4 = Face_sommets(f0, 0)) != n0 && no4 != n1
109 && no4 != n2 && no4 != n3) { }
110 else if ((no4 = Face_sommets(f0, 1)) != n0 && no4 != n1
111 && no4 != n2 && no4 != n3) { }
112 else if ((no4 = Face_sommets(f0, 2)) != n0 && no4 != n1
113 && no4 != n2 && no4 != n3) { }
115 no4 = Face_sommets(f0, 3);
117 x1 = les_coords(no4, 0) - les_coords(n0, 0);
118 y1 = les_coords(no4, 1) - les_coords(n0, 1);
119 z1 = les_coords(no4, 2) - les_coords(n0, 2);
121 if ((nx * x1 + ny * y1 + nz * z1) > 0)
123 Face_normales(num_Face, 0) += -nx;
124 Face_normales(num_Face, 1) += -ny;
125 Face_normales(num_Face, 2) += -nz;
129 Face_normales(num_Face, 0) += nx;
130 Face_normales(num_Face, 1) += ny;
131 Face_normales(num_Face, 2) += nz;
136 x1 = les_coords(n0, 0) - les_coords(n2, 0);
137 y1 = les_coords(n0, 1) - les_coords(n2, 1);
138 z1 = les_coords(n0, 2) - les_coords(n2, 2);
140 x2 = les_coords(n3, 0) - les_coords(n2, 0);
141 y2 = les_coords(n3, 1) - les_coords(n2, 1);
142 z2 = les_coords(n3, 2) - les_coords(n2, 2);
144 nx = (y1 * z2 - y2 * z1) / 2;
145 ny = (-x1 * z2 + x2 * z1) / 2;
146 nz = (x1 * y2 - x2 * y1) / 2;
151 elem1 = Face_voisins(num_Face, 0);
153 if ((f0 = elem_faces(elem1, 0)) == num_Face)
154 f0 = elem_faces(elem1, 1);
156 if ((no4 = Face_sommets(f0, 0)) != n0 && no4 != n1
157 && no4 != n2 && no4 != n3) { }
158 else if ((no4 = Face_sommets(f0, 1)) != n0 && no4 != n1
159 && no4 != n2 && no4 != n3) { }
160 else if ((no4 = Face_sommets(f0, 2)) != n0 && no4 != n1
161 && no4 != n2 && no4 != n3) { }
163 no4 = Face_sommets(f0, 3);
165 x1 = les_coords(no4, 0) - les_coords(n0, 0);
166 y1 = les_coords(no4, 1) - les_coords(n0, 1);
167 z1 = les_coords(no4, 2) - les_coords(n0, 2);
169 if ((nx * x1 + ny * y1 + nz * z1) > 0)
171 Face_normales(num_Face, 0) += -nx;
172 Face_normales(num_Face, 1) += -ny;
173 Face_normales(num_Face, 2) += -nz;
177 Face_normales(num_Face, 0) += nx;
178 Face_normales(num_Face, 1) += ny;
179 Face_normales(num_Face, 2) += nz;
189 const IntVect& rang_elem_non_std)
const
191 const Domaine& domaine_geom = dom_VEF.
domaine();
192 auto& facette_normales =
const_cast<Domaine_VEF&
>(dom_VEF).facette_normales();
194 const IntTab& les_Polys = domaine_geom.
les_elems();
209 if (facette_normales.dimension(0) != nb_elem_tot)
210 facette_normales.resize(nb_elem_tot,
nb_facette(),3);
212 for(i=0; i<nb_elem_tot; i++)
214 if (rang_elem_non_std(i)==-1)
216 num_som[0]=les_Polys(i,0);
217 num_som[1]=les_Polys(i,1);
218 num_som[2]=les_Polys(i,2);
219 num_som[3]=les_Polys(i,3);
220 num_som[4]=les_Polys(i,4);
221 num_som[5]=les_Polys(i,5);
222 num_som[6]=les_Polys(i,6);
223 num_som[7]=les_Polys(i,7);
225 x[0][0]=les_coords(num_som[0],0);
226 x[0][1]=les_coords(num_som[0],1);
227 x[0][2]=les_coords(num_som[0],2);
228 x[1][0]=les_coords(num_som[1],0);
229 x[1][1]=les_coords(num_som[1],1);
230 x[1][2]=les_coords(num_som[1],2);
231 x[2][0]=les_coords(num_som[2],0);
232 x[2][1]=les_coords(num_som[2],1);
233 x[2][2]=les_coords(num_som[2],2);
234 x[3][0]=les_coords(num_som[3],0);
235 x[3][1]=les_coords(num_som[3],1);
236 x[3][2]=les_coords(num_som[3],2);
237 x[4][0]=les_coords(num_som[4],0);
238 x[4][1]=les_coords(num_som[4],1);
239 x[4][2]=les_coords(num_som[4],2);
240 x[5][0]=les_coords(num_som[5],0);
241 x[5][1]=les_coords(num_som[5],1);
242 x[5][2]=les_coords(num_som[5],2);
243 x[6][0]=les_coords(num_som[6],0);
244 x[6][1]=les_coords(num_som[6],1);
245 x[6][2]=les_coords(num_som[6],2);
246 x[7][0]=les_coords(num_som[7],0);
247 x[7][1]=les_coords(num_som[7],1);
248 x[7][2]=les_coords(num_som[7],2);
250 xg[0]=(x[0][0]+x[1][0]+x[2][0]+x[3][0]+x[4][0]+x[5][0]+x[6][0]+x[7][0])*0.125;
251 xg[1]=(x[0][1]+x[1][1]+x[2][1]+x[3][1]+x[4][1]+x[5][1]+x[6][1]+x[7][1])*0.125;
252 xg[2]=(x[0][2]+x[1][2]+x[2][2]+x[3][2]+x[4][2]+x[5][2]+x[6][2]+x[7][2])*0.125;
259 u[0]=x[
KEL_(2,fa7)][0]-xg[0];
260 u[1]=x[
KEL_(2,fa7)][1]-xg[1];
261 u[2]=x[
KEL_(2,fa7)][2]-xg[2];
262 v[0]=x[
KEL_(3,fa7)][0]-xg[0];
263 v[1]=x[
KEL_(3,fa7)][1]-xg[1];
264 v[2]=x[
KEL_(3,fa7)][2]-xg[2];
271 int num1 =
KEL_(0,fa7);
272 int num2 =
KEL_(1,fa7);
278 num_som[0]=les_Polys(i,0);
279 num_som[1]=les_Polys(i,2);
280 num_som[2]=les_Polys(i,4);
281 num_som[3]=les_Polys(i,6);
286 num_som[0]=les_Polys(i,0);
287 num_som[1]=les_Polys(i,1);
288 num_som[2]=les_Polys(i,4);
289 num_som[3]=les_Polys(i,5);
294 num_som[0]=les_Polys(i,0);
295 num_som[1]=les_Polys(i,1);
296 num_som[2]=les_Polys(i,2);
297 num_som[3]=les_Polys(i,3);
302 num_som[0]=les_Polys(i,1);
303 num_som[1]=les_Polys(i,3);
304 num_som[2]=les_Polys(i,5);
305 num_som[3]=les_Polys(i,7);
310 num_som[0]=les_Polys(i,2);
311 num_som[1]=les_Polys(i,3);
312 num_som[2]=les_Polys(i,6);
313 num_som[3]=les_Polys(i,7);
318 num_som[0]=les_Polys(i,4);
319 num_som[1]=les_Polys(i,5);
320 num_som[2]=les_Polys(i,6);
321 num_som[3]=les_Polys(i,7);
326 x_[0][0]=les_coords(num_som[0],0);
327 x_[0][1]=les_coords(num_som[0],1);
328 x_[0][2]=les_coords(num_som[0],2);
329 x_[1][0]=les_coords(num_som[1],0);
330 x_[1][1]=les_coords(num_som[1],1);
331 x_[1][2]=les_coords(num_som[1],2);
332 x_[2][0]=les_coords(num_som[2],0);
333 x_[2][1]=les_coords(num_som[2],1);
334 x_[2][2]=les_coords(num_som[2],2);
335 x_[3][0]=les_coords(num_som[3],0);
336 x_[3][1]=les_coords(num_som[3],1);
337 x_[3][2]=les_coords(num_som[3],2);
339 xjnum1[0]=(x_[0][0]+x_[1][0]+x_[2][0]+x_[3][0])*0.25;
340 xjnum1[1]=(x_[0][1]+x_[1][1]+x_[2][1]+x_[3][1])*0.25;
341 xjnum1[2]=(x_[0][2]+x_[1][2]+x_[2][2]+x_[3][2])*0.25;
347 num_som[0]=les_Polys(i,0);
348 num_som[1]=les_Polys(i,2);
349 num_som[2]=les_Polys(i,4);
350 num_som[3]=les_Polys(i,6);
355 num_som[0]=les_Polys(i,0);
356 num_som[1]=les_Polys(i,1);
357 num_som[2]=les_Polys(i,4);
358 num_som[3]=les_Polys(i,5);
363 num_som[0]=les_Polys(i,0);
364 num_som[1]=les_Polys(i,1);
365 num_som[2]=les_Polys(i,2);
366 num_som[3]=les_Polys(i,3);
371 num_som[0]=les_Polys(i,1);
372 num_som[1]=les_Polys(i,3);
373 num_som[2]=les_Polys(i,5);
374 num_som[3]=les_Polys(i,7);
379 num_som[0]=les_Polys(i,2);
380 num_som[1]=les_Polys(i,3);
381 num_som[2]=les_Polys(i,6);
382 num_som[3]=les_Polys(i,7);
387 num_som[0]=les_Polys(i,4);
388 num_som[1]=les_Polys(i,5);
389 num_som[2]=les_Polys(i,6);
390 num_som[3]=les_Polys(i,7);
395 x_[0][0]=les_coords(num_som[0],0);
396 x_[0][1]=les_coords(num_som[0],1);
397 x_[0][2]=les_coords(num_som[0],2);
398 x_[1][0]=les_coords(num_som[1],0);
399 x_[1][1]=les_coords(num_som[1],1);
400 x_[1][2]=les_coords(num_som[1],2);
401 x_[2][0]=les_coords(num_som[2],0);
402 x_[2][1]=les_coords(num_som[2],1);
403 x_[2][2]=les_coords(num_som[2],2);
404 x_[3][0]=les_coords(num_som[3],0);
405 x_[3][1]=les_coords(num_som[3],1);
406 x_[3][2]=les_coords(num_som[3],2);
408 xjnum2[0]=(x_[0][0]+x_[1][0]+x_[2][0]+x_[3][0])*0.25;
409 xjnum2[1]=(x_[0][1]+x_[1][1]+x_[2][1]+x_[3][1])*0.25;
410 xjnum2[2]=(x_[0][2]+x_[1][2]+x_[2][2]+x_[3][2])*0.25;
412 xj0[0]= xjnum1[0]-xjnum2[0];
413 xj0[1]= xjnum1[1]-xjnum2[1];
414 xj0[2]= xjnum1[2]-xjnum2[2];
416 psc=xj0[0]*pv[0] + xj0[1]*pv[1] + xj0[2]*pv[2] ;
420 facette_normales(i,fa7,0) = pv[0]/2;
421 facette_normales(i,fa7,1) = pv[1]/2;
422 facette_normales(i,fa7,2) = pv[2]/2;
426 facette_normales(i,fa7,0)= -pv[0]/2;
427 facette_normales(i,fa7,1)= -pv[1]/2;
428 facette_normales(i,fa7,2)= -pv[2]/2;
437 int num_elem,
const DoubleTab& x,
438 const DoubleVect& xg,
const
439 Domaine& domaine_geom)
const
453 const IntTab& les_Polys = domaine_geom.
les_elems();
455 int i2 =
KEL_(2,fa7);
456 int i3 =
KEL_(3,fa7);
472 int num1 =
KEL_(0,fa7);
473 int num2 =
KEL_(1,fa7);
479 num_som[0]=les_Polys(num_elem,0);
480 num_som[1]=les_Polys(num_elem,2);
481 num_som[2]=les_Polys(num_elem,4);
482 num_som[3]=les_Polys(num_elem,6);
487 num_som[0]=les_Polys(num_elem,0);
488 num_som[1]=les_Polys(num_elem,1);
489 num_som[2]=les_Polys(num_elem,4);
490 num_som[3]=les_Polys(num_elem,5);
495 num_som[0]=les_Polys(num_elem,0);
496 num_som[1]=les_Polys(num_elem,1);
497 num_som[2]=les_Polys(num_elem,2);
498 num_som[3]=les_Polys(num_elem,3);
503 num_som[0]=les_Polys(num_elem,1);
504 num_som[1]=les_Polys(num_elem,3);
505 num_som[2]=les_Polys(num_elem,5);
506 num_som[3]=les_Polys(num_elem,7);
511 num_som[0]=les_Polys(num_elem,2);
512 num_som[1]=les_Polys(num_elem,3);
513 num_som[2]=les_Polys(num_elem,6);
514 num_som[3]=les_Polys(num_elem,7);
519 num_som[0]=les_Polys(num_elem,4);
520 num_som[1]=les_Polys(num_elem,5);
521 num_som[2]=les_Polys(num_elem,6);
522 num_som[3]=les_Polys(num_elem,7);
536 x_[0][0]=les_coords(num_som[0],0);
537 x_[0][1]=les_coords(num_som[0],1);
538 x_[0][2]=les_coords(num_som[0],2);
539 x_[1][0]=les_coords(num_som[1],0);
540 x_[1][1]=les_coords(num_som[1],1);
541 x_[1][2]=les_coords(num_som[1],2);
542 x_[2][0]=les_coords(num_som[2],0);
543 x_[2][1]=les_coords(num_som[2],1);
544 x_[2][2]=les_coords(num_som[2],2);
545 x_[3][0]=les_coords(num_som[3],0);
546 x_[3][1]=les_coords(num_som[3],1);
547 x_[3][2]=les_coords(num_som[3],2);
549 xjnum1[0]=(x_[0][0]+x_[1][0]+x_[2][0]+x_[3][0])*0.25;
550 xjnum1[1]=(x_[0][1]+x_[1][1]+x_[2][1]+x_[3][1])*0.25;
551 xjnum1[2]=(x_[0][2]+x_[1][2]+x_[2][2]+x_[3][2])*0.25;
558 num_som[0]=les_Polys(num_elem,0);
559 num_som[1]=les_Polys(num_elem,2);
560 num_som[2]=les_Polys(num_elem,4);
561 num_som[3]=les_Polys(num_elem,6);
566 num_som[0]=les_Polys(num_elem,0);
567 num_som[1]=les_Polys(num_elem,1);
568 num_som[2]=les_Polys(num_elem,4);
569 num_som[3]=les_Polys(num_elem,5);
574 num_som[0]=les_Polys(num_elem,0);
575 num_som[1]=les_Polys(num_elem,1);
576 num_som[2]=les_Polys(num_elem,2);
577 num_som[3]=les_Polys(num_elem,3);
582 num_som[0]=les_Polys(num_elem,1);
583 num_som[1]=les_Polys(num_elem,3);
584 num_som[2]=les_Polys(num_elem,5);
585 num_som[3]=les_Polys(num_elem,7);
590 num_som[0]=les_Polys(num_elem,2);
591 num_som[1]=les_Polys(num_elem,3);
592 num_som[2]=les_Polys(num_elem,6);
593 num_som[3]=les_Polys(num_elem,7);
598 num_som[0]=les_Polys(num_elem,4);
599 num_som[1]=les_Polys(num_elem,5);
600 num_som[2]=les_Polys(num_elem,6);
601 num_som[3]=les_Polys(num_elem,7);
607 x_[0][0]=les_coords(num_som[0],0);
608 x_[0][1]=les_coords(num_som[0],1);
609 x_[0][2]=les_coords(num_som[0],2);
610 x_[1][0]=les_coords(num_som[1],0);
611 x_[1][1]=les_coords(num_som[1],1);
612 x_[1][2]=les_coords(num_som[1],2);
613 x_[2][0]=les_coords(num_som[2],0);
614 x_[2][1]=les_coords(num_som[2],1);
615 x_[2][2]=les_coords(num_som[2],2);
616 x_[3][0]=les_coords(num_som[3],0);
617 x_[3][1]=les_coords(num_som[3],1);
618 x_[3][2]=les_coords(num_som[3],2);
620 xjnum2[0]=(x_[0][0]+x_[1][0]+x_[2][0]+x_[3][0])*0.25;
621 xjnum2[1]=(x_[0][1]+x_[1][1]+x_[2][1]+x_[3][1])*0.25;
622 xjnum2[2]=(x_[0][2]+x_[1][2]+x_[2][2]+x_[3][2])*0.25;
624 xj0[0]= xjnum1[0]-xjnum2[0];
625 xj0[1]= xjnum1[1]-xjnum2[1];
626 xj0[2]= xjnum1[2]-xjnum2[2];
628 psc=xj0[0]*pv[0] + xj0[1]*pv[1] + xj0[2]*pv[2] ;
632 normales_facettes_Cl(num_elem,fa7,0) = -pv[0]/2;
633 normales_facettes_Cl(num_elem,fa7,1) = -pv[1]/2;
634 normales_facettes_Cl(num_elem,fa7,2) = -pv[2]/2;
638 normales_facettes_Cl(num_elem,fa7,0) = pv[0]/2;
639 normales_facettes_Cl(num_elem,fa7,1) = pv[1]/2;
640 normales_facettes_Cl(num_elem,fa7,2) = pv[2]/2;