TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Extruder.cpp
1/****************************************************************************
2* Copyright (c) 2026, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15
16#include <Frontiere.h>
17#include <Connectivite_som_elem.h>
18#include <Static_Int_Lists.h>
19#include <Faces_builder.h>
20#include <Extruder.h>
21#include <Domaine.h>
22#include <Scatter.h>
23#include <Param.h>
24
25Implemente_instanciable_sans_constructeur_32_64(Extruder_32_64, "Extruder", Interprete_geometrique_base_32_64<_T_>);
26// XD extruder interprete extruder BRACE Class to create a 3D tetrahedral/hexahedral mesh (a prism is cut in 14) from a
27// XD_CONT 2D triangular/quadrangular mesh.
28
29template <typename _SIZE_>
30Extruder_32_64<_SIZE_>::Extruder_32_64() { direction.resize(3, RESIZE_OPTIONS::NOCOPY_NOINIT); }
31
32template <typename _SIZE_>
34
35template <typename _SIZE_>
37
38/*! @brief Main function of the Extruder interpreter. Extrudes the domain
39 *
40 * specified by the directive, element by element.
41 * The domain is extruded using the method:
42 * void Extruder_32_64<_SIZE_>::extruder(Domaine_t& domaine) const
43 * Extruding here means transforming geometric elements of a domain
44 * into 3D elements by translation.
45 *
46 * @param (Entree& is) an input stream
47 * @return (Entree&) the input stream
48 * @throws the object to mesh is not of type Domaine
49 */
50template <typename _SIZE_>
52{
53 Nom nom_dom;
54 Param param(this->que_suis_je());
55 param.ajouter("domaine",&nom_dom,Param::REQUIRED); // XD attr domaine ref_domaine domain_name REQ Name of the domain.
56 param.ajouter("nb_tranches",&NZ,Param::REQUIRED); // XD attr nb_tranches entier nb_tranches REQ Number of elements
57 // XD_CONT in the extrusion direction.
58 param.ajouter_arr_size_predefinie("direction",&direction,Param::REQUIRED); // XD attr direction troisf direction REQ
59 // XD_CONT Direction of the extrude operation.
61 this->associer_domaine(nom_dom);
63 extruder(this->domaine());
65 return is;
66}
67
68inline void check_boundary_name(const Nom& name)
69{
70// Check that the boundary is not already named "devant" or "derriere"
71 if (name=="devant" || name=="derriere")
72 {
73 Cerr << "Problem : you must change the name of the boundary : " <<name<<finl;
74 Cerr << "because the extrusion keyword is going to create new boundaries named derriere and devant" << finl;
75 Cerr << "which will create a conflict." << finl;
77 }
78}
79/*! @brief Extrudes all elements of a domain: transforms the geometric elements of the domain into 3D elements.
80 *
81 * Currently only Rectangles/Quadrangles and Triangles can be extruded.
82 *
83 * @param dom The domain whose elements are to be extruded.
84 */
85template <typename _SIZE_>
87{
88
89
90 if(dom.type_elem()->que_suis_je() == "Rectangle" || dom.type_elem()->que_suis_je() == "Quadrangle"
91 || dom.type_elem()->que_suis_je() == "Rectangle_64" || dom.type_elem()->que_suis_je() == "Quadrangle_64" )
92 {
93 extruder_hexa(dom);
94 }
95 else if( dom.type_elem()->que_suis_je() == "Triangle" || dom.type_elem()->que_suis_je() == "Triangle_64")
96 {
97 int_t oldnbsom = dom.nb_som();
98 IntTab_t& les_elems=dom.les_elems();
99 int_t oldsz=les_elems.dimension(0);
100 double dx = direction[0]/NZ;
101 double dy = direction[1]/NZ;
102 double dz = direction[2]/NZ;
103
104 Faces_t les_faces;
105 //domaine.creer_faces(les_faces);
106 {
107 // block to be factored out with Domaine_VF.cpp:
108 Type_Face type_face = dom.type_elem()->type_face(0);
109 les_faces.typer(type_face);
110 les_faces.associer_domaine(dom);
111
112 Static_Int_Lists_t connectivite_som_elem;
113 const int_t nb_sommets_tot = dom.nb_som_tot();
114 const IntTab_t& elements = dom.les_elems();
115
116 construire_connectivite_som_elem(nb_sommets_tot,
117 elements,
118 connectivite_som_elem,
119 1 /* include virtual elements */);
120
121 Faces_builder_t faces_builder;
122 IntTab_t elem_faces; // Array that will not be needed
123 faces_builder.creer_faces_reeles(dom,
124 connectivite_som_elem,
125 les_faces,
126 elem_faces);
127 }
128 const int_t nbfaces2D = les_faces.nb_faces();
129
130
131 int_t newnbsom = (oldnbsom*(NZ+1)+NZ*oldsz+nbfaces2D*NZ);
132 DoubleTab_t new_soms(newnbsom, 3);
133 DoubleTab_t& coord_sommets=dom.les_sommets();
135
136
137 // vertices of the 2D mesh are translated first
138 for (int i=0; i<oldnbsom; i++)
139 {
140 double x = coord_sommets(i,0);
141 double y = coord_sommets(i,1);
142 double z=0.;
143 if (coord_sommets.dimension(1)>2)
144 z=coord_sommets(i,2);
145
146 for (int k=0; k<=NZ; k++)
147 {
148 new_soms(k*oldnbsom+i,0)=x;
149 new_soms(k*oldnbsom+i,1)=y;
150 new_soms(k*oldnbsom+i,2)=z;
151
152 x += dx;
153 y += dy;
154 z += dz;
155 }
156 }
157
158
159 // then create the centroids of the 2D elements and translate these points
160 for (int_t i=0; i<oldsz; i++)
161 {
162 int_t i0=les_elems(i,0);
163 int_t i1=les_elems(i,1);
164 int_t i2=les_elems(i,2);
165
166 double xg = 1./3.*(coord_sommets(i0,0)+coord_sommets(i1,0)+coord_sommets(i2,0))+0.5*dx;
167 double yg = 1./3.*(coord_sommets(i0,1)+coord_sommets(i1,1)+coord_sommets(i2,1))+0.5*dy;
168 double z = 0.5*dz;
169 if (coord_sommets.dimension(1)>2)
170 z = 1./3.*(coord_sommets(i0,2)+coord_sommets(i1,2)+coord_sommets(i2,2))+0.5*dz;
171 for (int k=0; k<NZ; k++)
172 {
173
174 new_soms((oldnbsom*(NZ+1)+k*oldsz+i),0)=xg;
175 new_soms((oldnbsom*(NZ+1)+k*oldsz+i),1)=yg;
176 new_soms((oldnbsom*(NZ+1)+k*oldsz+i),2)=z;
177
178 xg += dx;
179 yg += dy;
180 z += dz;
181 }
182 }
183
184
185 // finally, create the face centers of the 2D mesh and translate these points
186 for (int i=0; i<nbfaces2D; i++)
187 {
188 int_t i0=les_faces.sommet(i,0);
189 int_t i1=les_faces.sommet(i,1);
190
191 double x01 = 0.5*(coord_sommets(i0,0)+coord_sommets(i1,0))+0.5*dx;
192 double y01 = 0.5*(coord_sommets(i0,1)+coord_sommets(i1,1))+0.5*dy;
193 double z = 0.5*dz;
194 if (coord_sommets.dimension(1)>2)
195 z = 0.5*(coord_sommets(i0,2)+coord_sommets(i1,2))+0.5*dz;
196
197 for (int k=0; k<NZ; k++)
198 {
199 new_soms((oldnbsom*(NZ+1)+NZ*oldsz+k*nbfaces2D+i),0)=x01;
200 new_soms((oldnbsom*(NZ+1)+NZ*oldsz+k*nbfaces2D+i),1)=y01;
201 new_soms((oldnbsom*(NZ+1)+NZ*oldsz+k*nbfaces2D+i),2)=z;
202 x01 += dx;
203 y01 += dy;
204 z += dz;
205 }
206 }
207
208
209 coord_sommets.resize(0);
210 dom.ajouter(new_soms);
211
212 int_t newnbelem = 14*NZ*oldsz;
213 IntTab_t new_elems(newnbelem, 4); // the new elements
214 int_t cpt=0;
215
216
217 // first, store the top and bottom tetrahedra: NZ*nb_triangle*2 tetrahedra
218 for (int_t i=0; i<oldsz; i++)
219 {
220 int_t i0=les_elems(i,0);
221 int_t i1=les_elems(i,1);
222 int_t i2=les_elems(i,2);
223
224 int_t ig=oldnbsom*(NZ+1)+i;
225
226 for (int k=0; k<NZ; k++)
227 {
228 new_elems(2*k*oldsz+2*i,0) = i0;
229 new_elems(2*k*oldsz+2*i,1) = i1;
230 new_elems(2*k*oldsz+2*i,2) = i2;
231 new_elems(2*k*oldsz+2*i,3) = ig;
232 cpt++;
233
234 new_elems(2*k*oldsz+2*i+1,0) = i0+oldnbsom;
235 new_elems(2*k*oldsz+2*i+1,1) = i1+oldnbsom;
236 new_elems(2*k*oldsz+2*i+1,2) = i2+oldnbsom;
237 new_elems(2*k*oldsz+2*i+1,3) = ig;
238 cpt++;
239
240 this->mettre_a_jour_sous_domaine(dom,i,(2*k*oldsz+2*i),2);
241
242 i0+=oldnbsom;
243 i1+=oldnbsom;
244 i2+=oldnbsom;
245 ig+=oldsz;
246 }
247 }
248
249
250
251 // then the remaining tetrahedra
252 for (int_t i=0; i<nbfaces2D; i++)
253 {
254 for (int ivois=0; ivois<2; ivois++)
255 {
256 int_t elem = les_faces.voisin(i,ivois);
257
258 if (elem>=0)
259 {
260 int_t i0=les_faces.sommet(i,0);
261 int_t i1=les_faces.sommet(i,1);
262 int_t i01=oldnbsom*(NZ+1)+NZ*oldsz+i;
263
264 for (int_t k=0; k<NZ; k++)
265 {
266 int_t ig=oldnbsom*(NZ+1)+k*oldsz+elem;
267
268 new_elems(cpt,0) = i0;
269 new_elems(cpt,1) = i1;
270 new_elems(cpt,2) = i01;
271 new_elems(cpt++,3) = ig;
272
273 new_elems(cpt,0) = i0+oldnbsom;
274 new_elems(cpt,1) = i1+oldnbsom;
275 new_elems(cpt,2) = i01;
276 new_elems(cpt++,3) = ig;
277
278 new_elems(cpt,0) = i1;
279 new_elems(cpt,1) = i1+oldnbsom;
280 new_elems(cpt,2) = i01;
281 new_elems(cpt++,3) = ig;
282
283 new_elems(cpt,0) = i0;
284 new_elems(cpt,1) = i0+oldnbsom;
285 new_elems(cpt,2) = i01;
286 new_elems(cpt++,3) = ig;
287
288
289 i0+=oldnbsom;
290 i1+=oldnbsom;
291 i01+=nbfaces2D;
292 ig+=oldsz;
293 }
294 }
295 }
296 }
297
298 les_elems.ref(new_elems);
299
300 // Rebuild the octree
301 dom.invalide_octree();
302 dom.typer("Tetraedre");
303
304 extruder_dvt(dom, les_faces,oldnbsom, oldsz);
305
306 }
307 else
308 {
309 Cerr << "It is not known yet how to extrude "
310 << dom.type_elem()->que_suis_je() <<"s"<<finl;
311 this->exit();
312 }
313}
314
315
316template <typename _SIZE_>
317void Extruder_32_64<_SIZE_>::traiter_faces_dvt(Faces_t& les_faces_bord, Faces_t& les_faces, int_t oldnbsom, int_t oldsz, int_t nbfaces2D )
318{
319 int_t size_2D = les_faces_bord.nb_faces();
320
321 IntTab_t les_sommets(4*size_2D*NZ, 3);
322
323 for (int_t i=0; i<size_2D; i++)
324 {
325 int_t i0=les_faces_bord.sommet(i,0);
326 int_t i1=les_faces_bord.sommet(i,1);
327
328 //double x01 = 0.5*(coord_sommets(i0,0)+coord_sommets(i1,0));
329 //double y01 = 0.5*(coord_sommets(i0,1)+coord_sommets(i1,1));
330
331 // find the index of this boundary face: not optimal!
332 int_t jface=-1;
333 for (int_t iface=0; iface<nbfaces2D; iface++)
334 {
335 int_t j0=les_faces.sommet(iface,0);
336 int_t j1=les_faces.sommet(iface,1);
337
338 if (((i0==j0) &&(i1==j1)) || ((i0==j1) &&(i1==j0)))
339 {
340 jface=iface;
341 break;
342 }
343 }
344 assert(jface>=0);
345
346 for (int_t k=0; k<NZ; k++)
347 {
348 //double z = (k+0.5)*dz;
349 //int i01 = domaine.chercher_sommets(x01, y01, z);
350 int_t j01 = oldnbsom*(NZ+1)+NZ*oldsz+k*nbfaces2D+jface;
351
352 les_sommets(k*4*size_2D+4*i,0) = i0;
353 les_sommets(k*4*size_2D+4*i,1) = i1;
354 les_sommets(k*4*size_2D+4*i,2) = j01;
355
356 les_sommets(k*4*size_2D+4*i+1,0) = j01;
357 les_sommets(k*4*size_2D+4*i+1,1) = i1;
358 les_sommets(k*4*size_2D+4*i+1,2) = i1+oldnbsom;
359
360
361 les_sommets(k*4*size_2D+4*i+2,0) = j01;
362 les_sommets(k*4*size_2D+4*i+2,1) = i0+oldnbsom;
363 les_sommets(k*4*size_2D+4*i+2,2) = i1+oldnbsom;
364
365
366 les_sommets(k*4*size_2D+4*i+3,0) = j01;
367 les_sommets(k*4*size_2D+4*i+3,1) = i0+oldnbsom;
368 les_sommets(k*4*size_2D+4*i+3,2) = i0;
369
370 i0+=oldnbsom;
371 i1+=oldnbsom;
372 }
373 }
374
375 les_faces_bord.typer(Type_Face::triangle_3D);
376 les_faces_bord.les_sommets().ref(les_sommets);
377 les_faces_bord.voisins().resize(4*size_2D*NZ, 2);
378 les_faces_bord.voisins()=-1;
379}
380
381
382template <typename _SIZE_>
383void Extruder_32_64<_SIZE_>::extruder_dvt(Domaine_t& dom, Faces_t& les_faces, int_t oldnbsom, int_t oldsz)
384{
385
386 const int_t nbfaces2D = les_faces.nb_faces();
387 IntTab_t& les_elems=dom.les_elems();
388
389 for (auto &itr : dom.faces_bord())
390 {
391 check_boundary_name(itr.le_nom());
392 Faces_t& les_faces_bord = itr.faces();
393 traiter_faces_dvt(les_faces_bord, les_faces, oldnbsom, oldsz, nbfaces2D);
394 }
395
396 for (auto &itr : dom.faces_raccord())
397 {
398 check_boundary_name(itr->le_nom());
399 Faces_t& les_faces_bord = itr->faces();
400 traiter_faces_dvt(les_faces_bord, les_faces, oldnbsom, oldsz, nbfaces2D);
401 }
402
403 Bord_t& devant = dom.faces_bord().add(Bord_t());
404 devant.nommer("devant");
405 Faces_t& les_faces_dvt=devant.faces();
406 les_faces_dvt.typer(Type_Face::triangle_3D);
407
408 IntTab_t som_dvt(oldsz, 3);
409 les_faces_dvt.voisins().resize(oldsz, 2);
410 les_faces_dvt.voisins()=-1;
411
412 Bord_t& derriere = dom.faces_bord().add(Bord_t());
413 derriere.nommer("derriere");
414 Faces_t& les_faces_der=derriere.faces();
415 les_faces_der.typer(Type_Face::triangle_3D);
416
417 IntTab_t som_der(oldsz, 3);
418 les_faces_der.voisins().resize(oldsz, 2);
419 les_faces_der.voisins()=-1;
420
421 for (int_t i=0; i<oldsz; i++)
422 {
423 int_t i0=les_elems(2*i,0);
424 int_t i1=les_elems(2*i,1);
425 int_t i2=les_elems(2*i,2);
426
427 som_dvt(i,0) = i0;
428 som_dvt(i,1) = i1;
429 som_dvt(i,2) = i2;
430
431 som_der(i,0) = i0+oldnbsom*NZ;
432 som_der(i,1) = i1+oldnbsom*NZ;
433 som_der(i,2) = i2+oldnbsom*NZ;
434
435 }
436
437
438 les_faces_dvt.les_sommets().ref(som_dvt);
439 les_faces_der.les_sommets().ref(som_der);
440
441}
442template <typename _SIZE_>
444{
445
446 int_t oldnbsom = dom.nb_som();
447 IntTab_t& les_elems=dom.les_elems();
448 int_t oldsz=les_elems.dimension(0);
449 double dx = direction[0]/NZ;
450 double dy = direction[1]/NZ;
451 double dz = direction[2]/NZ;
452
453 Faces_t les_faces;
454 {
455 // block to be factored out with Domaine_VF.cpp :
456 Type_Face type_face = dom.type_elem()->type_face(0);
457 les_faces.typer(type_face);
458 les_faces.associer_domaine(dom);
459
460 Static_Int_Lists_t connectivite_som_elem;
461 const int_t nb_sommets_tot = dom.nb_som_tot();
462 const IntTab_t& elements = dom.les_elems();
463
464 construire_connectivite_som_elem(nb_sommets_tot,
465 elements,
466 connectivite_som_elem,
467 1 /* include virtual elements */);
468
469 Faces_builder_t faces_builder;
470 IntTab_t elem_faces; // Array that will not be needed
471 faces_builder.creer_faces_reeles(dom,
472 connectivite_som_elem,
473 les_faces,
474 elem_faces);
475 }
476
477 int_t newnbsom = oldnbsom*(NZ+1);
478 DoubleTab_t new_soms(newnbsom, 3);
479 DoubleTab_t& coord_sommets=dom.les_sommets();
481
482 int_t i;
483 // vertices of the 2D mesh are translated
484 for (i=0; i<oldnbsom; i++)
485 {
486 double x = coord_sommets(i,0);
487 double y = coord_sommets(i,1);
488 double z=0.;
489 if (coord_sommets.dimension(1)>2)
490 z=coord_sommets(i,2);
491 for (int k=0; k<=NZ; k++)
492 {
493 new_soms(k*oldnbsom+i,0)=x;
494 new_soms(k*oldnbsom+i,1)=y;
495 new_soms(k*oldnbsom+i,2)=z;
496
497 x += dx;
498 y += dy;
499 z += dz;
500 }
501 }
502
503
504 coord_sommets.resize(0);
505 dom.ajouter(new_soms);
506
507 int_t newnbelem = NZ*oldsz;
508 IntTab_t new_elems(newnbelem, 8); // the new elements
509
510
511 // define the new hexahedra
512 for (i=0; i<oldsz; i++)
513 {
514 int_t i0=les_elems(i,0);
515 int_t i1=les_elems(i,1);
516 int_t i2=les_elems(i,2);
517 int_t i3=les_elems(i,3);
518
519
520 for (int_t k=0; k<NZ; k++)
521 {
522 new_elems(k*oldsz+i,0) = i0;
523 new_elems(k*oldsz+i,1) = i1;
524 new_elems(k*oldsz+i,2) = i2;
525 new_elems(k*oldsz+i,3) = i3;
526 new_elems(k*oldsz+i,4) = i0+oldnbsom;
527 new_elems(k*oldsz+i,5) = i1+oldnbsom;
528 new_elems(k*oldsz+i,6) = i2+oldnbsom;
529 new_elems(k*oldsz+i,7) = i3+oldnbsom;
530
531
532 i0+=oldnbsom;
533 i1+=oldnbsom;
534 i2+=oldnbsom;
535 i3+=oldnbsom;
536 }
537 }
538
539 les_elems.ref(new_elems);
540
541 // Rebuild the octree
542 dom.invalide_octree();
543 if ((dom.type_elem()->que_suis_je()) == "Quadrangle")
544 dom.typer("Hexaedre_VEF");
545 else
546 dom.typer("Hexaedre");
547
548 extruder_dvt_hexa(dom, les_faces,oldnbsom, oldsz);
549}
550template <typename _SIZE_>
551void Extruder_32_64<_SIZE_>::traiter_faces_dvt_hexa(Faces_t& les_faces_bord, int_t oldnbsom)
552{
553 int_t size_2D = les_faces_bord.nb_faces();
554
555 IntTab_t les_sommets(size_2D*NZ, 4);
556
557 for (int_t i=0; i<size_2D; i++)
558 {
559 int_t i0=les_faces_bord.sommet(i,0);
560 int_t i1=les_faces_bord.sommet(i,1);
561
562
563 for (int_t k=0; k<NZ; k++)
564 {
565 les_sommets(k*size_2D+i,0) = i0;
566 les_sommets(k*size_2D+i,1) = i1;
567 les_sommets(k*size_2D+i,2) = i0+oldnbsom;
568 les_sommets(k*size_2D+i,3) = i1+oldnbsom;
569
570 i0+=oldnbsom;
571 i1+=oldnbsom;
572 }
573 }
574
575 les_faces_bord.typer(Type_Face::quadrangle_3D);
576 les_faces_bord.les_sommets().ref(les_sommets);
577 les_faces_bord.voisins().resize(size_2D*NZ, 2);
578 les_faces_bord.voisins()=-1;
579}
580template <typename _SIZE_>
582{
583
584 IntTab_t& les_elems=dom.les_elems();
585
586 for (auto &itr : dom.faces_bord())
587 {
588 check_boundary_name(itr.le_nom());
589 Faces_t& les_faces_bord = itr.faces();
590 traiter_faces_dvt_hexa(les_faces_bord, oldnbsom);
591 }
592
593 for (auto &itr : dom.faces_raccord())
594 {
595 check_boundary_name(itr->le_nom());
596 Frontiere_32_64<_SIZE_>& f = dynamic_cast<Frontiere_32_64<_SIZE_>&>(itr);
597 Faces_t& les_faces_bord = f.faces();
598 traiter_faces_dvt_hexa(les_faces_bord, oldnbsom);
599 }
600
601 Bord_t& devant = dom.faces_bord().add(Bord_t());
602 devant.nommer("devant");
603 Faces_t& les_faces_dvt=devant.faces();
604 les_faces_dvt.typer(Type_Face::quadrangle_3D);
605
606 IntTab_t som_dvt(oldsz, 4);
607 les_faces_dvt.voisins().resize(oldsz, 2);
608 les_faces_dvt.voisins()=-1;
609
610 Bord_t& derriere = dom.faces_bord().add(Bord_t());
611 derriere.nommer("derriere");
612 Faces_t& les_faces_der=derriere.faces();
613 les_faces_der.typer(Type_Face::quadrangle_3D);
614
615 IntTab_t som_der(oldsz, 4);
616 les_faces_der.voisins().resize(oldsz, 2);
617 les_faces_der.voisins()=-1;
618
619 for (int_t i=0; i<oldsz; i++)
620 {
621 int_t i0=les_elems(i,0);
622 int_t i1=les_elems(i,1);
623 int_t i2=les_elems(i,2);
624 int_t i3=les_elems(i,3);
625
626 som_dvt(i,0) = i0;
627 som_dvt(i,1) = i1;
628 som_dvt(i,2) = i2;
629 som_dvt(i,3) = i3;
630
631 som_der(i,0) = i0+oldnbsom*NZ;
632 som_der(i,1) = i1+oldnbsom*NZ;
633 som_der(i,2) = i2+oldnbsom*NZ;
634 som_der(i,3) = i3+oldnbsom*NZ;
635
636 }
637
638
639 les_faces_dvt.les_sommets().ref(som_dvt);
640 les_faces_der.les_sommets().ref(som_der);
641
642}
643
644template class Extruder_32_64<int>;
645#if INT_is_64_ == 2
646template class Extruder_32_64<trustIdType>;
647#endif
DoubleTab_t & les_sommets()
Definition Domaine.h:113
Bords_t & faces_bord()
Definition Domaine.h:198
Raccords_t & faces_raccord()
Definition Domaine.h:253
IntTab_t & les_elems()
Definition Domaine.h:129
void invalide_octree()
Definition Domaine.cpp:809
void typer(const Nom &)
Sets the element type of the domain using the name passed as parameter.
Definition Domaine.h:457
int_t nb_som_tot() const
Returns the total number of vertices of the domain i.e. the number of real and virtual vertices on th...
Definition Domaine.h:123
int_t nb_som() const
Returns the number of vertices of the domain.
Definition Domaine.h:121
void ajouter(const DoubleTab_t &soms)
Adds nodes (or vertices) to the domain (without checking for duplicates).
Definition Domaine.cpp:908
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
class Extruder This class is an interpreter used to read and execute
Definition Extruder.h:38
DoubleTab_T< _SIZE_ > DoubleTab_t
Definition Extruder.h:47
Faces_builder_32_64< _SIZE_ > Faces_builder_t
Definition Extruder.h:48
Faces_32_64< _SIZE_ > Faces_t
Definition Extruder.h:44
ArrOfDouble direction
Definition Extruder.h:70
Bord_32_64< _SIZE_ > Bord_t
Definition Extruder.h:45
IntTab_T< _SIZE_ > IntTab_t
Definition Extruder.h:46
Static_Int_Lists_32_64< _SIZE_ > Static_Int_Lists_t
Definition Extruder.h:49
Domaine_32_64< _SIZE_ > Domaine_t
Definition Extruder.h:43
Entree & interpreter_(Entree &) override
Main function of the Extruder interpreter. Extrudes the domain.
Definition Extruder.cpp:51
virtual void extruder_dvt_hexa(Domaine_t &, Faces_t &, int_t, int_t)
Definition Extruder.cpp:581
virtual void extruder_dvt(Domaine_t &, Faces_t &, int_t, int_t)
Definition Extruder.cpp:383
void extruder(Domaine_t &)
Extrudes all elements of a domain: transforms the geometric elements of the domain into 3D elements.
Definition Extruder.cpp:86
_SIZE_ int_t
Definition Extruder.h:42
void extruder_hexa(Domaine_t &)
Definition Extruder.cpp:443
void typer(const Motcle &)
Sets the type of the faces.
Definition Faces.cpp:382
void associer_domaine(const Domaine_t &z)
Definition Faces.h:94
IntTab_t & voisins()
Returns the array of neighbors (of the faces).
Definition Faces.h:89
int_t nb_faces() const
Definition Faces.h:66
int_t voisin(int_t, int) const
Returns the number of the i-th neighbor of face.
Definition Faces.h:165
const IntTab_t & les_sommets() const
Returns the array of vertices of all faces.
Definition Faces.h:74
int_t sommet(int_t, int) const
Returns the number of the j-th vertex of the i-th face.
Definition Faces.h:130
void creer_faces_reeles(Domaine_t &domaine, const Static_Int_Lists_t &connect_som_elem, Faces_t &les_faces, IntTab_t &elem_faces)
From the description of the domain elements and boundaries (borders, connections, face groups,...
Class Frontiere.
Definition Frontiere.h:32
void nommer(const Nom &) override
Gives a name to the boundary.
Definition Frontiere.cpp:74
const Faces_t & faces() const
Definition Frontiere.h:54
Class Interprete_geometrique_base.
void mettre_a_jour_sous_domaine(Domaine_t &domaine, int_t &elem, int_t num_premier_elem, int_t nb_elem) const
Adds the new elements into the sub-domains.
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
friend class Entree
Definition Objet_U.h:71
static int dimension
Definition Objet_U.h:94
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
void ajouter_arr_size_predefinie(const char *keyword, const ArrOfInt *value, Param::Nature nat=Param::OPTIONAL)
Register an ArrOfInt whose size has already been fixed.
Definition Param.cpp:411
void ajouter(const char *keyword, const int *value, Param::Nature nat=Param::OPTIONAL)
Register an integer parameter.
Definition Param.cpp:364
@ REQUIRED
Definition Param.h:115
int lire_avec_accolades_depuis(Entree &is)
Parse the parameter block { ... } from is.
Definition Param.cpp:32
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
static void init_sequential_domain(Domaine_32_64< _SIZE_ > &dom)
Create parallel descriptors for the vertex and element arrays of the domain (necessary because Scatte...
Definition Scatter.cpp:2739
static void uninit_sequential_domain(Domaine_32_64< _SIZE_ > &dom)
Method used by interpreters that modify the domain (sequential), destroys the descriptors of vertices...
Definition Scatter.cpp:2754
Base class for output streams.
Definition Sortie.h:52
virtual void ref(const TRUSTTab &)
Definition TRUSTTab.tpp:308
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
Definition TRUSTTab.tpp:469
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133