From 2bbedbe8e77b831531fbdef0cb08223d32da1a99 Mon Sep 17 00:00:00 2001 From: nicolas Date: Tue, 9 Apr 2013 15:47:53 +0000 Subject: [PATCH] Catalogue pour YACS ; liberation de structures allouees ; documentation --- doc/tui_create_boundary.rst | 22 +- doc/tui_create_iteration.rst | 8 +- idl/Gen.xml | 336 ++++++++++++++++-- idl/HOMARD_Iteration.idl | 4 +- resources/HOMARDCatalog.xml.in | 284 +++++++++++++++- src/HOMARD/HOMARD_DriverTools.cxx | 8 +- src/HOMARD/HOMARD_Iteration.cxx | 4 +- src/HOMARD/HOMARD_Iteration.hxx | 4 +- src/HOMARD/HomardDriver.cxx | 25 +- src/HOMARDGUI/HOMARD_msg_fr.ts | 6 +- src/HOMARDGUI/HomardQtCommun.cxx | 254 ++++++++------ src/HOMARDGUI/MonCreateIteration.cxx | 5 +- src/HOMARD_I/HOMARD_Cas_i.cxx | 2 +- src/HOMARD_I/HOMARD_Gen_i.cxx | 62 ++-- src/HOMARD_I/HOMARD_Iteration_i.cxx | 16 +- src/HOMARD_I/HOMARD_Iteration_i.hxx | 4 +- src/HOMARD_I/HomardMedCommun.cxx | 486 +++++++++++++-------------- 17 files changed, 1071 insertions(+), 459 deletions(-) diff --git a/doc/tui_create_boundary.rst b/doc/tui_create_boundary.rst index 842717f9..10dbc624 100644 --- a/doc/tui_create_boundary.rst +++ b/doc/tui_create_boundary.rst @@ -52,10 +52,10 @@ Ces m | Retourne une instance de la classe ``boundary`` analytique de type conique | | après sa création | | | -| - ``boundary_name`` : le nom de la frontière analytique basée sur un cone | -| - ``Xaxe``, ``Yaxe``, ``Zaxe`` : vecteur de l'axe | -| - ``Angle`` : angle d'ouverture du cone en degre (entre 0 et 90) | -| - ``Xcen``, ``Ycen``, ``Zcen`` : coordonnées du centre du cone | +| - ``boundary_name`` : le nom de la frontière analytique basée sur un cône | +| - ``Xaxe``, ``Yaxe``, ``Zaxe`` : vecteur de l'axe (non nécessairement normé) | +| - ``Angle`` : angle d'ouverture du cône en degre (entre 0 et 90) | +| - ``Xcen``, ``Ycen``, ``Zcen`` : coordonnées du centre du cône | +----------------------------------------------------------------------------------------+ | .. module:: CreateBoundaryConeR | | | @@ -63,11 +63,11 @@ Ces m | Retourne une instance de la classe ``boundary`` analytique de type conique | | après sa création | | | -| - ``boundary_name`` : le nom de la frontière analytique basée sur un cone | -| - ``Xc1``, ``Yc1``, ``Zc1`` : coordonnées du premier centre du cone | -| - ``R1`` : rayon du cone à la hauteur du premier centre | -| - ``Xc2``, ``Yc2``, ``Zc2`` : coordonnées du second centre du cone | -| - ``R2`` : rayon du cone à la hauteur du second centre | +| - ``boundary_name`` : le nom de la frontière analytique basée sur un cône | +| - ``Xc1``, ``Yc1``, ``Zc1`` : coordonnées du premier centre du cône | +| - ``R1`` : rayon du cône à la hauteur du premier centre | +| - ``Xc2``, ``Yc2``, ``Zc2`` : coordonnées du second centre du cône | +| - ``R2`` : rayon du cône à la hauteur du second centre | +----------------------------------------------------------------------------------------+ +---------------------------------------------------------------+ @@ -131,8 +131,8 @@ M | * 0 : discrète | | * 1 : cylindre | | * 2 : sphère | -| * 3 : cone défini par un axe et un angle | -| * 4 : cone défini par deux rayons | +| * 3 : cône défini par un axe et un angle | +| * 4 : cône défini par deux rayons | +---------------------------------------------------------------+ | .. module:: GetCoords | | | diff --git a/doc/tui_create_iteration.rst b/doc/tui_create_iteration.rst index 3e153d80..facb35fe 100644 --- a/doc/tui_create_iteration.rst +++ b/doc/tui_create_iteration.rst @@ -161,7 +161,13 @@ G | .. module:: GetFileInfo | | | | **GetFileInfo()** | -| Retourne le nom du fichier contenant l'abalyse du maillage| +| Retourne le nom du fichier contenant l'analyse du maillage| ++---------------------------------------------------------------+ +| .. module:: GetDirName | +| | +| **GetDirName()** | +| Retourne le nom du répertoire des résutats associé à | +| l'itération | +---------------------------------------------------------------+ | .. index:: single: Delete | | | diff --git a/idl/Gen.xml b/idl/Gen.xml index 468db6d7..5ff23f74 100644 --- a/idl/Gen.xml +++ b/idl/Gen.xml @@ -15,7 +15,7 @@ HOMARD OTHER HOMARD team - EDF RD - 1.3 + 1.4 unknown 1 1 @@ -58,14 +58,19 @@ - CreateHypothesis + CreateCaseFromIteration HOMARD team - EDF RD 1.1 unknown 0 - HypoName + CaseName + string + unknown + + + DirNameStart string unknown @@ -73,66 +78,95 @@ return - HOMARD/HOMARD_Hypothesis + HOMARD/HOMARD_Cas unknown - CreateZoneBox + CreateCaseFromCaseLastIteration HOMARD team - EDF RD 1.1 unknown 0 - ZoneName + CaseName string unknown - Xmini - double - unknown - - - Xmaxi - double + DirNameStart + string unknown + + + + return + HOMARD/HOMARD_Cas + unknown + + + + + + CreateCaseFromCaseIteration + HOMARD team - EDF RD + 1.1 + unknown + 0 + - Ymini - double + CaseName + string unknown - Ymaxi - double + DirNameStart + string unknown - Zmini - double + Number + long unknown + + + + return + HOMARD/HOMARD_Cas + unknown + + + + + + CreateHypothesis + HOMARD team - EDF RD + 1.1 + unknown + 0 + - Zmaxi - double + HypoName + string unknown return - HOMARD/HOMARD_Zone + HOMARD/HOMARD_Hypothesis unknown - CreateZoneSphere + CreateZoneBox HOMARD team - EDF RD 1.1 unknown @@ -144,22 +178,32 @@ unknown - Xcentre + Xmini double unknown - Ycentre + Xmaxi double unknown - Zcentre + Ymini double unknown - Radius + Ymaxi + double + unknown + + + Zmini + double + unknown + + + Zmaxi double unknown @@ -302,6 +346,48 @@ + + CreateZoneSphere + HOMARD team - EDF RD + 1.1 + unknown + 0 + + + ZoneName + string + unknown + + + Xcentre + double + unknown + + + Ycentre + double + unknown + + + Zcentre + double + unknown + + + Radius + double + unknown + + + + + return + HOMARD/HOMARD_Zone + unknown + + + + CreateZoneBox2D HOMARD team - EDF RD @@ -569,6 +655,125 @@ + + CreateBoundaryConeA + HOMARD team - EDF RD + 1.1 + unknown + 0 + + + BoundaryName + string + unknown + + + Xaxis + double + unknown + + + Yaxis + double + unknown + + + Zaxis + double + unknown + + + Angle + double + unknown + + + Xcentre + double + unknown + + + Ycentre + double + unknown + + + Zcentre + double + unknown + + + + + return + HOMARD/HOMARD_Boundary + unknown + + + + + + CreateBoundaryConeR + HOMARD team - EDF RD + 1.1 + unknown + 0 + + + BoundaryName + string + unknown + + + Xcentre1 + double + unknown + + + Ycentre1 + double + unknown + + + Zcentre1 + double + unknown + + + Radius1 + double + unknown + + + Xcentre2 + double + unknown + + + Ycentre2 + double + unknown + + + Zcentre2 + double + unknown + + + Radius2 + double + unknown + + + + + return + HOMARD/HOMARD_Boundary + unknown + + + + GetCase HOMARD team - EDF RD @@ -797,6 +1002,83 @@ + + PublishResultInSmesh + HOMARD team - EDF RD + 1.1 + unknown + 0 + + + FileName + string + unknown + + + Option + long + unknown + + + + + + + MeshInfo + HOMARD team - EDF RD + 1.1 + unknown + 0 + + + CaseName + string + unknown + + + MeshName + string + unknown + + + FileName + string + unknown + + + DirName + string + unknown + + + Qual + long + unknown + + + Diam + long + unknown + + + Conn + long + unknown + + + Tail + long + unknown + + + Inte + long + unknown + + + + + diff --git a/idl/HOMARD_Iteration.idl b/idl/HOMARD_Iteration.idl index 5847e41e..dafec449 100644 --- a/idl/HOMARD_Iteration.idl +++ b/idl/HOMARD_Iteration.idl @@ -48,7 +48,9 @@ module HOMARD string GetDumpPython() raises (SALOME::SALOME_Exception); // Caracteristiques - void SetDirName(in string NomDir) raises (SALOME::SALOME_Exception); + void SetDirNameLoc(in string NomDir) raises (SALOME::SALOME_Exception); + string GetDirNameLoc() raises (SALOME::SALOME_Exception); + string GetDirName() raises (SALOME::SALOME_Exception); void SetNumber(in long NumIter) raises (SALOME::SALOME_Exception); diff --git a/resources/HOMARDCatalog.xml.in b/resources/HOMARDCatalog.xml.in index 260fc8c6..bac71ed7 100644 --- a/resources/HOMARDCatalog.xml.in +++ b/resources/HOMARDCatalog.xml.in @@ -52,7 +52,7 @@ HOMARD OTHER HOMARD team - EDF RD - 1.1 + 1.4 unknown 1 1 @@ -94,6 +94,92 @@ + + CreateCaseFromIteration + HOMARD team - EDF RD + 1.1 + unknown + 0 + + + CaseName + string + unknown + + + DirNameStart + string + unknown + + + + + return + HOMARD_Cas + unknown + + + + + + CreateCaseFromCaseLastIteration + HOMARD team - EDF RD + 1.1 + unknown + 0 + + + CaseName + string + unknown + + + DirNameStart + string + unknown + + + + + return + HOMARD_Cas + unknown + + + + + + CreateCaseFromCaseIteration + HOMARD team - EDF RD + 1.1 + unknown + 0 + + + CaseName + string + unknown + + + DirNameStart + string + unknown + + + Number + long + unknown + + + + + return + HOMARD_Cas + unknown + + + + CreateHypothesis HOMARD team - EDF RD @@ -606,6 +692,125 @@ + + CreateBoundaryConeA + HOMARD team - EDF RD + 1.1 + unknown + 0 + + + BoundaryName + string + unknown + + + Xaxis + double + unknown + + + Yaxis + double + unknown + + + Zaxis + double + unknown + + + Angle + double + unknown + + + Xcentre + double + unknown + + + Ycentre + double + unknown + + + Zcentre + double + unknown + + + + + return + HOMARD_Boundary + unknown + + + + + + CreateBoundaryConeR + HOMARD team - EDF RD + 1.1 + unknown + 0 + + + BoundaryName + string + unknown + + + Xcentre1 + double + unknown + + + Ycentre1 + double + unknown + + + Zcentre1 + double + unknown + + + Radius1 + double + unknown + + + Xcentre2 + double + unknown + + + Ycentre2 + double + unknown + + + Zcentre2 + double + unknown + + + Radius2 + double + unknown + + + + + return + HOMARD_Boundary + unknown + + + + GetCase HOMARD team - EDF RD @@ -834,6 +1039,83 @@ + + PublishResultInSmesh + HOMARD team - EDF RD + 1.1 + unknown + 0 + + + FileName + string + unknown + + + Option + long + unknown + + + + + + + MeshInfo + HOMARD team - EDF RD + 1.1 + unknown + 0 + + + CaseName + string + unknown + + + MeshName + string + unknown + + + FileName + string + unknown + + + DirName + string + unknown + + + Qual + long + unknown + + + Diam + long + unknown + + + Conn + long + unknown + + + Tail + long + unknown + + + Inte + long + unknown + + + + + diff --git a/src/HOMARD/HOMARD_DriverTools.cxx b/src/HOMARD/HOMARD_DriverTools.cxx index 138b740d..faf77553 100644 --- a/src/HOMARD/HOMARD_DriverTools.cxx +++ b/src/HOMARD/HOMARD_DriverTools.cxx @@ -34,7 +34,7 @@ namespace HOMARD { - const char* const SEPARATOR = "|"; + std::string SEPARATOR = "|" ; /*! \brief Read next chunk of data from the string @@ -90,7 +90,7 @@ namespace HOMARD */ std::string separator() { - return std::string( SEPARATOR ); + return SEPARATOR ; } // ======================= @@ -171,7 +171,7 @@ namespace HOMARD os << separator() << iteration.GetHypoName(); os << separator() << iteration.GetCaseName(); - os << separator() << iteration.GetDirName(); + os << separator() << iteration.GetDirNameLoc(); saux = os.str(); // MESSAGE( ". Fin avec "< _HOMARD_Exec ="<<_HOMARD_Exec) ; // _siter = siter ; _siterp1 = siterp1 ; } - //============================================================================= //============================================================================= HomardDriver::~HomardDriver() diff --git a/src/HOMARDGUI/HOMARD_msg_fr.ts b/src/HOMARDGUI/HOMARD_msg_fr.ts index 12eab8e3..440c5808 100644 --- a/src/HOMARDGUI/HOMARD_msg_fr.ts +++ b/src/HOMARDGUI/HOMARD_msg_fr.ts @@ -927,6 +927,10 @@ Iteration number A partir d'une itération numérotée + + The directory of the case does not exist. + Le répertoire du cas n'existe pas. + The directory for the case cannot be modified because some iterations are already defined. Impossible de changer le répertoire du cas car des itérations ont déjà été définies. @@ -944,7 +948,7 @@ Impossible de déplacer le point de départ du cas dans le nouveau répertoire. - This directory of the case does not exist. + The directory of the case for the pursuit does not exist. Le répertoire du cas de reprise n'existe pas. diff --git a/src/HOMARDGUI/HomardQtCommun.cxx b/src/HOMARDGUI/HomardQtCommun.cxx index 595e66d0..188b6ed6 100644 --- a/src/HOMARDGUI/HomardQtCommun.cxx +++ b/src/HOMARDGUI/HomardQtCommun.cxx @@ -201,8 +201,6 @@ QString HOMARD_QT_COMMUN::PushNomFichier(bool avertir) return aFile; } - - // ======================================================================= int HOMARD_QT_COMMUN::OuvrirFichier(QString aFile) // ======================================================================= @@ -221,21 +219,40 @@ int HOMARD_QT_COMMUN::OuvrirFichier(QString aFile) QString HOMARD_QT_COMMUN::LireNomMaillage(QString aFile) // ======================================================== { - med_int medIdt = HOMARD_QT_COMMUN::OuvrirFichier(aFile); - med_int numberOfMeshes = MEDnMesh(medIdt) ; - if (numberOfMeshes == 0 ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_MED_FILE_2") ); - } - if (numberOfMeshes > 1 ) + QString nomMaillage = "" ; + int erreur = 0 ; + med_int medIdt ; + while ( erreur == 0 ) { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_MED_FILE_3") ); + // Ouverture du fichier + medIdt = HOMARD_QT_COMMUN::OuvrirFichier(aFile); + if ( medIdt < 0 ) + { + erreur = 1 ; + break ; + } + med_int numberOfMeshes = MEDnMesh(medIdt) ; + if (numberOfMeshes == 0 ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_MED_FILE_2") ); + erreur = 2 ; + break ; + } + if (numberOfMeshes > 1 ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_MED_FILE_3") ); + erreur = 3 ; + break ; + } + + nomMaillage = HOMARD_QT_COMMUN::LireNomMaillage(medIdt,1); + break ; } + // Fermeture du fichier + if ( medIdt > 0 ) MEDfileClose(medIdt); - QString nomMaillage= HOMARD_QT_COMMUN::LireNomMaillage(medIdt,1); - MEDfileClose(medIdt); return nomMaillage; } // ======================================================================= @@ -268,15 +285,13 @@ QString HOMARD_QT_COMMUN::LireNomMaillage(int medIdt ,int meshId) axisname, axisunit); - if ( aRet < 0 ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_MED_FILE_4") ); - } - else - { - NomMaillage=QString(meshname); - } + if ( aRet < 0 ) { QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), \ + QObject::tr("HOM_MED_FILE_4") ); } + else { NomMaillage=QString(meshname); } + + delete[] axisname ; + delete[] axisunit ; + return NomMaillage; } @@ -288,53 +303,60 @@ std::list HOMARD_QT_COMMUN::GetListeChamps(QString aFile) // Il faut voir si plusieurs maillages MESSAGE("GetListeChamps"); - std::list ListeChamp; - - char *comp, *unit; - char nomcha [MED_NAME_SIZE+1]; - char meshname[MED_NAME_SIZE+1]; - med_field_type typcha; - med_int ncomp; - med_bool local; - med_int nbofcstp; - - SCRUTE(aFile.toStdString()); - med_int medIdt = HOMARD_QT_COMMUN::OuvrirFichier(aFile); - if ( medIdt < 0 ) { return ListeChamp; } - - // Le fichier Med est lisible - // Lecture du maillage + std::list ListeChamp ; - // Lecture du nombre de champs - med_int ncha = MEDnField(medIdt) ; - if (ncha < 1 ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_MED_FILE_5") ); - MEDfileClose(medIdt); - return ListeChamp; - } + med_err erreur = 0 ; + med_int medIdt ; - for (int i=0; i< ncha; i++) + while ( erreur == 0 ) { - /* Lecture du type du champ, des noms des composantes et du nom de l'unite*/ - ncomp = MEDfieldnComponent(medIdt,i+1); - comp = (char*) malloc(ncomp*MED_SNAME_SIZE+1); - unit = (char*) malloc(ncomp*MED_SNAME_SIZE+1); - char dtunit[MED_SNAME_SIZE+1]; - if ( MEDfieldInfo(medIdt,i+1,nomcha,meshname,&local,&typcha,comp,unit,dtunit,&nbofcstp) < 0 ) + // Ouverture du fichier + SCRUTE(aFile.toStdString()); + medIdt = HOMARD_QT_COMMUN::OuvrirFichier(aFile); + if ( medIdt < 0 ) + { + erreur = 1 ; + break ; + } + // Lecture du nombre de champs + med_int ncha = MEDnField(medIdt) ; + if (ncha < 1 ) { QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_MED_FILE_6") ); - MEDfileClose(medIdt); - return ListeChamp; + QObject::tr("HOM_MED_FILE_5") ); + erreur = 2 ; + break ; } - - ListeChamp.push_back(QString(nomcha)); - free(comp); - free(unit); + // Lecture des caracteristiques des champs + for (int i=0; i< ncha; i++) + { +// Lecture du nombre de composantes + med_int ncomp = MEDfieldnComponent(medIdt,i+1); +// Lecture du type du champ, des noms des composantes et du nom de l'unite + char nomcha [MED_NAME_SIZE+1]; + char meshname[MED_NAME_SIZE+1]; + char * comp = (char*) malloc(ncomp*MED_SNAME_SIZE+1); + char * unit = (char*) malloc(ncomp*MED_SNAME_SIZE+1); + char dtunit[MED_SNAME_SIZE+1]; + med_bool local; + med_field_type typcha; + med_int nbofcstp; + erreur = MEDfieldInfo(medIdt,i+1,nomcha,meshname,&local,&typcha,comp,unit,dtunit,&nbofcstp) ; + free(comp); + free(unit); + if ( erreur < 0 ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_MED_FILE_6") ); + break ; + } + ListeChamp.push_back(QString(nomcha)); + } + break ; } - MEDfileClose(medIdt); + // Fermeture du fichier + if ( medIdt > 0 ) MEDfileClose(medIdt); + return ListeChamp; } @@ -347,61 +369,71 @@ std::list HOMARD_QT_COMMUN::GetListeComposants(QString aFile, QString a std::list ListeComposants; - char *comp, *unit; - char nomcha [MED_NAME_SIZE+1]; - char meshname[MED_NAME_SIZE+1]; - med_field_type typcha; - med_int ncomp; - med_bool local; - med_int nbofcstp; - - int medIdt = HOMARD_QT_COMMUN::OuvrirFichier(aFile); - if ( medIdt < 0 ) { return ListeComposants; } + med_err erreur = 0 ; + med_int medIdt ; - - // Lecture du nombre de champs - med_int ncha = MEDnField(medIdt) ; - if (ncha < 1 ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_MED_FILE_5") ); - MEDfileClose(medIdt); - return ListeComposants; - } - - for (int i=0; i< ncha; i++) + while ( erreur == 0 ) { - /* Lecture du type du champ, des noms des composantes et du nom de l'unite*/ - ncomp = MEDfieldnComponent(medIdt,i+1); - comp = (char*) malloc(ncomp*MED_SNAME_SIZE+1); - unit = (char*) malloc(ncomp*MED_SNAME_SIZE+1); - char dtunit[MED_SNAME_SIZE+1]; - - if ( MEDfieldInfo(medIdt,i+1,nomcha,meshname,&local,&typcha,comp,unit,dtunit,&nbofcstp) < 0 ) + // Ouverture du fichier + SCRUTE(aFile.toStdString()); + medIdt = HOMARD_QT_COMMUN::OuvrirFichier(aFile); + if ( medIdt < 0 ) { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_MED_FILE_6") ); - MEDfileClose(medIdt); - return ListeComposants; + erreur = 1 ; + break ; } - - if ( QString(nomcha) != aChamp ) { - free(comp); - free(unit); - continue; + // Lecture du nombre de champs + med_int ncha = MEDnField(medIdt) ; + if (ncha < 1 ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_MED_FILE_5") ); + erreur = 2 ; + break ; } - - for (int j = 0; j 0 ) MEDfileClose(medIdt); + return ListeComposants; } diff --git a/src/HOMARDGUI/MonCreateIteration.cxx b/src/HOMARDGUI/MonCreateIteration.cxx index ace8e1e6..f46b5894 100644 --- a/src/HOMARDGUI/MonCreateIteration.cxx +++ b/src/HOMARDGUI/MonCreateIteration.cxx @@ -160,8 +160,7 @@ bool MonCreateIteration::PushOnApply() } } // Mise en place des attributs - const char* IterName = aIter->GetName() ; - std::cerr << IterName << std::endl; + std::string IterName = aIter->GetName() ; if ( LEFieldFile->text().trimmed() != QString("")) { @@ -172,7 +171,7 @@ bool MonCreateIteration::PushOnApply() if ( step == -2 ) { aIter->SetTimeStepRankLast(); } else { aIter->SetTimeStepRank(step,rank); } } - _myHomardGen->AssociateIterHypo (IterName, monHypoName.toStdString().c_str()); + _myHomardGen->AssociateIterHypo (IterName.c_str(), monHypoName.toStdString().c_str()); aIter->SetMeshName(CORBA::string_dup(aMeshName_np1.toStdString().c_str())); HOMARD_UTILS::updateObjBrowser() ; diff --git a/src/HOMARD_I/HOMARD_Cas_i.cxx b/src/HOMARD_I/HOMARD_Cas_i.cxx index ff5491ab..3660bfc3 100755 --- a/src/HOMARD_I/HOMARD_Cas_i.cxx +++ b/src/HOMARD_I/HOMARD_Cas_i.cxx @@ -136,7 +136,7 @@ void HOMARD_Cas_i::SetDirName( const char* NomDir ) MESSAGE ( "etat : " << GetState() ) ; char* Iter0Name = GetIter0Name() ; HOMARD::HOMARD_Iteration_ptr Iter = _gen_i->GetIteration(Iter0Name) ; - char* DirNameIter = Iter->GetDirName() ; + char* DirNameIter = Iter->GetDirNameLoc() ; std::string commande = "mv " + std::string(oldrep) + "/" + std::string(DirNameIter) + " " + std::string(NomDir) ; codret = system(commande.c_str()) ; if ( codret != 0 ) diff --git a/src/HOMARD_I/HOMARD_Gen_i.cxx b/src/HOMARD_I/HOMARD_Gen_i.cxx index bc40259d..20242f24 100755 --- a/src/HOMARD_I/HOMARD_Gen_i.cxx +++ b/src/HOMARD_I/HOMARD_Gen_i.cxx @@ -187,14 +187,14 @@ void HOMARD_Gen_i::SetEtatIter(const char* nomIter, const CORBA::Long Etat) SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder(); SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myIteration))); - const char* icone ; + std::string icone ; if ( Etat <= 0 ) icone = "iter0.png" ; else if ( Etat == 2 ) icone = "iter_calculee.png" ; else icone = "iter_non_calculee.png" ; - PublishInStudyAttr(aStudyBuilder, aIterSO, NULL , NULL, icone, NULL) ; + PublishInStudyAttr(aStudyBuilder, aIterSO, NULL , NULL, icone.c_str(), NULL) ; aStudyBuilder->CommitCommand(); @@ -590,10 +590,9 @@ void HOMARD_Gen_i::InvalideIterOption(const char* nomIter, CORBA::Long Option) throw SALOME::SALOME_Exception(es); return ; }; - const char* dirCase = myCase->GetDirName(); const char* nomDir = myIteration->GetDirName(); const char* nomFichier = myIteration->GetMeshFile(); - std::string commande= "rm -rf " + std::string(dirCase) + "/" + std::string(nomDir); + std::string commande= "rm -rf " + std::string(nomDir); if ( Option == 1 ) { commande = commande + ";rm -rf " + std::string(nomFichier) ; } MESSAGE ( "commande = " << commande ); if ((system(commande.c_str())) != 0) @@ -651,10 +650,9 @@ void HOMARD_Gen_i::InvalideIterInfo(const char* nomIter) throw SALOME::SALOME_Exception(es); return ; }; - const char* dirCase = myCase->GetDirName(); const char* nomDir = myIteration->GetDirName(); - std::string commande = "rm -f " + std::string(dirCase) + "/" + std::string(nomDir) + "/info* " ; - commande += std::string(dirCase) + "/" + std::string(nomDir) + "/Liste.*info" ; + std::string commande = "rm -f " + std::string(nomDir) + "/info* " ; + commande += std::string(nomDir) + "/Liste.*info" ; /* MESSAGE ( "commande = " << commande );*/ if ((system(commande.c_str())) != 0) { @@ -1097,7 +1095,7 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromIteration(const char* nomCas, // { MESSAGE ( "CreateCaseFromIteration : nomCas = " << nomCas << ", DirNameStart = " << DirNameStart ); - char* nomDirWork = getenv("PWD") ; + std::string nomDirWork = getenv("PWD") ; int codret ; // A. Decodage du point de reprise @@ -1246,7 +1244,7 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromIteration(const char* nomCas, IterName = myCase->GetIter0Name() ; HOMARD::HOMARD_Iteration_var Iter = GetIteration(IterName) ; char* nomDirIter = CreateDirNameIter(nomDirCase, 0 ); - Iter->SetDirName(nomDirIter); + Iter->SetDirNameLoc(nomDirIter); std::string nomDirIterTotal ; nomDirIterTotal = std::string(nomDirCase) + "/" + std::string(nomDirIter) ; if (mkdir(nomDirIterTotal.c_str(), S_IRWXU|S_IRGRP|S_IXGRP) != 0) @@ -1278,7 +1276,7 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromIteration(const char* nomCas, delete[] MeshName ; delete[] MeshFile ; - chdir(nomDirWork); + chdir(nomDirWork.c_str()); return HOMARD::HOMARD_Cas::_duplicate(myCase); } @@ -1343,7 +1341,7 @@ std::string HOMARD_Gen_i::CreateCase1(const char* DirNameStart, CORBA::Long Numb { SALOME::ExceptionStruct es; es.type = SALOME::BAD_PARAM; - es.text = "This directory of the case does not exist."; + es.text = "The directory of the case for the pursuit does not exist."; throw SALOME::SALOME_Exception(es); return 0; }; @@ -1652,7 +1650,7 @@ HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::CreateIteration(const char* NomIterat // la creation d'un sous-repertoire unique int nbitercase = myCase->GetNumberofIter(); char* nomDirIter = CreateDirNameIter(nomDirCase, nbitercase ); - myIteration->SetDirName(nomDirIter); + myIteration->SetDirNameLoc(nomDirIter); // Le nom du fichier du maillage MED est indice par le nombre d'iterations du cas. // Si on a une chaine unique depuis le depart, ce nombre est le meme que le @@ -2194,7 +2192,7 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena // B. Les repertoires // B.1. Le repertoire courant - char* nomDirWork = getenv("PWD") ; + std::string nomDirWork = getenv("PWD") ; // B.2. Le sous-repertoire de l'iteration a traiter char* DirCompute = ComputeDirManagement(myCase, myIteration, etatMenage); MESSAGE( ". DirCompute = " << DirCompute ); @@ -2330,7 +2328,7 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena { delete myDriver; MESSAGE ( ". On retourne dans nomDirWork = " << nomDirWork ); - chdir(nomDirWork); + chdir(nomDirWork.c_str()); } return codretexec ; @@ -2497,14 +2495,24 @@ CORBA::Long HOMARD_Gen_i::ComputeAdap(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOM return codret ; } //============================================================================= -// Creation d'un nom de sous-repertoire pour l'iteration au sein d'un repertoire +// Creation d'un nom de sous-repertoire pour l'iteration au sein d'un repertoire parent // nomrep : nom du repertoire parent // num : le nom du sous-repertoire est sous la forme 'In', n est >= num //============================================================================= char* HOMARD_Gen_i::CreateDirNameIter(const char* nomrep, CORBA::Long num ) { MESSAGE ( "CreateDirNameIter : nomrep ="<< nomrep << ", num = "< DirName = " << DirName); MESSAGE ( ". On retourne dans nomDirActuel = " << nomDirActuel ); - chdir(nomDirActuel); + chdir(nomDirActuel.c_str()); return CORBA::string_dup( DirName.c_str() ); } @@ -2569,7 +2577,7 @@ char* HOMARD_Gen_i::ComputeDirManagement(HOMARD::HOMARD_Cas_var myCase, HOMARD:: // B.3. Le sous-repertoire de l'iteration a calculer, puis le repertoire complet a creer // B.3.1. Le nom du sous-repertoire - const char* nomDirIt = myIteration->GetDirName(); + const char* nomDirIt = myIteration->GetDirNameLoc(); // B.3.2. Le nom complet du sous-repertoire std::stringstream DirCompute ; @@ -2647,7 +2655,7 @@ char* HOMARD_Gen_i::ComputeDirPaManagement(HOMARD::HOMARD_Cas_var myCase, HOMARD const char* nomIterationParent = myIteration->GetIterParentName(); HOMARD::HOMARD_Iteration_var myIterationParent = myContextMap[GetCurrentStudyID()]._mesIterations[nomIterationParent]; - const char* nomDirItPa = myIterationParent->GetDirName(); + const char* nomDirItPa = myIterationParent->GetDirNameLoc(); std::stringstream DirComputePa ; DirComputePa << nomDirCase << "/" << nomDirItPa; MESSAGE( ". nomDirItPa = " << nomDirItPa); @@ -3019,7 +3027,7 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishZoneInStudy(SALOMEDS::Study_ptr theSt else { MESSAGE("La categorie des zones existe deja."); } aResultSO = aStudyBuilder->NewObject(aSOZone); - const char* icone ; + std::string icone ; switch (ZoneType) { case 11 : @@ -3063,7 +3071,7 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishZoneInStudy(SALOMEDS::Study_ptr theSt break ; } } - PublishInStudyAttr(aStudyBuilder, aResultSO, theName, "ZoneHomard", icone, _orb->object_to_string(theObject) ) ; + PublishInStudyAttr(aStudyBuilder, aResultSO, theName, "ZoneHomard", icone.c_str(), _orb->object_to_string(theObject) ) ; return aResultSO._retn(); } @@ -3100,8 +3108,8 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishBoundaryInStudy(SALOMEDS::Study_ptr t aResultSO = aStudyBuilder->NewObject(aSOBoundary); CORBA::Long BoundaryType = myBoundary->GetType(); // MESSAGE("BoundaryType : "<object_to_string(theObject)); + PublishInStudyAttr(aStudyBuilder, aResultSO, theName, value.c_str(), icone.c_str(), _orb->object_to_string(theObject)); return aResultSO._retn(); } @@ -3399,13 +3407,13 @@ void HOMARD_Gen_i::PublishFileUnderIteration(const char* NomIter, const char* No // Pour les fichiers med, on affiche une icone de maillage // Pour les fichiers qui sont texte, on affiche une icone de fichier texte 'texte' // Le reperage se fait par la 1ere lettre du commentaire : I pour Iteration n - const char* icone ; - const char* ior = " " ; + std::string icone ; + std::string ior = " " ; if ( Commentaire[0] == 'I' ) { icone = "med.png" ; } else { icone = "texte_2.png" ; } - PublishInStudyAttr(aStudyBuilder, aSubSO, NomFich, Commentaire, icone, ior ) ; + PublishInStudyAttr(aStudyBuilder, aSubSO, NomFich, Commentaire, icone.c_str(), ior.c_str() ) ; aStudyBuilder->CommitCommand(); } diff --git a/src/HOMARD_I/HOMARD_Iteration_i.cxx b/src/HOMARD_I/HOMARD_Iteration_i.cxx index 6ccffbbd..136228c1 100644 --- a/src/HOMARD_I/HOMARD_Iteration_i.cxx +++ b/src/HOMARD_I/HOMARD_Iteration_i.cxx @@ -112,16 +112,26 @@ bool HOMARD_Iteration_i::Restore( const std::string& stream ) // Caracteristiques //============================================================================= //============================================================================= -void HOMARD_Iteration_i::SetDirName( const char* NomDir ) +void HOMARD_Iteration_i::SetDirNameLoc( const char* NomDir ) { ASSERT( myHomardIteration ); - myHomardIteration->SetDirName( NomDir ); + myHomardIteration->SetDirNameLoc( NomDir ); +} +//============================================================================= +char* HOMARD_Iteration_i::GetDirNameLoc() +{ + ASSERT( myHomardIteration ); + return CORBA::string_dup( myHomardIteration->GetDirNameLoc().c_str() ); } //============================================================================= char* HOMARD_Iteration_i::GetDirName() { ASSERT( myHomardIteration ); - return CORBA::string_dup( myHomardIteration->GetDirName().c_str() ); + std::string casename = myHomardIteration->GetCaseName() ; + HOMARD::HOMARD_Cas_ptr caseiter = _gen_i->GetCase(casename.c_str()) ; + std::string dirnamecase = caseiter->GetDirName() ; + std::string dirname = dirnamecase + "/" + GetDirNameLoc() ; + return CORBA::string_dup( dirname.c_str() ); } //============================================================================= void HOMARD_Iteration_i::SetNumber( CORBA::Long NumIter ) diff --git a/src/HOMARD_I/HOMARD_Iteration_i.hxx b/src/HOMARD_I/HOMARD_Iteration_i.hxx index c29d5c4d..bf57bee9 100644 --- a/src/HOMARD_I/HOMARD_Iteration_i.hxx +++ b/src/HOMARD_I/HOMARD_Iteration_i.hxx @@ -65,7 +65,9 @@ public: bool Restore( const std::string& stream ); // Caracteristiques - void SetDirName( const char* NomDir ); + void SetDirNameLoc( const char* NomDir ); + char* GetDirNameLoc(); + char* GetDirName(); void SetNumber( CORBA::Long NumIter ); diff --git a/src/HOMARD_I/HomardMedCommun.cxx b/src/HOMARD_I/HomardMedCommun.cxx index 19208d1a..7b22b6df 100644 --- a/src/HOMARD_I/HomardMedCommun.cxx +++ b/src/HOMARD_I/HomardMedCommun.cxx @@ -48,96 +48,99 @@ std::set GetListeGroupesInMedFile(const char * aFile) // ======================================================================= { std::set ListeGroupes; - med_idt medIdt = MEDfileOpen(aFile,MED_ACC_RDONLY); - if ( medIdt < 0 ) { return ListeGroupes; }; - - char meshname[MED_NAME_SIZE+1]; - med_int spacedim,meshdim; - med_mesh_type meshtype; - char descriptionription[MED_COMMENT_SIZE+1]; - char dtunit[MED_SNAME_SIZE+1]; - med_sorting_type sortingtype; - med_int nstep; - med_axis_type axistype; - int naxis = MEDmeshnAxis(medIdt,1); - char *axisname=new char[naxis*MED_SNAME_SIZE+1]; - char *axisunit=new char[naxis*MED_SNAME_SIZE+1]; - med_err aRet = MEDmeshInfo(medIdt, - 1, - meshname, - &spacedim, - &meshdim, - &meshtype, - descriptionription, - dtunit, - &sortingtype, - &nstep, - &axistype, - axisname, - axisunit); - if ( aRet < 0 ) { return ListeGroupes; }; - - med_int nfam, ngro, natt; - if ((nfam = MEDnFamily(medIdt,meshname)) < 0) { return ListeGroupes; }; - - char familyname[MED_NAME_SIZE+1]; - med_int numfam; - for (int i=0;i 0 ) + { + char familyname[MED_NAME_SIZE+1]; + med_int numfam; + char* gro = (char*) malloc(MED_LNAME_SIZE*ngro+1); + erreur = MEDfamilyInfo(medIdt, + meshname, + i+1, + familyname, + &numfam, + gro); + if ( erreur < 0 ) + { + free(gro); + break ; + } + // Lecture des groupes pour une famille de mailles + if ( numfam < 0) + { + for (int j=0;j 0) { continue;} // On ne garde que les familles d elts - - for (int j=0;j 0 ) MEDfileClose(medIdt); + return ListeGroupes; } @@ -151,150 +154,145 @@ std::vector GetBoundingBoxInMedFile(const char * aFile) // en position 6 et 7 Zmin, Zmax et en position 8 Dz si < 0 2D // 9 distance max dans le maillage - std::vector LesExtremes; - - // Ouverture du Fichier Med - med_idt medIdt = MEDfileOpen(aFile,MED_ACC_RDONLY); - if (medIdt <0) - { - // GERALD -- QMESSAGE BOX - std::cerr << "Error : mesh is unreadable" << std::endl; - return LesExtremes; - } - - // Le fichier Med est lisible - // Boucle sur les noms de maillage - med_int numberOfMeshes = MEDnMesh(medIdt) ; - if (numberOfMeshes != 1 ) - { - // GERALD -- QMESSAGE BOX - std::cerr << "Error : file contains more than one mesh" << std::endl; - return LesExtremes; - } - - char meshname[MED_NAME_SIZE+1]; - med_int spacedim,meshdim; - med_mesh_type meshtype; - char descriptionription[MED_COMMENT_SIZE+1]; - char dtunit[MED_SNAME_SIZE+1]; - med_sorting_type sortingtype; - med_int nstep; - med_axis_type axistype; - int naxis = MEDmeshnAxis(medIdt,1); - char *axisname=new char[naxis*MED_SNAME_SIZE+1]; - char *axisunit=new char[naxis*MED_SNAME_SIZE+1]; - med_err aRet = MEDmeshInfo(medIdt, - 1, - meshname, - &spacedim, - &meshdim, - &meshtype, - descriptionription, - dtunit, - &sortingtype, - &nstep, - &axistype, - axisname, - axisunit); - - if (aRet < 0) - { - // GERALD -- QMESSAGE BOX - std::cerr << "Error : mesh is unreadable" << std::endl; - return LesExtremes; - } - - med_bool chgt,trsf; - med_int nnoe = MEDmeshnEntity(medIdt, + std::vector LesExtremes; + med_err erreur = 0 ; + med_int medIdt ; + while ( erreur == 0 ) + { + // Ouverture du fichier + medIdt = MEDfileOpen(aFile,MED_ACC_RDONLY); + if ( medIdt < 0 ) + { + erreur = 1 ; + break ; + } + //Nombre de maillage : on ne peut en lire qu'un seul + med_int numberOfMeshes = MEDnMesh(medIdt) ; + if (numberOfMeshes != 1 ) + { + erreur = 2 ; + break ; + } + // Caracteristiques du maillage + char meshname[MED_NAME_SIZE+1]; + med_int spacedim,meshdim; + med_mesh_type meshtype; + char descriptionription[MED_COMMENT_SIZE+1]; + char dtunit[MED_SNAME_SIZE+1]; + med_sorting_type sortingtype; + med_int nstep; + med_axis_type axistype; + int naxis = MEDmeshnAxis(medIdt,1); + char *axisname=new char[naxis*MED_SNAME_SIZE+1]; + char *axisunit=new char[naxis*MED_SNAME_SIZE+1]; + erreur = MEDmeshInfo(medIdt, + 1, meshname, - MED_NO_DT, - MED_NO_IT, - MED_NODE, - MED_NO_GEOTYPE, - MED_COORDINATE, - MED_NO_CMODE, - &chgt, - &trsf); - if ( nnoe < 0) - { - // GERALD -- QMESSAGE BOX - std::cerr << "Error : mesh is unreadable" << std::endl; - return LesExtremes; - } + &spacedim, + &meshdim, + &meshtype, + descriptionription, + dtunit, + &sortingtype, + &nstep, + &axistype, + axisname, + axisunit); + delete[] axisname ; + delete[] axisunit ; + if ( erreur < 0 ) { break ; } + + // Nombre de noeuds + med_bool chgt,trsf; + med_int nnoe = MEDmeshnEntity(medIdt, + meshname, + MED_NO_DT, + MED_NO_IT, + MED_NODE, + MED_NO_GEOTYPE, + MED_COORDINATE, + MED_NO_CMODE, + &chgt, + &trsf); + if ( nnoe < 0 ) + { + erreur = 4; + break ; + } - med_float* coo = (med_float*) malloc(sizeof(med_float)*nnoe*spacedim); + // Les coordonnees + med_float* coo = (med_float*) malloc(sizeof(med_float)*nnoe*spacedim); - aRet = MEDmeshNodeCoordinateRd(medIdt, + erreur = MEDmeshNodeCoordinateRd(medIdt, meshname, MED_NO_DT, MED_NO_IT, MED_NO_INTERLACE, coo); - if ( aRet < 0) - { - // GERALD -- QMESSAGE BOX - std::cerr << "Error : mesh coordinates are unreadable" << std::endl; - return LesExtremes; - } + if ( erreur < 0 ) + { + free(coo) ; + break ; + } - med_float xmin,xmax,ymin,ymax,zmin,zmax; + // Calcul des extremes + med_float xmin,xmax,ymin,ymax,zmin,zmax; - xmin=coo[0]; - xmax=coo[0]; - for (int i=1;i 1) - { - ymin=coo[nnoe]; ymax=coo[nnoe]; - for (int i=nnoe+1;i<2*nnoe;i++) - { - ymin = std::min(ymin,coo[i]); - ymax = std::max(ymax,coo[i]); - } - } - else - { - ymin=0; - ymax=0; - zmin=0; - zmax=0; - } + xmin=coo[0]; + xmax=coo[0]; + for (int i=1;i 1) + { + ymin=coo[nnoe]; ymax=coo[nnoe]; + for (int i=nnoe+1;i<2*nnoe;i++) + { + ymin = std::min(ymin,coo[i]); + ymax = std::max(ymax,coo[i]); + } + } + else + { + ymin=0; + ymax=0; + zmin=0; + zmax=0; + } // - if (spacedim > 2) - { - zmin=coo[2*nnoe]; zmax=coo[2*nnoe]; - for (int i=2*nnoe+1;i<3*nnoe;i++) - { - zmin = std::min(zmin,coo[i]); - zmax = std::max(zmax,coo[i]); - } - } - else - { - zmin=0; - zmax=0; - } - MEDfileClose(medIdt); + if (spacedim > 2) + { + zmin=coo[2*nnoe]; zmax=coo[2*nnoe]; + for (int i=2*nnoe+1;i<3*nnoe;i++) + { + zmin = std::min(zmin,coo[i]); + zmax = std::max(zmax,coo[i]); + } + } + else + { + zmin=0; + zmax=0; + } - MESSAGE( "_______________________________________"); - MESSAGE( "xmin : " << xmin << " xmax : " << xmax ); - MESSAGE( "ymin : " << ymin << " ymax : " << ymax ); - MESSAGE( "zmin : " << zmin << " zmax : " << zmax ); - MESSAGE( "_______________________________________" ); - double epsilon = 1.e-6 ; - LesExtremes.push_back(xmin); - LesExtremes.push_back(xmax); - LesExtremes.push_back(0); - LesExtremes.push_back(ymin); - LesExtremes.push_back(ymax); - LesExtremes.push_back(0); - LesExtremes.push_back(zmin); - LesExtremes.push_back(zmax); - LesExtremes.push_back(0); + MESSAGE( "_______________________________________"); + MESSAGE( "xmin : " << xmin << " xmax : " << xmax ); + MESSAGE( "ymin : " << ymin << " ymax : " << ymax ); + MESSAGE( "zmin : " << zmin << " zmax : " << zmax ); + MESSAGE( "_______________________________________" ); + double epsilon = 1.e-6 ; + LesExtremes.push_back(xmin); + LesExtremes.push_back(xmax); + LesExtremes.push_back(0); + LesExtremes.push_back(ymin); + LesExtremes.push_back(ymax); + LesExtremes.push_back(0); + LesExtremes.push_back(zmin); + LesExtremes.push_back(zmax); + LesExtremes.push_back(0); double max1=std::max ( LesExtremes[1] - LesExtremes[0] , LesExtremes[4] - LesExtremes[3] ) ; @@ -310,42 +308,30 @@ std::vector GetBoundingBoxInMedFile(const char * aFile) // On fait un traitement pour dans le cas d'une coordonnee constante // inhiber ce cas en mettant un increment negatif // - double diff = LesExtremes[1] - LesExtremes[0]; - if (fabs(diff) > epsilon*max2) - { - LesExtremes[2] = diff/100.; - } - else - { - LesExtremes[2] = -1. ; - } - - diff = LesExtremes[4] - LesExtremes[3]; - if (fabs(diff) > epsilon*max2) - { - LesExtremes[5]=diff/100.; - } - else - { - LesExtremes[5] = -1. ; - } - - diff = LesExtremes[7] - LesExtremes[6]; - if (fabs(diff) > epsilon*max2) - { - LesExtremes[8]=diff/100.; - } - else - { - LesExtremes[8] = -1. ; - } - - MESSAGE ( "_______________________________________" ); - MESSAGE ( "xmin : " << LesExtremes[0] << " xmax : " << LesExtremes[1] << " xincr : " << LesExtremes[2] ); - MESSAGE ( "ymin : " << LesExtremes[3] << " ymax : " << LesExtremes[4] << " yincr : " << LesExtremes[5] ); - MESSAGE ( "zmin : " << LesExtremes[6] << " zmax : " << LesExtremes[7] << " zincr : " << LesExtremes[8] ); - MESSAGE ( "dmax : " << LesExtremes[9] ); - MESSAGE ( "_______________________________________" ); + double diff = LesExtremes[1] - LesExtremes[0]; + if ( fabs(diff) > epsilon*max2 ) { LesExtremes[2] = diff/100.; } + else { LesExtremes[2] = -1. ; } + + diff = LesExtremes[4] - LesExtremes[3]; + if ( fabs(diff) > epsilon*max2 ) { LesExtremes[5]=diff/100.; } + else { LesExtremes[5] = -1. ; } + + diff = LesExtremes[7] - LesExtremes[6]; + if ( fabs(diff) > epsilon*max2 ) { LesExtremes[8]=diff/100.; } + else { LesExtremes[8] = -1. ; } + + MESSAGE ( "_______________________________________" ); + MESSAGE ( "xmin : " << LesExtremes[0] << " xmax : " << LesExtremes[1] << " xincr : " << LesExtremes[2] ); + MESSAGE ( "ymin : " << LesExtremes[3] << " ymax : " << LesExtremes[4] << " yincr : " << LesExtremes[5] ); + MESSAGE ( "zmin : " << LesExtremes[6] << " zmax : " << LesExtremes[7] << " zincr : " << LesExtremes[8] ); + MESSAGE ( "dmax : " << LesExtremes[9] ); + MESSAGE ( "_______________________________________" ); + + free(coo) ; + break ; + } + // Fermeture du fichier + if ( medIdt > 0 ) MEDfileClose(medIdt); return LesExtremes; } -- 2.30.2