136 bool is_non_manifold =
false;
138 is_non_manifold =
mesh->meshKind().isNonManifold();
149 type->setInfos(
this, IT_NullType,
"NullType", Dimension::DimUnknown, 0, 0, 0);
157 type->setInfos(
this, IT_Vertex,
"Vertex", Dimension::Dim0, 0, 0, 0);
168 type->setInfos(
this, IT_FaceVertex,
"FaceVertex", Dimension::Dim0, 1, 0, 0);
169 type->setIsValidForCell(
false);
177 type->setInfos(
this, IT_Line2,
"Line2", Dimension::Dim1, 2, 0, 0);
178 type->setIsValidForCell(
true);
187 type->setInfos(
this, IT_Line3,
"Line3", Dimension::Dim1, 3, 0, 0);
188 type->setIsValidForCell(
false);
196 type->setInfos(
this, IT_CellLine2,
"CellLine2", Dimension::Dim1, 2, 0, 2);
214 type->setInfos(
this, IT_Triangle3,
"Triangle3", Dimension::Dim2, 3, 3, 3);
227 type->setInfos(
this, IT_Triangle6,
"Triangle6", Dimension::Dim2, 6, 3, 3);
244 type->setInfos(
this, IT_Quad4,
"Quad4", Dimension::Dim2, 4, 4, 4);
258 type->setInfos(
this, IT_Quad8,
"Quad8", Dimension::Dim2, 8, 4, 4);
277 type->setInfos(
this, IT_Pentagon5,
"Pentagon5", Dimension::Dim2, 5, 5, 5);
297 type->setInfos(
this, IT_Hexagon6,
"Hexagon6", Dimension::Dim2, 6, 6, 6);
319 type->setInfos(
this, IT_Hexaedron8,
"Hexaedron8", Dimension::Dim3, 8, 12, 6);
346 m_types[IT_Hexaedron20] = type;
348 type->setInfos(
this, IT_Hexaedron20,
"Hexaedron20", Dimension::Dim3, 20, 12, 6);
377 type->setInfos(
this, IT_Pyramid5,
"Pyramid5", Dimension::Dim3, 5, 8, 5);
398 m_types[IT_Pentaedron6] = type;
400 type->setInfos(
this, IT_Pentaedron6,
"Pentaedron6", Dimension::Dim3, 6, 9, 5);
422 m_types[IT_Tetraedron4] = type;
424 type->setInfos(
this, IT_Tetraedron4,
"Tetraedron4", Dimension::Dim3, 4, 6, 4);
443 m_types[IT_Tetraedron10] = type;
445 type->setInfos(
this, IT_Tetraedron10,
"Tetraedron10", Dimension::Dim3, 10, 6, 4);
464 m_types[IT_Heptaedron10] = type;
466 type->setInfos(
this, IT_Heptaedron10,
"Heptaedron10", Dimension::Dim3, 10, 15, 7);
496 m_types[IT_Octaedron12] = type;
498 type->setInfos(
this, IT_Octaedron12,
"Octaedron12", Dimension::Dim3, 12, 18, 8);
519 type->
addEdge(10, 10, 11, 1, 6);
520 type->
addEdge(11, 11, 6, 1, 7);
525 type->
addEdge(16, 4, 10, 5, 6);
526 type->
addEdge(17, 5, 11, 6, 7);
534 type->setInfos(
this, IT_HemiHexa7,
"HemiHexa7", Dimension::Dim3, 7, 11, 6);
561 type->setInfos(
this, IT_HemiHexa6,
"HemiHexa6", Dimension::Dim3, 6, 10, 6);
587 type->setInfos(
this, IT_HemiHexa5,
"HemiHexa5", Dimension::Dim3, 5, 7, 4);
606 m_types[IT_AntiWedgeLeft6] = type;
608 type->setInfos(
this, IT_AntiWedgeLeft6,
"AntiWedgeLeft6", Dimension::Dim3, 6, 10, 6);
632 m_types[IT_AntiWedgeRight6] = type;
634 type->setInfos(
this, IT_AntiWedgeRight6,
"AntiWedgeRight6", Dimension::Dim3, 6, 10, 6);
660 type->setInfos(
this, IT_DiTetra5,
"DiTetra5", Dimension::Dim3, 5, 9, 6);
685 type->setInfos(
this, IT_DualNode,
"DualNode", 1, 0, 0);
692 type->setInfos(
this, IT_DualEdge,
"DualEdge", 1, 0, 0);
699 type->setInfos(
this, IT_DualFace,
"DualFace", 1, 0, 0);
706 type->setInfos(
this, IT_DualCell,
"DualCell", 1, 0, 0);
711 m_types[IT_DualParticle] = type;
713 type->setInfos(
this, IT_DualParticle,
"DualParticle", 1, 0, 0);
720 type->setInfos(
this, IT_Link,
"Link", 0, 0, 0);
726 m_types[IT_Enneedron14] = type;
728 type->setInfos(
this, IT_Enneedron14,
"Enneedron14", Dimension::Dim3, 14, 21, 9);
750 type->
addEdge(10, 10, 11, 1, 5);
751 type->
addEdge(11, 11, 12, 1, 6);
752 type->
addEdge(12, 12, 13, 1, 7);
753 type->
addEdge(13, 13, 7, 1, 8);
757 type->
addEdge(17, 3, 10, 3, 4);
758 type->
addEdge(18, 4, 11, 4, 5);
759 type->
addEdge(19, 5, 12, 5, 6);
760 type->
addEdge(20, 6, 13, 6, 7);
765 m_types[IT_Decaedron16] = type;
767 type->setInfos(
this, IT_Decaedron16,
"Decaedron16", Dimension::Dim3, 16, 24, 10);
790 type->
addEdge(10, 10, 11, 1, 4);
791 type->
addEdge(11, 11, 12, 1, 5);
792 type->
addEdge(12, 12, 13, 1, 6);
793 type->
addEdge(13, 13, 14, 1, 7);
794 type->
addEdge(14, 14, 15, 1, 8);
795 type->
addEdge(15, 15, 8, 1, 9);
798 type->
addEdge(18, 2, 10, 3, 4);
799 type->
addEdge(19, 3, 11, 4, 5);
800 type->
addEdge(20, 4, 12, 5, 6);
801 type->
addEdge(21, 5, 13, 6, 7);
802 type->
addEdge(22, 6, 14, 7, 8);
803 type->
addEdge(23, 7, 15, 8, 9);
811 type->setInfos(
this, IT_Heptagon7,
"Heptagon7", Dimension::Dim2, 7, 7, 7);
827 type->setInfos(
this, IT_Octogon8,
"Octogon8", Dimension::Dim2, 8, 8, 8);
842 m_types[IT_Cell3D_Line2] = type;
844 type->setInfos(
this, IT_Cell3D_Line2,
"Cell3D_Line2", Dimension::Dim1, 2, 0, 0);
850 m_types[IT_Cell3D_Triangle3] = type;
854 std::swap(nb_face, nb_edge);
856 type->setInfos(
this, IT_Cell3D_Triangle3,
"Cell3D_Triangle3", Dimension::Dim2, 3, nb_edge, nb_face);
858 if (is_non_manifold) {
873 m_types[IT_Cell3D_Quad4] = type;
877 std::swap(nb_face, nb_edge);
879 type->setInfos(
this, IT_Cell3D_Quad4,
"Cell3D_Quad4", Dimension::Dim2, 4, nb_edge, nb_face);
880 if (is_non_manifold) {
896 if (!arcane_item_type_file.
null()) {
898 _readTypes(parallel_mng, arcane_item_type_file);
905 ItemTypeInfoBuilder* type =
static_cast<ItemTypeInfoBuilder*
>(
m_types[i]);
968 m_trace->info() <<
"Reading additional item types from file '" << filename <<
"'";
976 if (file_length == 0)
977 throw IOException(A_FUNCINFO,
"ARCANE_ITEM_TYPE_FILE is an empty file");
979 ifile.open(filename.
localstr(), std::ios::binary);
981 throw IOException(A_FUNCINFO,
"Cannot open ARCANE_ITEM_TYPE_FILE item type file");
983 ifile.read((
char*)bytes.
data(), file_length);
984 bytes[(
Integer)file_length] =
'\0';
986 throw IOException(A_FUNCINFO,
"Cannot read ARCANE_ITEM_TYPE_FILE item type file");
1003 typedef std::map<Integer, Integer> PolygonMapper;
1004 PolygonMapper built_polygons;
1005 built_polygons[3] = IT_Triangle3;
1006 built_polygons[4] = IT_Quad4;
1007 built_polygons[5] = IT_Pentagon5;
1008 built_polygons[6] = IT_Hexagon6;
1009 typedef std::set<Integer> KnownTypes;
1010 KnownTypes known_types;
1012 known_types.insert(i_type);
1023 Int16 typeId = -1, nbN = 0, nbE = 0, nbF = 0;
1024 for (
Integer i = 0; i < nb_type; ++i) {
1026 ifile >> typeId >> nbF >> nbE;
1027 if (typeId >= nb_type || typeId < 0)
1028 throw IOException(A_FUNCINFO, String::format(
"Polyhedron reader cannot allow typeId {0}", typeId));
1030 if (known_types.find(typeId) != known_types.end())
1031 throw FatalErrorException(A_FUNCINFO, String::format(
"Already existing typeId {0}", typeId));
1032 known_types.insert(typeId);
1038 nbN = nbE - nbF + 2;
1040 type->setInfos(
this, typeId, String::format(
"Polyhedron{0}_{1}-{2}-{3}", typeId, nbN, nbE, nbF), nbN, nbE, nbF);
1043 << nbE <<
" edges, " << nbF <<
" faces.";
1045 for (
Integer iface = 0; iface < nbF; ++iface) {
1048 for (
Integer inodeFace = 0; inodeFace < nbN; ++inodeFace) {
1049 ifile >> nodeFace[inodeFace];
1051 PolygonMapper::const_iterator finder = built_polygons.find(nbN);
1052 Int16 face_type = IT_NullType;
1053 if (finder != built_polygons.end()) {
1054 face_type = finder->second;
1056 <<
" for face " << iface <<
" with " << nbN <<
" nodes";
1063 built_polygons[nbN] = face_type;
1065 type2->setInfos(
this, face_type, String::format(
"Polygon{0}", nbN), nbN, nbN, nbN);
1066 for (
Integer j = 0; j < nbN; ++j)
1069 for (
Integer j = 0; j < nbN; ++j)
1070 type2->
addEdge(j, j, (j + 1) % nbN, (j - 1 + nbN) % nbN, (j + 1) % nbN);
1072 <<
" for face " << iface <<
" with " << nbN <<
" nodes";
1076 Integer node0, node1, leftFace, rightFace;
1077 for (
Integer iedge = 0; iedge < nbE; ++iedge) {
1078 ifile >> node0 >> node1 >> leftFace >> rightFace;
1079 type->
addEdge(iedge, node0, node1, leftFace, rightFace);