MEDiterators.c
Aller à la documentation de ce fichier.
/* This file is part of MED.
*
* COPYRIGHT (C) 1999 - 2020 EDF R&D, CEA/DEN
* MED is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* MED is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with MED. If not, see <http://www.gnu.org/licenses/>.
*/
#include <med.h>
#include <med_config.h>
#include <string.h>
/*L'itération sur les */
med_entity_type MED_GET_ENTITY_TYPE[MED_N_ENTITY_TYPES+2]={
MED_UNDEF_ENTITY_TYPE,
MED_CELL,
MED_DESCENDING_FACE,
MED_DESCENDING_EDGE,
MED_NODE,
MED_NODE_ELEMENT,
MED_STRUCT_ELEMENT,
MED_UNDEF_ENTITY_TYPE
};
const char * const MED_GET_ENTITY_TYPENAME[MED_N_ENTITY_TYPES+2]={
"MED_UNDEF_ENTITY_TYPE",
"MED_CELL",
"MED_DESCENDING_FACE",
"MED_DESCENDING_EDGE",
"MED_NODE",
"MED_NODE_ELEMENT",
"MED_STRUCT_ELEMENT",
"MED_UNDEF_ENTITY_TYPE"
};
/* MED_N_CELL_FIXED_GEO ne prend pas en compte (MED_NODE,MED_NO_GEOTYPE)
sinon il faudrait ajouter un MED_NO_GEOTYPE supplémentaire avant POINT1
mais les NOEUDS ne sont pas des mailles et le MED_N_NODE_FIXED_GEO ==1 n'est
pas comptabilisé dans MED_N_CELL_FIXED_GEO.
Pour le codage interne Nbits itératif des types géométrique de MED_ALL_ENTITY_TYPE ,
il faut commencer à _it==0 contrairement aux autres type d'entités.
*/
med_geometry_type MED_GET_CELL_GEOMETRY_TYPE[MED_N_CELL_FIXED_GEO+2]={
MED_NO_GEOTYPE,
MED_POINT1,
MED_SEG2,
MED_SEG3,
MED_SEG4,
MED_TRIA3,
MED_QUAD4,
MED_TRIA6,
MED_TRIA7,
MED_QUAD8,
MED_QUAD9,
MED_TETRA4,
MED_PYRA5,
MED_PENTA6,
MED_HEXA8,
MED_TETRA10,
MED_OCTA12,
MED_PYRA13,
MED_PENTA15,
MED_PENTA18,
MED_HEXA20,
MED_HEXA27,
MED_POLYGON,
MED_POLYGON2,
MED_POLYHEDRON,
MED_NO_GEOTYPE
};
const char * const MED_GET_CELL_GEOMETRY_TYPENAME[MED_N_CELL_FIXED_GEO+2]={
"MED_NO_GEOTYPE",
"MED_POINT1",
"MED_SEG2",
"MED_SEG3",
"MED_SEG4",
"MED_TRIA3",
"MED_QUAD4",
"MED_TRIA6",
"MED_TRIA7",
"MED_QUAD8",
"MED_QUAD9",
"MED_TETRA4",
"MED_PYRA5",
"MED_PENTA6",
"MED_HEXA8",
"MED_TETRA10",
"MED_OCTA12",
"MED_PYRA13",
"MED_PENTA15",
"MED_PENTA18",
"MED_HEXA20",
"MED_HEXA27",
"MED_POLYGON",
"MED_POLYGON2",
"MED_POLYHEDRON",
"MED_NO_GEOTYPE"
};
med_geometry_type MED_GET_FACE_GEOMETRY_TYPE[MED_N_FACE_FIXED_GEO+2]={
MED_NO_GEOTYPE,
MED_TRIA3,
MED_QUAD4,
MED_TRIA6,
MED_TRIA7,
MED_QUAD8,
MED_QUAD9,
MED_POLYGON,
MED_POLYGON2,
MED_NO_GEOTYPE
};
const char * const MED_GET_FACE_GEOMETRY_TYPENAME[MED_N_FACE_FIXED_GEO+2]={
"MED_NO_GEOTYPE",
"MED_TRIA3",
"MED_QUAD4",
"MED_TRIA6",
"MED_TRIA7",
"MED_QUAD8",
"MED_QUAD9",
"MED_POLYGON",
"MED_POLYGON2",
"MED_NO_GEOTYPE"
};
med_geometry_type MED_GET_EDGE_GEOMETRY_TYPE[MED_N_EDGE_FIXED_GEO+2]={
MED_NO_GEOTYPE,
MED_SEG2,
MED_SEG3,
MED_SEG4,
MED_NO_GEOTYPE
};
const char * MED_GET_EDGE_GEOMETRY_TYPENAME[MED_N_EDGE_FIXED_GEO+2]={
"MED_NO_GEOTYPE",
"MED_SEG2",
"MED_SEG3",
"MED_SEG4",
"MED_NO_GEOTYPE"
};
med_geometry_type MED_GET_NODE_GEOMETRY_TYPE[MED_N_NODE_FIXED_GEO+2]={
MED_NO_GEOTYPE,
MED_NO_GEOTYPE,
MED_NO_GEOTYPE
};
const char * MED_GET_NODE_GEOMETRY_TYPENAME[MED_N_NODE_FIXED_GEO+2]={
"MED_NO_GEOTYPE",
"MED_NO_GEOTYPE",
"MED_NO_GEOTYPE"
};
/* A renommer en MED_GET_GEOMETRY_TYPE_FROM_ENTITY_TYPE */
/* cf. define dans med.h.in */
const med_geometry_type * const MED_GET_CELL_GEOMETRY_TYPE_FROM_ENTITY_TYPE[MED_N_ENTITY_TYPES+2]={
MED_NULL,
MED_GET_CELL_GEOMETRY_TYPE,
MED_GET_FACE_GEOMETRY_TYPE,
MED_GET_EDGE_GEOMETRY_TYPE,
MED_GET_NODE_GEOMETRY_TYPE,
MED_GET_CELL_GEOMETRY_TYPE, /*Les éléments aux noeuds ont les mêmes types géométriques que les CELL*/
MED_NULL, /*pas de type géométrique prédéfini (statique) pour les éléments de structure */
MED_NULL
};
const int MED_GET_N_FIXED_GEO_FOR_ENTITY_TYPE_IT[MED_N_ENTITY_TYPES+2]={
0,
MED_N_CELL_FIXED_GEO,
MED_N_FACE_FIXED_GEO,
MED_N_EDGE_FIXED_GEO,
MED_N_NODE_FIXED_GEO,
MED_N_CELL_FIXED_GEO, /*Les éléments aux noeuds ont les mêmes types géométriques que les CELL*/
0, /*pas de type géométrique prédéfini (statique) pour les éléments de structure */
0
};
int MEDgetEntityTypeIt(med_entity_type entitytype) {
switch( entitytype ) {
case MED_UNDEF_ENTITY_TYPE : return 0; break;
case MED_CELL : return 1; break;
case MED_DESCENDING_FACE : return 2; break;
case MED_DESCENDING_EDGE : return 3; break;
case MED_NODE : return 4; break;
case MED_NODE_ELEMENT : return 5; break;
case MED_STRUCT_ELEMENT : return 6; break;
/* case MED_UNDEF_ENTITY_TYPE : return 7; break; */
}
};
int MEDgetCellGeometryTypeIt(med_geometry_type geotype) {
switch( geotype ) {
case MED_NO_GEOTYPE : return 0; break;
case MED_POINT1 : return 1; break;
case MED_SEG2 : return 2; break;
case MED_SEG3 : return 3; break;
case MED_SEG4 : return 4; break;
case MED_TRIA3 : return 5; break;
case MED_QUAD4 : return 6; break;
case MED_TRIA6 : return 7; break;
case MED_TRIA7 : return 8; break;
case MED_QUAD8 : return 9; break;
case MED_QUAD9 : return 10; break;
case MED_TETRA4 : return 11; break;
case MED_PYRA5 : return 12; break;
case MED_PENTA6 : return 13; break;
case MED_HEXA8 : return 14; break;
case MED_TETRA10 : return 15; break;
case MED_OCTA12 : return 16; break;
case MED_PYRA13 : return 17; break;
case MED_PENTA15 : return 18; break;
case MED_PENTA18 : return 19; break;
case MED_HEXA20 : return 20; break;
case MED_HEXA27 : return 21; break;
case MED_POLYGON : return 22; break;
case MED_POLYGON2 : return 23; break;
case MED_POLYHEDRON : return 24; break;
/* case MED_NO_GEOTYPE : return 25; break; */
}
};
int MEDgetFaceGeometryTypeIt(med_geometry_type geotype) {
switch( geotype ) {
case MED_NO_GEOTYPE : return 0; break;
case MED_TRIA3 : return 1; break;
case MED_QUAD4 : return 2; break;
case MED_TRIA6 : return 3; break;
case MED_TRIA7 : return 4; break;
case MED_QUAD8 : return 5; break;
case MED_QUAD9 : return 6; break;
case MED_POLYGON : return 7; break;
case MED_POLYGON2 : return 8; break;
/* case MED_NO_GEOTYPE : return 9; break; */
}
};
int MEDgetEdgeGeometryTypeIt(med_geometry_type geotype) {
switch( geotype ) {
case MED_NO_GEOTYPE : return 0; break;
case MED_SEG2 : return 1; break;
case MED_SEG3 : return 2; break;
case MED_SEG4 : return 3; break;
}
};
int MEDgetNodeGeometryTypeIt(med_geometry_type geotype) {
switch( geotype ) {
case MED_NO_GEOTYPE : return 1; break;
}
};
int MEDgetEntityGeometryTypeIt(med_entity_type entitytype, med_geometry_type geotype) {
switch( entitytype ) {
case MED_UNDEF_ENTITY_TYPE : return 0; break;
case MED_CELL : return MEDgetCellGeometryTypeIt(geotype); break;
case MED_DESCENDING_FACE : return MEDgetFaceGeometryTypeIt(geotype); break;
case MED_DESCENDING_EDGE : return MEDgetEdgeGeometryTypeIt(geotype); break;
case MED_NODE : return MEDgetNodeGeometryTypeIt(geotype); break;
case MED_NODE_ELEMENT : return MEDgetCellGeometryTypeIt(geotype); break;
case MED_STRUCT_ELEMENT : return geotype%MED_STRUCT_GEO_INTERNAL ; break;
}
};
const char * const MEDgetEntityTypeName(med_entity_type entitytype) {
switch( entitytype ) {
case MED_UNDEF_ENTITY_TYPE : return "MED_UNDEF_ENTITY_TYPE"; break;
case MED_CELL : return "MED_CELL" ; break;
case MED_DESCENDING_FACE : return "MED_DESCENDING_FACE" ; break;
case MED_DESCENDING_EDGE : return "MED_DESCENDING_EDGE" ; break;
case MED_NODE : return "MED_NODE" ; break;
case MED_NODE_ELEMENT : return "MED_NODE_ELEMENT" ; break;
case MED_STRUCT_ELEMENT : return "MED_STRUCT_ELEMENT" ; break;
}
}
const char * const MEDgetGeometryTypeName(med_geometry_type geotype) {
switch( geotype ) {
case MED_NO_GEOTYPE : return "MED_NO_GEOTYPE"; break;
case MED_POINT1 : return "MED_POINT1" ; break;
case MED_SEG2 : return "MED_SEG2" ; break;
case MED_SEG3 : return "MED_SEG3" ; break;
case MED_SEG4 : return "MED_SEG4" ; break;
case MED_TRIA3 : return "MED_TRIA3" ; break;
case MED_QUAD4 : return "MED_QUAD4" ; break;
case MED_TRIA6 : return "MED_TRIA6" ; break;
case MED_TRIA7 : return "MED_TRIA7" ; break;
case MED_QUAD8 : return "MED_QUAD8" ; break;
case MED_QUAD9 : return "MED_QUAD9" ; break;
case MED_TETRA4 : return "MED_TETRA4" ; break;
case MED_PYRA5 : return "MED_PYRA5" ; break;
case MED_PENTA6 : return "MED_PENTA6" ; break;
case MED_HEXA8 : return "MED_HEXA8" ; break;
case MED_TETRA10 : return "MED_TETRA10" ; break;
case MED_OCTA12 : return "MED_OCTA12" ; break;
case MED_PYRA13 : return "MED_PYRA13" ; break;
case MED_PENTA15 : return "MED_PENTA15" ; break;
case MED_PENTA18 : return "MED_PENTA18" ; break;
case MED_HEXA20 : return "MED_HEXA20" ; break;
case MED_HEXA27 : return "MED_HEXA27" ; break;
case MED_POLYGON : return "MED_POLYGON" ; break;
case MED_POLYGON2 : return "MED_POLYGON2" ; break;
case MED_POLYHEDRON : return "MED_POLYHEDRON"; break;
default :
return "MED_UNKNOWN_GEOTYPE";
break;
}
};
MEDgetGeometryTypeName
const char *const MEDgetGeometryTypeName(med_geometry_type geotype)
Definition MEDiterators.c:296
MED_GET_CELL_GEOMETRY_TYPE_FROM_ENTITY_TYPE
const med_geometry_type *const MED_GET_CELL_GEOMETRY_TYPE_FROM_ENTITY_TYPE[MED_N_ENTITY_TYPES+2]
Definition MEDiterators.c:171
MED_GET_N_FIXED_GEO_FOR_ENTITY_TYPE_IT
const int MED_GET_N_FIXED_GEO_FOR_ENTITY_TYPE_IT[MED_N_ENTITY_TYPES+2]
Definition MEDiterators.c:182
MEDgetNodeGeometryTypeIt
int MEDgetNodeGeometryTypeIt(med_geometry_type geotype)
Definition MEDiterators.c:266
MEDgetFaceGeometryTypeIt
int MEDgetFaceGeometryTypeIt(med_geometry_type geotype)
Definition MEDiterators.c:242
MED_GET_CELL_GEOMETRY_TYPE
med_geometry_type MED_GET_CELL_GEOMETRY_TYPE[MED_N_CELL_FIXED_GEO+2]
Definition MEDiterators.c:55
MEDgetCellGeometryTypeIt
int MEDgetCellGeometryTypeIt(med_geometry_type geotype)
Definition MEDiterators.c:210
MEDgetEntityGeometryTypeIt
int MEDgetEntityGeometryTypeIt(med_entity_type entitytype, med_geometry_type geotype)
Definition MEDiterators.c:272
MEDgetEntityTypeName
const char *const MEDgetEntityTypeName(med_entity_type entitytype)
Definition MEDiterators.c:284
MED_GET_NODE_GEOMETRY_TYPENAME
const char * MED_GET_NODE_GEOMETRY_TYPENAME[MED_N_NODE_FIXED_GEO+2]
Definition MEDiterators.c:162
MED_GET_EDGE_GEOMETRY_TYPE
med_geometry_type MED_GET_EDGE_GEOMETRY_TYPE[MED_N_EDGE_FIXED_GEO+2]
Definition MEDiterators.c:140
MEDgetEdgeGeometryTypeIt
int MEDgetEdgeGeometryTypeIt(med_geometry_type geotype)
Definition MEDiterators.c:257
MED_GET_NODE_GEOMETRY_TYPE
med_geometry_type MED_GET_NODE_GEOMETRY_TYPE[MED_N_NODE_FIXED_GEO+2]
Definition MEDiterators.c:156
MED_GET_ENTITY_TYPE
med_entity_type MED_GET_ENTITY_TYPE[MED_N_ENTITY_TYPES+2]
Definition MEDiterators.c:25
MED_GET_FACE_GEOMETRY_TYPENAME
const char *const MED_GET_FACE_GEOMETRY_TYPENAME[MED_N_FACE_FIXED_GEO+2]
Definition MEDiterators.c:127
MEDgetEntityTypeIt
int MEDgetEntityTypeIt(med_entity_type entitytype)
Definition MEDiterators.c:196
MED_GET_EDGE_GEOMETRY_TYPENAME
const char * MED_GET_EDGE_GEOMETRY_TYPENAME[MED_N_EDGE_FIXED_GEO+2]
Definition MEDiterators.c:148
MED_GET_ENTITY_TYPENAME
const char *const MED_GET_ENTITY_TYPENAME[MED_N_ENTITY_TYPES+2]
Definition MEDiterators.c:36
MED_GET_CELL_GEOMETRY_TYPENAME
const char *const MED_GET_CELL_GEOMETRY_TYPENAME[MED_N_CELL_FIXED_GEO+2]
Definition MEDiterators.c:84
MED_GET_FACE_GEOMETRY_TYPE
med_geometry_type MED_GET_FACE_GEOMETRY_TYPE[MED_N_FACE_FIXED_GEO+2]
Definition MEDiterators.c:114
med_geometry_type
int med_geometry_type
Definition build.python3.12/include/med.h:194
MED_OCTA12
#define MED_OCTA12
Definition build.python3.12/include/med.h:215
MED_SEG4
#define MED_SEG4
Definition build.python3.12/include/med.h:202
MED_TRIA7
#define MED_TRIA7
Definition build.python3.12/include/med.h:206
MED_QUAD4
#define MED_QUAD4
Definition build.python3.12/include/med.h:204
MED_SEG2
#define MED_SEG2
Definition build.python3.12/include/med.h:200
MED_TRIA3
#define MED_TRIA3
Definition build.python3.12/include/med.h:203
MED_NULL
#define MED_NULL
Definition build.python3.12/include/med.h:75
MED_TETRA10
#define MED_TETRA10
Definition build.python3.12/include/med.h:214
MED_PENTA15
#define MED_PENTA15
Definition build.python3.12/include/med.h:217
MED_POLYGON2
#define MED_POLYGON2
Definition build.python3.12/include/med.h:224
MED_TRIA6
#define MED_TRIA6
Definition build.python3.12/include/med.h:205
MED_POLYGON
#define MED_POLYGON
Definition build.python3.12/include/med.h:223
MED_NO_GEOTYPE
#define MED_NO_GEOTYPE
Definition build.python3.12/include/med.h:232
MED_TETRA4
#define MED_TETRA4
Definition build.python3.12/include/med.h:210
MED_N_NODE_FIXED_GEO
#define MED_N_NODE_FIXED_GEO
Definition build.python3.12/include/med.h:251
MED_N_ENTITY_TYPES
#define MED_N_ENTITY_TYPES
Definition build.python3.12/include/med.h:146
med_entity_type
med_entity_type
Definition build.python3.12/include/med.h:143
MED_NODE
@ MED_NODE
Definition build.python3.12/include/med.h:143
MED_UNDEF_ENTITY_TYPE
@ MED_UNDEF_ENTITY_TYPE
Definition build.python3.12/include/med.h:145
MED_CELL
@ MED_CELL
Definition build.python3.12/include/med.h:143
MED_NODE_ELEMENT
@ MED_NODE_ELEMENT
Definition build.python3.12/include/med.h:144
MED_DESCENDING_FACE
@ MED_DESCENDING_FACE
Definition build.python3.12/include/med.h:143
MED_STRUCT_ELEMENT
@ MED_STRUCT_ELEMENT
Definition build.python3.12/include/med.h:144
MED_DESCENDING_EDGE
@ MED_DESCENDING_EDGE
Definition build.python3.12/include/med.h:143
MED_POINT1
#define MED_POINT1
Definition build.python3.12/include/med.h:198
MED_N_FACE_FIXED_GEO
#define MED_N_FACE_FIXED_GEO
Definition build.python3.12/include/med.h:243
MED_HEXA8
#define MED_HEXA8
Definition build.python3.12/include/med.h:213
MED_PENTA6
#define MED_PENTA6
Definition build.python3.12/include/med.h:212
MED_PENTA18
#define MED_PENTA18
Definition build.python3.12/include/med.h:218
MED_N_EDGE_FIXED_GEO
#define MED_N_EDGE_FIXED_GEO
Definition build.python3.12/include/med.h:247
MED_SEG3
#define MED_SEG3
Definition build.python3.12/include/med.h:201
MED_N_CELL_FIXED_GEO
#define MED_N_CELL_FIXED_GEO
Definition build.python3.12/include/med.h:239
MED_QUAD8
#define MED_QUAD8
Definition build.python3.12/include/med.h:207
MED_HEXA20
#define MED_HEXA20
Definition build.python3.12/include/med.h:219
MED_PYRA13
#define MED_PYRA13
Definition build.python3.12/include/med.h:216
MED_STRUCT_GEO_INTERNAL
#define MED_STRUCT_GEO_INTERNAL
Definition build.python3.12/include/med.h:228
MED_POLYHEDRON
#define MED_POLYHEDRON
Definition build.python3.12/include/med.h:225
MED_HEXA27
#define MED_HEXA27
Definition build.python3.12/include/med.h:220
MED_PYRA5
#define MED_PYRA5
Definition build.python3.12/include/med.h:211
MED_QUAD9
#define MED_QUAD9
Definition build.python3.12/include/med.h:208