Salome HOME
interpolation des champs
authornicolas <nicolas>
Tue, 22 Oct 2013 13:14:45 +0000 (13:14 +0000)
committernicolas <nicolas>
Tue, 22 Oct 2013 13:14:45 +0000 (13:14 +0000)
26 files changed:
idl/HOMARD_Hypothesis.idl
idl/HOMARD_Iteration.idl
src/HOMARD/CMakeLists.txt
src/HOMARD/HOMARD.hxx [new file with mode: 0644]
src/HOMARD/HOMARD_Boundary.cxx
src/HOMARD/HOMARD_DriverTools.cxx
src/HOMARD/HOMARD_Hypothesis.cxx
src/HOMARD/HOMARD_Hypothesis.hxx
src/HOMARD/HOMARD_Iteration.cxx
src/HOMARD/HOMARD_Iteration.hxx
src/HOMARD/HOMARD_Zone.cxx
src/HOMARD/HomardDriver.cxx
src/HOMARD/HomardDriver.hxx
src/HOMARD/YACSDriver.cxx
src/HOMARDGUI/MonCreateHypothesis.cxx
src/HOMARDGUI/MonEditHypothesis.cxx
src/HOMARD_I/HOMARD_Cas_i.cxx
src/HOMARD_I/HOMARD_Gen_i.cxx
src/HOMARD_I/HOMARD_Hypothesis_i.cxx
src/HOMARD_I/HOMARD_Hypothesis_i.hxx
src/HOMARD_I/HOMARD_Iteration_i.cxx
src/HOMARD_I/HOMARD_Iteration_i.hxx
src/HOMARD_SCRIPTS/CMakeLists.txt [deleted file]
src/HOMARD_SCRIPTS/testHomard.py [deleted file]
src/HOMARD_SCRIPTS/test_homard.py [deleted file]
tests/test_1.py

index 2137fd8034db89093abb61b982bb4cbfb3f95b7a..ab8c55fb8502beed932d934f648ae32f2174b63a 100644 (file)
@@ -40,8 +40,8 @@ module HOMARD
   typedef sequence<string> listeZonesHypo ;
   typedef sequence<string> listeIters ;
   typedef sequence<string> listeComposantsHypo ;
-  typedef sequence<long>   listeTypes;
-  typedef sequence<string> listFieldInterpHypo;
+  typedef sequence<long>   listeTypes ;
+  typedef sequence<string> listeFieldInterpsHypo ;
 
   struct InfosHypo
   {
@@ -109,8 +109,11 @@ module HOMARD
     void     SetTypeFieldInterp(in long TypeFieldInterp)   raises (SALOME::SALOME_Exception);
     long     GetTypeFieldInterp()                          raises (SALOME::SALOME_Exception);
     void     AddFieldInterp(in string FieldInterp)         raises (SALOME::SALOME_Exception);
-    void     SupprFieldInterp()                            raises (SALOME::SALOME_Exception);
-    listFieldInterpHypo GetListFieldInterp()               raises (SALOME::SALOME_Exception);
+    void     AddFieldInterpType(in string FieldInterp, in long TypeInterp)
+                                                           raises (SALOME::SALOME_Exception);
+    void     SupprFieldInterp(in string FieldInterp)       raises (SALOME::SALOME_Exception);
+    void     SupprFieldInterps()                           raises (SALOME::SALOME_Exception);
+    listeFieldInterpsHypo GetFieldInterps()                raises (SALOME::SALOME_Exception);
 
 // Liens avec les autres structures
     void     SetCaseCreation(in string NomCas)             raises (SALOME::SALOME_Exception);
index cbf487022a92b2523e9b729371639fc89d67ed4f..1addb5f126cf575fb5a1dbb73bea9e0af74c2dd3 100644 (file)
@@ -36,6 +36,8 @@
 module HOMARD
 {
   typedef sequence<string> listeIterFilles ;
+  typedef sequence<string> listeFieldInterpsIter ;
+  typedef sequence<string> listeFieldInterpTSRsIter ;
 
   interface HOMARD_Iteration : Engines::EngineComponent
   {
@@ -67,12 +69,26 @@ module HOMARD
 
     void     SetFieldFile(in string FieldFile)             raises (SALOME::SALOME_Exception);
     string   GetFieldFile()                                raises (SALOME::SALOME_Exception);
+
+// Instants pour le champ de pilotage
+    void     SetTimeStep(in long TimeStep)                 raises (SALOME::SALOME_Exception);
     void     SetTimeStepRank(in long TimeStep, in long Rank)
                                                            raises (SALOME::SALOME_Exception);
     void     SetTimeStepRankLast()                         raises (SALOME::SALOME_Exception);
     long     GetTimeStep()                                 raises (SALOME::SALOME_Exception);
     long     GetRank()                                     raises (SALOME::SALOME_Exception);
 
+// Instants pour un champ a interpoler
+    void     SetFieldInterpTimeStep(in string FieldInterp, in long TimeStep)
+                                                           raises (SALOME::SALOME_Exception);
+    void     SetFieldInterpTimeStepRank(in string FieldInterp, in long TimeStep, in long Rank)
+                                                           raises (SALOME::SALOME_Exception);
+    listeFieldInterpTSRsIter GetFieldInterpsTimeStepRank() raises (SALOME::SALOME_Exception);
+    void     SetFieldInterp(in string FieldInterp)         raises (SALOME::SALOME_Exception);
+    listeFieldInterpsIter GetFieldInterps()                raises (SALOME::SALOME_Exception);
+    void     SupprFieldInterps()                           raises (SALOME::SALOME_Exception);
+
+// Fichier des messages
     void     SetLogFile(in string LogFile)                 raises (SALOME::SALOME_Exception);
     string   GetLogFile()                                  raises (SALOME::SALOME_Exception);
 
index de819ba950dd8ee84d0b7414b46eda1836b5c13d..e472b5b348e40c390ff4cf150927394da5393a8e 100644 (file)
@@ -37,6 +37,7 @@ SET(_link_LIBRARIES
 
 # header files
 SET(HOMARDImpl_HEADERS
+  HOMARD.hxx
   HOMARD_Cas.hxx
   HOMARD_Boundary.hxx
   HOMARD_Hypothesis.hxx
diff --git a/src/HOMARD/HOMARD.hxx b/src/HOMARD/HOMARD.hxx
new file mode 100644 (file)
index 0000000..abc1805
--- /dev/null
@@ -0,0 +1,34 @@
+//  HOMARD HOMARD : implementation of HOMARD idl descriptions
+//
+// Copyright (C) 2011-2013  CEA/DEN, EDF R&D
+//
+// This library 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 2.1 of the License.
+//
+// This library 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 this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  File   : HOMARD.hxx
+//  Author : Paul RASCLE, EDF
+//  Module : HOMARD
+
+#ifndef _HOMARD_HXX_
+#define _HOMARD_HXX_
+
+// C'est le ASSERT de SALOMELocalTrace/utilities.h dans KERNEL
+#ifndef VERIFICATION
+#define VERIFICATION(condition) \
+        if (!(condition)){INTERRUPTION("CONDITION "<<#condition<<" NOT VERIFIED")}
+#endif /* VERIFICATION */
+
+#endif
index 464d24b8d673607747d978c69af6dd87740de519..24db564af733db58add2db43e9f7ce4b509013cf 100644 (file)
@@ -32,6 +32,7 @@
 // Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
 
 #include "HOMARD_Boundary.hxx"
+#include "HOMARD.hxx"
 #include "utilities.h"
 
 //=============================================================================
@@ -234,7 +235,7 @@ std::vector<double> HOMARD_Boundary::GetCoords() const
       mesCoor.push_back( _Rayon2 );
       break ;
     }
-    ASSERT ( _Type == -1 ) ;
+    VERIFICATION( (_Type>=1) and (_Type<=4) ) ;
   }
   return mesCoor;
 }
index 6f1c9a3b8bb7d5a95b7c8b671cc360f7f68535e7..b1d5f6f4a2501061a44c5396d3339e734d2c94eb 100644 (file)
@@ -230,7 +230,7 @@ namespace HOMARD
     for ( it = ListString.begin(); it != ListString.end(); ++it )
           os << separator() << *it;
 
-    ListString = hypothesis.GetListFieldInterp();
+    ListString = hypothesis.GetFieldInterps();
     os << separator() << ListString.size();
     for ( it = ListString.begin(); it != ListString.end(); ++it )
           os << separator() << *it;
@@ -616,7 +616,11 @@ namespace HOMARD
     for ( int i = 0; i < size; i++ ) {
       chunk = getNextChunk( stream, start, ok );
       if ( !ok ) return false;
-      hypothesis.AddFieldInterp( chunk.c_str() );
+      i++;
+      chunkNext = getNextChunk( stream, start, ok );
+      int TypeInterp = atoi( chunkNext.c_str() );
+      if ( !ok ) return false;
+      hypothesis.AddFieldInterpType( chunk.c_str(), TypeInterp );
     }
 
     chunk = getNextChunk( stream, start, ok );
index e5640d6fc1bdb15f826b5d9fc1a096662e96eab6..0902046541e7c64d9daa086fd6d23293e8322a75 100644 (file)
@@ -32,6 +32,7 @@
 // Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
 
 #include "HOMARD_Hypothesis.hxx"
+#include "HOMARD.hxx"
 #include "utilities.h"
 
 //=============================================================================
@@ -119,17 +120,22 @@ std::string HOMARD_Hypothesis::GetDumpPython() const
    for ( it=_ListGroupSelected.begin(); it!=_ListGroupSelected.end();it++)
        aScript << "\t" << _Name << ".AddGroup(\""  << (*it) <<  "\")\n" ;
 
-// Interpolation champ
-  aScript << "\t" << _Name << ".SetTypeFieldInterp(" << _TypeFieldInterp << ")\n";
+// Interpolation des champs
   if ( _TypeFieldInterp == 2 )
   {
     std::list<std::string>::const_iterator it_champ = _ListFieldInterp.begin();
     while(it_champ != _ListFieldInterp.end())
     {
-      aScript << "\t" << _Name << ".AddFieldInterp(\"" << *it_champ << "\")\n";
+      aScript << "\t" << _Name << ".AddFieldInterpType( \"" << *it_champ  <<  "\" " ;
+      it_champ++;
+      aScript << ", " << *it_champ << ")\n";
       it_champ++;
     }
   }
+  else if ( _TypeFieldInterp != 0 )
+  {
+    aScript << "\t" << _Name << ".SetTypeFieldInterp(" << _TypeFieldInterp << ")\n";
+  }
   if ( _NivMax > 0 )
   {
     aScript << "\t" <<_Name << ".SetNivMax(" << _NivMax << ")\n";
@@ -156,7 +162,7 @@ std::string HOMARD_Hypothesis::GetDumpPython() const
 //=============================================================================
 void HOMARD_Hypothesis::SetAdapType( int TypeAdap )
 {
-  ASSERT (!((TypeAdap < -1) or (TypeAdap > 1)));
+  VERIFICATION( (TypeAdap>=-1) and (TypeAdap<=1) );
   _TypeAdap = TypeAdap;
 }
 //=============================================================================
@@ -167,9 +173,11 @@ int HOMARD_Hypothesis::GetAdapType() const
 //=============================================================================
 void HOMARD_Hypothesis::SetRefinTypeDera( int TypeRaff, int TypeDera )
 {
-  ASSERT(!(( TypeRaff < 0) or (TypeRaff > 1)));
+    INFOS("SetRefinTypeDera TypeRaff="<<TypeRaff);
+    INFOS("SetRefinTypeDera TypeDera="<<TypeDera);
+  VERIFICATION( (TypeRaff>=-1) and (TypeRaff<=1) );
   _TypeRaff = TypeRaff;
-  ASSERT(! ((TypeDera < 0) or (TypeDera > 1)));
+  VERIFICATION( (TypeDera>=-1) and (TypeDera<=1) );
   _TypeDera = TypeDera;
 }
 //=============================================================================
@@ -196,7 +204,7 @@ std::string HOMARD_Hypothesis::GetFieldName() const
 //=============================================================================
 void HOMARD_Hypothesis::SetUseField( int UsField )
 {
-  ASSERT(!((UsField < 0) or (UsField > 1 )));
+  VERIFICATION( (UsField>=0) and (UsField<=1) );
   _UsField = UsField;
 }
 //=============================================================================
@@ -207,7 +215,7 @@ int HOMARD_Hypothesis::GetUseField() const
 //=============================================================================
 void HOMARD_Hypothesis::SetUseComp( int UsCmpI )
 {
-  ASSERT(!((UsCmpI < 0) or (UsCmpI > 2)));
+  VERIFICATION( (UsCmpI>=0) and (UsCmpI<=2) );
   _UsCmpI = UsCmpI;
 }
 //=============================================================================
@@ -246,7 +254,7 @@ const std::list<std::string>& HOMARD_Hypothesis::GetComps() const
 void HOMARD_Hypothesis::SetRefinThr( int TypeThR, double ThreshR )
 {
   MESSAGE( "SetRefinThr : TypeThR = " << TypeThR << ", ThreshR = " << ThreshR );
-  ASSERT(!(( TypeThR < 0) or (TypeThR > 4 )));
+  VERIFICATION( (TypeThR>=0) and (TypeThR<=4) );
   _TypeThR = TypeThR;
   _ThreshR = ThreshR;
 }
@@ -263,7 +271,7 @@ double HOMARD_Hypothesis::GetThreshR() const
 //=============================================================================
 void HOMARD_Hypothesis::SetUnRefThr( int TypeThC, double ThreshC )
 {
-  ASSERT(!((TypeThC < 0) or (TypeThC > 4)));
+  VERIFICATION( (TypeThC>=0) and (TypeThC<=4) );
   _TypeThC = TypeThC;
   _ThreshC = ThreshC;
 }
@@ -344,9 +352,13 @@ const std::list<std::string>& HOMARD_Hypothesis::GetGroups() const
   return _ListGroupSelected;
 }
 //=============================================================================
+// Type d'interpolation des champs :
+//   0 : aucun champ n'est interpole
+//   1 : tous les champs sont interpoles
+//   2 : certains champs sont interpoles
 void HOMARD_Hypothesis::SetTypeFieldInterp( int TypeFieldInterp )
 {
-  ASSERT (!((TypeFieldInterp < -1) or (TypeFieldInterp > 2)));
+  VERIFICATION( (TypeFieldInterp>=0) and (TypeFieldInterp<=2) );
   _TypeFieldInterp = TypeFieldInterp;
 }
 //=============================================================================
@@ -355,18 +367,59 @@ int HOMARD_Hypothesis::GetTypeFieldInterp() const
   return _TypeFieldInterp;
 }
 //=============================================================================
-void HOMARD_Hypothesis::AddFieldInterp( const char* FieldInterp )
+void HOMARD_Hypothesis::AddFieldInterpType( const char* FieldInterp, int TypeInterp )
 {
+  MESSAGE ("Dans AddFieldInterpType pour " << FieldInterp << " et TypeInterp = " << TypeInterp) ;
+// On commence par supprimer le champ au cas ou il aurait deja ete insere
+// Cela peut se produire dans un schema YACS quand on repasse plusieurs fois par la
+// definition de l'hypothese
+  SupprFieldInterp( FieldInterp ) ;
+// Insertion veritable
+// . Nom du champ
   _ListFieldInterp.push_back( std::string( FieldInterp ) );
+// . Usage du champ
+  std::stringstream saux1 ;
+  saux1 << TypeInterp ;
+  _ListFieldInterp.push_back( saux1.str() );
+// . Indication generale : certains champs sont a interpoler
+  SetTypeFieldInterp ( 2 ) ;
 }
 //=============================================================================
-void HOMARD_Hypothesis::SupprFieldInterp()
+void HOMARD_Hypothesis::SupprFieldInterp( const char* FieldInterp )
 {
-  MESSAGE ("SupprFieldInterp") ;
+  MESSAGE ("Dans SupprFieldInterp pour " << FieldInterp) ;
+  std::list<std::string>::iterator it = find( _ListFieldInterp.begin(), _ListFieldInterp.end(), FieldInterp ) ;
+// Attention a supprimer le nom du champ et le type d'usage
+  if ( it != _ListFieldInterp.end() )
+  {
+    it = _ListFieldInterp.erase( it ) ;
+    it = _ListFieldInterp.erase( it ) ;
+  }
+// Decompte du nombre de champs restant a interpoler
+  it = _ListFieldInterp.begin() ;
+  int cpt = 0 ;
+  while(it != _ListFieldInterp.end())
+  {
+    cpt += 1 ;
+    (*it++);
+  }
+  MESSAGE("Nombre de champ restants = "<<cpt/2);
+// . Indication generale : aucun champ ne reste a interpoler
+  if ( cpt == 0 )
+  {
+    SetTypeFieldInterp ( 0 ) ;
+  }
+}
+//=============================================================================
+void HOMARD_Hypothesis::SupprFieldInterps()
+{
+  MESSAGE ("SupprFieldInterps") ;
   _ListFieldInterp.clear();
+// . Indication generale : aucun champ ne reste a interpoler
+  SetTypeFieldInterp ( 0 ) ;
 }
 //=============================================================================
-const std::list<std::string>& HOMARD_Hypothesis::GetListFieldInterp() const
+const std::list<std::string>& HOMARD_Hypothesis::GetFieldInterps() const
 {
   return _ListFieldInterp;
 }
@@ -412,8 +465,8 @@ const std::list<std::string>& HOMARD_Hypothesis::GetIterations() const
 //=============================================================================
 void HOMARD_Hypothesis::AddZone( const char* NomZone, int TypeUse )
 {
-  MESSAGE ("Dans AddZone pour " << NomZone) ;
-// On commence par la supprimer au cas ou elle aurait deja ete inseree
+  MESSAGE ("Dans AddZone pour " << NomZone << " et TypeUse = " << TypeUse) ;
+// On commence par supprimer la zone au cas ou elle aurait deja ete inseree
 // Cela peut se produire dans un schema YACS quand on repasse plusieurs fois par la
 // definition de l'hypothese
   SupprZone( NomZone ) ;
index 439d43e9c661ee7bc80aefadad8d8900cbcca0db..83f9c592b69a3bd5585db9644a1653e80695019a 100644 (file)
@@ -93,9 +93,10 @@ public:
 
   void                          SetTypeFieldInterp( int TypeFieldInterp );
   int                           GetTypeFieldInterp() const;
-  void                          AddFieldInterp( const char* FieldInterp );
-  void                          SupprFieldInterp();
-  const std::list<std::string>& GetListFieldInterp() const;
+  void                          AddFieldInterpType( const char* FieldInterp, int TypeInterp );
+  void                          SupprFieldInterp( const char* FieldInterp );
+  void                          SupprFieldInterps();
+  const std::list<std::string>& GetFieldInterps() const;
 
 // Liens avec les autres structures
   void                          SetCaseCreation( const char* NomCasCreation );
@@ -142,6 +143,7 @@ private:
   std::list<std::string>        _ListComp;
   std::list<std::string>        _ListGroupSelected;
   std::list<std::string>        _ListFieldInterp;
+
 };
 
 #endif
index 09bc0ad3b2575df2d8b3719c163014e3b1abc096..592154ba76c6a77e7ff428e596aa9b16a83de512 100644 (file)
@@ -32,6 +32,7 @@
 // Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
 
 #include "HOMARD_Iteration.hxx"
+#include "HOMARD.hxx"
 #include "utilities.h"
 
 //=============================================================================
@@ -91,28 +92,61 @@ std::string HOMARD_Iteration::GetDumpPython() const
   {
        aScript << "\t" << _Name << " = " << _IterParent << ".NextIteration(\"" << _Name << "\")\n";
   }
+// L'hypothese (doit etre au debut)
+  aScript << "\t" << _Name << ".AssociateHypo(\"" << _NomHypo << "\")\n";
 // Le nom du maillage produit
 //   MESSAGE (".. maillage produit " << _NomMesh );
   aScript << "\t" << _Name << ".SetMeshName(\"" << _NomMesh << "\")\n" ;
 // Le fichier du maillage produit
   aScript << "\t" << _Name << ".SetMeshFile(\"" << _MeshFile << "\")\n";
-// Le fichier des champs, avec l'instant eventuel
-  if ( _FieldFile != "" ) {
+// Le fichier des champs
+  if ( _FieldFile != "" )
+  {
     aScript << "\t" << _Name << ".SetFieldFile(\"" << _FieldFile << "\")\n";
+  }
+// Si champ de pilotage, valeurs de pas de temps
+  MESSAGE (". champ de pilotage : _TimeStep = " << _TimeStep << ", _Rank : " << _Rank);
+  if ( _TimeStep != -1 )
+  {
     if ( _TimeStep == -2 ) {
       aScript << "\t" << _Name << ".SetTimeStepRankLast()\n";
     }
     else
     {
-      if ( ( _TimeStep != -1 ) and ( _Rank != -1 ) ) {
-        aScript << "\t" << _Name << ".SetTimeStepRank( " << _TimeStep << ", " << _Rank << " )\n";
+      if ( _TimeStep != -1 )
+      {
+        if ( _Rank == -1 )
+        {
+          aScript << "\t" << _Name << ".SetTimeStep( " << _TimeStep << " )\n";
+        }
+        else
+        {
+          aScript << "\t" << _Name << ".SetTimeStepRank( " << _TimeStep << ", " << _Rank << " )\n";
+        }
       }
     }
   }
+// Les instants d'interpolation
+  MESSAGE (". instants d'interpolation ");
+  std::list<std::string>::const_iterator it = _ListFieldInterpTSR.begin() ;
+  while(it != _ListFieldInterpTSR.end())
+  {
+    std::string FieldName = std::string((*it)) ;
+//     MESSAGE ("... FieldName = "<< FieldName);
+    (*it++);
+    std::string TimeStepstr = std::string((*it)) ;
+//     MESSAGE ("... TimeStepstr = "<< TimeStepstr);
+    (*it++);
+    std::string Rankstr = std::string((*it)) ;
+//     MESSAGE ("... Rankstr = "<< Rankstr);
+    (*it++);
+    aScript << "\t" << _Name << ".SetFieldInterpTimeStepRank( \"" << FieldName << "\"" ;
+    aScript << ", " << TimeStepstr ;
+    aScript << ", " << Rankstr << " )\n" ;
+  }
 
-//   MESSAGE (".. Hypothese " << _NomHypo );
-  aScript << "\t" << _Name << ".AssociateHypo(\"" << _NomHypo << "\")\n";
-
+// Compute
+  MESSAGE (". Compute ");
   if (_Etat == true) { aScript << "\tcodret = "  <<_Name << ".Compute(1, 1)\n"; }
   else               { aScript << "\t#codret = " <<_Name << ".Compute(1, 1)\n"; }
 //   MESSAGE (". Fin de l ecriture de l iteration " << _Name );
@@ -184,6 +218,13 @@ std::string HOMARD_Iteration::GetFieldFile() const
   return _FieldFile;
 }
 //=============================================================================
+// Instants pour le champ de pilotage
+//=============================================================================
+void HOMARD_Iteration::SetTimeStep( int TimeStep )
+{
+  _TimeStep = TimeStep;
+}
+//=============================================================================
 void HOMARD_Iteration::SetTimeStepRank( int TimeStep, int Rank )
 {
   _TimeStep = TimeStep;
@@ -205,6 +246,56 @@ int HOMARD_Iteration::GetRank() const
   return _Rank;
 }
 //=============================================================================
+// Instants pour un champ a interpoler
+//=============================================================================
+void HOMARD_Iteration::SetFieldInterpTimeStep( const char* FieldInterp, int TimeStep )
+{
+  SetFieldInterpTimeStepRank( FieldInterp, TimeStep, TimeStep ) ;
+}
+//=============================================================================
+void HOMARD_Iteration::SetFieldInterpTimeStepRank( const char* FieldInterp, int TimeStep, int Rank )
+{
+  MESSAGE("Champ " << FieldInterp << ", hypothese " << _NomHypo )
+// Verification de la presence du champ dans l'hypothese
+  std::list<std::string>::iterator it = find( _ListFieldInterp.begin(), _ListFieldInterp.end(), FieldInterp );
+  if ( it == _ListFieldInterp.end() )
+  {
+    INFOS("Champ " << FieldInterp << " ; hypothese " << _NomHypo )
+    VERIFICATION("Le champ est inconnu dans l'hypothese associee a cette iteration." == 0);
+  }
+
+// . Nom du champ
+  _ListFieldInterpTSR.push_back( std::string( FieldInterp ) );
+// . Pas de temps
+  std::stringstream saux1 ;
+  saux1 << TimeStep ;
+  _ListFieldInterpTSR.push_back( saux1.str() );
+// . Numero d'ordre
+  std::stringstream saux2 ;
+  saux2 << Rank ;
+  _ListFieldInterpTSR.push_back( saux2.str() );
+}
+//=============================================================================
+const std::list<std::string>& HOMARD_Iteration::GetFieldInterpsTimeStepRank() const
+{
+  return _ListFieldInterpTSR;
+}
+//=============================================================================
+void HOMARD_Iteration::SetFieldInterp( const char* FieldInterp )
+{
+  _ListFieldInterp.push_back( std::string( FieldInterp ) );
+}
+//=============================================================================
+const std::list<std::string>& HOMARD_Iteration::GetFieldInterps() const
+{
+  return _ListFieldInterp;
+}
+//=============================================================================
+void HOMARD_Iteration::SupprFieldInterps()
+{
+  _ListFieldInterp.clear();
+}
+//=============================================================================
 void HOMARD_Iteration::SetLogFile( const char* LogFile )
 {
   _LogFile = std::string( LogFile );
index 5013783dadee40f01639bd4f218322b9b96aa80f..3acf698f8d1c815e4e33cda9999b1a6a55324f82 100644 (file)
@@ -67,10 +67,19 @@ public:
 
   void                          SetFieldFile( const char* FieldFile );
   std::string                   GetFieldFile() const;
+// Instants pour le champ de pilotage
+  void                          SetTimeStep( int TimeStep );
   void                          SetTimeStepRank( int TimeStep, int Rank );
   void                          SetTimeStepRankLast();
   int                           GetTimeStep() const;
   int                           GetRank() const;
+// Instants pour un champ a interpoler
+  void                          SetFieldInterpTimeStep( const char* FieldInterp, int TimeStep );
+  void                          SetFieldInterpTimeStepRank( const char* FieldInterp, int TimeStep, int Rank );
+  const std::list<std::string>& GetFieldInterpsTimeStepRank() const;
+  void                          SetFieldInterp( const char* FieldInterp );
+  const std::list<std::string>& GetFieldInterps() const;
+  void                          SupprFieldInterps();
 
   void                          SetLogFile( const char* LogFile );
   std::string                   GetLogFile() const;
@@ -115,6 +124,10 @@ private:
   std::list<std::string>        _mesIterFilles;
   std::string                   _FileInfo;
   int                           _MessInfo;
+  // La liste des champs retenus par l'hypothese
+  std::list<std::string>        _ListFieldInterp;
+  // La liste des triplets (champs, pas de temps, numero d'ordre) retenus par l'iteration
+  std::list<std::string>        _ListFieldInterpTSR;
 };
 
 #endif
index b0e862c2e552a1abceef7bde9ac3fb91ce6133b3..d4a207f10198575348e0b44e57900dbe2c2d7064 100644 (file)
@@ -32,6 +32,7 @@
 // Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
 
 #include "HOMARD_Zone.hxx"
+#include "HOMARD.hxx"
 #include "utilities.h"
 
 //=============================================================================
@@ -275,7 +276,7 @@ std::vector<double> HOMARD_Zone::GetCoords() const
       mesCoor.push_back( _Rayonint ) ;
       break ;
     }
-    ASSERT ( _Type == -1 ) ;
+    VERIFICATION ( ( (_Type>10) and (_Type<14) ) or (_Type==2) or ( (_Type>30) and (_Type<34) ) or (_Type==4) or (_Type==5) or ( (_Type>60) and (_Type<64) ) or (_Type==7) ) ;
   }
   return mesCoor;
 }
index 04e810b8c43db196da761bb360af8bf9a8a85ee1..3da2f75a80029f17ae7c966c742dfb0b3097501b 100644 (file)
@@ -25,9 +25,9 @@
 #include <unistd.h>
 #include <sys/stat.h>
 
+#include "HomardDriver.hxx"
 #include "Utils_SALOME_Exception.hxx"
 #include "utilities.h"
-#include "HomardDriver.hxx"
 
 //=============================================================================
 //=============================================================================
@@ -60,6 +60,8 @@ HomardDriver::~HomardDriver()
 {
 }
 //===============================================================================
+// A. Generalites
+//===============================================================================
 void HomardDriver::TexteInit( const std::string DirCompute, const std::string LogFile, const std::string Langue )
 {
   MESSAGE("TexteInit, DirCompute ="<<DirCompute<<", LogFile ="<<LogFile);
@@ -105,7 +107,8 @@ void HomardDriver::TexteInfo( int TypeBila, int NumeIter )
   }
 //
 }
-
+//===============================================================================
+// B. Les maillages en entree et en sortie
 //===============================================================================
 void HomardDriver::TexteMaillage( const std::string NomMesh, const std::string MeshFile, int apres )
 {
@@ -131,6 +134,8 @@ void HomardDriver::TexteMaillageHOMARD( const std::string Dir, const std::string
   _Texte += "HOMaiN" + saux + " Mai" + liter   + " \"" + Dir + "/maill." + liter   + ".hom.med\"\n" ;
 }
 
+//===============================================================================
+// C. Le pilotage de l'adaptation
 //===============================================================================
 void HomardDriver::TexteConfRaffDera( int ConfType, int TypeAdap, int TypeRaff, int TypeDera )
 {
@@ -142,6 +147,11 @@ void HomardDriver::TexteConfRaffDera( int ConfType, int TypeAdap, int TypeRaff,
   std::string saux ;
   switch (ConfType)
   {
+    case -1: //
+    {
+      saux = "conforme_boites" ;
+      break;
+    }
     case 1: //
     {
       saux = "conforme" ;
@@ -519,6 +529,7 @@ void HomardDriver::TexteField( const std::string FieldName, const std::string Fi
       saux2 = saux1.str() ;
       _Texte += "CCNumPTI " + saux2  + "\n" ;
     }
+    if ( Rank >= 0 )
     {
       std::stringstream saux1 ;
       saux1 << Rank ;
@@ -590,6 +601,8 @@ void HomardDriver::TexteGroup( const std::string GroupName )
 //
 }
 //===============================================================================
+// D. Les frontieres
+//===============================================================================
 void HomardDriver::TexteBoundaryOption( int BoundaryOption )
 {
   MESSAGE("TexteBoundaryOption, BoundaryOption = "<<BoundaryOption);
@@ -811,52 +824,76 @@ void HomardDriver::TexteBoundaryAnGr( const std::string NameBoundary, int NumeBo
 //
 }
 //===============================================================================
-void HomardDriver::TexteFieldInterp( int TypeFieldInterp, const std::string FieldFile, const std::string MeshFile, int TimeStep, int Rank )
+// E. Les interpolations
+//===============================================================================
+// Les fichiers d'entree et de sortie des champs a interpoler
+void HomardDriver::TexteFieldInterp( const std::string FieldFile, const std::string MeshFile )
 {
-  MESSAGE("TexteFieldInterp, TypeFieldInterp = "<<TypeFieldInterp);
   MESSAGE("TexteFieldInterp, FieldFile = "<<FieldFile<<", MeshFile = "<<MeshFile);
-  MESSAGE("TexteFieldInterp, TimeStep = "<<TimeStep<<", Rank = "<<Rank);
 //
-// Type d'interpolation
+  _Texte += "#\n# Interpolations des champs\n" ;
 //
-  _Texte += "# Interpolations des champs\n" ;
+// Fichier en entree
   _Texte += "CCSolN__ \"" + FieldFile + "\"\n" ;
+// Fichier en sortie
   _Texte += "CCSolNP1 \"" + MeshFile  + "\"\n" ;
-  if ( TypeFieldInterp == 1 )
-  {
-    _Texte += "CCChaTou oui\n" ;
-  }
-//
-  _TimeStep = TimeStep ;
-  _Rank = Rank ;
 //
 //  std::cerr << "A la fin de TexteFieldInterp _Texte ="<<_Texte << std::endl;
 }
 //===============================================================================
-void HomardDriver::TexteFieldInterpName( int NumeChamp, const std::string FieldName)
+// Tous les champs sont a interpoler
+void HomardDriver::TexteFieldInterpAll( )
 {
-  MESSAGE("TexteFieldInterpName, NumeChamp = "<<NumeChamp<<", FieldName = "<<FieldName);
+  MESSAGE("TexteFieldInterpAll");
+//
+  _Texte += "CCChaTou oui\n" ;
+}
+//===============================================================================
+// Ecrit les caracteristiques de chaque interpolation sous la forme :
+//   CCChaNom 1 "DEPL"     ! Nom du 1er champ a interpoler
+//   CCChaTIn 1 0          ! Mode d'interpolation : automatique
+//   CCChaNom 2 "VOLUME"   ! Nom du 2nd champ a interpoler
+//   CCChaTIn 2 1          ! Mode d'interpolation : une variable extensive
+//   CCChaPdT 2 14         ! Pas de temps 14
+//   CCChaNuO 2 14         ! Numero d'ordre 14
+//   etc.
+//
+// NumeChamp : numero d'ordre du champ a interpoler
+// FieldName : nom du champ
+// TypeInterp : type d'interpolation
+// TimeStep : pas de temps retenu (>0 si pas de precision)
+// Rank : numero d'ordre retenu
+//
+void HomardDriver::TexteFieldInterpNameType( int NumeChamp, const std::string FieldName, const std::string TypeInterp, int TimeStep, int Rank)
+{
+  MESSAGE("TexteFieldInterpNameType, NumeChamp = "<<NumeChamp<<", FieldName = "<<FieldName<<", TypeInterp = "<<TypeInterp);
+  MESSAGE("TexteFieldInterpNameType, TimeStep = "<<TimeStep<<", Rank = "<<Rank);
+// Numero d'ordre du champ a interpoler
   std::stringstream saux1 ;
-  saux1 << NumeChamp+1 ;
+  saux1 << NumeChamp ;
   std::string saux = saux1.str() ;
+// Nom du champ
   _Texte +="CCChaNom " + saux + " \"" + FieldName + "\"\n" ;
+// Type d'interpolation pour le champ
+  _Texte +="CCChaTIn " + saux + " " + TypeInterp + "\n" ;
 //
-  MESSAGE("TexteFieldInterpName, _TimeStep = "<<_TimeStep<<", _Rank = "<<_Rank);
-  if ( _TimeStep >= 0 )
+  if ( TimeStep >= 0 )
   {
     {
       std::stringstream saux1 ;
-      saux1 << _TimeStep ;
+      saux1 << TimeStep ;
       _Texte += "CCChaPdT " + saux + " " + saux1.str()  + "\n" ;
     }
     {
       std::stringstream saux1 ;
-      saux1 << _Rank ;
+      saux1 << Rank ;
       _Texte += "CCChaNuO " + saux + " " + saux1.str()  + "\n" ;
     }
   }
 }
 //===============================================================================
+// F. Les options avancees
+//===============================================================================
 void HomardDriver::TexteAdvanced( int Pyram, int NivMax, double DiamMin, int AdapInit, int LevelOutput )
 {
   MESSAGE("TexteAdvanced, Pyram ="<<Pyram<<", NivMax ="<<NivMax<<", DiamMin ="<<DiamMin<<", AdapInit ="<<AdapInit<<", LevelOutput ="<<LevelOutput);
@@ -901,6 +938,8 @@ void HomardDriver::TexteAdvanced( int Pyram, int NivMax, double DiamMin, int Ada
   }
 }
 //===============================================================================
+// G. Les messages
+//===============================================================================
 void HomardDriver::TexteInfoCompute( int MessInfo )
 {
   MESSAGE("TexteAdvanced, MessInfo ="<<MessInfo);
index f98c11af0cec2f62503345a76f11841284ab110d..f75754ac6d1e3461db5bbeac21216fa0158d8766 100644 (file)
@@ -53,9 +53,9 @@ public:
   void        TexteBoundaryAn( const std::string NameBoundary, int NumeBoundary, int BoundaryType, double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7 );
   void        TexteBoundaryAnGr( const std::string NameBoundary, int NumeBoundary, const std::string GroupName );
 
-  void        TexteFieldInterp( int TypeFieldInterp, const std::string FieldFile, const std::string MeshFile,
-                                int TimeStep, int Rank );
-  void        TexteFieldInterpName( int NumeChamp, const std::string FieldName );
+  void        TexteFieldInterp( const std::string FieldFile, const std::string MeshFile );
+  void        TexteFieldInterpAll();
+  void        TexteFieldInterpNameType( int NumeChamp, const std::string FieldName, const std::string TypeInterp, int TimeStep, int Rank );
   void        TexteAdvanced( int Pyram, int NivMax, double DiamMin, int AdapInit, int LevelOutput );
   void        TexteInfoCompute( int MessInfo );
   //
index d3ac23f8c95d63738e94b901d31916da6be572e0..982217e2ffbdac74bdefb4210d81dd382c46e102 100644 (file)
 #include <unistd.h>
 #include <sys/stat.h>
 
+#include "YACSDriver.hxx"
+#include "HOMARD.hxx"
 #include "Utils_SALOME_Exception.hxx"
 #include "utilities.h"
-#include "YACSDriver.hxx"
 
 //=============================================================================
 //=============================================================================
@@ -254,7 +255,7 @@ std::string YACSDriver::Texte_Iter_1_Zone( int ZoneType, const std::string pytho
 //
 // 4.2. Erreur
   else
-  { ASSERT("Type de zone inconnu." == 0); }
+  { VERIFICATION("Type de zone inconnu." == 0); }
 
 //
 // 5. La fin
@@ -404,7 +405,7 @@ std::string YACSDriver::Texte_Iter_1_Boundary( int BoundaryType, const std::stri
 //
 // 4.2. Erreur
   else
-  { ASSERT("Type de frontiere inconnu." == 0); }
+  { VERIFICATION("Type de frontiere inconnu." == 0); }
 
 //
 // 5. La fin
index 560a41bba4d3e2eaa5563ecd2639963431262548..24ad732b397f89520ea07f03f565e6968d1d0bcb 100644 (file)
@@ -460,8 +460,12 @@ void MonCreateHypothesis::AssocieFieldInterp()
 {
   if ( _TypeFieldInterp != 2 ) return;
   for ( int row=0; row< TWField->rowCount(); row++)
-      if ( TWField->item( row, 0 )->checkState() == Qt::Checked )
-      { aHypothesis->AddFieldInterp(TWField->item(row, 1)->text().toStdString().c_str()); }
+  {
+    if ( TWField->item( row, 0 )->checkState() == Qt::Checked )
+    {
+      aHypothesis->AddFieldInterp(TWField->item(row, 1)->text().toStdString().c_str());
+    }
+  }
 }
 // ------------------------------------------------------------------------
 void MonCreateHypothesis::SetUniRaff()
index c1452e511de8f2bd9c442200a755d8be20965a4b..19478b3d014f49044b99bc049743fbb7dd3a413f 100644 (file)
@@ -25,6 +25,7 @@ using namespace std;
 #include "SalomeApp_Tools.h"
 #include "HOMARDGUI_Utils.h"
 #include "HomardQtCommun.h"
+#include "HOMARD.hxx"
 #include <utilities.h>
 // ----------------------------------------------------------------------------
 MonEditHypothesis::MonEditHypothesis( MonCreateIteration* parent, bool modal,
@@ -161,13 +162,13 @@ void MonEditHypothesis::InitAdaptUniforme()
 // Raffinement ou deraffinement ?
     if (_aTypeDera == 0)
     {
-        ASSERT(_aTypeRaff==1);
+        VERIFICATION(_aTypeRaff==1);
         RBUniDera->setChecked(false);
         RBUniRaff->setChecked(true);
     }
     if (_aTypeDera == 1)
     {
-        ASSERT(_aTypeRaff==0);
+        VERIFICATION(_aTypeRaff==0);
         RBUniDera->setChecked(true);
         RBUniRaff->setChecked(false);
     }
@@ -371,19 +372,20 @@ void MonEditHypothesis::InitFieldInterp()
       RBFieldChosen->setChecked(true);
 //
       TWField->setVisible(1);
-      HOMARD::listFieldInterpHypo_var mesChampsAvant = aHypothesis->GetListFieldInterp();
+      HOMARD::listeFieldInterpsHypo_var mesChampsAvant = aHypothesis->GetFieldInterps();
       TWField->clear();
       TWField->setRowCount(0);
       TWField->resizeRowsToContents();
-      for (int i=0; i<mesChampsAvant->length(); i++)
+      for (int iaux=0; iaux<mesChampsAvant->length(); iaux++)
       {
         TWField->insertRow(0);
         TWField->setItem( 0, 0, new QTableWidgetItem( QString ("") ) );
         TWField->item( 0, 0 )->setFlags( Qt::ItemIsUserCheckable|Qt::ItemIsEnabled);
         TWField->item( 0, 0 )->setCheckState(Qt::Checked );
         TWField->item( 0, 0 )->setFlags( 0 );
-        TWField->setItem( 0, 1, new QTableWidgetItem(QString(mesChampsAvant[i]).trimmed()));
+        TWField->setItem( 0, 1, new QTableWidgetItem(QString(mesChampsAvant[iaux]).trimmed()));
         TWField->item( 0, 1 )->setFlags( Qt::ItemIsEnabled |Qt::ItemIsSelectable );
+        iaux++;
       }
       TWField->resizeColumnsToContents();
       TWField->resizeRowsToContents();
index 8338f814dd2e531bd64f39c3bc6ad9c89f996674..bc459d4604eef24b7e379aaf26ab12c517d6deda 100755 (executable)
@@ -30,6 +30,7 @@
 #include "HOMARD_Gen_i.hxx"
 #include "HOMARD_Cas.hxx"
 #include "HOMARD_DriverTools.hxx"
+#include "HOMARD.hxx"
 
 #include "utilities.h"
 #include <vector>
@@ -419,7 +420,7 @@ HOMARD::HOMARD_Iteration_ptr HOMARD_Cas_i::LastIteration( )
     nbiterfilles = ListeIterFilles->length() ;
 //     MESSAGE ( ".. nbiterfilles = " << nbiterfilles );
 // S'il y a au moins 2 filles, arret : on ne sait pas faire
-    ASSERT( nbiterfilles <= 1 ) ;
+    VERIFICATION( nbiterfilles <= 1 ) ;
 // S'il y a une fille unique, on recupere le nom de la fille et on recommence
     if ( nbiterfilles == 1 )
     { IterName = ListeIterFilles[0] ; }
index 2b65286b3cd34e5606b93c4def87617de1e59a6b..3fd2d1bf1c1ddbfd3429b85df9ec0e6f77e0c75a 100755 (executable)
@@ -28,6 +28,7 @@
 #include "HOMARD_DriverTools.hxx"
 #include "HomardMedCommun.h"
 #include "YACSDriver.hxx"
+#include "HOMARD.hxx"
 
 #include "HOMARD_version.h"
 
@@ -820,16 +821,19 @@ void HOMARD_Gen_i::AssociateIterHypo(const char* nomIter, const char* nomHypo)
 {
   MESSAGE("AssociateIterHypo : nomHypo = " << nomHypo << " nomIter = " << nomIter);
 
+  // Verification de l'existence de l'hypothese
   HOMARD::HOMARD_Hypothesis_var myHypo = myContextMap[GetCurrentStudyID()]._mesHypotheses[nomHypo];
   ASSERT(!CORBA::is_nil(myHypo));
   SALOMEDS::SObject_var aHypoSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myHypo)));
   ASSERT(!CORBA::is_nil(aHypoSO));
 
+  // Verification de l'existence de l'iteration
   HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[nomIter];
   ASSERT(!CORBA::is_nil(myIteration));
   SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myIteration)));
   ASSERT(!CORBA::is_nil(aIterSO));
 
+  // Gestion de l'etude
   SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
 
   aStudyBuilder->NewCommand();
@@ -839,8 +843,20 @@ void HOMARD_Gen_i::AssociateIterHypo(const char* nomIter, const char* nomHypo)
 
   aStudyBuilder->CommitCommand();
 
+  // Liens reciproques
   myIteration->SetHypoName(nomHypo);
   myHypo->LinkIteration(nomIter);
+
+  // On stocke les noms des champ a interpoler pour le futur controle de la donnee des pas de temps
+  myIteration->SupprFieldInterps() ;
+  HOMARD::listeFieldInterpsHypo* ListField = myHypo->GetFieldInterps();
+  int numberOfFieldsx2 = ListField->length();
+  for (int iaux = 0; iaux< numberOfFieldsx2; iaux++)
+  {
+    std::string FieldName = std::string((*ListField)[iaux]) ;
+    myIteration->SetFieldInterp(FieldName.c_str()) ;
+    iaux++ ;
+  }
 };
 //=============================================================================
 //=============================================================================
@@ -2128,7 +2144,7 @@ HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZoneBox2D(const char* ZoneName,
     Ymaxi = 0. ;
     Zmini = Umini ;
     Zmaxi = Umaxi ; }
-  else { ASSERT( Orient >= 1 and Orient <= 3 ) ; }
+  else { VERIFICATION( (Orient>=1) and (Orient<=3) ) ; }
 
   HOMARD::HOMARD_Zone_var myZone = CreateZone(ZoneName, 10+Orient) ;
   myZone->SetBox ( Xmini, Xmaxi, Ymini, Ymaxi, Zmini, Zmaxi) ;
@@ -2173,7 +2189,7 @@ HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZoneDisk(const char* ZoneName,
   { Xcentre = Vcentre ;
     Ycentre = 0. ;
     Zcentre = Ucentre ; }
-  else { ASSERT( Orient >= 1 and Orient <= 3 ) ; }
+  else { VERIFICATION( (Orient>=1) and (Orient<=3) ) ; }
 
   HOMARD::HOMARD_Zone_var myZone = CreateZone(ZoneName, 30+Orient) ;
   myZone->SetCylinder( Xcentre, Ycentre, Zcentre, 0., 0., 1., Rayon, 1. ) ;
@@ -2221,7 +2237,7 @@ HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZoneDiskWithHole(const char* ZoneNam
   { Xcentre = Vcentre ;
     Ycentre = 0. ;
     Zcentre = Ucentre ; }
-  else { ASSERT( Orient >= 1 and Orient <= 3 ) ; }
+  else { VERIFICATION( (Orient>=1) and (Orient<=3) ) ; }
 
   HOMARD::HOMARD_Zone_var myZone = CreateZone(ZoneName, 60+Orient) ;
   myZone->SetPipe( Xcentre, Ycentre, Zcentre, 0., 0., 1., Rayon, 1., Rayonint ) ;
@@ -2351,6 +2367,7 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena
   DriverTexteBoundary(myCase, myDriver) ;
 
   // E.5. Ecriture du texte dans le fichier
+  MESSAGE ( ". Ecriture du texte dans le fichier de configuration ; codret = "<<codret );
   if (codret == 0)
   { myDriver->CreeFichier(); }
 
@@ -2484,7 +2501,7 @@ CORBA::Long HOMARD_Gen_i::ComputeAdap(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOM
     if (codret != 0)
     {
       // GERALD -- QMESSAGE BOX
-      ASSERT("Pb au calcul de l'iteration precedente" == 0);
+      VERIFICATION("Pb au calcul de l'iteration precedente" == 0);
     }
   };
 
@@ -2693,7 +2710,7 @@ char* HOMARD_Gen_i::ComputeDirManagement(HOMARD::HOMARD_Cas_var myCase, HOMARD::
     {
        // GERALD -- QMESSAGE BOX
        std::cerr << "Pb Creation du repertoire DirCompute = " << DirCompute.str() << std::endl;
-       ASSERT("Pb a la creation du repertoire" == 0);
+       VERIFICATION("Pb a la creation du repertoire" == 0);
     }
   }
   else
@@ -2709,7 +2726,7 @@ char* HOMARD_Gen_i::ComputeDirManagement(HOMARD::HOMARD_Cas_var myCase, HOMARD::
       {
         // GERALD -- QMESSAGE BOX
         std::cerr << ". Menage du repertoire de calcul" << DirCompute.str() << std::endl;
-        ASSERT("Pb au menage du repertoire de calcul" == 0);
+        VERIFICATION("Pb au menage du repertoire de calcul" == 0);
       }
     }
 //  On n'a pas demande de faire le menage de son contenu : on sort en erreur :
@@ -2734,7 +2751,7 @@ char* HOMARD_Gen_i::ComputeDirManagement(HOMARD::HOMARD_Cas_var myCase, HOMARD::
           std::string text = "Directory : " + DirCompute.str() + "is not empty";
           es.text = CORBA::string_dup(text.c_str());
           throw SALOME::SALOME_Exception(es);
-          ASSERT("Directory is not empty" == 0);
+          VERIFICATION("Directory is not empty" == 0);
         }
       }
     }
@@ -2795,7 +2812,7 @@ void HOMARD_Gen_i::DriverTexteZone(HOMARD::HOMARD_Hypothesis_var myHypo, HomardD
     { myDriver->TexteZone(NumZone, ZoneType, TypeUse, (*zone)[0], (*zone)[1], (*zone)[2], (*zone)[3], (*zone)[4], (*zone)[5], (*zone)[6], (*zone)[7], 0.); }
     else if ( ZoneType == 7 or ( ZoneType>=61 and ZoneType <=63 ) ) // Cas d un tuyau ou disque perce
     { myDriver->TexteZone(NumZone, ZoneType, TypeUse, (*zone)[0], (*zone)[1], (*zone)[2], (*zone)[3], (*zone)[4], (*zone)[5], (*zone)[6], (*zone)[7], (*zone)[8]); }
-    else { ASSERT("ZoneType est incorrect." == 0) ; }
+    else { VERIFICATION("ZoneType est incorrect." == 0) ; }
     iaux += 1 ;
   }
   return ;
@@ -2813,9 +2830,9 @@ void HOMARD_Gen_i::DriverTexteField(HOMARD::HOMARD_Iteration_var myIteration, HO
   {
     // GERALD -- QMESSAGE BOX
     std::cerr << "Le fichier du champ n'a pas ete fourni." << std::endl;
-    ASSERT("The file for the field is not given." == 0);
+    VERIFICATION("The file for the field is not given." == 0);
   }
-//  Les caracteristiques d'instants
+//  Les caracteristiques d'instants du champ de pilotage
   int TimeStep = myIteration->GetTimeStep();
   MESSAGE( ". TimeStep = " << TimeStep );
   int Rank = myIteration->GetRank();
@@ -2852,21 +2869,28 @@ void HOMARD_Gen_i::DriverTexteField(HOMARD::HOMARD_Iteration_var myIteration, HO
 }
 //=============================================================================
 // Calcul d'une iteration : ecriture des frontieres dans le fichier de configuration
+// On ecrit dans l'ordre :
+//    1. la definition des frontieres
+//    2. les liens avec les groupes
+//    3. un entier resumant le type de comportement pour les frontieres
 //=============================================================================
 void HOMARD_Gen_i::DriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, HomardDriver* myDriver)
 {
   MESSAGE ( "... DriverTexteBoundary" );
-  // On ecrit d'abord la definition des frontieres, puis les liens avec les groupes
+  // 1. Recuperation des frontieres
   std::list<std::string>  ListeBoundaryTraitees ;
   HOMARD::ListBoundaryGroupType* ListBoundaryGroupType = myCase->GetBoundaryGroup();
   int numberOfitems = ListBoundaryGroupType->length();
   MESSAGE ( "... number of string for Boundary+Group = " << numberOfitems);
   int BoundaryOption = 1 ;
+  // 2. Parcours des frontieres pour ecrire leur description
   int NumBoundaryAnalytical = 0 ;
   for (int NumBoundary = 0; NumBoundary< numberOfitems; NumBoundary=NumBoundary+2)
   {
     std::string BoundaryName = std::string((*ListBoundaryGroupType)[NumBoundary]);
     MESSAGE ( "... BoundaryName = " << BoundaryName);
+    // 2.1. La frontiere a-t-elle deja ete ecrite ?
+    //      Cela arrive quand elle estliéé a plusieurs groupes. Il ne faut l'ecrire que la premiere fois
     int A_faire = 1 ;
     std::list<std::string>::const_iterator it = ListeBoundaryTraitees.begin();
     while (it != ListeBoundaryTraitees.end())
@@ -2875,22 +2899,25 @@ void HOMARD_Gen_i::DriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, HomardDriv
       if ( BoundaryName == *it ) { A_faire = 0 ; }
       it++;
     }
+    // 2.2. Ecriture de la frontiere
     if ( A_faire == 1 )
     {
-// Caracteristiques de la frontiere
+      // 2.2.1. Caracteristiques de la frontiere
       HOMARD::HOMARD_Boundary_var myBoundary = myContextMap[GetCurrentStudyID()]._mesBoundarys[BoundaryName];
       ASSERT(!CORBA::is_nil(myBoundary));
       int BoundaryType = myBoundary->GetType();
       MESSAGE ( "... BoundaryType = " << BoundaryType );
-// Ecriture selon le type
-      if (BoundaryType == 0) // Cas d une frontiere discrete
+      // 2.2.2. Ecriture selon le type
+      // 2.2.2.1. Cas d une frontiere discrete
+      if (BoundaryType == 0)
       {
         const char* MeshName = myBoundary->GetMeshName() ;
         const char* MeshFile = myBoundary->GetMeshFile() ;
         myDriver->TexteBoundaryDi( MeshName, MeshFile);
         if ( BoundaryOption % 2 != 0 ) { BoundaryOption = BoundaryOption*2 ; }
       }
-      else // Cas d une frontiere analytique
+      // 2.2.2.1. Cas d une frontiere analytique
+      else
       {
         NumBoundaryAnalytical++ ;
         HOMARD::double_array* coor = myBoundary->GetCoords();
@@ -2915,10 +2942,11 @@ void HOMARD_Gen_i::DriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, HomardDriv
           if ( BoundaryOption % 3 != 0 ) { BoundaryOption = BoundaryOption*3 ; }
         }
       }
-// Memorisation du traitement
+      // 2.2.3. Memorisation du traitement
       ListeBoundaryTraitees.push_back( BoundaryName );
     }
   }
+  // 3. Parcours des frontieres pour ecrire les liens avec les groupes
   NumBoundaryAnalytical = 0 ;
   for (int NumBoundary = 0; NumBoundary< numberOfitems; NumBoundary=NumBoundary+2)
   {
@@ -2928,20 +2956,24 @@ void HOMARD_Gen_i::DriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, HomardDriv
     ASSERT(!CORBA::is_nil(myBoundary));
     int BoundaryType = myBoundary->GetType();
     MESSAGE ( "... BoundaryType = " << BoundaryType );
-//  Recuperation du nom du groupe
+    // 3.1. Recuperation du nom du groupe
     std::string GroupName = std::string((*ListBoundaryGroupType)[NumBoundary+1]);
     MESSAGE ( "... GroupName = " << GroupName);
-    if (BoundaryType == 0) // Cas d une frontiere discrete
+    // 3.2. Cas d une frontiere discrete
+    if ( BoundaryType == 0 )
     {
       if ( GroupName.size() > 0 ) { myDriver->TexteBoundaryDiGr ( GroupName ) ; }
     }
-    else // Cas d une frontiere analytique
+    // 3.3. Cas d une frontiere analytique
+    else
     {
       NumBoundaryAnalytical++ ;
       myDriver->TexteBoundaryAnGr ( BoundaryName, NumBoundaryAnalytical, GroupName ) ;
     }
   }
+  // 4. Ecriture de l'option finale
   myDriver->TexteBoundaryOption(BoundaryOption);
+//
   return ;
 }
 //=============================================================================
@@ -2951,6 +2983,7 @@ void HOMARD_Gen_i::DriverTexteFieldInterp(HOMARD::HOMARD_Iteration_var myIterati
 {
   MESSAGE ( "... DriverTexteFieldInterp" );
   int TypeFieldInterp = myHypo->GetTypeFieldInterp();
+  MESSAGE ( "... TypeFieldInterp = " << TypeFieldInterp);
   if (TypeFieldInterp != 0)
   {
 //  Le fichier des champs
@@ -2959,28 +2992,68 @@ void HOMARD_Gen_i::DriverTexteFieldInterp(HOMARD::HOMARD_Iteration_var myIterati
     if (strlen(FieldFile) == 0)
     {
       // GERALD -- QMESSAGE BOX
-      std::cerr << "Le fichier du champ n'a pas ete fourni." << std::endl;
-      ASSERT("The file for the field is not given." == 0);
+      VERIFICATION("The file for the field is not given." == 0);
     }
-  //  Les caracteristiques d'instants
-    int TimeStep = myIteration->GetTimeStep();
-    MESSAGE( ". TimeStep = " << TimeStep );
-    int Rank = myIteration->GetRank();
-    MESSAGE( ". Rank = " << Rank );
   //
     const char* MeshFile = myIteration->GetMeshFile();
-    myDriver->TexteFieldInterp(TypeFieldInterp, FieldFile, MeshFile, TimeStep, Rank);
-  //  Les champs
-    if (TypeFieldInterp == 2)
+    myDriver->TexteFieldInterp(FieldFile, MeshFile);
+
+  // Les champs
+  // Interpolation de tous les champs
+    if ( TypeFieldInterp == 1 )
+    {
+      myDriver->TexteFieldInterpAll();
+    }
+  // Interpolation de certains champs
+    else if (TypeFieldInterp == 2)
     {
-      HOMARD::listFieldInterpHypo* meschamps = myHypo->GetListFieldInterp();
-      int numberOfFields = meschamps->length();
-      MESSAGE( ". numberOfFields = " << numberOfFields );
-      for (int NumeChamp = 0; NumeChamp< numberOfFields; NumeChamp++)
+      // Les champs et leurs instants pour l'iteration
+      HOMARD::listeFieldInterpTSRsIter* ListFieldTSR = myIteration->GetFieldInterpsTimeStepRank();
+      int numberOfFieldsx3 = ListFieldTSR->length();
+      MESSAGE( ". pour iteration, numberOfFields = " << numberOfFieldsx3/3 );
+      // Les champs pour l'hypothese
+      HOMARD::listeFieldInterpsHypo* ListField = myHypo->GetFieldInterps();
+      int numberOfFieldsx2 = ListField->length();
+      MESSAGE( ". pour hypothese, numberOfFields = " << numberOfFieldsx2/2 );
+      // On parcourt tous les champs de  l'hypothese
+      int NumField = 0 ;
+      for (int iaux = 0; iaux< numberOfFieldsx2; iaux++)
       {
-        std::string nomChamp = std::string((*meschamps)[NumeChamp]);
-        MESSAGE( "... nomChamp = " << nomChamp );
-        myDriver->TexteFieldInterpName(NumeChamp, nomChamp);
+        // Le nom du champ
+        std::string FieldName = std::string((*ListField)[iaux]) ;
+        // Le type d'interpolation
+        std::string TypeInterpstr = std::string((*ListField)[iaux+1]) ;
+        MESSAGE( "... FieldName = " << FieldName << ", TypeInterp = " << TypeInterpstr );
+        // On cherche à savoir si des instants ont été précisés pour cette itération
+        int tsrvu = 0;
+        for (int jaux = 0; jaux< numberOfFieldsx3; jaux++)
+        {
+        // Le nom du champ
+          std::string FieldName2 = std::string((*ListFieldTSR)[jaux]) ;
+          MESSAGE( "..... FieldName2 = " << FieldName2 );
+        // Quand c'est le bon champ, on ecrit le pas de temps
+          if ( FieldName == FieldName2 )
+          {
+            tsrvu = 1 ;
+            // Le pas de temps
+            std::string TimeStepstr = std::string((*ListFieldTSR)[jaux+1]) ;
+            // Le numero d'ordre
+            std::string Rankstr = std::string((*ListFieldTSR)[jaux+2]) ;
+            MESSAGE( "..... TimeStepstr = " << TimeStepstr <<", Rankstr = "<<Rankstr );
+            NumField += 1 ;
+            int TimeStep = atoi( TimeStepstr.c_str() );
+            int Rank = atoi( Rankstr.c_str() );
+            myDriver->TexteFieldInterpNameType(NumField, FieldName, TypeInterpstr, TimeStep, Rank);
+          }
+          jaux += 2 ;
+        }
+        // Si aucun instant n'a été défini
+        if ( tsrvu == 0 )
+        {
+          NumField += 1 ;
+          myDriver->TexteFieldInterpNameType(NumField, FieldName, TypeInterpstr, -1, -1);
+        }
+        iaux++ ;
       }
     }
   }
index b22af469440b7f40291bb98bcffd1cf816f19b10..e9d2f3d2479408c8e269fda6f8f6fa91b97abd3b 100644 (file)
@@ -166,7 +166,7 @@ void HOMARD_Hypothesis_i::SetUseField( CORBA::Long UsField )
 //=============================================================================
 HOMARD::InfosHypo* HOMARD_Hypothesis_i::GetField()
 {
-  ASSERT(myHomardHypothesis);
+  ASSERT( myHomardHypothesis );
   HOMARD::InfosHypo* aInfosHypo = new HOMARD::InfosHypo();
   aInfosHypo->FieldName  = CORBA::string_dup( myHomardHypothesis->GetFieldName().c_str() );
   aInfosHypo->TypeThR    = CORBA::Long( myHomardHypothesis->GetRefinThrType() );
@@ -333,20 +333,32 @@ CORBA::Long HOMARD_Hypothesis_i::GetTypeFieldInterp()
 void HOMARD_Hypothesis_i::AddFieldInterp( const char* FieldInterp )
 {
   ASSERT( myHomardHypothesis );
-  myHomardHypothesis->AddFieldInterp( FieldInterp );
+  myHomardHypothesis->AddFieldInterpType( FieldInterp, 0 );
+}
+//=============================================================================
+void HOMARD_Hypothesis_i::AddFieldInterpType( const char* FieldInterp, CORBA::Long TypeInterp )
+{
+  ASSERT( myHomardHypothesis );
+  myHomardHypothesis->AddFieldInterpType( FieldInterp, TypeInterp );
 }
 //=============================================================================
-void HOMARD_Hypothesis_i::SupprFieldInterp()
+void HOMARD_Hypothesis_i::SupprFieldInterp( const char* FieldInterp )
 {
   ASSERT( myHomardHypothesis );
-  myHomardHypothesis->SupprFieldInterp();
+  myHomardHypothesis->SupprFieldInterp(FieldInterp);
 }
 //=============================================================================
-HOMARD::listFieldInterpHypo* HOMARD_Hypothesis_i::GetListFieldInterp()
+void HOMARD_Hypothesis_i::SupprFieldInterps()
 {
   ASSERT( myHomardHypothesis );
-  const std::list<std::string>& ListString = myHomardHypothesis->GetListFieldInterp();
-  HOMARD::listFieldInterpHypo_var aResult = new HOMARD::listFieldInterpHypo;
+  myHomardHypothesis->SupprFieldInterps();
+}
+//=============================================================================
+HOMARD::listeFieldInterpsHypo* HOMARD_Hypothesis_i::GetFieldInterps()
+{
+  ASSERT( myHomardHypothesis );
+  const std::list<std::string>& ListString = myHomardHypothesis->GetFieldInterps();
+  HOMARD::listeFieldInterpsHypo_var aResult = new HOMARD::listeFieldInterpsHypo;
   aResult->length( ListString.size() );
   std::list<std::string>::const_iterator it;
   int i = 0;
@@ -375,19 +387,19 @@ char* HOMARD_Hypothesis_i::GetCaseCreation()
 //=============================================================================
 void HOMARD_Hypothesis_i::LinkIteration( const char* NomIteration )
 {
-  ASSERT(myHomardHypothesis);
+  ASSERT( myHomardHypothesis );
   myHomardHypothesis->LinkIteration( NomIteration );
 }
 //=============================================================================
 void HOMARD_Hypothesis_i::UnLinkIteration( const char* NomIteration )
 {
-  ASSERT(myHomardHypothesis);
+  ASSERT( myHomardHypothesis );
   myHomardHypothesis->UnLinkIteration( NomIteration );
 }
 //=============================================================================
 HOMARD::listeIters* HOMARD_Hypothesis_i::GetIterations()
 {
-  ASSERT(myHomardHypothesis);
+  ASSERT( myHomardHypothesis );
   const std::list<std::string>& ListString = myHomardHypothesis->GetIterations();
   HOMARD::listeIters_var aResult = new HOMARD::listeIters;
   aResult->length( ListString.size() );
@@ -400,7 +412,7 @@ HOMARD::listeIters* HOMARD_Hypothesis_i::GetIterations()
   return aResult._retn();
 }
 //=============================================================================
-void  HOMARD_Hypothesis_i::AddZone( const char* NomZone, CORBA::Long TypeUse )
+void HOMARD_Hypothesis_i::AddZone( const char* NomZone, CORBA::Long TypeUse )
 {
   MESSAGE ("Dans AddZone pour " << NomZone) ;
   ASSERT( myHomardHypothesis );
@@ -408,28 +420,28 @@ void  HOMARD_Hypothesis_i::AddZone( const char* NomZone, CORBA::Long TypeUse )
   return _gen_i->AssociateHypoZone(NomHypo, NomZone, TypeUse) ;
 }
 //=============================================================================
-void  HOMARD_Hypothesis_i::AddZone0( const char* NomZone, CORBA::Long TypeUse )
+void HOMARD_Hypothesis_i::AddZone0( const char* NomZone, CORBA::Long TypeUse )
 {
   MESSAGE ("Dans AddZone0 pour " << NomZone) ;
   ASSERT( myHomardHypothesis );
   myHomardHypothesis->AddZone( NomZone, TypeUse );
 }
 //=============================================================================
-void  HOMARD_Hypothesis_i::SupprZone(const char * NomZone)
+void HOMARD_Hypothesis_i::SupprZone(const char * NomZone)
 {
-  ASSERT(myHomardHypothesis);
+  ASSERT( myHomardHypothesis );
   myHomardHypothesis->SupprZone( NomZone);
 }
 //=============================================================================
-void  HOMARD_Hypothesis_i::SupprZones()
+void HOMARD_Hypothesis_i::SupprZones()
 {
-  ASSERT(myHomardHypothesis);
+  ASSERT( myHomardHypothesis );
   myHomardHypothesis->SupprZones();
 }
 //=============================================================================
 HOMARD::listeZonesHypo* HOMARD_Hypothesis_i::GetZones()
 {
-  ASSERT(myHomardHypothesis);
+  ASSERT( myHomardHypothesis );
   const std::list<std::string>& ListString = myHomardHypothesis->GetZones();
   HOMARD::listeZonesHypo_var aResult = new HOMARD::listeZonesHypo;
   aResult->length( ListString.size() );
index 5bc2fad3ececb53d5bef07685334d840ea619373..cfbfe66aefe59b78c6aa815650af35ec9cbff56f 100644 (file)
@@ -105,8 +105,10 @@ public:
   void                   SetTypeFieldInterp( CORBA::Long TypeFieldInterp );
   CORBA::Long            GetTypeFieldInterp();
   void                   AddFieldInterp( const char* FieldInterp );
-  void                   SupprFieldInterp();
-  HOMARD::listFieldInterpHypo* GetListFieldInterp();
+  void                   AddFieldInterpType( const char* FieldInterp, CORBA::Long TypeInterp );
+  void                   SupprFieldInterp( const char* FieldInterp );
+  void                   SupprFieldInterps();
+  HOMARD::listeFieldInterpsHypo* GetFieldInterps();
 
 // Liens avec les autres structures
   void                   SetCaseCreation( const char* NomCaseCreation );
index 3a99dab3780caa6d37562ba1aed263cb14d7d597..429f82d8708331646eff2dfb7f3d074e1a1ecf0e 100644 (file)
@@ -143,7 +143,7 @@ void HOMARD_Iteration_i::SetNumber( CORBA::Long NumIter )
 CORBA::Long HOMARD_Iteration_i::GetNumber()
 {
   ASSERT( myHomardIteration );
-  return  myHomardIteration->GetNumber() ;
+  return myHomardIteration->GetNumber() ;
 }
 //=============================================================================
 void HOMARD_Iteration_i::SetState( CORBA::Long Etat )
@@ -194,6 +194,14 @@ char* HOMARD_Iteration_i::GetFieldFile()
   return CORBA::string_dup( myHomardIteration->GetFieldFile().c_str() );
 }
 //=============================================================================
+// Instants pour le champ de pilotage
+//=============================================================================
+void HOMARD_Iteration_i::SetTimeStep( CORBA::Long TimeStep )
+{
+  ASSERT( myHomardIteration );
+  myHomardIteration->SetTimeStep( TimeStep );
+}
+//=============================================================================
 void HOMARD_Iteration_i::SetTimeStepRank( CORBA::Long TimeStep, CORBA::Long Rank )
 {
   ASSERT( myHomardIteration );
@@ -218,6 +226,60 @@ CORBA::Long HOMARD_Iteration_i::GetRank()
   return  CORBA::Long( myHomardIteration->GetRank() );
 }
 //=============================================================================
+// Instants pour un champ a interpoler
+//=============================================================================
+void HOMARD_Iteration_i::SetFieldInterpTimeStep( const char* FieldInterp, CORBA::Long TimeStep )
+{
+  SetFieldInterpTimeStepRank( FieldInterp, TimeStep, TimeStep );
+}
+//=============================================================================
+void HOMARD_Iteration_i::SetFieldInterpTimeStepRank( const char* FieldInterp, CORBA::Long TimeStep, CORBA::Long Rank )
+{
+  ASSERT( myHomardIteration );
+  myHomardIteration->SetFieldInterpTimeStepRank( FieldInterp, TimeStep, Rank );
+}
+//=============================================================================
+HOMARD::listeFieldInterpTSRsIter* HOMARD_Iteration_i::GetFieldInterpsTimeStepRank()
+{
+  ASSERT( myHomardIteration );
+  const std::list<std::string>& ListString = myHomardIteration->GetFieldInterpsTimeStepRank();
+  HOMARD::listeFieldInterpTSRsIter_var aResult = new HOMARD::listeFieldInterpTSRsIter;
+  aResult->length( ListString.size() );
+  std::list<std::string>::const_iterator it;
+  int i = 0;
+  for ( it = ListString.begin(); it != ListString.end(); it++ )
+  {
+    aResult[i++] = CORBA::string_dup( (*it).c_str() );
+  }
+  return aResult._retn();
+}
+//=============================================================================
+void HOMARD_Iteration_i::SetFieldInterp( const char* FieldInterp )
+{
+  myHomardIteration->SetFieldInterp( FieldInterp );
+}
+//=============================================================================
+HOMARD::listeFieldInterpsIter* HOMARD_Iteration_i::GetFieldInterps()
+{
+  ASSERT( myHomardIteration );
+  const std::list<std::string>& ListString = myHomardIteration->GetFieldInterps();
+  HOMARD::listeFieldInterpsIter_var aResult = new HOMARD::listeFieldInterpsIter;
+  aResult->length( ListString.size() );
+  std::list<std::string>::const_iterator it;
+  int i = 0;
+  for ( it = ListString.begin(); it != ListString.end(); it++ )
+  {
+    aResult[i++] = CORBA::string_dup( (*it).c_str() );
+  }
+  return aResult._retn();
+}
+//=============================================================================
+void HOMARD_Iteration_i::SupprFieldInterps()
+{
+  ASSERT( myHomardIteration );
+  myHomardIteration->SupprFieldInterps();
+}
+//=============================================================================
 void HOMARD_Iteration_i::SetLogFile( const char* LogFile )
 {
   ASSERT( myHomardIteration );
@@ -398,5 +460,5 @@ void HOMARD_Iteration_i::SetInfoCompute( CORBA::Long MessInfo )
 CORBA::Long HOMARD_Iteration_i::GetInfoCompute()
 {
   ASSERT( myHomardIteration );
-  return  myHomardIteration->GetInfoCompute() ;
+  return myHomardIteration->GetInfoCompute() ;
 }
index aaaa2018e58aca879d7f1495cdb5d20a32c984a3..15802f6a6ce3fb45664634624c25459dca6a90f0 100644 (file)
@@ -84,10 +84,19 @@ public:
 
   void                   SetFieldFile( const char* FieldFile );
   char*                  GetFieldFile();
+// Instants pour le champ de pilotage
+  void                   SetTimeStep( CORBA::Long TimeStep );
   void                   SetTimeStepRank( CORBA::Long TimeStep, CORBA::Long Rank );
   void                   SetTimeStepRankLast();
   CORBA::Long            GetTimeStep();
   CORBA::Long            GetRank();
+// Instants pour un champ a interpoler
+  void                   SetFieldInterpTimeStep( const char* FieldInterp, CORBA::Long TimeStep );
+  void                   SetFieldInterpTimeStepRank( const char* FieldInterp, CORBA::Long TimeStep, CORBA::Long Rank );
+  HOMARD::listeFieldInterpTSRsIter* GetFieldInterpsTimeStepRank();
+  void                   SetFieldInterp( const char* FieldInterp );
+  HOMARD::listeFieldInterpsIter* GetFieldInterps();
+  void                   SupprFieldInterps();
 
   void                   SetLogFile( const char* LogFile );
   char*                  GetLogFile();
diff --git a/src/HOMARD_SCRIPTS/CMakeLists.txt b/src/HOMARD_SCRIPTS/CMakeLists.txt
deleted file mode 100644 (file)
index 38fd626..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright (C) 2012-2013  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# This library 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 2.1 of the License.
-#
-# This library 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 this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-# --- scripts ---
-
-# scripts / static
-SET(_bin_SCRIPTS
-  test_homard.py
-)
-
-# --- rules ---
-SALOME_INSTALL_SCRIPTS("${_bin_SCRIPTS}" ${SALOME_INSTALL_SCRIPT_PYTHON})
\ No newline at end of file
diff --git a/src/HOMARD_SCRIPTS/testHomard.py b/src/HOMARD_SCRIPTS/testHomard.py
deleted file mode 100644 (file)
index bd34826..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2011-2013  CEA/DEN, EDF R&D
-#
-# This library 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 2.1 of the License.
-#
-# This library 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 this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-#  File   : Makefile.in
-#  Author : Nicolas REJNERI, Paul RASCLE
-#  Modified by : Alexander BORODIN (OCN) - autotools usage
-#  Module : HOMARD
-
-import salome
-homard=salome.lcc.FindOrLoadComponent("FactoryServer","HOMARD")
-import os
-home=os.environ["HOME"]
-etape0= home+"essai/etape0"
-archive=+"/archives"
-FichierConfiguration=etape0+"HOMARD.Configuration.0.vers.1"
-monCas=homard.CreateCas("MonCas",etape0)
-print monCas
-monCas.AjoutIter(1,FichierConfiguration)
-print "ici"
-monCas.CalculIter(1)
-print "la"
diff --git a/src/HOMARD_SCRIPTS/test_homard.py b/src/HOMARD_SCRIPTS/test_homard.py
deleted file mode 100644 (file)
index 5b621af..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-# Copyright (C) 2011-2013  CEA/DEN, EDF R&D
-#
-# This library 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 2.1 of the License.
-#
-# This library 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 this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-#  File   : Makefile.in
-#  Author : Nicolas REJNERI, Paul RASCLE
-#  Modified by : Alexander BORODIN (OCN) - autotools usage
-#  Module : HOMARD
-
-import salome
-salome.salome_init()
-
-import HOMARD
-
-#
-# initialize engine
-#
-homard = salome.lcc.FindOrLoadComponent("FactoryServer", "HOMARD")
-
-def test_save(fname):
-    #
-    # create new study
-    #
-    study = salome.myStudyManager.NewStudy("HOMARD")
-    homard.SetCurrentStudy(study)
-    #
-    # create case
-    #
-    case_1 = homard.CreateCas("Case 1")
-    case_1.SetNomDir("/tmp/homard")
-    case_1.SetTypeConf(12)
-    case_1.SetBoiteEnglobante([1.2,2.3,3.4,4.5,5.6,6.7,7.8,8.9,9.10,10.11])
-    #
-    # create hypothesis 1
-    #
-    hypo_1 = homard.CreateHypothese("Hypothesis 1")
-    hypo_1.SetTypeAdapRaffDera(2,3,4)
-    hypo_1.SetField("Field 1", 12, 3.45, 67, 23.343)
-    hypo_1.AjoutComposant("Comp 1")
-    hypo_1.AjoutComposant("Comp 2")
-    hypo_1.AjoutComposant("Comp 3")
-    #
-    # create hypothesis 2
-    #
-    hypo_2 = homard.CreateHypothese("Hypothesis 2")
-    hypo_2.SetTypeAdapRaffDera(20,30,40)
-    hypo_2.SetField("Field 2", 5, 12.67223, 900, 6.5434)
-    hypo_2.AjoutComposant("Comp 123")
-    #
-    # create iteration 1
-    #
-    iter_1 = homard.CreateIteration("Iteration 1")
-    iter_1.SetEtat(True)
-    iter_1.SetNumIter(56)
-    iter_1.SetMeshFile("/aaaa/bbbb/AAAAA.med")
-    iter_1.SetNomMesh("My Mesh")
-    iter_1.SetField("Field 1", 42, 522)
-    #
-    # create iteration 2
-    #
-    iter_2 = homard.CreateIteration("Iteration 2")
-    iter_2.SetEtat(False)
-    iter_2.SetNumIter(57)
-    iter_2.SetMeshFile("/cccc/cccc/asd.med")
-    iter_2.SetNomMesh("MeshXZY")
-    iter_2.SetField("Field 2", 22222, 50000)
-    #
-    # create iteration 3 (not published)
-    #
-    iter_3 = homard.CreateIteration("Iteration 3")
-    iter_3.SetEtat(True)
-    iter_3.SetNumIter(666)
-    iter_3.SetMeshFile("/not/assigned/iteration/file.med")
-    iter_3.SetNomMesh("NOT ASSIGNED")
-    iter_3.SetField("Field XXX", 999, -1)
-    #
-    # create zone 1
-    #
-    zone_1 = homard.CreateZone("Zone 1")
-    zone_1.SetBox(1.,2.,3.,4.,5.,6.)
-    zone_1.SetTypeZone(5454)
-    #
-    # create zone 2
-    #
-    zone_2 = homard.CreateZone("Zone 2")
-    zone_2.SetSphere(12.3, 3.4, .56, 6.5)
-    zone_2.SetTypeZone(6545)
-    #
-    # associate objects
-    #
-    homard.AssocieCasIteration("Case 1", "Iteration 1")
-    homard.AssocieCasIteration("Case 1", "Iteration 2")
-    homard.AssocieHypoIteration("Iteration 1", "Hypothesis 1")
-    homard.AssocieHypoZone("Zone 1", "Hypothesis 1")
-    homard.AssocieHypoIteration("Iteration 2", "Hypothesis 2")
-    homard.AssocieHypoZone("Zone 2", "Hypothesis 2")
-    homard.AssocieIterationIteration("Iteration 1", "Iteration 2")
-    #
-    # save study
-    #
-    salome.myStudyManager.SaveAs(fname, study, 0)
-    #
-    # close study
-    #
-    salome.myStudyManager.Close(study)
-    #
-    pass
-
-def test_load(fname):
-    #
-    # load study and 
-    #
-    study = salome.myStudyManager.Open(fname)
-    #
-    # load homard data
-    #
-    comp = study.FindComponent("HOMARD")
-    builder = study.NewBuilder()
-    builder.LoadWith(comp, homard)
-    #
-    # dump study id
-    #
-    print homard.GetCurrentStudy()._get_StudyId()
-    #
-    # dump case 1
-    #
-    case_1 = homard.GetCas("Case 1")
-    print "Case: ",          case_1.GetNomCas()
-    print "-> nom dir:",     case_1.GetNomDir()
-    print "-> type conf:",   case_1.GetTypeConf()
-    print "-> boite:",       case_1.GetBoiteEnglobante()
-    print "---"
-    #
-    # dump hypothesis 1
-    #
-    hypo_1 = homard.GetHypothesis("Hypothesis 1")
-    print "Hypothesis: ",    hypo_1.GetNomHypothesis()
-    print "-> type:",        hypo_1.GetTypeAdapRaffDera()
-    print "-> field name:",  hypo_1.GetFieldName()
-    print "-> composants:",  hypo_1.GetComposants()
-    print "-> zones:",       hypo_1.GetZones()
-    print "---"
-    #
-    # dump hypothesis 2
-    #
-    hypo_2 = homard.GetHypothesis("Hypothesis 2")
-    print "Hypothesis: ",    hypo_2.GetNomHypothesis()
-    print "-> type:",        hypo_2.GetTypeAdapRaffDera()
-    print "-> field name:",  hypo_2.GetFieldName()
-    print "-> composants:",  hypo_2.GetComposants()
-    print "-> zones:",       hypo_2.GetZones()
-    print "---"
-    #
-    # dump zone 1
-    #
-    zone_1 = homard.GetZone("Zone 1")
-    print "Zone: ",          zone_1.GetNomZone()
-    print "-> type zone:",   zone_1.GetTypeZone()
-    print "-> shere:",       zone_1.GetSphere()
-    print "-> box:",         zone_1.GetBox()
-    print "-> hypotheses:",  zone_1.GetHypo()
-    print "---"
-    #
-    # dump zone 1
-    #
-    zone_2 = homard.GetZone("Zone 2")
-    print "Zone: ",          zone_2.GetNomZone()
-    print "-> type zone:",   zone_2.GetTypeZone()
-    print "-> shere:",       zone_2.GetSphere()
-    print "-> box:",         zone_2.GetBox()
-    print "-> hypotheses:",  zone_2.GetHypo()
-    print "---"
-    #
-    # dump iteration 1
-    #
-    iter_1 = homard.GetIteration("Iteration 1")
-    print "Iteration: ",     iter_1.GetNomIter()
-    print "-> etat:",        iter_1.GetEtat()
-    print "-> num iter:",    iter_1.GetNumIter()
-    print "-> nom mesh:",    iter_1.GetNomMesh()
-    print "-> mesh file:",   iter_1.GetMeshFile()
-    print "-> field:",       iter_1.GetFieldFileName()
-    print "-> time step:",   iter_1.GetTimeStep()
-    print "-> rank:",        iter_1.GetRank()
-    print "-> parent iter:", iter_1.GetIterParent()
-    print "-> hypothesis:",  iter_1.GetNomHypo()
-    print "-> case:",        iter_1.GetNomCas()
-    print "---"
-    #
-    # dump iteration 2
-    #
-    iter_2 = homard.GetIteration("Iteration 2")
-    print "Iteration: ",     iter_2.GetNomIter()
-    print "-> etat:",        iter_2.GetEtat()
-    print "-> num iter:",    iter_2.GetNumIter()
-    print "-> nom mesh:",    iter_2.GetNomMesh()
-    print "-> mesh file:",   iter_2.GetMeshFile()
-    print "-> field:",       iter_2.GetFieldFileName()
-    print "-> time step:",   iter_2.GetTimeStep()
-    print "-> rank:",        iter_2.GetRank()
-    print "-> parent iter:", iter_2.GetIterParent()
-    print "-> hypothesis:",  iter_2.GetNomHypo()
-    print "-> case:",        iter_2.GetNomCas()
-    print "---"
-    #
-    # dump iteration 3
-    #
-    iter_3 = homard.GetIteration("Iteration 3")
-    print "Iteration: ",     iter_3.GetNomIter()
-    print "-> etat:",        iter_3.GetEtat()
-    print "-> num iter:",    iter_3.GetNumIter()
-    print "-> nom mesh:",    iter_3.GetNomMesh()
-    print "-> mesh file:",   iter_3.GetMeshFile()
-    print "-> field:",       iter_3.GetFieldFileName()
-    print "-> time step:",   iter_3.GetTimeStep()
-    print "-> rank:",        iter_3.GetRank()
-    print "-> parent iter:", iter_3.GetIterParent()
-    print "-> hypothesis:",  iter_3.GetNomHypo()
-    print "-> case:",        iter_3.GetNomCas()
-    print "---"
-
-# test file name
-filename = "/tmp/save_homard.hdf"
-
-# run tests
-test_save(filename)
-test_load(filename)
index 2cbc34dee380b57e96ae564352cd3673738304eb..faab0704c51c8809d235e61d75113f82d55b63cb 100644 (file)
@@ -94,7 +94,6 @@ Copyright EDF-R&D 2010, 2013
     Hypo_1_1.SetUseComp(0)
     Hypo_1_1.AddComp('ERREST')
     Hypo_1_1.SetRefinThr(3, 10.1)
-    Hypo_1_1.SetTypeFieldInterp(2)
     Hypo_1_1.AddFieldInterp('RESU____DEPL____________________')
     Hypo_1_1.AddFieldInterp('RESU____ERRE_ELEM_SIGM__________')
     print HypoName_1, " : zones utilisées :", Hypo_1_1.GetZones()
@@ -102,6 +101,7 @@ Copyright EDF-R&D 2010, 2013
     print HypoName_1, " : composantes utilisées :", Hypo_1_1.GetComps()
     if ( len (Hypo_1_1.GetFieldName()) > 0 ) :
       print ".. caractéristiques de l'adaptation :", Hypo_1_1.GetField()
+    print HypoName_1, " : champs interpolés :", Hypo_1_1.GetFieldInterps()
   # Creation of the hypothesis Zones_1_et_2
     HypoName_2 = "Zones_1_et_2"
     print "-------- Creation of the hypothesis", HypoName_2
@@ -111,49 +111,68 @@ Copyright EDF-R&D 2010, 2013
     Zones_1_et_2.AddZone('Zone_1_2', 1)
     print HypoName_2, " : zones utilisées :", Zones_1_et_2.GetZones()
     print HypoName_2, " : champ utilisé :", Zones_1_et_2.GetFieldName()
-    print HypoName_2, " : composantes utilisées :", Zones_1_et_2.GetComps()
     if ( len (Zones_1_et_2.GetFieldName()) > 0 ) :
       print ".. caractéristiques de l'adaptation :", Zones_1_et_2.GetField()
+    print HypoName_2, " : champs interpolés :", Zones_1_et_2.GetFieldInterps()
   #
   # Creation of the cases
   # =====================
     # Creation of the case Case_1
+    CaseName = "Case_1"
+    print "-------- Creation of the hypothesis", CaseName
     MeshFile = os.path.join(Rep_Test, Test_Name + '.00.med')
-    Case_1 = homard.CreateCase('Case_1', 'MAILL', MeshFile)
+    Case_1 = homard.CreateCase(CaseName, 'MAILL', MeshFile)
     Case_1.SetDirName(Rep_Test_Resu)
     Case_1.SetConfType(1)
   #
   # Creation of the iterations
   # ==========================
   # Creation of the iteration I1_1
-    I1_1 = Case_1.NextIteration('I1_1')
+    IterName_1 = "I1_1"
+    print "-------- Creation of the iteration", IterName_1
+    I1_1 = Case_1.NextIteration(IterName_1)
+    I1_1.AssociateHypo(HypoName_1)
+    print ". Hypothese :", HypoName_1
     I1_1.SetMeshName('M1')
     I1_1.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.01.med'))
     I1_1.SetFieldFile(os.path.join(Rep_Test, Test_Name + '.00.med'))
     I1_1.SetTimeStepRank(1, 1)
-    I1_1.AssociateHypo(HypoName_1)
+    I1_1.SetFieldInterpTimeStep('RESU____DEPL____________________', 1)
+    I1_1.SetFieldInterpTimeStepRank('RESU____ERRE_ELEM_SIGM__________', 1, 1)
+    print ". Instants d'interpolation :", I1_1.GetFieldInterpsTimeStepRank()
     error = I1_1.Compute(1, 1)
     if error :
       error = 1
       break
 
   # Creation of the iteration I1_2
-    I1_2 = I1_1.NextIteration('I1_2')
+    IterName_2 = "I1_2"
+    print "-------- Creation of the iteration", IterName_2
+    I1_2 = I1_1.NextIteration(IterName_2)
+    I1_2.AssociateHypo(HypoName_1)
+    print ". Hypothese :", HypoName_1
     I1_2.SetMeshName('M2')
     I1_2.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.02.med'))
     I1_2.SetFieldFile(os.path.join(Rep_Test, Test_Name + '.01.med'))
     I1_2.SetTimeStepRank(1, 1)
-    I1_2.AssociateHypo(HypoName_1)
+    I1_2.SetFieldInterpTimeStep('RESU____DEPL____________________', 1)
+    I1_2.SetFieldInterpTimeStepRank('RESU____ERRE_ELEM_SIGM__________', 1, 1)
+    print ". Instants d'interpolation :", I1_2.GetFieldInterpsTimeStepRank()
     error = I1_2.Compute(1, 1)
     if error :
       error = 2
       break
 
   # Creation of the iteration I1_3
-    I1_3 = I1_2.NextIteration('I1_3')
+    IterName_3 = "I1_3"
+    print "-------- Creation of the iteration", IterName_3
+    I1_3 = I1_2.NextIteration(IterName_3)
+    I1_3.AssociateHypo(HypoName_2)
+    print ". Hypothese :", HypoName_2
     I1_3.SetMeshName('M3')
     I1_3.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.03.med'))
-    I1_3.AssociateHypo(HypoName_2)
+    I1_2.SetFieldFile(os.path.join(Rep_Test, Test_Name + '.02.med'))
+    print ". Instants d'interpolation :", I1_3.GetFieldInterpsTimeStepRank()
     error = I1_3.Compute(1, 1)
     if error :
       error = 3