Back to index

salome-med  6.5.0
MEDMEM_define.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 #ifndef DEFINE_HXX
00024 #define DEFINE_HXX
00025 
00026 #include <stdio.h>
00027 #include <iostream>
00028 #include <string>
00029 #include <assert.h>
00030 
00031 // UTILE AUX DEUX NAMESPACES
00032 #include <hdf5.h>
00033 
00034 namespace med_2_3 {
00035   extern "C" { 
00036     #include <med.h>
00037         med_err MEDfieldComputingStepInfo(const med_idt fid,
00038                                     const char * const fieldname,
00039                                     const int csit,
00040                                     med_int * const numdt,
00041                                     med_int * const numit,
00042                                     med_float * const dt);
00043   
00044   med_err MEDmeshEntityFamilyNumberRd(const med_idt               fid,
00045                                       const char*  const          meshname,
00046                                       const med_int               numdt,
00047                                       const med_int               numit,
00048                                       const med_entity_type       entitype,
00049                                       const med_geometry_type     geotype,
00050                                       med_int * const             number);
00051 
00052   med_err MEDmeshEntityNumberRd(const med_idt               fid,
00053                                 const char*  const          meshname,
00054                                 const med_int               numdt,
00055                                 const med_int               numit,
00056                                 const med_entity_type       entitype,
00057                                 const med_geometry_type     geotype,
00058                                 med_int * const             number);
00059 
00060   med_err MEDfieldCr( const med_idt fid,
00061                       const char * const fieldname,
00062                       const med_field_type fieldtype,
00063                       const med_int nbofcomponent,
00064                       const char * const componentname,
00065                       const char * const componentunit,
00066                       const char * const dtunit,
00067                       const char * const meshname);
00068   }
00069 }
00070 
00071 namespace MED_EN {
00072   extern "C" { // on est la
00073 
00074 // #define MED_NULL       (void *) NULL
00075 // #define MED_MAX_PARA     20
00076 
00077 // #define MED_TAILLE_DESC 200
00078 // #define MED_TAILLE_IDENT  8
00079 // #define MED_TAILLE_NOM   32
00080 // #define MED_TAILLE_LNOM  80
00081 // #define MED_TAILLE_PNOM   8
00082 
00083 #ifdef MED_NONE
00084 #undef MED_NONE
00085 #endif
00086 #ifdef MED_POINT1
00087 #undef MED_POINT1
00088 #endif
00089 #ifdef MED_SEG2
00090 #undef MED_SEG2
00091 #endif
00092 #ifdef MED_SEG3
00093 #undef MED_SEG3
00094 #endif
00095 #ifdef MED_TRIA3
00096 #undef MED_TRIA3
00097 #endif
00098 #ifdef MED_QUAD4
00099 #undef MED_QUAD4
00100 #endif
00101 #ifdef MED_TRIA6
00102 #undef MED_TRIA6
00103 #endif
00104 #ifdef MED_QUAD8
00105 #undef MED_QUAD8
00106 #endif
00107 #ifdef MED_TETRA4
00108 #undef MED_TETRA4
00109 #endif
00110 #ifdef MED_PYRA5
00111 #undef MED_PYRA5
00112 #endif
00113 #ifdef MED_PENTA6
00114 #undef MED_PENTA6
00115 #endif
00116 #ifdef MED_HEXA8
00117 #undef MED_HEXA8
00118 #endif
00119 #ifdef MED_TETRA10
00120 #undef MED_TETRA10
00121 #endif
00122 #ifdef MED_PYRA13
00123 #undef MED_PYRA13
00124 #endif
00125 #ifdef MED_PENTA15
00126 #undef MED_PENTA15
00127 #endif
00128 #ifdef MED_HEXA20
00129 #undef MED_HEXA20
00130 #endif
00131 #ifdef MED_POLYGON
00132 #undef MED_POLYGON
00133 #endif
00134 #ifdef MED_POLYHEDRA
00135 #undef MED_POLYHEDRA
00136 #endif
00137 #ifdef MED_ALL_ELEMENTS
00138 #undef MED_ALL_ELEMENTS
00139 #endif
00140 
00141     typedef long medGeometryElement;
00142     const medGeometryElement MED_NONE = 0;
00143     const medGeometryElement MED_POINT1 = 1;
00144     const medGeometryElement MED_SEG2 = 102;
00145     const medGeometryElement MED_SEG3 = 103;
00146     const medGeometryElement MED_TRIA3 = 203;
00147     const medGeometryElement MED_QUAD4 = 204;
00148     const medGeometryElement MED_TRIA6 = 206;
00149     const medGeometryElement MED_QUAD8 = 208;
00150     const medGeometryElement MED_TETRA4 = 304;
00151     const medGeometryElement MED_PYRA5 = 305;
00152     const medGeometryElement MED_PENTA6 = 306;
00153     const medGeometryElement MED_HEXA8 = 308;
00154     const medGeometryElement MED_TETRA10 = 310;
00155     const medGeometryElement MED_PYRA13 = 313;
00156     const medGeometryElement MED_PENTA15 = 315;
00157     const medGeometryElement MED_HEXA20 = 320;
00158     const medGeometryElement MED_POLYGON = 400;
00159     const medGeometryElement MED_POLYHEDRA = 500;
00160     const medGeometryElement MED_ALL_ELEMENTS = 999;
00161 
00162     typedef long medEntityMesh;
00163     const medEntityMesh MED_CELL = 0;
00164     const medEntityMesh MED_FACE = 1;
00165     const medEntityMesh MED_EDGE = 2;
00166     const medEntityMesh MED_NODE = 3;
00167     const medEntityMesh MED_ALL_ENTITIES = 4;
00168 
00169     typedef long medModeSwitch;
00170     const medModeSwitch MED_FULL_INTERLACE = 0;
00171     const medModeSwitch MED_NO_INTERLACE = 1;
00172     const medModeSwitch MED_NO_INTERLACE_BY_TYPE = 2;
00173     const medModeSwitch MED_UNDEFINED_INTERLACE = 3;
00174     
00175     typedef long medConnectivity;
00176     const medConnectivity MED_NODAL = 0;
00177     const medConnectivity MED_DESCENDING = 1;
00178 
00179     typedef enum {MED_CARTESIAN, MED_POLAR, MED_BODY_FITTED} med_grid_type;
00180 
00181     //typedef enum {MED_LECT,MED_ECRI,MED_REMP,MED_CREA} med_mode_acces;
00182     typedef enum {RDONLY,WRONLY,RDWR} med_mode_acces;
00183 
00184     typedef enum {ASCENDING=7,DESCENDING=77} med_sort_direc;
00185 
00186     typedef enum {MED_REEL64=6, MED_INT32=24,MED_INT64=26, MED_UNDEFINED_TYPE=0} med_type_champ;
00187 
00188 // #define MED_NBR_GEOMETRIE_MAILLE 15
00189 // #define MED_NBR_GEOMETRIE_FACE 4
00190 // #define MED_NBR_GEOMETRIE_ARETE 2
00191 
00192 typedef enum {MED_CART, MED_CYL, MED_SPHER} med_repere;
00193 
00194 typedef enum {MED_FAUX, MED_VRAI} med_booleen ;
00195 
00196 typedef enum {MED_GROUPE, MED_ATTR, MED_FAMILLE} med_dim_famille;
00197 
00198 typedef enum {MED_COMP, MED_DTYPE} med_dim_champ;
00199 
00200 typedef enum {MED_HDF_VERSION, MED_VERSION, MED_FICH_DES} med_fich_info;
00201 
00202 // #define MED_NOPG   1                   /* -> pas de point de Gauss                    */
00203 // #define MED_NOPFL  ""                  /* -> pas de profils utilisateur               */
00204 // #define MED_NOPFLi "                                "  /* Variable Interne                      */
00205 // #define MED_NOPF   0                   /* -> pas de profils pour _MEDdataseNnumEcrire */
00206 // #define MED_NOPDT -1                   /* rem: pas de pas de temps negatifs           */
00207 // #define MED_NONOR -1                   /* rem: pas de nĀ°ordre negatif                 */
00208 // #define MED_DIM1   1                   /* PAS */
00209 //   //#define MED_ALL    0 !!!!! NB: WARNING MED_ALL deja utilise dans l'enum medGeometryElement !!!!!!!!
00210 // #define MED_ALL    0
00211 
00212 #if defined(SUN4SOL2) || defined(PCLINUX) || defined(PCLINUX64_32) || defined(OSF1_32) || defined(IRIX64_32) || defined(RS6000)
00213 /* interface C/FORTRAN */
00214 /* this true only with g77 and gcc : we must change it to use directly NOMF_... and INT32 or INT64 - it will be more simple to understand and to use ! */
00215 // #define NOMF_POST_UNDERSCORE
00216 
00217 /* correspondance des types avec HDF 5 */
00218 typedef hsize_t        med_size;
00219 typedef hssize_t       med_ssize;
00220     //typedef hid_t          med_idt;
00221 typedef herr_t         med_err;
00222 
00223 /* types elementaires */
00224 typedef int            med_int;
00225 typedef double         med_float;
00226 #endif
00227 
00228 #if defined(HP9000)
00229 /* correspondance des types avec HDF 5 */
00230 typedef hsize_t        med_size;
00231 typedef hssize_t       med_ssize;
00232     //typedef hid_t          med_idt;
00233 typedef herr_t         med_err;
00234 
00235 /* types elementaires */
00236 typedef int            med_int;
00237 typedef double         med_float;
00238 #endif
00239 
00240 #if defined(IRIX64) || defined(OSF1) || defined(VPP5000) || defined(PCLINUX64) 
00241 // #define NOMF_POST_UNDERSCORE
00242 
00243 /* correspondance des types avec HDF 5 */
00244 typedef hsize_t        med_size;
00245 typedef hssize_t       med_ssize;
00246     //typedef hid_t          med_idt;
00247 typedef herr_t         med_err;
00248 
00249 /* types elementaires */
00250 typedef long           med_int;
00251 typedef double         med_float;
00252 #endif
00253 
00254 
00255 #if defined(PPRO_NT)
00256 /* correspondance des types avec HDF 5 */
00257 typedef hsize_t        med_size;
00258 typedef hssize_t       med_ssize;
00259     //typedef hid_t          med_idt;
00260 typedef herr_t         med_err;
00261 
00262 /* types elementaires */
00263 typedef int            med_int;
00264 typedef double         med_float;
00265 #endif
00266 
00267 
00268 // #if defined(NOMF_PRE_UNDERSCORE) && defined(NOMF_POST_UNDERSCORE)
00269 // #   define NOMF(x)     _##x##_
00270 // #endif
00271 // #if defined(NOMF_PRE_UNDERSCORE) && !defined(NOMF_POST_UNDERSCORE)
00272 // #   define NOMF(x)     _##x
00273 // #endif
00274 // #if !defined(NOMF_PRE_UNDERSCORE) && defined(NOMF_POST_UNDERSCORE)
00275 // #   define NOMF(x)     x##_
00276 // #endif
00277 // #if !defined(NOMF_PRE_UNDERSCORE) && !defined(NOMF_POST_UNDERSCORE)
00278 // #   define NOMF(x)     x
00279 // #endif
00280 
00281   //#include "med_proto.h"
00282 
00283   }
00284 
00285   // valeurs des algos de connexites
00286   const int FRACT_ALGO = 10;
00287   const int MAX_LOOP   = 200;
00288 // fin
00289 
00290 // Valeurs de IO_MED
00291 //#define READ 0
00292 //#define WRITE 1
00293 
00294 
00295   const int MED_CLOSED   = 0;
00296   const int MED_OPENED   = 1;
00297   const int MED_INVALID  = -1;
00298   const int MED_ERROR    = -1;
00299   const int MED_VALID    = 0;
00300 //#define MED_NULL     NULL
00301 
00302 //#define MED_RDONLY RDONLY
00308 //#define MED_WRONLY WRONLY
00309 //#define MED_RDWR   RDWR
00310 //#define MED_CREATE MED_CREA
00311 // Fin
00312 
00313   const int longueur_string = 100;
00314   const double PRECISION = 0.0000001;
00315   const int MED_UNDEFINED = -1;
00316 
00317 // type des connectivites
00318 //#define CONN_NOD 0
00319 //#define CONN_DESC_PART 1
00320 //#define CONN_DESC_TOT 2
00321 
00322 // valeurs de type_interpolation
00323   const int P1                 = 0;
00324   const int pseudo_P2          = 1;
00325   const int trilineaire        = 2;
00326   const int P2_adapte          = 3;
00327   const int VF_conservatif     = 4;
00328   const int VF_non_conservatif = 5;
00329   // valeurs de type_mapping
00330   const int connexite   = 0;
00331   const int conn_octree = 1;
00332   const int brutal      = 2;
00333 // valeurs des type_support
00334   const int support_noeud = 0;
00335   const int support_maille = 1;
00336 // retour des fonctions
00337   //const int OK = 0;
00338   //const int KO = 1;
00339 
00340 //maximum number of groups handled by the Family Group converter
00341   const int MAX_NB_GROUP = 100000;
00342   /*
00343     enum definition for the used Med File version V2.1 or V2.2
00344     because of incompatibility between them.
00345   */
00346 
00347   typedef enum {V21 = 26, V22 = 75} medFileVersion;
00348 
00349 // fin
00350 }
00351 // End Of NameSpace MED_EN
00352 
00353 #endif /* DEFINE_HXX */