]> SALOME platform Git repositories - modules/med.git/blobdiff - src/MEDMEM/MEDMEM_MedMeshDriver21.cxx
Salome HOME
Join modifications from branch CEAFor_V3_2_0
[modules/med.git] / src / MEDMEM / MEDMEM_MedMeshDriver21.cxx
index 2b7a9de1ab63ee24258c3fdf7d8f3d1087308f1e..cdd559c0294f3c64624fcc8c8aab6107e62e012e 100644 (file)
@@ -716,10 +716,10 @@ int MED_MESH_RDONLY_DRIVER21::getNodalConnectivity(CONNECTIVITY * Connectivity)
   const char * LOC = "MED_MESH_RDONLY_DRIVER21::getNodalConnectivity : " ;
   BEGIN_OF(LOC);
 
-  int spaceDimension = _ptrMesh->_spaceDimension;
-
   if (_status==MED_OPENED)
     {
+      int spaceDimension = _ptrMesh->_spaceDimension;
+
       // Get the type of entity to work on (previously set in the Connectivity Object)
       med_2_1::med_entite_maillage Entity = (med_2_1::med_entite_maillage) Connectivity->getEntity();
 
@@ -2471,6 +2471,13 @@ int MED_MESH_WRONLY_DRIVER21::writeFamilies(vector<FAMILY*> & families ) const {
     err =med_2_1::_MEDdatagroupOuvrir(_medIdt,const_cast <char *> (dataGroupFam.c_str()) ) ;
     if ( err < MED_VALID ) {
       SCRUTE(err);
+      if ( families[i]->getName().size() > MED_TAILLE_NOM )
+       throw MEDEXCEPTION
+          ( LOCALIZED(STRING(LOC) << "The size of the name of the family |" << i+1
+                      << "| |" << families[i]->getName()
+                      << "| with identifier |" << families[i]->getIdentifier()  << "| is |" 
+                      <<  families[i]->getName().size()  <<"| and is more than |"
+                      << MED_TAILLE_NOM << "|")) ;
 
       MESSAGE(LOC<<"families[i]->getName().c_str() : "<<families[i]->getName().c_str());
       MESSAGE(LOC<<"_meshName.c_str() : "<<_meshName.c_str());
@@ -2508,8 +2515,8 @@ int MED_MESH_WRONLY_DRIVER21::writeFamilies(vector<FAMILY*> & families ) const {
                              const_cast <char *> ( _meshName.c_str() ),
                              const_cast <char *> ( families[i]->getName().c_str() ),
                              families[i]->getIdentifier(), 
-                             families[i]->getAttributesIdentifiers(),
-                             families[i]->getAttributesValues(),
+                             (med_2_1::med_int*) families[i]->getAttributesIdentifiers(),
+                             (med_2_1::med_int*) families[i]->getAttributesValues(),
                              const_cast <char *> (attributesDescriptions.c_str()), 
                              numberOfAttributes,  
                              const_cast <char *> (groupsNames.c_str()),