14#include "arcane/ItemTypeMng.h"
16#include "arcane/utils/Iostream.h"
17#include "arcane/utils/String.h"
18#include "arcane/utils/PlatformUtils.h"
19#include "arcane/utils/ITraceMng.h"
20#include "arcane/utils/TraceAccessor.h"
21#include "arcane/utils/IStackTraceService.h"
22#include "arcane/utils/IOException.h"
23#include "arcane/utils/FatalErrorException.h"
24#include "arcane/utils/Array.h"
25#include "arcane/utils/MultiBuffer.h"
27#include "arcane/ItemTypeInfoBuilder.h"
28#include "arcane/IParallelSuperMng.h"
29#include "arcane/ItemTypeInfoBuilder.h"
32#include "arcane/ItemRefinementPattern.h"
46const Integer ItemTypeMng::m_nb_builtin_item_type = NB_BASIC_ITEM_TYPE;
56 m_initialized_counter = 0;
65 delete m_types_buffer;
79 Int32 max_rank = parallel_mng->
commSize() + 1;
80 Int32 init_counter = ++m_initialized_counter;
81 if (init_counter == 1) {
82 _build(parallel_mng, trace);
84 m_initialized_counter = max_rank;
89 while (init_counter < max_rank)
90 init_counter = m_initialized_counter.load();
106 m_types.resize(m_nb_builtin_item_type);
112 m_types[IT_NullType] = type;
114 type->setInfos(
this, IT_NullType,
"NullType", 0, 0, 0);
119 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
120 m_types[IT_Vertex] = type;
122 type->setInfos(
this, IT_Vertex,
"Vertex", 0, 0, 0);
130 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
131 m_types[IT_FaceVertex] = type;
133 type->setInfos(
this, IT_FaceVertex,
"FaceVertex", 1, 0, 0);
134 type->setIsValidForCell(
false);
139 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
140 m_types[IT_Line2] = type;
142 type->setInfos(
this, IT_Line2,
"Line2", 2, 0, 0);
143 type->setIsValidForCell(
false);
148 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
149 m_types[IT_Line3] = type;
151 type->setInfos(
this, IT_Line3,
"Line3", 3, 0, 0);
152 type->setIsValidForCell(
false);
157 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
158 m_types[IT_CellLine2] = type;
160 type->setInfos(
this, IT_CellLine2,
"CellLine2", 2, 0, 2);
162 type->addFaceVertex(0, 0);
163 type->addFaceVertex(1, 1);
175 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
176 m_types[IT_Triangle3] = type;
178 type->setInfos(
this, IT_Triangle3,
"Triangle3", 3, 3, 3);
180 type->addFaceLine(0, 0, 1);
181 type->addFaceLine(1, 1, 2);
182 type->addFaceLine(2, 2, 0);
184 type->addEdge(0, 0, 1, 1, 2);
185 type->addEdge(1, 1, 2, 2, 0);
186 type->addEdge(2, 2, 0, 0, 1);
192 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
193 m_types[IT_Triangle6] = type;
195 type->setInfos(
this, IT_Triangle6,
"Triangle6", 6, 3, 3);
197 type->addFaceLine3(0, 0, 1, 3);
198 type->addFaceLine3(1, 1, 2, 4);
199 type->addFaceLine3(2, 2, 0, 5);
201 type->addEdge(0, 0, 1, 1, 2);
202 type->addEdge(1, 1, 2, 2, 0);
203 type->addEdge(2, 2, 0, 0, 1);
208 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
209 m_types[IT_Quad4] = type;
211 type->setInfos(
this, IT_Quad4,
"Quad4", 4, 4, 4);
213 type->addFaceLine(0, 0, 1);
214 type->addFaceLine(1, 1, 2);
215 type->addFaceLine(2, 2, 3);
216 type->addFaceLine(3, 3, 0);
218 type->addEdge(0, 0, 1, 3, 1);
219 type->addEdge(1, 1, 2, 0, 2);
220 type->addEdge(2, 2, 3, 1, 3);
221 type->addEdge(3, 3, 0, 2, 0);
227 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
228 m_types[IT_Quad8] = type;
230 type->setInfos(
this, IT_Quad8,
"Quad8", 8, 4, 4);
232 type->addFaceLine3(0, 0, 1, 4);
233 type->addFaceLine3(1, 1, 2, 5);
234 type->addFaceLine3(2, 2, 3, 6);
235 type->addFaceLine3(3, 3, 0, 7);
237 type->addEdge(0, 0, 1, 3, 1);
238 type->addEdge(1, 1, 2, 0, 2);
239 type->addEdge(2, 2, 3, 1, 3);
240 type->addEdge(3, 3, 0, 2, 0);
245 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
246 m_types[IT_Pentagon5] = type;
248 type->setInfos(
this, IT_Pentagon5,
"Pentagon5", 5, 5, 5);
250 type->addFaceLine(0, 0, 1);
251 type->addFaceLine(1, 1, 2);
252 type->addFaceLine(2, 2, 3);
253 type->addFaceLine(3, 3, 4);
254 type->addFaceLine(4, 4, 0);
256 type->addEdge(0, 0, 1, 4, 1);
257 type->addEdge(1, 1, 2, 0, 2);
258 type->addEdge(2, 2, 3, 1, 3);
259 type->addEdge(3, 3, 4, 2, 4);
260 type->addEdge(4, 4, 0, 3, 0);
265 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
266 m_types[IT_Hexagon6] = type;
268 type->setInfos(
this, IT_Hexagon6,
"Hexagon6", 6, 6, 6);
270 type->addFaceLine(0, 0, 1);
271 type->addFaceLine(1, 1, 2);
272 type->addFaceLine(2, 2, 3);
273 type->addFaceLine(3, 3, 4);
274 type->addFaceLine(4, 4, 5);
275 type->addFaceLine(5, 5, 0);
277 type->addEdge(0, 0, 1, 5, 1);
278 type->addEdge(1, 1, 2, 0, 2);
279 type->addEdge(2, 2, 3, 1, 3);
280 type->addEdge(3, 3, 4, 2, 4);
281 type->addEdge(4, 4, 5, 3, 5);
282 type->addEdge(5, 5, 0, 4, 0);
287 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
288 m_types[IT_Hexaedron8] = type;
290 type->setInfos(
this, IT_Hexaedron8,
"Hexaedron8", 8, 12, 6);
292 type->addFaceQuad(0, 0, 3, 2, 1);
293 type->addFaceQuad(1, 0, 4, 7, 3);
294 type->addFaceQuad(2, 0, 1, 5, 4);
295 type->addFaceQuad(3, 4, 5, 6, 7);
296 type->addFaceQuad(4, 1, 2, 6, 5);
297 type->addFaceQuad(5, 2, 3, 7, 6);
299 type->addEdge(0, 0, 1, 2, 0);
300 type->addEdge(1, 1, 2, 4, 0);
301 type->addEdge(2, 2, 3, 5, 0);
302 type->addEdge(3, 3, 0, 1, 0);
303 type->addEdge(4, 0, 4, 1, 2);
304 type->addEdge(5, 1, 5, 2, 4);
305 type->addEdge(6, 2, 6, 4, 5);
306 type->addEdge(7, 3, 7, 5, 1);
307 type->addEdge(8, 4, 5, 3, 2);
308 type->addEdge(9, 5, 6, 3, 4);
309 type->addEdge(10, 6, 7, 3, 5);
310 type->addEdge(11, 7, 4, 3, 1);
316 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
317 m_types[IT_Hexaedron20] = type;
319 type->setInfos(
this, IT_Hexaedron20,
"Hexaedron20", 20, 12, 6);
321 type->addFaceQuad8(0, 0, 3, 2, 1, 11, 10, 9, 8);
322 type->addFaceQuad8(1, 0, 4, 7, 3, 16, 15, 19, 11);
323 type->addFaceQuad8(2, 0, 1, 5, 4, 8, 17, 12, 16);
324 type->addFaceQuad8(3, 4, 5, 6, 7, 19, 13, 14, 15);
325 type->addFaceQuad8(4, 1, 2, 6, 5, 9, 18, 13, 17);
326 type->addFaceQuad8(5, 2, 3, 7, 6, 10, 19, 14, 18);
328 type->addEdge(0, 0, 1, 2, 0);
329 type->addEdge(1, 1, 2, 4, 0);
330 type->addEdge(2, 2, 3, 5, 0);
331 type->addEdge(3, 3, 0, 1, 0);
332 type->addEdge(4, 0, 4, 1, 2);
333 type->addEdge(5, 1, 5, 2, 4);
334 type->addEdge(6, 2, 6, 4, 5);
335 type->addEdge(7, 3, 7, 5, 1);
336 type->addEdge(8, 4, 5, 3, 2);
337 type->addEdge(9, 5, 6, 3, 4);
338 type->addEdge(10, 6, 7, 3, 5);
339 type->addEdge(11, 7, 4, 3, 1);
344 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
345 m_types[IT_Pyramid5] = type;
347 type->setInfos(
this, IT_Pyramid5,
"Pyramid5", 5, 8, 5);
349 type->addFaceQuad(0, 0, 3, 2, 1);
350 type->addFaceTriangle(1, 0, 4, 3);
351 type->addFaceTriangle(2, 0, 1, 4);
352 type->addFaceTriangle(3, 1, 2, 4);
353 type->addFaceTriangle(4, 2, 3, 4);
355 type->addEdge(0, 0, 1, 2, 0);
356 type->addEdge(1, 1, 2, 3, 0);
357 type->addEdge(2, 2, 3, 4, 0);
358 type->addEdge(3, 3, 0, 1, 0);
359 type->addEdge(4, 0, 4, 1, 2);
360 type->addEdge(5, 1, 4, 2, 3);
361 type->addEdge(6, 2, 4, 3, 4);
362 type->addEdge(7, 3, 4, 4, 1);
367 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
368 m_types[IT_Pentaedron6] = type;
370 type->setInfos(
this, IT_Pentaedron6,
"Pentaedron6", 6, 9, 5);
372 type->addFaceTriangle(0, 0, 2, 1);
373 type->addFaceQuad(1, 0, 3, 5, 2);
374 type->addFaceQuad(2, 0, 1, 4, 3);
375 type->addFaceTriangle(3, 3, 4, 5);
376 type->addFaceQuad(4, 1, 2, 5, 4);
378 type->addEdge(0, 0, 1, 2, 0);
379 type->addEdge(1, 1, 2, 4, 0);
380 type->addEdge(2, 2, 0, 1, 0);
381 type->addEdge(3, 0, 3, 1, 2);
382 type->addEdge(4, 1, 4, 2, 4);
383 type->addEdge(5, 2, 5, 4, 1);
384 type->addEdge(6, 3, 4, 3, 2);
385 type->addEdge(7, 4, 5, 3, 4);
386 type->addEdge(8, 5, 3, 3, 1);
391 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
392 m_types[IT_Tetraedron4] = type;
394 type->setInfos(
this, IT_Tetraedron4,
"Tetraedron4", 4, 6, 4);
396 type->addFaceTriangle(0, 0, 2, 1);
397 type->addFaceTriangle(1, 0, 3, 2);
398 type->addFaceTriangle(2, 0, 1, 3);
399 type->addFaceTriangle(3, 1, 2, 3);
401 type->addEdge(0, 0, 1, 2, 0);
402 type->addEdge(1, 1, 2, 3, 0);
403 type->addEdge(2, 2, 0, 1, 0);
404 type->addEdge(3, 0, 3, 1, 2);
405 type->addEdge(4, 1, 3, 2, 3);
406 type->addEdge(5, 2, 3, 3, 1);
412 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
413 m_types[IT_Tetraedron10] = type;
415 type->setInfos(
this, IT_Tetraedron10,
"Tetraedron10", 10, 6, 4);
417 type->addFaceTriangle6(0, 0, 2, 1, 6, 5, 4);
418 type->addFaceTriangle6(1, 0, 3, 2, 7, 9, 6);
419 type->addFaceTriangle6(2, 0, 1, 3, 4, 8, 7);
420 type->addFaceTriangle6(3, 1, 2, 3, 5, 9, 8);
422 type->addEdge(0, 0, 1, 2, 0);
423 type->addEdge(1, 1, 2, 3, 0);
424 type->addEdge(2, 2, 0, 1, 0);
425 type->addEdge(3, 0, 3, 1, 2);
426 type->addEdge(4, 1, 3, 2, 3);
427 type->addEdge(5, 2, 3, 3, 1);
432 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
433 m_types[IT_Heptaedron10] = type;
435 type->setInfos(
this, IT_Heptaedron10,
"Heptaedron10", 10, 15, 7);
437 type->addFacePentagon(0, 0, 4, 3, 2, 1);
438 type->addFacePentagon(1, 5, 6, 7, 8, 9);
439 type->addFaceQuad(2, 0, 1, 6, 5);
440 type->addFaceQuad(3, 1, 2, 7, 6);
441 type->addFaceQuad(4, 2, 3, 8, 7);
442 type->addFaceQuad(5, 3, 4, 9, 8);
443 type->addFaceQuad(6, 4, 0, 5, 9);
445 type->addEdge(0, 0, 1, 2, 0);
446 type->addEdge(1, 1, 2, 3, 0);
447 type->addEdge(2, 2, 3, 4, 0);
448 type->addEdge(3, 3, 4, 5, 0);
449 type->addEdge(4, 4, 0, 6, 0);
450 type->addEdge(5, 5, 6, 1, 2);
451 type->addEdge(6, 6, 7, 1, 3);
452 type->addEdge(7, 7, 8, 1, 4);
453 type->addEdge(8, 8, 9, 1, 5);
454 type->addEdge(9, 9, 5, 1, 6);
455 type->addEdge(10, 0, 5, 6, 2);
456 type->addEdge(11, 1, 6, 2, 3);
457 type->addEdge(12, 2, 7, 3, 4);
458 type->addEdge(13, 3, 8, 4, 5);
459 type->addEdge(14, 4, 9, 5, 6);
464 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
465 m_types[IT_Octaedron12] = type;
467 type->setInfos(
this, IT_Octaedron12,
"Octaedron12", 12, 18, 8);
469 type->addFaceHexagon(0, 0, 5, 4, 3, 2, 1);
470 type->addFaceHexagon(1, 6, 7, 8, 9, 10, 11);
471 type->addFaceQuad(2, 0, 1, 7, 6);
472 type->addFaceQuad(3, 1, 2, 8, 7);
473 type->addFaceQuad(4, 2, 3, 9, 8);
474 type->addFaceQuad(5, 3, 4, 10, 9);
475 type->addFaceQuad(6, 4, 5, 11, 10);
476 type->addFaceQuad(7, 5, 0, 6, 11);
478 type->addEdge(0, 0, 1, 2, 0);
479 type->addEdge(1, 1, 2, 3, 0);
480 type->addEdge(2, 2, 3, 4, 0);
481 type->addEdge(3, 3, 4, 5, 0);
482 type->addEdge(4, 4, 5, 6, 0);
483 type->addEdge(5, 5, 0, 7, 0);
484 type->addEdge(6, 6, 7, 1, 2);
485 type->addEdge(7, 7, 8, 1, 3);
486 type->addEdge(8, 8, 9, 1, 4);
487 type->addEdge(9, 9, 10, 1, 5);
488 type->addEdge(10, 10, 11, 1, 6);
489 type->addEdge(11, 11, 6, 1, 7);
490 type->addEdge(12, 0, 6, 7, 2);
491 type->addEdge(13, 1, 7, 2, 3);
492 type->addEdge(14, 2, 8, 3, 4);
493 type->addEdge(15, 3, 9, 4, 5);
494 type->addEdge(16, 4, 10, 5, 6);
495 type->addEdge(17, 5, 11, 6, 7);
500 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
501 m_types[IT_HemiHexa7] = type;
503 type->setInfos(
this, IT_HemiHexa7,
"HemiHexa7", 7, 11, 6);
505 type->addFaceTriangle(0, 0, 1, 2);
506 type->addFaceQuad(1, 0, 2, 3, 4);
507 type->addFaceQuad(2, 0, 5, 6, 1);
508 type->addFaceTriangle(3, 0, 4, 5);
509 type->addFaceQuad(4, 1, 6, 3, 2);
510 type->addFaceQuad(5, 3, 6, 5, 4);
512 type->addEdge(0, 0, 1, 0, 2);
513 type->addEdge(1, 1, 2, 0, 4);
514 type->addEdge(2, 2, 0, 0, 1);
515 type->addEdge(3, 2, 3, 1, 4);
516 type->addEdge(4, 3, 4, 1, 5);
517 type->addEdge(5, 4, 5, 3, 5);
518 type->addEdge(6, 5, 0, 3, 2);
519 type->addEdge(7, 0, 4, 3, 1);
520 type->addEdge(8, 5, 6, 2, 5);
521 type->addEdge(9, 6, 1, 2, 4);
522 type->addEdge(10, 3, 6, 5, 4);
527 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
528 m_types[IT_HemiHexa6] = type;
530 type->setInfos(
this, IT_HemiHexa6,
"HemiHexa6", 6, 10, 6);
532 type->addFaceTriangle(0, 0, 1, 2);
533 type->addFaceQuad(1, 0, 2, 3, 4);
534 type->addFaceQuad(2, 0, 5, 3, 1);
535 type->addFaceTriangle(3, 0, 4, 5);
536 type->addFaceTriangle(4, 1, 3, 2);
537 type->addFaceTriangle(5, 3, 5, 4);
539 type->addEdge(0, 0, 1, 0, 2);
540 type->addEdge(1, 1, 2, 0, 4);
541 type->addEdge(2, 2, 0, 0, 1);
542 type->addEdge(3, 2, 3, 1, 4);
543 type->addEdge(4, 3, 4, 1, 5);
544 type->addEdge(5, 4, 5, 3, 5);
545 type->addEdge(6, 5, 0, 3, 2);
546 type->addEdge(7, 0, 4, 3, 1);
547 type->addEdge(8, 5, 3, 2, 5);
548 type->addEdge(9, 3, 1, 2, 4);
553 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
554 m_types[IT_HemiHexa5] = type;
556 type->setInfos(
this, IT_HemiHexa5,
"HemiHexa5", 5, 7, 4);
558 type->addFaceTriangle(0, 0, 1, 2);
559 type->addFaceQuad(1, 0, 2, 3, 4);
560 type->addFaceQuad(2, 0, 4, 3, 1);
561 type->addFaceTriangle(3, 1, 3, 2);
563 type->addEdge(0, 0, 1, 0, 2);
564 type->addEdge(1, 1, 2, 0, 3);
565 type->addEdge(2, 2, 0, 0, 1);
566 type->addEdge(3, 2, 3, 1, 3);
567 type->addEdge(4, 3, 1, 2, 3);
568 type->addEdge(5, 3, 4, 1, 2);
569 type->addEdge(6, 4, 0, 1, 2);
574 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
575 m_types[IT_AntiWedgeLeft6] = type;
577 type->setInfos(
this, IT_AntiWedgeLeft6,
"AntiWedgeLeft6", 6, 10, 6);
579 type->addFaceTriangle(0, 0, 2, 1);
580 type->addFaceQuad(1, 0, 3, 5, 2);
581 type->addFaceQuad(2, 0, 1, 4, 3);
582 type->addFaceTriangle(3, 3, 4, 5);
583 type->addFaceTriangle(4, 1, 2, 4);
584 type->addFaceTriangle(5, 2, 5, 4);
586 type->addEdge(0, 0, 1, 0, 2);
587 type->addEdge(1, 1, 2, 4, 0);
588 type->addEdge(2, 2, 0, 1, 0);
589 type->addEdge(3, 0, 3, 1, 2);
590 type->addEdge(4, 1, 4, 2, 4);
591 type->addEdge(5, 2, 5, 5, 1);
592 type->addEdge(6, 3, 4, 3, 2);
593 type->addEdge(7, 4, 5, 3, 5);
594 type->addEdge(8, 5, 3, 3, 1);
595 type->addEdge(9, 2, 4, 4, 5);
600 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
601 m_types[IT_AntiWedgeRight6] = type;
603 type->setInfos(
this, IT_AntiWedgeRight6,
"AntiWedgeRight6", 6, 10, 6);
605 type->addFaceTriangle(0, 0, 2, 1);
606 type->addFaceQuad(1, 0, 3, 5, 2);
607 type->addFaceQuad(2, 0, 1, 4, 3);
608 type->addFaceTriangle(3, 3, 4, 5);
609 type->addFaceTriangle(4, 1, 2, 5);
610 type->addFaceTriangle(5, 1, 5, 4);
612 type->addEdge(0, 0, 1, 0, 2);
613 type->addEdge(1, 1, 2, 4, 0);
614 type->addEdge(2, 2, 0, 1, 0);
615 type->addEdge(3, 0, 3, 1, 2);
616 type->addEdge(4, 1, 4, 2, 5);
617 type->addEdge(5, 2, 5, 4, 1);
618 type->addEdge(6, 3, 4, 3, 2);
619 type->addEdge(7, 4, 5, 3, 5);
620 type->addEdge(8, 5, 3, 3, 1);
621 type->addEdge(9, 1, 5, 5, 4);
626 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
627 m_types[IT_DiTetra5] = type;
629 type->setInfos(
this, IT_DiTetra5,
"DiTetra5", 5, 9, 6);
631 type->addFaceTriangle(0, 0, 1, 3);
632 type->addFaceTriangle(1, 1, 2, 3);
633 type->addFaceTriangle(2, 2, 0, 3);
634 type->addFaceTriangle(3, 1, 0, 4);
635 type->addFaceTriangle(4, 2, 1, 4);
636 type->addFaceTriangle(5, 0, 2, 4);
638 type->addEdge(0, 0, 1, 0, 3);
639 type->addEdge(1, 1, 2, 1, 4);
640 type->addEdge(2, 2, 0, 2, 5);
641 type->addEdge(3, 0, 3, 2, 0);
642 type->addEdge(4, 1, 3, 0, 1);
643 type->addEdge(5, 2, 3, 1, 2);
644 type->addEdge(6, 0, 4, 3, 5);
645 type->addEdge(7, 1, 4, 4, 3);
646 type->addEdge(8, 2, 4, 5, 4);
651 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
652 m_types[IT_DualNode] = type;
654 type->setInfos(
this, IT_DualNode,
"DualNode", 1, 0, 0);
658 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
659 m_types[IT_DualEdge] = type;
661 type->setInfos(
this, IT_DualEdge,
"DualEdge", 1, 0, 0);
665 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
666 m_types[IT_DualFace] = type;
668 type->setInfos(
this, IT_DualFace,
"DualFace", 1, 0, 0);
672 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
673 m_types[IT_DualCell] = type;
675 type->setInfos(
this, IT_DualCell,
"DualCell", 1, 0, 0);
679 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
680 m_types[IT_DualParticle] = type;
682 type->setInfos(
this, IT_DualParticle,
"DualParticle", 1, 0, 0);
686 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
687 m_types[IT_Link] = type;
689 type->setInfos(
this, IT_Link,
"Link", 0, 0, 0);
694 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
695 m_types[IT_Enneedron14] = type;
697 type->setInfos(
this, IT_Enneedron14,
"IT_Enneedron14", 14, 21, 9);
699 type->addFaceHeptagon(0, 0, 6, 5, 4, 3, 2, 1);
700 type->addFaceHeptagon(1, 7, 8, 9, 10, 11, 12, 13);
701 type->addFaceQuad(2, 0, 1, 8, 7);
702 type->addFaceQuad(3, 1, 2, 9, 8);
703 type->addFaceQuad(4, 2, 3, 10, 9);
704 type->addFaceQuad(5, 3, 4, 11, 10);
705 type->addFaceQuad(6, 4, 5, 12, 11);
706 type->addFaceQuad(7, 5, 6, 13, 12);
707 type->addFaceQuad(8, 6, 0, 7, 13);
709 type->addEdge(0, 0, 1, 2, 0);
710 type->addEdge(1, 1, 2, 3, 0);
711 type->addEdge(2, 2, 3, 4, 0);
712 type->addEdge(3, 3, 4, 5, 0);
713 type->addEdge(4, 4, 5, 6, 0);
714 type->addEdge(5, 5, 6, 7, 0);
715 type->addEdge(6, 6, 0, 8, 0);
716 type->addEdge(7, 7, 8, 1, 2);
717 type->addEdge(8, 8, 9, 1, 3);
718 type->addEdge(9, 9, 10, 1, 4);
719 type->addEdge(10, 10, 11, 1, 5);
720 type->addEdge(11, 11, 12, 1, 6);
721 type->addEdge(12, 12, 13, 1, 7);
722 type->addEdge(13, 13, 7, 1, 8);
723 type->addEdge(14, 0, 7, 8, 2);
724 type->addEdge(15, 1, 8, 1, 2);
725 type->addEdge(16, 2, 9, 2, 3);
726 type->addEdge(17, 3, 10, 3, 4);
727 type->addEdge(18, 4, 11, 4, 5);
728 type->addEdge(19, 5, 12, 5, 6);
729 type->addEdge(20, 6, 13, 6, 7);
733 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
734 m_types[IT_Decaedron16] = type;
736 type->setInfos(
this, IT_Decaedron16,
"IT_Decaedron16", 16, 24, 10);
738 type->addFaceOctogon(0, 0, 7, 6, 5, 4, 3, 2, 1);
739 type->addFaceOctogon(1, 8, 9, 10, 11, 12, 13, 14, 15);
740 type->addFaceQuad(2, 0, 1, 9, 8);
741 type->addFaceQuad(3, 1, 2, 10, 9);
742 type->addFaceQuad(4, 2, 3, 11, 10);
743 type->addFaceQuad(5, 3, 4, 12, 11);
744 type->addFaceQuad(6, 4, 5, 13, 12);
745 type->addFaceQuad(7, 5, 6, 14, 13);
746 type->addFaceQuad(8, 6, 7, 15, 14);
747 type->addFaceQuad(9, 7, 0, 8, 15);
749 type->addEdge(0, 0, 1, 2, 0);
750 type->addEdge(1, 1, 2, 3, 0);
751 type->addEdge(2, 2, 3, 4, 0);
752 type->addEdge(3, 3, 4, 5, 0);
753 type->addEdge(4, 4, 5, 6, 0);
754 type->addEdge(5, 5, 6, 7, 0);
755 type->addEdge(6, 6, 7, 8, 0);
756 type->addEdge(7, 7, 0, 9, 0);
757 type->addEdge(8, 8, 9, 1, 2);
758 type->addEdge(9, 9, 10, 1, 3);
759 type->addEdge(10, 10, 11, 1, 4);
760 type->addEdge(11, 11, 12, 1, 5);
761 type->addEdge(12, 12, 13, 1, 6);
762 type->addEdge(13, 13, 14, 1, 7);
763 type->addEdge(14, 14, 15, 1, 8);
764 type->addEdge(15, 15, 8, 1, 9);
765 type->addEdge(16, 0, 8, 9, 2);
766 type->addEdge(17, 1, 9, 2, 3);
767 type->addEdge(18, 2, 10, 3, 4);
768 type->addEdge(19, 3, 11, 4, 5);
769 type->addEdge(20, 4, 12, 5, 6);
770 type->addEdge(21, 5, 13, 6, 7);
771 type->addEdge(22, 6, 14, 7, 8);
772 type->addEdge(23, 7, 15, 8, 9);
777 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
778 m_types[IT_Heptagon7] = type;
780 type->setInfos(
this, IT_Heptagon7,
"Heptagon7", 7, 7, 7);
782 type->addFaceLine(0, 0, 1);
783 type->addFaceLine(1, 1, 2);
784 type->addFaceLine(2, 2, 3);
785 type->addFaceLine(3, 3, 4);
786 type->addFaceLine(4, 4, 5);
787 type->addFaceLine(5, 5, 6);
788 type->addFaceLine(6, 6, 0);
790 type->addEdge(0, 0, 1, 6, 1);
791 type->addEdge(1, 1, 2, 0, 2);
792 type->addEdge(2, 2, 3, 1, 3);
793 type->addEdge(3, 3, 4, 2, 4);
794 type->addEdge(4, 4, 5, 3, 5);
795 type->addEdge(5, 5, 6, 4, 6);
796 type->addEdge(6, 6, 0, 5, 0);
801 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
802 m_types[IT_Octogon8] = type;
804 type->setInfos(
this, IT_Octogon8,
"Octogon8", 8, 8, 8);
806 type->addFaceLine(0, 0, 1);
807 type->addFaceLine(1, 1, 2);
808 type->addFaceLine(2, 2, 3);
809 type->addFaceLine(3, 3, 4);
810 type->addFaceLine(4, 4, 5);
811 type->addFaceLine(5, 5, 6);
812 type->addFaceLine(6, 6, 7);
813 type->addFaceLine(7, 7, 0);
815 type->addEdge(0, 0, 1, 7, 1);
816 type->addEdge(1, 1, 2, 0, 2);
817 type->addEdge(2, 2, 3, 1, 3);
818 type->addEdge(3, 3, 4, 2, 4);
819 type->addEdge(4, 4, 5, 3, 5);
820 type->addEdge(5, 5, 6, 4, 6);
821 type->addEdge(6, 6, 7, 5, 7);
822 type->addEdge(7, 7, 0, 6, 0);
826 String arcane_item_type_file = platform::getEnvironmentVariable(
"ARCANE_ITEM_TYPE_FILE");
827 if (!arcane_item_type_file.null()) {
829 readTypes(parallel_mng, arcane_item_type_file);
835 for (Integer i = 0; i < m_types.size(); ++i) {
836 ItemTypeInfoBuilder* type =
static_cast<ItemTypeInfoBuilder*
>(m_types[i]);
839 type->computeFaceEdgeInfos();
849 ARCANE_ASSERT((m_initialized), (
"Cannot use not built ItemTypeMng"));
850 Integer nb_type = m_types.size();
851 ostr <<
"** Number of types " << nb_type <<
'\n';
852 for (Integer i = 0; i < nb_type; ++i) {
854 ostr <<
" - Type " << type->
typeId()
858 for (Integer z = 0, sz = type->
nbLocalFace(); z < sz; ++z) {
860 ostr <<
" - - Face " << z <<
":";
861 for (Integer zk = 0, szk = lf.
nbNode(); zk < szk; ++zk) {
862 ostr <<
" " << lf.
node(zk);
899 m_trace->
info() <<
"Reading additional item types from file '" << filename <<
"'";
906 long unsigned int file_length = platform::getFileLength(filename);
907 if (file_length == 0)
908 throw IOException(A_FUNCINFO,
"ARCANE_ITEM_TYPE_FILE is an empty file");
910 ifile.open(filename.
localstr(), std::ios::binary);
912 throw IOException(A_FUNCINFO,
"Cannot open ARCANE_ITEM_TYPE_FILE item type file");
914 ifile.read((
char*)bytes.
data(), file_length);
915 bytes[(Integer)file_length] =
'\0';
917 throw IOException(A_FUNCINFO,
"Cannot read ARCANE_ITEM_TYPE_FILE item type file");
934 typedef std::map<Integer, Integer> PolygonMapper;
935 PolygonMapper built_polygons;
936 built_polygons[3] = IT_Triangle3;
937 built_polygons[4] = IT_Quad4;
938 built_polygons[5] = IT_Pentagon5;
939 built_polygons[6] = IT_Hexagon6;
940 typedef std::set<Integer> KnownTypes;
941 KnownTypes known_types;
943 known_types.insert(i_type);
946 throw FatalErrorException(A_FUNCINFO,
"Invalid initialization of built-in item types");
949 std::istringstream ifile((
char*)bytes.unguardedBasePointer(), std::istringstream::in);
955 for (Integer i = 0; i < nb_type; ++i) {
956 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
957 ifile >> typeId >> nbF >> nbE;
958 if (typeId >= nb_type || typeId < 0)
959 throw IOException(A_FUNCINFO, String::format(
"Polyhedron reader cannot allow typeId {0}", typeId));
961 if (known_types.find(typeId) != known_types.end())
962 throw FatalErrorException(A_FUNCINFO, String::format(
"Already existing typeId {0}", typeId));
963 known_types.insert(typeId);
971 type->setInfos(
this, typeId, String::format(
"Polyhedron{0}_{1}-{2}-{3}", typeId, nbN, nbE, nbF), nbN, nbE, nbF);
974 << nbE <<
" edges, " << nbF <<
" faces.";
975 m_types[typeId] = type;
976 for (Integer iface = 0; iface < nbF; ++iface) {
978 UniqueArray<Integer> nodeFace(nbN);
979 for (Integer inodeFace = 0; inodeFace < nbN; ++inodeFace) {
980 ifile >> nodeFace[inodeFace];
982 PolygonMapper::const_iterator finder = built_polygons.find(nbN);
984 if (finder != built_polygons.end()) {
985 face_type = finder->second;
986 m_trace->
debug(
Trace::High) <<
"\tAdding already existing face type " << face_type
987 <<
" for face " << iface <<
" with " << nbN <<
" nodes";
990 ItemTypeInfoBuilder* type2 = m_types_buffer->allocOne();
992 face_type = m_types.size();
994 built_polygons[nbN] = face_type;
996 type2->setInfos(
this, face_type, String::format(
"Polygon{0}", nbN), nbN, nbN, nbN);
997 for (Integer j = 0; j < nbN; ++j)
998 type2->addFaceLine(j, j, (j + 1) % nbN);
1000 for (Integer j = 0; j < nbN; ++j)
1001 type2->addEdge(j, j, (j + 1) % nbN, (j - 1 + nbN) % nbN, (j + 1) % nbN);
1003 <<
" for face " << iface <<
" with " << nbN <<
" nodes";
1005 type->addFaceGeneric(iface, face_type, nodeFace);
1007 Integer node0, node1, leftFace, rightFace;
1008 for (Integer iedge = 0; iedge < nbE; ++iedge) {
1009 ifile >> node0 >> node1 >> leftFace >> rightFace;
1010 type->addEdge(iedge, node0, node1, leftFace, rightFace);
1014 m_trace->
debug(
Trace::High) <<
"Total number of types : " << m_types.size();
1023 return _singleton()->
types().size();
1029 return m_nb_builtin_item_type;
1049 case IT_Tetraedron4:
1053 case IT_Pentaedron6:
1057 case IT_Heptaedron10:
1058 case IT_Octaedron12:
1062 case IT_AntiWedgeLeft6:
1063 case IT_AntiWedgeRight6:
1079 if (!singleton_instance)
1081 return singleton_instance;
1088#ifndef ARCANE_OS_WIN32
1089 delete singleton_instance;
1091 singleton_instance =
nullptr;
1100 ARCANE_ASSERT((m_initialized), (
"Cannot use not built ItemTypeMng"));
1110 ARCANE_ASSERT((m_initialized), (
"Cannot use not built ItemTypeMng"));
1120 ARCANE_ASSERT((m_initialized), (
"Cannot use not built ItemTypeMng"));
1121 return m_types[
id.typeId()];
1147_legacyTypeName(Integer t)
1151 return "InvalidType";
1159 auto has_general_cells =
false;
1160 if (m_mesh_with_general_cells.find(mesh) != m_mesh_with_general_cells.end()) {
1161 has_general_cells =
true;
1163 return has_general_cells;
1171 ARCANE_ASSERT(mesh, (
"Trying to indicate a null mesh contains general cells."));
1172 m_mesh_with_general_cells.insert(mesh);
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
Exception lorsqu'une erreur d'entrée/sortie est détectée.
virtual void broadcast(ByteArrayView send_buf, Integer process_id)=0
Envoie un tableau de valeurs sur tous les processus Cette opération synchronise le tableau de valeur ...
virtual Int32 commRank() const =0
Retourne le numéro du process (compris entre 0 et nbProcess()-1)
virtual Int32 commSize() const =0
Retourne le nombre total de process utilisés.
Type d'une entité (Item).
Informations locales sur une face d'une maille.
Integer node(Integer i) const
Indice locale dans la maille du i-ème noeud de la face.
Integer nbNode() const
Nombre de noeuds de la face.
Infos sur un type d'entité du maillage.
LocalFace localFace(Integer id) const
Connectivité locale de la i-ème face de la maille.
Integer nbLocalNode() const
Nombre de noeuds de l'entité
String typeName() const
Nom du type.
Integer nbLocalFace() const
Nombre de faces de l'entité
Int16 typeId() const
Numéro du type.
Gestionnaire des types d'entités de maillage.
void setMeshWithGeneralCells(IMesh *mesh) noexcept
Permet au maillage d'indiquer à l'ItemTypeMng s'il a des mailles génériques.
bool hasGeneralCells(IMesh *mesh) const
Indique si le maillage mesh contient des mailles génériques (en dehors des types intégrés ou addition...
ItemTypeMng()
Constructeur vide (non initialisé)
static Int32 nbHChildrenByItemType(Integer type)
AMR.
static Integer nbBasicItemType()
nombre de types disponibles
ItemTypeInfo * typeFromId(Integer id) const
Type correspondant au numéro id.
void build(IParallelSuperMng *parallel_mng, ITraceMng *trace)
Constructeur effectif.
ConstArrayView< ItemTypeInfo * > types() const
Liste des types disponibles.
static Integer nbBuiltInItemType()
nombre de types intégrés (hors types additionnels)
void printTypes(std::ostream &ostr)
Affiche les infos sur les types disponibles sur le flot ostr.
String typeName(Integer id) const
Nom du type correspondant au numéro id.
Integer size() const
Nombre d'éléments du vecteur.
const T * data() const
Accès à la racine du tableau hors toute protection.
void resize(Int64 s)
Change le nombre d'éléments du tableau à s.
Vue constante d'un tableau de type T.
Interface du gestionnaire de traces.
virtual TraceMessageDbg debug(Trace::eDebugLevel=Trace::Medium)=0
Flot pour un message de debug.
virtual TraceMessage info()=0
Flot pour un message d'information.
Chaîne de caractères unicode.
const char * localstr() const
Retourne la conversion de l'instance dans l'encodage UTF-8.
Vecteur 1D de données avec sémantique par valeur (style STL).
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Integer arcaneCheckArraySize(unsigned long long size)
Vérifie que size peut être converti dans un 'Integer' pour servir de taille à un tableau....
ArrayView< Integer > IntegerArrayView
Equivalent C d'un tableau à une dimension d'entiers.
Int32 Integer
Type représentant un entier.