From 9e58f253ace5b07462140dc8e3b2d1aea1d366a6 Mon Sep 17 00:00:00 2001 From: nicolas Date: Tue, 22 Oct 2013 13:14:45 +0000 Subject: [PATCH] interpolation des champs --- idl/HOMARD_Hypothesis.idl | 11 +- idl/HOMARD_Iteration.idl | 16 ++ src/HOMARD/CMakeLists.txt | 1 + src/HOMARD/HOMARD.hxx | 34 ++++ src/HOMARD/HOMARD_Boundary.cxx | 3 +- src/HOMARD/HOMARD_DriverTools.cxx | 8 +- src/HOMARD/HOMARD_Hypothesis.cxx | 87 ++++++++-- src/HOMARD/HOMARD_Hypothesis.hxx | 8 +- src/HOMARD/HOMARD_Iteration.cxx | 105 ++++++++++- src/HOMARD/HOMARD_Iteration.hxx | 13 ++ src/HOMARD/HOMARD_Zone.cxx | 3 +- src/HOMARD/HomardDriver.cxx | 81 ++++++--- src/HOMARD/HomardDriver.hxx | 6 +- src/HOMARD/YACSDriver.cxx | 7 +- src/HOMARDGUI/MonCreateHypothesis.cxx | 8 +- src/HOMARDGUI/MonEditHypothesis.cxx | 12 +- src/HOMARD_I/HOMARD_Cas_i.cxx | 3 +- src/HOMARD_I/HOMARD_Gen_i.cxx | 145 ++++++++++++---- src/HOMARD_I/HOMARD_Hypothesis_i.cxx | 46 +++-- src/HOMARD_I/HOMARD_Hypothesis_i.hxx | 6 +- src/HOMARD_I/HOMARD_Iteration_i.cxx | 66 ++++++- src/HOMARD_I/HOMARD_Iteration_i.hxx | 9 + src/HOMARD_SCRIPTS/CMakeLists.txt | 28 --- src/HOMARD_SCRIPTS/testHomard.py | 36 ---- src/HOMARD_SCRIPTS/test_homard.py | 241 -------------------------- tests/test_1.py | 37 +++- 26 files changed, 579 insertions(+), 441 deletions(-) create mode 100644 src/HOMARD/HOMARD.hxx delete mode 100644 src/HOMARD_SCRIPTS/CMakeLists.txt delete mode 100644 src/HOMARD_SCRIPTS/testHomard.py delete mode 100644 src/HOMARD_SCRIPTS/test_homard.py diff --git a/idl/HOMARD_Hypothesis.idl b/idl/HOMARD_Hypothesis.idl index 2137fd80..ab8c55fb 100644 --- a/idl/HOMARD_Hypothesis.idl +++ b/idl/HOMARD_Hypothesis.idl @@ -40,8 +40,8 @@ module HOMARD typedef sequence listeZonesHypo ; typedef sequence listeIters ; typedef sequence listeComposantsHypo ; - typedef sequence listeTypes; - typedef sequence listFieldInterpHypo; + typedef sequence listeTypes ; + typedef sequence 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); diff --git a/idl/HOMARD_Iteration.idl b/idl/HOMARD_Iteration.idl index cbf48702..1addb5f1 100644 --- a/idl/HOMARD_Iteration.idl +++ b/idl/HOMARD_Iteration.idl @@ -36,6 +36,8 @@ module HOMARD { typedef sequence listeIterFilles ; + typedef sequence listeFieldInterpsIter ; + typedef sequence 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); diff --git a/src/HOMARD/CMakeLists.txt b/src/HOMARD/CMakeLists.txt index de819ba9..e472b5b3 100644 --- a/src/HOMARD/CMakeLists.txt +++ b/src/HOMARD/CMakeLists.txt @@ -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 index 00000000..abc1805c --- /dev/null +++ b/src/HOMARD/HOMARD.hxx @@ -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 diff --git a/src/HOMARD/HOMARD_Boundary.cxx b/src/HOMARD/HOMARD_Boundary.cxx index 464d24b8..24db564a 100644 --- a/src/HOMARD/HOMARD_Boundary.cxx +++ b/src/HOMARD/HOMARD_Boundary.cxx @@ -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 HOMARD_Boundary::GetCoords() const mesCoor.push_back( _Rayon2 ); break ; } - ASSERT ( _Type == -1 ) ; + VERIFICATION( (_Type>=1) and (_Type<=4) ) ; } return mesCoor; } diff --git a/src/HOMARD/HOMARD_DriverTools.cxx b/src/HOMARD/HOMARD_DriverTools.cxx index 6f1c9a3b..b1d5f6f4 100644 --- a/src/HOMARD/HOMARD_DriverTools.cxx +++ b/src/HOMARD/HOMARD_DriverTools.cxx @@ -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 ); diff --git a/src/HOMARD/HOMARD_Hypothesis.cxx b/src/HOMARD/HOMARD_Hypothesis.cxx index e5640d6f..09020465 100644 --- a/src/HOMARD/HOMARD_Hypothesis.cxx +++ b/src/HOMARD/HOMARD_Hypothesis.cxx @@ -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::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="<::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 = "<& HOMARD_Hypothesis::GetListFieldInterp() const +const std::list& HOMARD_Hypothesis::GetFieldInterps() const { return _ListFieldInterp; } @@ -412,8 +465,8 @@ const std::list& 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 ) ; diff --git a/src/HOMARD/HOMARD_Hypothesis.hxx b/src/HOMARD/HOMARD_Hypothesis.hxx index 439d43e9..83f9c592 100644 --- a/src/HOMARD/HOMARD_Hypothesis.hxx +++ b/src/HOMARD/HOMARD_Hypothesis.hxx @@ -93,9 +93,10 @@ public: void SetTypeFieldInterp( int TypeFieldInterp ); int GetTypeFieldInterp() const; - void AddFieldInterp( const char* FieldInterp ); - void SupprFieldInterp(); - const std::list& GetListFieldInterp() const; + void AddFieldInterpType( const char* FieldInterp, int TypeInterp ); + void SupprFieldInterp( const char* FieldInterp ); + void SupprFieldInterps(); + const std::list& GetFieldInterps() const; // Liens avec les autres structures void SetCaseCreation( const char* NomCasCreation ); @@ -142,6 +143,7 @@ private: std::list _ListComp; std::list _ListGroupSelected; std::list _ListFieldInterp; + }; #endif diff --git a/src/HOMARD/HOMARD_Iteration.cxx b/src/HOMARD/HOMARD_Iteration.cxx index 09bc0ad3..592154ba 100644 --- a/src/HOMARD/HOMARD_Iteration.cxx +++ b/src/HOMARD/HOMARD_Iteration.cxx @@ -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::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::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& HOMARD_Iteration::GetFieldInterpsTimeStepRank() const +{ + return _ListFieldInterpTSR; +} +//============================================================================= +void HOMARD_Iteration::SetFieldInterp( const char* FieldInterp ) +{ + _ListFieldInterp.push_back( std::string( FieldInterp ) ); +} +//============================================================================= +const std::list& HOMARD_Iteration::GetFieldInterps() const +{ + return _ListFieldInterp; +} +//============================================================================= +void HOMARD_Iteration::SupprFieldInterps() +{ + _ListFieldInterp.clear(); +} +//============================================================================= void HOMARD_Iteration::SetLogFile( const char* LogFile ) { _LogFile = std::string( LogFile ); diff --git a/src/HOMARD/HOMARD_Iteration.hxx b/src/HOMARD/HOMARD_Iteration.hxx index 5013783d..3acf698f 100644 --- a/src/HOMARD/HOMARD_Iteration.hxx +++ b/src/HOMARD/HOMARD_Iteration.hxx @@ -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& GetFieldInterpsTimeStepRank() const; + void SetFieldInterp( const char* FieldInterp ); + const std::list& GetFieldInterps() const; + void SupprFieldInterps(); void SetLogFile( const char* LogFile ); std::string GetLogFile() const; @@ -115,6 +124,10 @@ private: std::list _mesIterFilles; std::string _FileInfo; int _MessInfo; + // La liste des champs retenus par l'hypothese + std::list _ListFieldInterp; + // La liste des triplets (champs, pas de temps, numero d'ordre) retenus par l'iteration + std::list _ListFieldInterpTSR; }; #endif diff --git a/src/HOMARD/HOMARD_Zone.cxx b/src/HOMARD/HOMARD_Zone.cxx index b0e862c2..d4a207f1 100644 --- a/src/HOMARD/HOMARD_Zone.cxx +++ b/src/HOMARD/HOMARD_Zone.cxx @@ -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 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; } diff --git a/src/HOMARD/HomardDriver.cxx b/src/HOMARD/HomardDriver.cxx index 04e810b8..3da2f75a 100644 --- a/src/HOMARD/HomardDriver.cxx +++ b/src/HOMARD/HomardDriver.cxx @@ -25,9 +25,9 @@ #include #include +#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 ="<= 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 = "<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 = "<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() diff --git a/src/HOMARDGUI/MonEditHypothesis.cxx b/src/HOMARDGUI/MonEditHypothesis.cxx index c1452e51..19478b3d 100644 --- a/src/HOMARDGUI/MonEditHypothesis.cxx +++ b/src/HOMARDGUI/MonEditHypothesis.cxx @@ -25,6 +25,7 @@ using namespace std; #include "SalomeApp_Tools.h" #include "HOMARDGUI_Utils.h" #include "HomardQtCommun.h" +#include "HOMARD.hxx" #include // ---------------------------------------------------------------------------- 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; ilength(); i++) + for (int iaux=0; iauxlength(); 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(); diff --git a/src/HOMARD_I/HOMARD_Cas_i.cxx b/src/HOMARD_I/HOMARD_Cas_i.cxx index 8338f814..bc459d46 100755 --- a/src/HOMARD_I/HOMARD_Cas_i.cxx +++ b/src/HOMARD_I/HOMARD_Cas_i.cxx @@ -30,6 +30,7 @@ #include "HOMARD_Gen_i.hxx" #include "HOMARD_Cas.hxx" #include "HOMARD_DriverTools.hxx" +#include "HOMARD.hxx" #include "utilities.h" #include @@ -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] ; } diff --git a/src/HOMARD_I/HOMARD_Gen_i.cxx b/src/HOMARD_I/HOMARD_Gen_i.cxx index 2b65286b..3fd2d1bf 100755 --- a/src/HOMARD_I/HOMARD_Gen_i.cxx +++ b/src/HOMARD_I/HOMARD_Gen_i.cxx @@ -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 = "<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 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::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 = "<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++ ; } } } diff --git a/src/HOMARD_I/HOMARD_Hypothesis_i.cxx b/src/HOMARD_I/HOMARD_Hypothesis_i.cxx index b22af469..e9d2f3d2 100644 --- a/src/HOMARD_I/HOMARD_Hypothesis_i.cxx +++ b/src/HOMARD_I/HOMARD_Hypothesis_i.cxx @@ -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& ListString = myHomardHypothesis->GetListFieldInterp(); - HOMARD::listFieldInterpHypo_var aResult = new HOMARD::listFieldInterpHypo; + myHomardHypothesis->SupprFieldInterps(); +} +//============================================================================= +HOMARD::listeFieldInterpsHypo* HOMARD_Hypothesis_i::GetFieldInterps() +{ + ASSERT( myHomardHypothesis ); + const std::list& ListString = myHomardHypothesis->GetFieldInterps(); + HOMARD::listeFieldInterpsHypo_var aResult = new HOMARD::listeFieldInterpsHypo; aResult->length( ListString.size() ); std::list::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& 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& ListString = myHomardHypothesis->GetZones(); HOMARD::listeZonesHypo_var aResult = new HOMARD::listeZonesHypo; aResult->length( ListString.size() ); diff --git a/src/HOMARD_I/HOMARD_Hypothesis_i.hxx b/src/HOMARD_I/HOMARD_Hypothesis_i.hxx index 5bc2fad3..cfbfe66a 100644 --- a/src/HOMARD_I/HOMARD_Hypothesis_i.hxx +++ b/src/HOMARD_I/HOMARD_Hypothesis_i.hxx @@ -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 ); diff --git a/src/HOMARD_I/HOMARD_Iteration_i.cxx b/src/HOMARD_I/HOMARD_Iteration_i.cxx index 3a99dab3..429f82d8 100644 --- a/src/HOMARD_I/HOMARD_Iteration_i.cxx +++ b/src/HOMARD_I/HOMARD_Iteration_i.cxx @@ -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& ListString = myHomardIteration->GetFieldInterpsTimeStepRank(); + HOMARD::listeFieldInterpTSRsIter_var aResult = new HOMARD::listeFieldInterpTSRsIter; + aResult->length( ListString.size() ); + std::list::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& ListString = myHomardIteration->GetFieldInterps(); + HOMARD::listeFieldInterpsIter_var aResult = new HOMARD::listeFieldInterpsIter; + aResult->length( ListString.size() ); + std::list::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() ; } diff --git a/src/HOMARD_I/HOMARD_Iteration_i.hxx b/src/HOMARD_I/HOMARD_Iteration_i.hxx index aaaa2018..15802f6a 100644 --- a/src/HOMARD_I/HOMARD_Iteration_i.hxx +++ b/src/HOMARD_I/HOMARD_Iteration_i.hxx @@ -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 index 38fd6266..00000000 --- a/src/HOMARD_SCRIPTS/CMakeLists.txt +++ /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 index bd348268..00000000 --- a/src/HOMARD_SCRIPTS/testHomard.py +++ /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 index 5b621af0..00000000 --- a/src/HOMARD_SCRIPTS/test_homard.py +++ /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) diff --git a/tests/test_1.py b/tests/test_1.py index 2cbc34de..faab0704 100644 --- a/tests/test_1.py +++ b/tests/test_1.py @@ -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 -- 2.30.2