Arcane  v3.14.10.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
ItemTypeMng.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2023£ CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* ItemTypeMng.cc (C) 2000-2023 */
9/* */
10/* Gestionnaire des types d'entite du maillage. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/ItemTypeMng.h"
15
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"
26
27#include "arcane/ItemTypeInfoBuilder.h"
28#include "arcane/IParallelSuperMng.h"
29#include "arcane/ItemTypeInfoBuilder.h"
30
31// AMR
32#include "arcane/ItemRefinementPattern.h"
33
34#include <map>
35#include <set>
36
37/*---------------------------------------------------------------------------*/
38/*---------------------------------------------------------------------------*/
39
40namespace Arcane
41{
42
43/*---------------------------------------------------------------------------*/
44/*---------------------------------------------------------------------------*/
45
46const Integer ItemTypeMng::m_nb_builtin_item_type = NB_BASIC_ITEM_TYPE;
47
48/*---------------------------------------------------------------------------*/
49/*---------------------------------------------------------------------------*/
50
53: m_initialized(false)
54, m_types_buffer(0)
55{
56 m_initialized_counter = 0;
57}
58
59/*---------------------------------------------------------------------------*/
60/*---------------------------------------------------------------------------*/
61
62ItemTypeMng::
63~ItemTypeMng()
64{
65 delete m_types_buffer;
66}
67
68/*---------------------------------------------------------------------------*/
69/*---------------------------------------------------------------------------*/
70
72build(IParallelSuperMng* parallel_mng, ITraceMng* trace)
73{
74 // Avec MPC, cette fonction peut être appelée plusieurs fois
75 // dans des threads différents. Comme tous les threads partagent
76 // le même singleton, seul le premier thread fait réelement l'init.
77 // ATTENTION: Cela est incompatible avec le mode readTypes()
78 // ou on lit les connectivités dans un fichier ARCANE_ITEM_TYPE_FILE.
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);
83 m_initialized = true;
84 m_initialized_counter = max_rank;
85 }
86 else
87 // Ceux qui ne font pas l'init doivent attendre que cette derniere
88 // soit faite.
89 while (init_counter < max_rank)
90 init_counter = m_initialized_counter.load();
91}
92
93/*---------------------------------------------------------------------------*/
94/*---------------------------------------------------------------------------*/
95
96void ItemTypeMng::
97_build(IParallelSuperMng* parallel_mng, ITraceMng* trace)
98{
99 // Construit la connectivité des éléments.
100 // Pour les éléments classiques, la connectivité est la même que
101 // celle de VTK, disponible dans le document:
102 //
103 // https://vtk.org/wp-content/uploads/2015/04/file-formats.pdf
104
105 m_trace = trace;
106 m_types.resize(m_nb_builtin_item_type);
107 m_types_buffer = new MultiBufferT<ItemTypeInfoBuilder>();
108
109 // Null
110 {
111 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
112 m_types[IT_NullType] = type;
113
114 type->setInfos(this, IT_NullType, "NullType", 0, 0, 0);
115 }
116
117 // Vertex
118 {
119 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
120 m_types[IT_Vertex] = type;
121
122 type->setInfos(this, IT_Vertex, "Vertex", 0, 0, 0);
123 // TODO regarder si ce type est autorisé pour les mailles.
124 // Si ce n'est pas le cas, il faudrait définir un type
125 // pour les mailles 0D qui sont assimilables à des points.
126 }
127
128 // FaceVertex (face pour les maillages 1D)
129 {
130 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
131 m_types[IT_FaceVertex] = type;
132
133 type->setInfos(this, IT_FaceVertex, "FaceVertex", 1, 0, 0);
134 type->setIsValidForCell(false);
135 }
136
137 // Line2
138 {
139 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
140 m_types[IT_Line2] = type;
141
142 type->setInfos(this, IT_Line2, "Line2", 2, 0, 0);
143 type->setIsValidForCell(false);
144 }
145
146 // Line3
147 {
148 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
149 m_types[IT_Line3] = type;
150
151 type->setInfos(this, IT_Line3, "Line3", 3, 0, 0);
152 type->setIsValidForCell(false);
153 }
154
155 // CellLine2 (mailles pour les maillages 1D)
156 {
157 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
158 m_types[IT_CellLine2] = type;
159
160 type->setInfos(this, IT_CellLine2, "CellLine2", 2, 0, 2);
161
162 type->addFaceVertex(0, 0);
163 type->addFaceVertex(1, 1);
164 }
165
166 /**
167 * SDP: Pour les polygones les faces et les aretes sont identiques.
168 *
169 * @note lors des declarations des aretes, on donne pour faces les
170 * aretes qui sont jointes a l'arete courante
171 */
172
173 // Triangle3
174 {
175 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
176 m_types[IT_Triangle3] = type;
177
178 type->setInfos(this, IT_Triangle3, "Triangle3", 3, 3, 3);
179
180 type->addFaceLine(0, 0, 1);
181 type->addFaceLine(1, 1, 2);
182 type->addFaceLine(2, 2, 0);
183
184 type->addEdge(0, 0, 1, 1, 2);
185 type->addEdge(1, 1, 2, 2, 0);
186 type->addEdge(2, 2, 0, 0, 1);
187 }
188
189 // Triangle6
190 {
191 // TODO: Pour l'instant comme triangle3
192 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
193 m_types[IT_Triangle6] = type;
194
195 type->setInfos(this, IT_Triangle6, "Triangle6", 6, 3, 3);
196
197 type->addFaceLine3(0, 0, 1, 3);
198 type->addFaceLine3(1, 1, 2, 4);
199 type->addFaceLine3(2, 2, 0, 5);
200
201 type->addEdge(0, 0, 1, 1, 2);
202 type->addEdge(1, 1, 2, 2, 0);
203 type->addEdge(2, 2, 0, 0, 1);
204 }
205
206 // Quad4
207 {
208 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
209 m_types[IT_Quad4] = type;
210
211 type->setInfos(this, IT_Quad4, "Quad4", 4, 4, 4);
212
213 type->addFaceLine(0, 0, 1);
214 type->addFaceLine(1, 1, 2);
215 type->addFaceLine(2, 2, 3);
216 type->addFaceLine(3, 3, 0);
217
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);
222 }
223
224 // Quad8
225 {
226 // TODO: Pour l'instant comme quad4
227 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
228 m_types[IT_Quad8] = type;
229
230 type->setInfos(this, IT_Quad8, "Quad8", 8, 4, 4);
231
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);
236
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);
241 }
242
243 // Pentagon5
244 {
245 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
246 m_types[IT_Pentagon5] = type;
247
248 type->setInfos(this, IT_Pentagon5, "Pentagon5", 5, 5, 5);
249
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);
255
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);
261 }
262
263 // Hexagon6
264 {
265 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
266 m_types[IT_Hexagon6] = type;
267
268 type->setInfos(this, IT_Hexagon6, "Hexagon6", 6, 6, 6);
269
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);
276
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);
283 }
284
285 // Hexaedron8
286 {
287 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
288 m_types[IT_Hexaedron8] = type;
289
290 type->setInfos(this, IT_Hexaedron8, "Hexaedron8", 8, 12, 6);
291
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);
298
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);
311 }
312
313 // Hexaedron20
314 {
315 // Pour l'instant comme Hexaedron8
316 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
317 m_types[IT_Hexaedron20] = type;
318
319 type->setInfos(this, IT_Hexaedron20, "Hexaedron20", 20, 12, 6);
320
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);
327
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);
340 }
341
342 // Pyramid5
343 {
344 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
345 m_types[IT_Pyramid5] = type;
346
347 type->setInfos(this, IT_Pyramid5, "Pyramid5", 5, 8, 5);
348
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);
354
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);
363 }
364
365 // Pentaedron6
366 {
367 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
368 m_types[IT_Pentaedron6] = type;
369
370 type->setInfos(this, IT_Pentaedron6, "Pentaedron6", 6, 9, 5);
371
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);
377
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);
387 }
388
389 // Tetraedron4
390 {
391 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
392 m_types[IT_Tetraedron4] = type;
393
394 type->setInfos(this, IT_Tetraedron4, "Tetraedron4", 4, 6, 4);
395
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);
400
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);
407 }
408
409 // Tetraedron10
410 {
411 // Pour l'instant comme Tetraedron4
412 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
413 m_types[IT_Tetraedron10] = type;
414
415 type->setInfos(this, IT_Tetraedron10, "Tetraedron10", 10, 6, 4);
416
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);
421
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);
428 }
429
430 // Heptaedron10
431 {
432 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
433 m_types[IT_Heptaedron10] = type;
434
435 type->setInfos(this, IT_Heptaedron10, "Heptaedron10", 10, 15, 7);
436
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);
444
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);
460 }
461
462 // Octaedron12
463 {
464 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
465 m_types[IT_Octaedron12] = type;
466
467 type->setInfos(this, IT_Octaedron12, "Octaedron12", 12, 18, 8);
468
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);
477
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);
496 }
497
498 // HemiHexa7
499 {
500 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
501 m_types[IT_HemiHexa7] = type;
502
503 type->setInfos(this, IT_HemiHexa7, "HemiHexa7", 7, 11, 6);
504
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);
511
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);
523 }
524
525 // HemiHexa6
526 {
527 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
528 m_types[IT_HemiHexa6] = type;
529
530 type->setInfos(this, IT_HemiHexa6, "HemiHexa6", 6, 10, 6);
531
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);
538
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);
549 }
550
551 // HemiHexa5
552 {
553 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
554 m_types[IT_HemiHexa5] = type;
555
556 type->setInfos(this, IT_HemiHexa5, "HemiHexa5", 5, 7, 4);
557
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);
562
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);
570 }
571
572 // AntiWedgeLeft6
573 {
574 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
575 m_types[IT_AntiWedgeLeft6] = type;
576
577 type->setInfos(this, IT_AntiWedgeLeft6, "AntiWedgeLeft6", 6, 10, 6);
578
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);
585
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);
596 }
597
598 // AntiWedgeRight6
599 {
600 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
601 m_types[IT_AntiWedgeRight6] = type;
602
603 type->setInfos(this, IT_AntiWedgeRight6, "AntiWedgeRight6", 6, 10, 6);
604
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);
611
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);
622 }
623
624 // DiTetra5
625 {
626 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
627 m_types[IT_DiTetra5] = type;
628
629 type->setInfos(this, IT_DiTetra5, "DiTetra5", 5, 9, 6);
630
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);
637
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);
647 }
648
649 // DualNode
650 {
651 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
652 m_types[IT_DualNode] = type;
653
654 type->setInfos(this, IT_DualNode, "DualNode", 1, 0, 0);
655 }
656 // DualEdge
657 {
658 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
659 m_types[IT_DualEdge] = type;
660
661 type->setInfos(this, IT_DualEdge, "DualEdge", 1, 0, 0);
662 }
663 // DualFace
664 {
665 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
666 m_types[IT_DualFace] = type;
667
668 type->setInfos(this, IT_DualFace, "DualFace", 1, 0, 0);
669 }
670 // DualCell
671 {
672 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
673 m_types[IT_DualCell] = type;
674
675 type->setInfos(this, IT_DualCell, "DualCell", 1, 0, 0);
676 }
677 // DualParticle
678 {
679 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
680 m_types[IT_DualParticle] = type;
681
682 type->setInfos(this, IT_DualParticle, "DualParticle", 1, 0, 0);
683 }
684 // Link
685 {
686 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
687 m_types[IT_Link] = type;
688
689 type->setInfos(this, IT_Link, "Link", 0, 0, 0);
690 }
691
692 // Enneedron14
693 {
694 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
695 m_types[IT_Enneedron14] = type;
696
697 type->setInfos(this, IT_Enneedron14, "IT_Enneedron14", 14, 21, 9);
698
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);
708
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);
730 }
731 // Decaedron16
732 {
733 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
734 m_types[IT_Decaedron16] = type;
735
736 type->setInfos(this, IT_Decaedron16, "IT_Decaedron16", 16, 24, 10);
737
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);
748
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);
773 }
774
775 // Heptagon7
776 {
777 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
778 m_types[IT_Heptagon7] = type;
779
780 type->setInfos(this, IT_Heptagon7, "Heptagon7", 7, 7, 7);
781
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);
789
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);
797 }
798
799 // Octogon8
800 {
801 ItemTypeInfoBuilder* type = m_types_buffer->allocOne();
802 m_types[IT_Octogon8] = type;
803
804 type->setInfos(this, IT_Octogon8, "Octogon8", 8, 8, 8);
805
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);
814
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);
823 }
824
825 { // Polygon & Polyhedron: generic item types
826 String arcane_item_type_file = platform::getEnvironmentVariable("ARCANE_ITEM_TYPE_FILE");
827 if (!arcane_item_type_file.null()) {
828 // verify the existence of item type file. if doesn't exist return an exception
829 readTypes(parallel_mng, arcane_item_type_file);
830 }
831 }
832
833 // Calcul les relations face->arêtes
834 // Cette opération doit être appelé en fin phase build
835 for (Integer i = 0; i < m_types.size(); ++i) {
836 ItemTypeInfoBuilder* type = static_cast<ItemTypeInfoBuilder*>(m_types[i]);
837 if (!type)
838 ARCANE_FATAL("ItemType '{0}' is not defined");
839 type->computeFaceEdgeInfos();
840 }
841}
842
843/*---------------------------------------------------------------------------*/
844/*---------------------------------------------------------------------------*/
845
847printTypes(std::ostream& ostr)
848{
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) {
853 ItemTypeInfo* type = m_types[i];
854 ostr << " - Type " << type->typeId()
855 << " Name: " << type->typeName()
856 << " Nodes: " << type->nbLocalNode()
857 << " Faces " << type->nbLocalFace() << '\n';
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);
863 }
864 ostr << "\n";
865 }
866 ostr << "\n";
867 }
868}
869
870/*---------------------------------------------------------------------------*/
871/*---------------------------------------------------------------------------*/
872/*!
873 * \brief Lecture d'un fichier de types voronoi.
874 *
875 * Une cellule voronoi est un polytope dont le nombre de faces et de noeuds
876 * varie d'une cellule a l'autre. Ici, le type de chaque cellule est lu dans
877 * un fichier de types associe a un maillage d'entree donne.
878 * Ce fichier est passe dans la variable d'environnement: ARCANE_ITEM_TYPE_FILE
879 * Ex: setenv ARCANE_ITEM_TYPE_FILE PATH_TO_FILE/item_file
880 * Le format du fichier est la suivante:
881 *
882 * nb_type
883 * type_id nb_faces nb_edges
884 * nb_node_face0 node0_face0 ... nodeN_face1
885 * . . .
886 * . . .
887 * . . .
888 * nb_node_faceN node0_faceN ... nodeN_faceN
889 *
890 * node0_edge0 node1_edge1 lefFace_edge0 rightFace_edge0
891 * .
892 * .
893 * .
894 * node0_edgeN node1_edge1 lefFace_edgeN rightFace_edgeN
895 */
896void ItemTypeMng::
897readTypes(IParallelSuperMng* pm, const String& filename)
898{
899 m_trace->info() << "Reading additional item types from file '" << filename << "'";
900
901 UniqueArray<Byte> bytes;
902 Integer size = 0;
903
904 // Lecture parallèle
905 if (pm->commRank() == 0) {
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");
909 std::ifstream ifile;
910 ifile.open(filename.localstr(), std::ios::binary);
911 if (ifile.fail())
912 throw IOException(A_FUNCINFO, "Cannot open ARCANE_ITEM_TYPE_FILE item type file");
913 bytes.resize(arcaneCheckArraySize(file_length + 1));
914 ifile.read((char*)bytes.data(), file_length);
915 bytes[(Integer)file_length] = '\0';
916 if (ifile.bad())
917 throw IOException(A_FUNCINFO, "Cannot read ARCANE_ITEM_TYPE_FILE item type file");
918 size = bytes.size();
919 }
920 {
921 IntegerArrayView bs(1, &size);
922 pm->broadcast(bs, 0);
923 }
924 bytes.resize(size);
925 if (size != 0) {
926 pm->broadcast(bytes, 0);
927 }
928 else { // CC: add ending '\0'
929 bytes.resize(1);
930 bytes[0] = '\0';
931 }
932
933 // Already built polygons (size => identifier)
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;
942 for (Integer i_type = 0; i_type < ItemTypeMng::nbBuiltInItemType(); ++i_type)
943 known_types.insert(i_type);
944
945 if (ItemTypeMng::nbBuiltInItemType() != m_types.size())
946 throw FatalErrorException(A_FUNCINFO, "Invalid initialization of built-in item types");
947
948 // Analyse du fichier de types
949 std::istringstream ifile((char*)bytes.unguardedBasePointer(), std::istringstream::in);
950 Integer nb_type;
951 ifile >> nb_type;
952
953 m_types.resize(ItemTypeMng::nbBuiltInItemType() + nb_type);
954 Integer typeId, nbN, nbE, nbF;
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));
960 typeId += ItemTypeMng::nbBuiltInItemType(); // translation d'indexation
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);
964 if (nbE == nbF) // 2d case nbN == nbE == nbF
965 {
966 nbN = nbE;
967 }
968 else
969 nbN = nbE - nbF + 2; // Calcul du nb de noeuds nbN a partir de nbE et nbF (formule d'Euler)
970
971 type->setInfos(this, typeId, String::format("Polyhedron{0}_{1}-{2}-{3}", typeId, nbN, nbE, nbF), nbN, nbE, nbF);
972 m_trace->debug(Trace::High) << "Adding " << type->typeName() << " type #"
973 << typeId - ItemTypeMng::nbBuiltInItemType() << " with " << nbN << " nodes, "
974 << nbE << " edges, " << nbF << " faces.";
975 m_types[typeId] = type;
976 for (Integer iface = 0; iface < nbF; ++iface) {
977 ifile >> nbN;
978 UniqueArray<Integer> nodeFace(nbN);
979 for (Integer inodeFace = 0; inodeFace < nbN; ++inodeFace) {
980 ifile >> nodeFace[inodeFace];
981 }
982 PolygonMapper::const_iterator finder = built_polygons.find(nbN);
983 Integer face_type;
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";
988 }
989 else {
990 ItemTypeInfoBuilder* type2 = m_types_buffer->allocOne();
991
992 face_type = m_types.size();
993 m_types.add(type2);
994 built_polygons[nbN] = face_type;
995
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);
999
1000 for (Integer j = 0; j < nbN; ++j)
1001 type2->addEdge(j, j, (j + 1) % nbN, (j - 1 + nbN) % nbN, (j + 1) % nbN);
1002 m_trace->debug(Trace::High) << "\tAdding new face type " << face_type
1003 << " for face " << iface << " with " << nbN << " nodes";
1004 }
1005 type->addFaceGeneric(iface, face_type, nodeFace);
1006 }
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);
1011 }
1012 }
1013
1014 m_trace->debug(Trace::High) << "Total number of types : " << m_types.size();
1015}
1016
1017/*---------------------------------------------------------------------------*/
1018/*---------------------------------------------------------------------------*/
1019
1022{
1023 return _singleton()->types().size();
1024}
1025
1028{
1029 return m_nb_builtin_item_type;
1030}
1031/*---------------------------------------------------------------------------*/
1032/*---------------------------------------------------------------------------*/
1033
1034//! AMR
1036nbHChildrenByItemType(Integer type)
1037{
1038 switch (type) {
1039 case IT_Line2:
1040 return 2;
1041 case IT_Triangle3:
1042 return 4;
1043 case IT_Quad4:
1044 return 4;
1045 case IT_Pentagon5:
1046 return 4;
1047 case IT_Hexagon6:
1048 return 4;
1049 case IT_Tetraedron4:
1050 return 8;
1051 case IT_Pyramid5:
1052 return 0;
1053 case IT_Pentaedron6:
1054 return 8;
1055 case IT_Hexaedron8:
1056 return 8;
1057 case IT_Heptaedron10:
1058 case IT_Octaedron12:
1059 case IT_HemiHexa7:
1060 case IT_HemiHexa6:
1061 case IT_HemiHexa5:
1062 case IT_AntiWedgeLeft6:
1063 case IT_AntiWedgeRight6:
1064 case IT_DiTetra5:
1065 return 0;
1066 default:
1067 ARCANE_FATAL("Not supported Item Type '{0}'", type);
1068 }
1069}
1070
1071/*---------------------------------------------------------------------------*/
1072/*---------------------------------------------------------------------------*/
1073
1074ItemTypeMng* ItemTypeMng::singleton_instance = 0;
1075
1076ItemTypeMng* ItemTypeMng::
1077_singleton()
1078{
1079 if (!singleton_instance)
1080 singleton_instance = new ItemTypeMng();
1081 return singleton_instance;
1082}
1083
1084void ItemTypeMng::
1085_destroySingleton()
1086{
1087 //GG: Ca plante avec Windows. Regarder pourquoi.
1088#ifndef ARCANE_OS_WIN32
1089 delete singleton_instance;
1090#endif
1091 singleton_instance = nullptr;
1092}
1093
1094/*---------------------------------------------------------------------------*/
1095/*---------------------------------------------------------------------------*/
1096
1098types() const
1099{
1100 ARCANE_ASSERT((m_initialized), ("Cannot use not built ItemTypeMng"));
1101 return m_types;
1102}
1103
1104/*---------------------------------------------------------------------------*/
1105/*---------------------------------------------------------------------------*/
1106
1108typeFromId(Integer id) const
1109{
1110 ARCANE_ASSERT((m_initialized), ("Cannot use not built ItemTypeMng"));
1111 return m_types[id];
1112}
1113
1114/*---------------------------------------------------------------------------*/
1115/*---------------------------------------------------------------------------*/
1116
1118typeFromId(ItemTypeId id) const
1119{
1120 ARCANE_ASSERT((m_initialized), ("Cannot use not built ItemTypeMng"));
1121 return m_types[id.typeId()];
1122}
1123
1124/*---------------------------------------------------------------------------*/
1125/*---------------------------------------------------------------------------*/
1126
1128typeName(Integer id) const
1129{
1130 return typeFromId(id)->typeName();
1131}
1132
1133/*---------------------------------------------------------------------------*/
1134/*---------------------------------------------------------------------------*/
1135
1137typeName(ItemTypeId id) const
1138{
1139 return typeFromId(id)->typeName();
1140}
1141
1142/*---------------------------------------------------------------------------*/
1143/*---------------------------------------------------------------------------*/
1144// Recopie de la fonction obsolète Item::typeName().
1145// TODO: voir pourquoi il y a un test sur nBasicItemType().
1146String ItemTypeMng::
1147_legacyTypeName(Integer t)
1148{
1149 if (t >= 0 && t < nbBasicItemType())
1150 return _singleton()->typeFromId(t)->typeName();
1151 return "InvalidType";
1152}
1153
1154/*---------------------------------------------------------------------------*/
1155/*---------------------------------------------------------------------------*/
1156
1158{
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;
1162 }
1163 return has_general_cells;
1164}
1165
1166/*---------------------------------------------------------------------------*/
1167/*---------------------------------------------------------------------------*/
1168
1170{
1171 ARCANE_ASSERT(mesh, ("Trying to indicate a null mesh contains general cells."));
1172 m_mesh_with_general_cells.insert(mesh);
1173}
1174
1175/*---------------------------------------------------------------------------*/
1176/*---------------------------------------------------------------------------*/
1177
1178} // End namespace Arcane
1179
1180/*---------------------------------------------------------------------------*/
1181/*---------------------------------------------------------------------------*/
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
Exception lorsqu'une erreur d'entrée/sortie est détectée.
Definition IOException.h:32
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).
Definition ItemTypeId.h:32
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.
Definition ItemTypeMng.h:66
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.
Definition String.cc:227
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.
Definition UtilsTypes.h:615
Int32 Integer
Type représentant un entier.