Reduce code

This commit is contained in:
jfa 2021-12-24 19:58:09 +03:00
parent ee8a2759a5
commit 02ac7e629d
9 changed files with 167 additions and 2326 deletions

View File

@ -118,19 +118,6 @@ module SMESHHOMARD
void SetFileInfo(in string FileInfo) raises (SALOME::SALOME_Exception); void SetFileInfo(in string FileInfo) raises (SALOME::SALOME_Exception);
string GetFileInfo() raises (SALOME::SALOME_Exception); string GetFileInfo() raises (SALOME::SALOME_Exception);
// Liens avec les autres iterations
void LinkNextIteration(in string NomIter) raises (SALOME::SALOME_Exception);
void UnLinkNextIteration(in string NomIter) raises (SALOME::SALOME_Exception);
void SetIterParentName(in string NomIterParent) raises (SALOME::SALOME_Exception);
string GetIterParentName() raises (SALOME::SALOME_Exception);
// Liens avec les autres structures
void SetCaseName(in string NomCas) raises (SALOME::SALOME_Exception);
string GetCaseName() raises (SALOME::SALOME_Exception);
void SetHypoName(in string NomHypo) raises (SALOME::SALOME_Exception);
// Drivers // Drivers
void SetInfoCompute(in long MessInfo) raises (SALOME::SALOME_Exception); void SetInfoCompute(in long MessInfo) raises (SALOME::SALOME_Exception);
long GetInfoCompute() raises (SALOME::SALOME_Exception); long GetInfoCompute() raises (SALOME::SALOME_Exception);
@ -164,16 +151,6 @@ module SMESHHOMARD
void AddIteration (in string IterName) raises (SALOME::SALOME_Exception); void AddIteration (in string IterName) raises (SALOME::SALOME_Exception);
}; };
interface HOMARD_Hypothesis : SALOME::GenericObj
{
// Generalites
void SetExtraOutput(in long ExtraOutput) raises (SALOME::SALOME_Exception);
long GetExtraOutput() raises (SALOME::SALOME_Exception);
void LinkIteration(in string NomIteration) raises (SALOME::SALOME_Exception);
void UnLinkIteration(in string NomIteration) raises (SALOME::SALOME_Exception);
};
interface HOMARD_Gen : SALOME::GenericObj interface HOMARD_Gen : SALOME::GenericObj
{ {
HOMARD_Boundary CreateBoundaryCAO (in string BoundaryName, in string FileName) HOMARD_Boundary CreateBoundaryCAO (in string BoundaryName, in string FileName)
@ -228,6 +205,7 @@ module SMESHHOMARD
long DeleteBoundary (in string BoundaryName) raises (SALOME::SALOME_Exception); long DeleteBoundary (in string BoundaryName) raises (SALOME::SALOME_Exception);
long DeleteCase() raises (SALOME::SALOME_Exception); long DeleteCase() raises (SALOME::SALOME_Exception);
void CleanCase() raises (SALOME::SALOME_Exception);
long Compute() raises (SALOME::SALOME_Exception); long Compute() raises (SALOME::SALOME_Exception);

File diff suppressed because it is too large Load Diff

View File

@ -25,30 +25,7 @@
#ifndef _SMESH_HOMARD_ADAPT_HXX_ #ifndef _SMESH_HOMARD_ADAPT_HXX_
#define _SMESH_HOMARD_ADAPT_HXX_ #define _SMESH_HOMARD_ADAPT_HXX_
// C'est le ASSERT de SALOMELocalTrace/utilities.h dans KERNEL #include "SMESH_SMESH.hxx"
#ifndef VERIFICATION
#define VERIFICATION(condition) \
if (!(condition)){INTERRUPTION("CONDITION "<<#condition<<" NOT VERIFIED")}
#endif /* VERIFICATION */
#ifdef WIN32
#if defined HOMARDIMPL_EXPORTS || defined HOMARDImpl_EXPORTS
#define HOMARDIMPL_EXPORT __declspec( dllexport )
#else
#define HOMARDIMPL_EXPORT __declspec( dllimport )
#endif
#else
#define HOMARDIMPL_EXPORT
#endif
// La gestion des repertoires
#ifndef CHDIR
#ifdef WIN32
#define CHDIR _chdir
#else
#define CHDIR chdir
#endif
#endif
#include <vector> #include <vector>
#include <string> #include <string>
@ -64,7 +41,7 @@
namespace SMESHHOMARDImpl namespace SMESHHOMARDImpl
{ {
class HOMARDIMPL_EXPORT HOMARD_Boundary class SMESH_EXPORT HOMARD_Boundary
{ {
public: public:
HOMARD_Boundary(); HOMARD_Boundary();
@ -105,7 +82,7 @@ public:
void SetGroups(const std::list<std::string>& ListGroup ); void SetGroups(const std::list<std::string>& ListGroup );
const std::list<std::string>& GetGroups() const; const std::list<std::string>& GetGroups() const;
// Liens avec les autres structures // Liens avec les autres structures
std::string GetCaseCreation() const; std::string GetCaseCreation() const;
void SetCaseCreation( const char* NomCasCreation ); void SetCaseCreation( const char* NomCasCreation );
@ -124,10 +101,9 @@ private:
double _Angle; double _Angle;
std::list<std::string> _ListGroupSelected; std::list<std::string> _ListGroupSelected;
}; };
class HOMARDIMPL_EXPORT HOMARD_Cas class SMESH_EXPORT HOMARD_Cas
{ {
public: public:
HOMARD_Cas(); HOMARD_Cas();
@ -143,8 +119,6 @@ public:
int SetDirName( const char* NomDir ); int SetDirName( const char* NomDir );
std::string GetDirName() const; std::string GetDirName() const;
int GetNumberofIter();
void SetConfType( int ConfType ); void SetConfType( int ConfType );
const int GetConfType() const; const int GetConfType() const;
@ -161,12 +135,7 @@ public:
const std::list<std::string>& GetBoundaryGroup() const; const std::list<std::string>& GetBoundaryGroup() const;
void SupprBoundaryGroup(); void SupprBoundaryGroup();
// Liens avec les autres structures
std::string GetIter0Name() const;
void AddIteration( const char* NomIteration ); void AddIteration( const char* NomIteration );
const std::list<std::string>& GetIterations() const;
void SupprIterations();
private: private:
std::string _Name; std::string _Name;
@ -183,7 +152,7 @@ private:
IterNames _ListIter; IterNames _ListIter;
}; };
class HOMARDIMPL_EXPORT HomardDriver class SMESH_EXPORT HomardDriver
{ {
public: public:
HomardDriver(const std::string siter, const std::string siterp1); HomardDriver(const std::string siter, const std::string siterp1);
@ -197,14 +166,7 @@ public:
void CreeFichier(); void CreeFichier();
void TexteMaillage( const std::string NomMesh, const std::string MeshFile, int apres ); void TexteMaillage( const std::string NomMesh, const std::string MeshFile, int apres );
void TexteMaillageHOMARD( const std::string Dir, const std::string liter, int apres ); void TexteMaillageHOMARD( const std::string Dir, const std::string liter, int apres );
void TexteConfRaffDera( int ConfType, int TypeAdap, int TypeRaff, int TypeDera ); void TexteConfRaffDera( int ConfType );
void TexteZone( int NumeZone, int ZoneType, int TypeUse, double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8 );
void TexteGroup( const std::string GroupName );
void TexteField( const std::string FieldName, const std::string FieldFile,
int TimeStep, int Rank,
int TypeThR, double ThreshR, int TypeThC, double ThreshC,
int UsField, int UsCmpI );
void TexteCompo( int NumeComp, const std::string NomCompo);
void TexteBoundaryOption( int BoundaryOption ); void TexteBoundaryOption( int BoundaryOption );
void TexteBoundaryCAOGr( const std::string GroupName ); void TexteBoundaryCAOGr( const std::string GroupName );
@ -213,9 +175,6 @@ 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 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 TexteBoundaryAnGr( const std::string NameBoundary, int NumeBoundary, const std::string GroupName );
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 NivMax, double DiamMin, int AdapInit, int LevelOutput ); void TexteAdvanced( int NivMax, double DiamMin, int AdapInit, int LevelOutput );
void TexteInfoCompute( int MessInfo ); void TexteInfoCompute( int MessInfo );
// //
@ -231,157 +190,19 @@ public:
std::string _siter; std::string _siter;
std::string _siterp1; std::string _siterp1;
std::string _Texte; std::string _Texte;
int _TimeStep;
int _Rank;
bool _bLu; bool _bLu;
}; };
class HOMARD_Iteration; class HOMARD_Iteration;
class HOMARD_Hypothesis;
//! persistence entity type class SMESH_EXPORT HOMARD_Gen
typedef enum { Case, Zone, Hypothesis, Iteration, Boundary } SignatureType;
//! get persistence signature
HOMARDIMPL_EXPORT std::string GetSignature( SignatureType type );
//! get data separator
HOMARDIMPL_EXPORT std::string separator();
//! dump boundary to the string
HOMARDIMPL_EXPORT std::string Dump( const SMESHHOMARDImpl::HOMARD_Boundary& boundary );
//! dump case to the string
HOMARDIMPL_EXPORT std::string Dump( const SMESHHOMARDImpl::HOMARD_Cas& cas );
//! dump iteration to the string
HOMARDIMPL_EXPORT std::string Dump( const SMESHHOMARDImpl::HOMARD_Iteration& iteration );
//! dump hypothesis to the string
HOMARDIMPL_EXPORT std::string Dump( const SMESHHOMARDImpl::HOMARD_Hypothesis& hypothesis );
//! restore boundary from the string
HOMARDIMPL_EXPORT bool Restore( SMESHHOMARDImpl::HOMARD_Boundary& boundary, const std::string& stream );
//! restore case from the string
HOMARDIMPL_EXPORT bool Restore( SMESHHOMARDImpl::HOMARD_Cas& cas, const std::string& stream );
//! restore hypothesis from the string
HOMARDIMPL_EXPORT bool Restore( SMESHHOMARDImpl::HOMARD_Hypothesis& hypothesis, const std::string& stream );
//! restore iteration from the string
HOMARDIMPL_EXPORT bool Restore( SMESHHOMARDImpl::HOMARD_Iteration& iteration, const std::string& stream );
class HOMARDIMPL_EXPORT HOMARD_Gen
{ {
public : public :
HOMARD_Gen(); HOMARD_Gen();
~HOMARD_Gen(); ~HOMARD_Gen();
}; };
class HOMARDIMPL_EXPORT HOMARD_Hypothesis class SMESH_EXPORT HOMARD_Iteration
{
public:
HOMARD_Hypothesis();
~HOMARD_Hypothesis();
// Generalites
void SetName( const char* Name );
std::string GetName() const;
// Caracteristiques
void SetAdapType( int TypeAdap );
int GetAdapType() const;
void SetRefinTypeDera( int TypeRaff, int TypeDera );
int GetRefinType() const;
int GetUnRefType() const;
void SetField( const char* FieldName );
std::string GetFieldName() const;
void SetUseField( int UsField );
int GetUseField() const;
void SetUseComp( int UsCmpI );
int GetUseComp() const;
void AddComp( const char* NomComp );
void SupprComp( const char* NomComp );
void SupprComps();
const std::list<std::string>& GetComps() const;
void SetRefinThr( int TypeThR, double ThreshR );
int GetRefinThrType() const;
double GetThreshR() const;
void SetUnRefThr( int TypeThC, double ThreshC );
int GetUnRefThrType() const;
double GetThreshC() const;
void SetNivMax( int NivMax );
const int GetNivMax() const;
void SetDiamMin( double DiamMin );
const double GetDiamMin() const;
void SetAdapInit( int AdapInit );
const int GetAdapInit() const;
void SetExtraOutput( int ExtraOutput );
const int GetExtraOutput() const;
void AddGroup( const char* Group);
void SupprGroup( const char* Group );
void SupprGroups();
void SetGroups(const std::list<std::string>& ListGroup );
const std::list<std::string>& GetGroups() const;
void SetTypeFieldInterp( int TypeFieldInterp );
int GetTypeFieldInterp() 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 );
std::string GetCaseCreation() const;
void LinkIteration( const char* NomIter );
void UnLinkIteration( const char* NomIter );
void UnLinkIterations();
const std::list<std::string>& GetIterations() const;
void AddZone( const char* NomZone, int TypeUse );
void SupprZone( const char* NomZone );
void SupprZones();
const std::list<std::string>& GetZones() const;
private:
std::string _Name;
std::string _NomCasCreation;
int _TypeAdap; // -1 pour une adapation Uniforme,
// 0 si l adaptation depend des zones,
// 1 pour des champs
int _TypeRaff;
int _TypeDera;
std::string _Field;
int _TypeThR;
int _TypeThC;
double _ThreshR;
double _ThreshC;
int _UsField;
int _UsCmpI;
int _TypeFieldInterp; // 0 pour aucune interpolation,
// 1 pour interpolation de tous les champs,
// 2 pour une liste
int _NivMax;
double _DiamMin;
int _AdapInit;
int _ExtraOutput;
std::list<std::string> _ListIter;
std::list<std::string> _ListZone;
std::list<std::string> _ListComp;
std::list<std::string> _ListGroupSelected;
std::list<std::string> _ListFieldInterp;
};
class HOMARDIMPL_EXPORT HOMARD_Iteration
{ {
public: public:
HOMARD_Iteration(); HOMARD_Iteration();
@ -407,45 +228,13 @@ public:
void SetMeshFile( const char* MeshFile ); void SetMeshFile( const char* MeshFile );
std::string GetMeshFile() const; std::string GetMeshFile() const;
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 ); void SetLogFile( const char* LogFile );
std::string GetLogFile() const; std::string GetLogFile() const;
void SetFileInfo( const char* FileInfo ); void SetFileInfo( const char* FileInfo );
std::string GetFileInfo() const; std::string GetFileInfo() const;
// Liens avec les autres iterations // Divers
void LinkNextIteration( const char* NomIteration );
void UnLinkNextIteration( const char* NomIteration );
void UnLinkNextIterations();
const std::list<std::string>& GetIterations() const;
void SetIterParentName( const char* iterParent );
std::string GetIterParentName() const;
// Liens avec les autres structures
void SetCaseName( const char* NomCas );
std::string GetCaseName() const;
void SetHypoName( const char* NomHypo );
std::string GetHypoName() const;
// Divers
void SetInfoCompute( int MessInfo ); void SetInfoCompute( int MessInfo );
int GetInfoCompute() const; int GetInfoCompute() const;
@ -455,21 +244,10 @@ private:
int _NumIter; int _NumIter;
std::string _NomMesh; std::string _NomMesh;
std::string _MeshFile; std::string _MeshFile;
std::string _FieldFile;
int _TimeStep;
int _Rank;
std::string _LogFile; std::string _LogFile;
std::string _IterParent;
std::string _NomHypo;
std::string _NomCas;
std::string _NomDir; std::string _NomDir;
std::list<std::string> _mesIterFilles;
std::string _FileInfo; std::string _FileInfo;
int _MessInfo; 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;
}; };
}; // namespace SMESHHOMARDImpl }; // namespace SMESHHOMARDImpl

View File

@ -72,6 +72,7 @@ SMESHGUI_HomardAdaptDlg::SMESHGUI_HomardAdaptDlg(SMESHHOMARD::HOMARD_Gen_ptr myH
{ {
MESSAGE("Debut du constructeur de SMESHGUI_HomardAdaptDlg"); MESSAGE("Debut du constructeur de SMESHGUI_HomardAdaptDlg");
myHomardGen = SMESHHOMARD::HOMARD_Gen::_duplicate(myHomardGen0); myHomardGen = SMESHHOMARD::HOMARD_Gen::_duplicate(myHomardGen0);
//myHomardGen = SMESHGUI::GetSMESHGen()->CreateHOMARD_ADAPT();
myHomardGen->Register(); myHomardGen->Register();
setModal(false); setModal(false);
@ -181,6 +182,7 @@ SMESHGUI_HomardAdaptDlg::SMESHGUI_HomardAdaptDlg(SMESHHOMARD::HOMARD_Gen_ptr myH
SMESHGUI_HomardAdaptDlg::~SMESHGUI_HomardAdaptDlg() SMESHGUI_HomardAdaptDlg::~SMESHGUI_HomardAdaptDlg()
{ {
// no need to delete child widgets, Qt does it all for us // no need to delete child widgets, Qt does it all for us
myHomardGen->CleanCase();
} }
//================================================================================= //=================================================================================

View File

@ -117,10 +117,10 @@ SMESH_CreateBoundaryAn::SMESH_CreateBoundaryAn(SMESHGUI_HomardAdaptDlg* parent,
// Pour affichage lors de l edition d une BoundaryAn sans nom de Cas // Pour affichage lors de l edition d une BoundaryAn sans nom de Cas
_Xcentre(0), _Ycentre(0), _Zcentre(0), _Rayon(0), _Xcentre(0), _Ycentre(0), _Zcentre(0), _Rayon(0),
_Xmin(1), _Xmax(1), _Xincr(1), _Ymin(1), _Ymax(1), _Yincr(1), _Zmin(1), _Zmax(1), _Zincr(1), _DMax(1), _Xmin(1), _Xmax(1), _Xincr(1), _Ymin(1), _Ymax(1), _Yincr(1), _Zmin(1), _Zmax(1), _Zincr(1), _DMax(1),
Chgt (false), Chgt (false)
myHomardGen(myHomardGen0)
{ {
// MESSAGE("Debut de SMESH_CreateBoundaryAn") // MESSAGE("Debut de SMESH_CreateBoundaryAn")
myHomardGen = SMESHHOMARD::HOMARD_Gen::_duplicate(myHomardGen0);
setupUi(this); setupUi(this);
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
QPixmap pix = resMgr->loadPixmap( "HOMARD", "spherepoint.png" ); QPixmap pix = resMgr->loadPixmap( "HOMARD", "spherepoint.png" );
@ -1140,13 +1140,13 @@ void SMESH_CreateBoundaryDi::SetFiltrage()
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
SMESH_EditBoundaryAn::SMESH_EditBoundaryAn( SMESHGUI_HomardAdaptDlg* parent, bool modal, SMESH_EditBoundaryAn::SMESH_EditBoundaryAn( SMESHGUI_HomardAdaptDlg* parent, bool modal,
SMESHHOMARD::HOMARD_Gen_var myHomardGen, SMESHHOMARD::HOMARD_Gen_var myHomardGen0,
QString caseName, QString Name ): QString caseName, QString Name ):
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
/* Constructs a SMESH_EditBoundaryAn /* Constructs a SMESH_EditBoundaryAn
herite de SMESH_CreateBoundaryAn herite de SMESH_CreateBoundaryAn
*/ */
SMESH_CreateBoundaryAn(parent, myHomardGen, caseName) SMESH_CreateBoundaryAn(parent, myHomardGen0, caseName)
{ {
MESSAGE("Debut de SMESH_EditBoundaryAn pour " << Name.toStdString().c_str()); MESSAGE("Debut de SMESH_EditBoundaryAn pour " << Name.toStdString().c_str());
setWindowTitle(QObject::tr("HOM_BOUN_A_EDIT_WINDOW_TITLE")); setWindowTitle(QObject::tr("HOM_BOUN_A_EDIT_WINDOW_TITLE"));
@ -1516,9 +1516,9 @@ bool SMESH_EditBoundaryAn::CreateOrUpdateBoundaryAn()
*/ */
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
SMESH_EditBoundaryCAO::SMESH_EditBoundaryCAO( SMESHGUI_HomardAdaptDlg* parent, bool modal, SMESH_EditBoundaryCAO::SMESH_EditBoundaryCAO( SMESHGUI_HomardAdaptDlg* parent, bool modal,
SMESHHOMARD::HOMARD_Gen_var myHomardGen, SMESHHOMARD::HOMARD_Gen_var myHomardGen0,
QString caseName, QString Name): QString caseName, QString Name):
SMESH_CreateBoundaryCAO(parent, modal, myHomardGen, caseName, Name) SMESH_CreateBoundaryCAO(parent, modal, myHomardGen0, caseName, Name)
{ {
MESSAGE("Debut de Boundary pour " << Name.toStdString().c_str()); MESSAGE("Debut de Boundary pour " << Name.toStdString().c_str());
setWindowTitle(QObject::tr("HOM_BOUN_C_EDIT_WINDOW_TITLE")); setWindowTitle(QObject::tr("HOM_BOUN_C_EDIT_WINDOW_TITLE"));
@ -1582,9 +1582,9 @@ void SMESH_EditBoundaryCAO::SetFiltrage()
*/ */
// ------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------
SMESH_EditBoundaryDi::SMESH_EditBoundaryDi( SMESHGUI_HomardAdaptDlg* parent, bool modal, SMESH_EditBoundaryDi::SMESH_EditBoundaryDi( SMESHGUI_HomardAdaptDlg* parent, bool modal,
SMESHHOMARD::HOMARD_Gen_var myHomardGen, SMESHHOMARD::HOMARD_Gen_var myHomardGen0,
QString caseName, QString Name): QString caseName, QString Name):
SMESH_CreateBoundaryDi(parent, modal, myHomardGen, caseName, Name) SMESH_CreateBoundaryDi(parent, modal, myHomardGen0, caseName, Name)
{ {
MESSAGE("Debut de Boundary pour " << Name.toStdString().c_str()); MESSAGE("Debut de Boundary pour " << Name.toStdString().c_str());
setWindowTitle(QObject::tr("HOM_BOUN_D_EDIT_WINDOW_TITLE")); setWindowTitle(QObject::tr("HOM_BOUN_D_EDIT_WINDOW_TITLE"));

View File

@ -1065,13 +1065,13 @@ class SMESHGUI_EXPORT SMESH_CreateBoundaryAn : public QDialog, public SMESH_Ui_C
public: public:
SMESH_CreateBoundaryAn (SMESHGUI_HomardAdaptDlg* parent, bool modal, SMESH_CreateBoundaryAn (SMESHGUI_HomardAdaptDlg* parent, bool modal,
SMESHHOMARD::HOMARD_Gen_var myHomardGen, SMESHHOMARD::HOMARD_Gen_var myHomardGen0,
QString caseName); QString caseName);
virtual ~SMESH_CreateBoundaryAn(); virtual ~SMESH_CreateBoundaryAn();
protected : protected :
SMESH_CreateBoundaryAn (SMESHGUI_HomardAdaptDlg* parent, SMESH_CreateBoundaryAn (SMESHGUI_HomardAdaptDlg* parent,
SMESHHOMARD::HOMARD_Gen_var myHomardGen, SMESHHOMARD::HOMARD_Gen_var myHomardGen0,
QString caseName); QString caseName);
SMESHGUI_HomardAdaptDlg * _parent; SMESHGUI_HomardAdaptDlg * _parent;
@ -1121,7 +1121,7 @@ class SMESHGUI_EXPORT SMESH_EditBoundaryAn : public SMESH_CreateBoundaryAn
Q_OBJECT Q_OBJECT
public: public:
SMESH_EditBoundaryAn( SMESHGUI_HomardAdaptDlg* parent, bool modal, SMESH_EditBoundaryAn( SMESHGUI_HomardAdaptDlg* parent, bool modal,
SMESHHOMARD::HOMARD_Gen_var myHomardGen, SMESHHOMARD::HOMARD_Gen_var myHomardGen0,
QString caseName, QString Name); QString caseName, QString Name);
virtual ~SMESH_EditBoundaryAn(); virtual ~SMESH_EditBoundaryAn();
@ -1147,7 +1147,7 @@ class SMESHGUI_EXPORT SMESH_CreateBoundaryCAO : public QDialog, public SMESH_Ui_
public: public:
SMESH_CreateBoundaryCAO( SMESHGUI_HomardAdaptDlg* parent, bool modal, SMESH_CreateBoundaryCAO( SMESHGUI_HomardAdaptDlg* parent, bool modal,
SMESHHOMARD::HOMARD_Gen_var myHomardGen, SMESHHOMARD::HOMARD_Gen_var myHomardGen0,
QString caseName, QString BoundaryName ); QString caseName, QString BoundaryName );
~SMESH_CreateBoundaryCAO(); ~SMESH_CreateBoundaryCAO();
virtual void setGroups (QStringList listGroup); virtual void setGroups (QStringList listGroup);
@ -1181,7 +1181,7 @@ class SMESHGUI_EXPORT SMESH_EditBoundaryCAO : public SMESH_CreateBoundaryCAO
Q_OBJECT Q_OBJECT
public: public:
SMESH_EditBoundaryCAO( SMESHGUI_HomardAdaptDlg* parent, bool modal, SMESH_EditBoundaryCAO( SMESHGUI_HomardAdaptDlg* parent, bool modal,
SMESHHOMARD::HOMARD_Gen_var myHomardGen, SMESHHOMARD::HOMARD_Gen_var myHomardGen0,
QString caseName, QString Name ); QString caseName, QString Name );
virtual ~SMESH_EditBoundaryCAO(); virtual ~SMESH_EditBoundaryCAO();
@ -1197,7 +1197,7 @@ class SMESHGUI_EXPORT SMESH_CreateBoundaryDi : public QDialog, public SMESH_Ui_C
public: public:
SMESH_CreateBoundaryDi( SMESHGUI_HomardAdaptDlg* parent, bool modal, SMESH_CreateBoundaryDi( SMESHGUI_HomardAdaptDlg* parent, bool modal,
SMESHHOMARD::HOMARD_Gen_var myHomardGen, SMESHHOMARD::HOMARD_Gen_var myHomardGen0,
QString caseName, QString BoundaryName ); QString caseName, QString BoundaryName );
~SMESH_CreateBoundaryDi(); ~SMESH_CreateBoundaryDi();
virtual void setGroups (QStringList listGroup); virtual void setGroups (QStringList listGroup);
@ -1231,7 +1231,7 @@ class SMESHGUI_EXPORT SMESH_EditBoundaryDi : public SMESH_CreateBoundaryDi
Q_OBJECT Q_OBJECT
public: public:
SMESH_EditBoundaryDi( SMESHGUI_HomardAdaptDlg* parent, bool modal, SMESH_EditBoundaryDi( SMESHGUI_HomardAdaptDlg* parent, bool modal,
SMESHHOMARD::HOMARD_Gen_var myHomardGen, SMESHHOMARD::HOMARD_Gen_var myHomardGen0,
QString caseName, QString Name ); QString caseName, QString Name );
virtual ~SMESH_EditBoundaryDi(); virtual ~SMESH_EditBoundaryDi();

View File

@ -57,7 +57,7 @@ SMESH_CreateListGroupCAO::SMESH_CreateListGroupCAO(SMESH_CreateBoundaryCAO* pare
} }
// ------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------
SMESH_CreateListGroupCAO::SMESH_CreateListGroupCAO(SMESH_CreateBoundaryCAO* parentBound, SMESH_CreateListGroupCAO::SMESH_CreateListGroupCAO(SMESH_CreateBoundaryCAO* parentBound,
SMESHHOMARD::HOMARD_Gen_var myHomardGen, SMESHHOMARD::HOMARD_Gen_var myHomardGen0,
QString aCaseName, QString aCaseName,
QStringList listeGroupesHypo) QStringList listeGroupesHypo)
: QDialog(0), SMESH_Ui_CreateListGroup(), : QDialog(0), SMESH_Ui_CreateListGroup(),
@ -65,7 +65,7 @@ SMESH_CreateListGroupCAO::SMESH_CreateListGroupCAO(SMESH_CreateBoundaryCAO* pare
_listeGroupesHypo (listeGroupesHypo), _listeGroupesHypo (listeGroupesHypo),
_parentBound(parentBound) _parentBound(parentBound)
{ {
myHomardGen = SMESHHOMARD::HOMARD_Gen::_duplicate(myHomardGen); myHomardGen = SMESHHOMARD::HOMARD_Gen::_duplicate(myHomardGen0);
setupUi(this); setupUi(this);
InitConnect(); InitConnect();
} }
@ -164,14 +164,14 @@ SMESH_CreateListGroup::SMESH_CreateListGroup(SMESH_CreateBoundaryDi* parentBound
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
SMESH_CreateListGroup::SMESH_CreateListGroup(SMESH_CreateBoundaryDi* parentBound, SMESH_CreateListGroup::SMESH_CreateListGroup(SMESH_CreateBoundaryDi* parentBound,
SMESHHOMARD::HOMARD_Gen_var myHomardGen, SMESHHOMARD::HOMARD_Gen_var myHomardGen0,
QString aCaseName, QStringList listeGroupesHypo) QString aCaseName, QStringList listeGroupesHypo)
: QDialog(0), SMESH_Ui_CreateListGroup(), : QDialog(0), SMESH_Ui_CreateListGroup(),
_aCaseName (aCaseName), _aCaseName (aCaseName),
_listeGroupesHypo (listeGroupesHypo), _listeGroupesHypo (listeGroupesHypo),
_parentBound(parentBound) _parentBound(parentBound)
{ {
myHomardGen = SMESHHOMARD::HOMARD_Gen::_duplicate(myHomardGen); myHomardGen = SMESHHOMARD::HOMARD_Gen::_duplicate(myHomardGen0);
setupUi(this); setupUi(this);
InitConnect(); InitConnect();
} }
@ -256,11 +256,11 @@ void SMESH_CreateListGroup::InitGroupes()
//--------------------------------------------------------------------- //---------------------------------------------------------------------
SMESH_EditListGroupCAO::SMESH_EditListGroupCAO( SMESH_CreateBoundaryCAO* parentBound, SMESH_EditListGroupCAO::SMESH_EditListGroupCAO( SMESH_CreateBoundaryCAO* parentBound,
bool modal, bool modal,
SMESHHOMARD::HOMARD_Gen_var myHomardGen, SMESHHOMARD::HOMARD_Gen_var myHomardGen0,
QString aCaseName, QString aCaseName,
QStringList listeGroupesHypo): QStringList listeGroupesHypo):
//--------------------------------------------------------------------- //---------------------------------------------------------------------
SMESH_CreateListGroupCAO(parentBound,myHomardGen,aCaseName,listeGroupesHypo) SMESH_CreateListGroupCAO(parentBound,myHomardGen0,aCaseName,listeGroupesHypo)
{ {
MESSAGE("Debut de SMESH_EditListGroupCAO"); MESSAGE("Debut de SMESH_EditListGroupCAO");
setWindowTitle(QObject::tr("HOM_GROU_EDIT_WINDOW_TITLE")); setWindowTitle(QObject::tr("HOM_GROU_EDIT_WINDOW_TITLE"));
@ -292,11 +292,11 @@ void SMESH_EditListGroupCAO:: InitGroupes()
//--------------------------------------------------------------------- //---------------------------------------------------------------------
SMESH_EditListGroup::SMESH_EditListGroup( SMESH_CreateBoundaryDi* parentBound, SMESH_EditListGroup::SMESH_EditListGroup( SMESH_CreateBoundaryDi* parentBound,
bool modal, bool modal,
SMESHHOMARD::HOMARD_Gen_var myHomardGen, SMESHHOMARD::HOMARD_Gen_var myHomardGen0,
QString aCaseName, QString aCaseName,
QStringList listeGroupesHypo): QStringList listeGroupesHypo):
//--------------------------------------------------------------------- //---------------------------------------------------------------------
SMESH_CreateListGroup(parentBound,myHomardGen,aCaseName,listeGroupesHypo) SMESH_CreateListGroup(parentBound,myHomardGen0,aCaseName,listeGroupesHypo)
{ {
MESSAGE("Debut de SMESH_EditListGroup"); MESSAGE("Debut de SMESH_EditListGroup");
setWindowTitle(QObject::tr("HOM_GROU_EDIT_WINDOW_TITLE")); setWindowTitle(QObject::tr("HOM_GROU_EDIT_WINDOW_TITLE"));

View File

@ -62,6 +62,21 @@
#include <vector> #include <vector>
#include <stdio.h> #include <stdio.h>
// C'est le ASSERT de SALOMELocalTrace/utilities.h dans KERNEL
#ifndef VERIFICATION
#define VERIFICATION(condition) \
if (!(condition)){INTERRUPTION("CONDITION "<<#condition<<" NOT VERIFIED")}
#endif /* VERIFICATION */
// La gestion des repertoires
#ifndef CHDIR
#ifdef WIN32
#define CHDIR _chdir
#else
#define CHDIR chdir
#endif
#endif
using namespace std; using namespace std;
SMESHHOMARD::HOMARD_Gen_ptr SMESH_Gen_i::CreateHOMARD_ADAPT() SMESHHOMARD::HOMARD_Gen_ptr SMESH_Gen_i::CreateHOMARD_ADAPT()
@ -652,80 +667,6 @@ void HOMARD_Cas_i::AddIteration(const char* NomIteration)
myHomardCas->AddIteration(NomIteration); myHomardCas->AddIteration(NomIteration);
} }
//=============================================================================
/*!
* standard constructor
*/
//=============================================================================
HOMARD_Hypothesis_i::HOMARD_Hypothesis_i()
: SALOME::GenericObj_i(SMESH_Gen_i::GetPOA())
{
MESSAGE("Default constructor, not for use");
ASSERT(0);
}
//=============================================================================
/*!
* standard constructor
*/
//=============================================================================
HOMARD_Hypothesis_i::HOMARD_Hypothesis_i(SMESHHOMARD::HOMARD_Gen_var engine)
: SALOME::GenericObj_i(SMESH_Gen_i::GetPOA())
{
MESSAGE("standard constructor");
_gen_i = engine;
myHomardHypothesis = new SMESHHOMARDImpl::HOMARD_Hypothesis();
ASSERT(myHomardHypothesis);
// SetUnifRefinUnRef(1)
int RefinType = 1;
int UnRefType = 0;
myHomardHypothesis->SetAdapType(-1);
myHomardHypothesis->SetRefinTypeDera(RefinType, UnRefType);
// Set name
myHomardHypothesis->SetName("Hypo_1");
}
//=============================================================================
/*!
* standard destructor
*/
//=============================================================================
HOMARD_Hypothesis_i::~HOMARD_Hypothesis_i()
{
}
//=============================================================================
void HOMARD_Hypothesis_i::SetExtraOutput(CORBA::Long ExtraOutput)
{
ASSERT(myHomardHypothesis);
myHomardHypothesis->SetExtraOutput(ExtraOutput);
}
//=============================================================================
CORBA::Long HOMARD_Hypothesis_i::GetExtraOutput()
{
ASSERT(myHomardHypothesis);
return myHomardHypothesis->GetExtraOutput();
}
//=============================================================================
//=============================================================================
// Liens avec les autres structures
//=============================================================================
//=============================================================================
void HOMARD_Hypothesis_i::LinkIteration(const char* NomIteration)
{
ASSERT(myHomardHypothesis);
myHomardHypothesis->LinkIteration(NomIteration);
}
//=============================================================================
void HOMARD_Hypothesis_i::UnLinkIteration(const char* NomIteration)
{
ASSERT(myHomardHypothesis);
myHomardHypothesis->UnLinkIteration(NomIteration);
}
//============================================================================= //=============================================================================
/*! /*!
* standard constructor * standard constructor
@ -864,61 +805,6 @@ char* HOMARD_Iteration_i::GetFileInfo()
return CORBA::string_dup(myHomardIteration->GetFileInfo().c_str()); return CORBA::string_dup(myHomardIteration->GetFileInfo().c_str());
} }
//============================================================================= //=============================================================================
//=============================================================================
// Liens avec les autres iterations
//=============================================================================
//=============================================================================
void HOMARD_Iteration_i::LinkNextIteration(const char* NomIteration)
{
ASSERT(myHomardIteration);
myHomardIteration->LinkNextIteration(NomIteration);
}
//=============================================================================
void HOMARD_Iteration_i::UnLinkNextIteration(const char* NomIteration)
{
ASSERT(myHomardIteration);
myHomardIteration->UnLinkNextIteration(NomIteration);
}
//=============================================================================
void HOMARD_Iteration_i::SetIterParentName(const char* NomIterParent)
{
ASSERT(myHomardIteration);
myHomardIteration->SetIterParentName(NomIterParent);
}
//=============================================================================
char* HOMARD_Iteration_i::GetIterParentName()
{
ASSERT(myHomardIteration);
return CORBA::string_dup(myHomardIteration->GetIterParentName().c_str());
}
//=============================================================================
//=============================================================================
// Liens avec les autres structures
//=============================================================================
//=============================================================================
void HOMARD_Iteration_i::SetCaseName(const char* NomCas)
{
ASSERT(myHomardIteration);
myHomardIteration->SetCaseName(NomCas);
}
//=============================================================================
char* HOMARD_Iteration_i::GetCaseName()
{
ASSERT(myHomardIteration);
return CORBA::string_dup(myHomardIteration->GetCaseName().c_str());
}
//=============================================================================
void HOMARD_Iteration_i::SetHypoName(const char* NomHypo)
{
ASSERT(myHomardIteration);
myHomardIteration->SetHypoName(NomHypo);
}
//=============================================================================
//=============================================================================
// Divers
//=============================================================================
//=============================================================================
void HOMARD_Iteration_i::SetInfoCompute(CORBA::Long MessInfo) void HOMARD_Iteration_i::SetInfoCompute(CORBA::Long MessInfo)
{ {
ASSERT(myHomardIteration); ASSERT(myHomardIteration);
@ -962,9 +848,9 @@ HOMARD_Gen_i::HOMARD_Gen_i() : SALOME::GenericObj_i(SMESH_Gen_i::GetPOA()),
HOMARD_Gen_i::~HOMARD_Gen_i() HOMARD_Gen_i::~HOMARD_Gen_i()
{ {
MESSAGE ("HOMARD_Gen_i::~HOMARD_Gen_i()"); MESSAGE ("HOMARD_Gen_i::~HOMARD_Gen_i()");
if (!myCase->_is_nil()) { //if (!myCase->_is_nil()) {
CleanCase(); // CleanCase();
} //}
} }
//============================================================================= //=============================================================================
@ -1010,17 +896,18 @@ CORBA::Long HOMARD_Gen_i::DeleteIteration(int numIter)
MESSAGE ("DeleteIteration : numIter = " << numIter); MESSAGE ("DeleteIteration : numIter = " << numIter);
if (numIter == 0) { if (numIter == 0) {
if (CORBA::is_nil(myIteration1))
myIteration0 = SMESHHOMARD::HOMARD_Iteration::_nil(); myIteration0 = SMESHHOMARD::HOMARD_Iteration::_nil();
} }
else { else {
if (!CORBA::is_nil(myIteration1)) { if (!CORBA::is_nil(myIteration1)) {
/*
if (CORBA::is_nil(myIteration0)) { if (CORBA::is_nil(myIteration0)) {
SALOME::ExceptionStruct es; SALOME::ExceptionStruct es;
es.type = SALOME::BAD_PARAM; es.type = SALOME::BAD_PARAM;
es.text = "Invalid iteration 0"; es.text = "Invalid iteration 0";
throw SALOME::SALOME_Exception(es); throw SALOME::SALOME_Exception(es);
} }
*/
// Invalide Iteration // Invalide Iteration
if (myIteration1->GetState() > 0) { if (myIteration1->GetState() > 0) {
@ -1043,10 +930,6 @@ CORBA::Long HOMARD_Gen_i::DeleteIteration(int numIter)
} }
} }
// Unlink from the parent iteration and from the hypothesis
myIteration0->UnLinkNextIteration("Iter_1");
ASSERT(!CORBA::is_nil(myHypothesis));
myHypothesis->UnLinkIteration("Iter_1");
myIteration1 = SMESHHOMARD::HOMARD_Iteration::_nil(); myIteration1 = SMESHHOMARD::HOMARD_Iteration::_nil();
} }
} }
@ -1102,7 +985,6 @@ void HOMARD_Gen_i::AssociateCaseIter(int numIter, const char* labelIter)
} }
myCase->AddIteration(myIteration0->GetName()); myCase->AddIteration(myIteration0->GetName());
myIteration0->SetCaseName("Case_1");
} }
else { else {
if (CORBA::is_nil(myIteration1)) { if (CORBA::is_nil(myIteration1)) {
@ -1113,7 +995,6 @@ void HOMARD_Gen_i::AssociateCaseIter(int numIter, const char* labelIter)
} }
myCase->AddIteration(myIteration1->GetName()); myCase->AddIteration(myIteration1->GetName());
myIteration1->SetCaseName("Case_1");
} }
} }
@ -1436,7 +1317,7 @@ SMESHHOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::CreateIteration()
myIteration1->SetState(1); myIteration1->SetState(1);
myIteration1->SetNumber(1); myIteration1->SetNumber(1);
int nbitercase = 1; //myCase->GetNumberofIter() int nbitercase = 1;
char* nomDirIter = CreateDirNameIter(nomDirCase, nbitercase); char* nomDirIter = CreateDirNameIter(nomDirCase, nbitercase);
myIteration1->SetDirNameLoc(nomDirIter); myIteration1->SetDirNameLoc(nomDirIter);
@ -1463,29 +1344,6 @@ SMESHHOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::CreateIteration()
std::string label = "IterationHomard_" + nomIterParent; std::string label = "IterationHomard_" + nomIterParent;
AssociateCaseIter(1, label.c_str()); AssociateCaseIter(1, label.c_str());
// Lien avec l'iteration precedente
myIteration0->LinkNextIteration("Iter_1");
myIteration1->SetIterParentName(nomIterParent.c_str());
// Associate hypothesis
if (CORBA::is_nil(myHypothesis)) {
SMESHHOMARD::HOMARD_Gen_var engine = POA_SMESHHOMARD::HOMARD_Gen::_this();
HOMARD_Hypothesis_i* aServant = new HOMARD_Hypothesis_i(engine);
myHypothesis = SMESHHOMARD::HOMARD_Hypothesis::_narrow(aServant->_this());
if (CORBA::is_nil(myHypothesis)) {
SALOME::ExceptionStruct es;
es.type = SALOME::BAD_PARAM;
es.text = "Unable to create the hypothesis";
throw SALOME::SALOME_Exception(es);
}
//myHypothesis->SetNivMax(-1);
//myHypothesis->SetDiamMin(-1.0);
//myHypothesis->SetAdapInit(0);
//myHypothesis->SetExtraOutput(1);
}
myIteration1->SetHypoName("Hypo_1");
myHypothesis->LinkIteration("Iter_1");
return SMESHHOMARD::HOMARD_Iteration::_duplicate(myIteration1); return SMESHHOMARD::HOMARD_Iteration::_duplicate(myIteration1);
} }
//============================================================================= //=============================================================================
@ -1731,7 +1589,7 @@ CORBA::Long HOMARD_Gen_i::Compute()
// B.1. Le répertoire courant // B.1. Le répertoire courant
std::string nomDirWork = getenv("PWD"); std::string nomDirWork = getenv("PWD");
// B.2. Le sous-répertoire de l'iteration a traiter // B.2. Le sous-répertoire de l'iteration a traiter
char* DirCompute = ComputeDirManagement(myCase, myIteration1); char* DirCompute = ComputeDirManagement();
MESSAGE(". DirCompute = " << DirCompute); MESSAGE(". DirCompute = " << DirCompute);
// C. Le fichier des messages // C. Le fichier des messages
@ -1767,10 +1625,10 @@ CORBA::Long HOMARD_Gen_i::Compute()
iaux = 1; iaux = 1;
myDriver->TexteMaillageHOMARD(DirCompute, siterp1, iaux); myDriver->TexteMaillageHOMARD(DirCompute, siterp1, iaux);
myDriver->TexteMaillage(NomMesh, MeshFile, 1); myDriver->TexteMaillage(NomMesh, MeshFile, 1);
codret = ComputeAdap(myCase, myIteration1, myDriver); codret = ComputeAdap(myDriver);
// E.4. Ajout des informations liees a l'eventuel suivi de frontiere // E.4. Ajout des informations liees a l'eventuel suivi de frontiere
int BoundaryOption = DriverTexteBoundary(myCase, myDriver); int BoundaryOption = DriverTexteBoundary(myDriver);
// E.5. Ecriture du texte dans le fichier // E.5. Ecriture du texte dans le fichier
MESSAGE (". Ecriture du texte dans le fichier de configuration; codret = "<<codret); MESSAGE (". Ecriture du texte dans le fichier de configuration; codret = "<<codret);
@ -1845,7 +1703,7 @@ CORBA::Long HOMARD_Gen_i::Compute()
if (codret == 0) { if (codret == 0) {
if ((BoundaryOption % 5 == 0) && (codretexec == 0)) { if ((BoundaryOption % 5 == 0) && (codretexec == 0)) {
MESSAGE ("Suivi de frontière CAO"); MESSAGE ("Suivi de frontière CAO");
codret = ComputeCAO(myCase, myIteration1); codret = ComputeCAO();
} }
} }
@ -1853,6 +1711,15 @@ CORBA::Long HOMARD_Gen_i::Compute()
// Python Dump // Python Dump
PythonDump(); PythonDump();
// Delete log file, if required
if (!myIteration1->_is_nil()) {
MESSAGE("myIteration1->GetLogFile() = " << myIteration1->GetLogFile());
if (_LogInFile && _RemoveLogOnSuccess) {
// Remove log file on success
SMESH_File(myIteration1->GetLogFile(), false).remove();
}
}
// Clean all data // Clean all data
CleanCase(); CleanCase();
} }
@ -1862,30 +1729,15 @@ CORBA::Long HOMARD_Gen_i::Compute()
void HOMARD_Gen_i::CleanCase() void HOMARD_Gen_i::CleanCase()
{ {
// Delete log file, if required MESSAGE ("CleanCase");
if (!myIteration1->_is_nil()) { if (myCase->_is_nil()) return;
MESSAGE("myIteration1->GetLogFile() = " << myIteration1->GetLogFile());
if (_LogInFile && _RemoveLogOnSuccess) {
// Remove log file on success
SMESH_File(myIteration1->GetLogFile(), false).remove();
}
}
// Delete all boundaries // Delete all boundaries
//std::map<std::string, SMESHHOMARD::HOMARD_Boundary_var>::const_iterator it_boundary;
//for (it_boundary = _mesBoundarys.begin();
// it_boundary != _mesBoundarys.end(); ++it_boundary) {
// DeleteBoundary((*it_boundary).first.c_str());
//}
_mesBoundarys.clear(); _mesBoundarys.clear();
// Delete iteration // Delete iteration
DeleteIteration(1); DeleteIteration(1);
// Delete hypothesis
// Hypothesis should be deleted only after iteration deletion
myHypothesis = SMESHHOMARD::HOMARD_Hypothesis::_nil();
// Delete case // Delete case
DeleteCase(); DeleteCase();
@ -1901,9 +1753,7 @@ void HOMARD_Gen_i::CleanCase()
//============================================================================= //=============================================================================
// Calcul d'une iteration : partie spécifique à l'adaptation // Calcul d'une iteration : partie spécifique à l'adaptation
//============================================================================= //=============================================================================
CORBA::Long HOMARD_Gen_i::ComputeAdap(SMESHHOMARD::HOMARD_Cas_var myCase, CORBA::Long HOMARD_Gen_i::ComputeAdap(SMESHHOMARDImpl::HomardDriver* myDriver)
SMESHHOMARD::HOMARD_Iteration_var myIteration,
SMESHHOMARDImpl::HomardDriver* myDriver)
{ {
MESSAGE ("ComputeAdap"); MESSAGE ("ComputeAdap");
@ -1911,20 +1761,17 @@ CORBA::Long HOMARD_Gen_i::ComputeAdap(SMESHHOMARD::HOMARD_Cas_var myCase,
// A.1. Bases // A.1. Bases
int codret = 0; int codret = 0;
// Numero de l'iteration // Numero de l'iteration
int NumeIter = myIteration->GetNumber(); int NumeIter = 1;
std::stringstream saux0; std::stringstream saux0;
saux0 << NumeIter-1; saux0 << NumeIter-1;
std::string siter = saux0.str(); std::string siter = saux0.str();
if (NumeIter < 11) { siter = "0" + siter; } if (NumeIter < 11) { siter = "0" + siter; }
// A.2. On verifie qu il y a une hypothese (erreur improbable);
ASSERT(!CORBA::is_nil(myHypothesis));
// B. L'iteration parent // B. L'iteration parent
ASSERT(!CORBA::is_nil(myIteration0)); ASSERT(!CORBA::is_nil(myIteration0));
// C. Le sous-répertoire de l'iteration precedente // C. Le sous-répertoire de l'iteration precedente
char* DirComputePa = ComputeDirPaManagement(myCase, myIteration); char* DirComputePa = ComputeDirPaManagement();
MESSAGE(". DirComputePa = " << DirComputePa); MESSAGE(". DirComputePa = " << DirComputePa);
// D. Les données de l'adaptation HOMARD // D. Les données de l'adaptation HOMARD
@ -1939,7 +1786,7 @@ CORBA::Long HOMARD_Gen_i::ComputeAdap(SMESHHOMARD::HOMARD_Cas_var myCase,
MESSAGE (". MeshFileParent = " << MeshFileParent); MESSAGE (". MeshFileParent = " << MeshFileParent);
// D.4. Le maillage associe a l'iteration // D.4. Le maillage associe a l'iteration
const char* MeshFile = myIteration->GetMeshFile(); const char* MeshFile = myIteration1->GetMeshFile();
MESSAGE (". MeshFile = " << MeshFile); MESSAGE (". MeshFile = " << MeshFile);
FILE *file = fopen(MeshFile,"r"); FILE *file = fopen(MeshFile,"r");
if (file != NULL) { if (file != NULL) {
@ -1966,36 +1813,20 @@ CORBA::Long HOMARD_Gen_i::ComputeAdap(SMESHHOMARD::HOMARD_Cas_var myCase,
} }
} }
// D.5. Les types de raffinement et de deraffinement
// Les appels corba sont lourds, il vaut mieux les grouper
//SMESHHOMARD::listeTypes* ListTypes = myHypothesis->GetAdapRefinUnRef();
//ASSERT(ListTypes->length() == 3);
int TypeAdap = -1; // HomardHypothesis->GetAdapType()
int TypeRaff = 1; // HomardHypothesis->GetRefinType()
int TypeDera = 0; // HomardHypothesis->GetUnRefType()
// E. Texte du fichier de configuration // E. Texte du fichier de configuration
// E.1. Incontournables du texte // E.1. Incontournables du texte
myDriver->TexteAdap(); myDriver->TexteAdap();
int iaux = 0; int iaux = 0;
myDriver->TexteMaillageHOMARD(DirComputePa, siter, iaux); myDriver->TexteMaillageHOMARD(DirComputePa, siter, iaux);
myDriver->TexteMaillage(NomMeshParent, MeshFileParent, 0); myDriver->TexteMaillage(NomMeshParent, MeshFileParent, 0);
myDriver->TexteConfRaffDera(ConfType, TypeAdap, TypeRaff, TypeDera); myDriver->TexteConfRaffDera(ConfType);
// E.6. Ajout des options avancees // E.6. Ajout des options avancees
//int NivMax = myHypo->GetNivMax();
//MESSAGE (". NivMax = " << NivMax);
//double DiamMin = myHypo->GetDiamMin();
//MESSAGE (". DiamMin = " << DiamMin);
//int AdapInit = myHypo->GetAdapInit();
//MESSAGE (". AdapInit = " << AdapInit);
//int ExtraOutput = myHypo->GetExtraOutput();
//MESSAGE (". ExtraOutput = " << ExtraOutput);
//myDriver->TexteAdvanced(NivMax, DiamMin, AdapInit, ExtraOutput); //myDriver->TexteAdvanced(NivMax, DiamMin, AdapInit, ExtraOutput);
myDriver->TexteAdvanced(-1, -1.0, 0, 1); myDriver->TexteAdvanced(-1, -1.0, 0, 1);
// E.7. Ajout des informations sur le deroulement de l'execution // E.7. Ajout des informations sur le deroulement de l'execution
int MessInfo = myIteration->GetInfoCompute(); int MessInfo = myIteration1->GetInfoCompute();
MESSAGE (". MessInfo = " << MessInfo); MESSAGE (". MessInfo = " << MessInfo);
myDriver->TexteInfoCompute(MessInfo); myDriver->TexteInfoCompute(MessInfo);
@ -2004,8 +1835,7 @@ CORBA::Long HOMARD_Gen_i::ComputeAdap(SMESHHOMARD::HOMARD_Cas_var myCase,
//============================================================================= //=============================================================================
// Calcul d'une iteration : partie spécifique au suivi de frontière CAO // Calcul d'une iteration : partie spécifique au suivi de frontière CAO
//============================================================================= //=============================================================================
CORBA::Long HOMARD_Gen_i::ComputeCAO(SMESHHOMARD::HOMARD_Cas_var myCase, CORBA::Long HOMARD_Gen_i::ComputeCAO()
SMESHHOMARD::HOMARD_Iteration_var myIteration)
{ {
MESSAGE ("ComputeCAO"); MESSAGE ("ComputeCAO");
@ -2013,9 +1843,9 @@ CORBA::Long HOMARD_Gen_i::ComputeCAO(SMESHHOMARD::HOMARD_Cas_var myCase,
// A.1. Bases // A.1. Bases
int codret = 0; int codret = 0;
// A.2. Le sous-répertoire de l'iteration en cours de traitement // A.2. Le sous-répertoire de l'iteration en cours de traitement
char* DirCompute = myIteration->GetDirName(); char* DirCompute = myIteration1->GetDirName();
// A.3. Le maillage résultat de l'iteration en cours de traitement // A.3. Le maillage résultat de l'iteration en cours de traitement
char* MeshFile = myIteration->GetMeshFile(); char* MeshFile = myIteration1->GetMeshFile();
// B. Les données pour FrontTrack // B. Les données pour FrontTrack
// B.1. Le maillage à modifier // B.1. Le maillage à modifier
@ -2077,9 +1907,6 @@ CORBA::Long HOMARD_Gen_i::ComputeCAO(SMESHHOMARD::HOMARD_Cas_var myCase,
const std::string theXaoFileName = myBoundary->GetDataFile(); const std::string theXaoFileName = myBoundary->GetDataFile();
MESSAGE (". theXaoFileName = " << theXaoFileName); MESSAGE (". theXaoFileName = " << theXaoFileName);
// B.5. Parallélisme
bool theIsParallel = false;
// C. Lancement des projections // C. Lancement des projections
MESSAGE (". Lancement des projections"); MESSAGE (". Lancement des projections");
@ -2101,15 +1928,11 @@ CORBA::Long HOMARD_Gen_i::ComputeCAO(SMESHHOMARD::HOMARD_Cas_var myCase,
PyRun_SimpleString(pyCommand.c_str()); PyRun_SimpleString(pyCommand.c_str());
PyGILState_Release(gstate); PyGILState_Release(gstate);
//SMESHHOMARDImpl::FrontTrack* myFrontTrack = new SMESHHOMARDImpl::FrontTrack();
//myFrontTrack->track(theInputMedFile, theOutputMedFile,
// theInputNodeFiles, theXaoFileName, theIsParallel);
// D. Transfert des coordonnées modifiées dans le fichier historique de HOMARD // D. Transfert des coordonnées modifiées dans le fichier historique de HOMARD
// On lance une exécution spéciale de HOMARD en attendant // On lance une exécution spéciale de HOMARD en attendant
// de savoir le faire avec MEDCoupling // de savoir le faire avec MEDCoupling
MESSAGE (". Transfert des coordonnées"); MESSAGE (". Transfert des coordonnées");
codret = ComputeCAObis(myIteration); codret = ComputeCAObis();
return codret; return codret;
} }
@ -2117,7 +1940,7 @@ CORBA::Long HOMARD_Gen_i::ComputeCAO(SMESHHOMARD::HOMARD_Cas_var myCase,
//============================================================================= //=============================================================================
// Transfert des coordonnées en suivi de frontière CAO // Transfert des coordonnées en suivi de frontière CAO
//============================================================================= //=============================================================================
CORBA::Long HOMARD_Gen_i::ComputeCAObis(SMESHHOMARD::HOMARD_Iteration_var myIteration) CORBA::Long HOMARD_Gen_i::ComputeCAObis()
{ {
MESSAGE ("ComputeCAObis"); MESSAGE ("ComputeCAObis");
@ -2126,7 +1949,7 @@ CORBA::Long HOMARD_Gen_i::ComputeCAObis(SMESHHOMARD::HOMARD_Iteration_var myIter
// A.1. Controle de la possibilite d'agir // A.1. Controle de la possibilite d'agir
// A.1.1. Etat de l'iteration // A.1.1. Etat de l'iteration
int etat = myIteration->GetState(); int etat = myIteration1->GetState();
MESSAGE ("etat = " << etat); MESSAGE ("etat = " << etat);
// A.1.2. L'iteration doit être calculee // A.1.2. L'iteration doit être calculee
if (etat == 1) { if (etat == 1) {
@ -2138,7 +1961,7 @@ CORBA::Long HOMARD_Gen_i::ComputeCAObis(SMESHHOMARD::HOMARD_Iteration_var myIter
} }
// A.2. Numero de l'iteration // A.2. Numero de l'iteration
// siterp1 : numero de l'iteration a traiter // siterp1 : numero de l'iteration a traiter
int NumeIter = myIteration->GetNumber(); int NumeIter = myIteration1->GetNumber();
std::string siterp1; std::string siterp1;
std::stringstream saux1; std::stringstream saux1;
saux1 << NumeIter; saux1 << NumeIter;
@ -2150,14 +1973,14 @@ CORBA::Long HOMARD_Gen_i::ComputeCAObis(SMESHHOMARD::HOMARD_Iteration_var myIter
ASSERT(!CORBA::is_nil(myCase)); ASSERT(!CORBA::is_nil(myCase));
// A.4. Le sous-répertoire de l'iteration a traiter // A.4. Le sous-répertoire de l'iteration a traiter
char* DirCompute = myIteration->GetDirName(); char* DirCompute = myIteration1->GetDirName();
MESSAGE(". DirCompute = " << DirCompute); MESSAGE(". DirCompute = " << DirCompute);
// C. Le fichier des messages // C. Le fichier des messages
std::string LogFile = DirCompute; std::string LogFile = DirCompute;
LogFile += "/Liste." + siterp1 + ".maj_coords.log"; LogFile += "/Liste." + siterp1 + ".maj_coords.log";
MESSAGE (". LogFile = " << LogFile); MESSAGE (". LogFile = " << LogFile);
myIteration->SetFileInfo(LogFile.c_str()); myIteration1->SetFileInfo(LogFile.c_str());
// D. On passe dans le répertoire de l'iteration a calculer // D. On passe dans le répertoire de l'iteration a calculer
MESSAGE (". On passe dans DirCompute = " << DirCompute); MESSAGE (". On passe dans DirCompute = " << DirCompute);
@ -2169,9 +1992,9 @@ CORBA::Long HOMARD_Gen_i::ComputeCAObis(SMESHHOMARD::HOMARD_Iteration_var myIter
myDriver->TexteInit(DirCompute, LogFile, "English"); myDriver->TexteInit(DirCompute, LogFile, "English");
// E.2. Le maillage associe a l'iteration // E.2. Le maillage associe a l'iteration
const char* NomMesh = myIteration->GetMeshName(); const char* NomMesh = myIteration1->GetMeshName();
MESSAGE (". NomMesh = " << NomMesh); MESSAGE (". NomMesh = " << NomMesh);
const char* MeshFile = myIteration->GetMeshFile(); const char* MeshFile = myIteration1->GetMeshFile();
MESSAGE (". MeshFile = " << MeshFile); MESSAGE (". MeshFile = " << MeshFile);
// E.3. Les données du traitement HOMARD // E.3. Les données du traitement HOMARD
@ -2296,8 +2119,7 @@ char* HOMARD_Gen_i::CreateDirNameIter(const char* nomrep, CORBA::Long num)
//============================================================================= //=============================================================================
// Calcul d'une iteration : gestion du répertoire de calcul // Calcul d'une iteration : gestion du répertoire de calcul
//============================================================================= //=============================================================================
char* HOMARD_Gen_i::ComputeDirManagement(SMESHHOMARD::HOMARD_Cas_var myCase, char* HOMARD_Gen_i::ComputeDirManagement()
SMESHHOMARD::HOMARD_Iteration_var myIteration)
{ {
MESSAGE ("ComputeDirManagement : répertoires pour le calcul"); MESSAGE ("ComputeDirManagement : répertoires pour le calcul");
@ -2313,7 +2135,7 @@ char* HOMARD_Gen_i::ComputeDirManagement(SMESHHOMARD::HOMARD_Cas_var myCase,
// B.3. Le sous-répertoire de l'iteration a calculer, puis le répertoire complet a creer // B.3. Le sous-répertoire de l'iteration a calculer, puis le répertoire complet a creer
// B.3.1. Le nom du sous-répertoire // B.3.1. Le nom du sous-répertoire
const char* nomDirIt = myIteration->GetDirNameLoc(); const char* nomDirIt = myIteration1->GetDirNameLoc();
// B.3.2. Le nom complet du sous-répertoire // B.3.2. Le nom complet du sous-répertoire
std::stringstream DirCompute; std::stringstream DirCompute;
@ -2395,8 +2217,7 @@ char* HOMARD_Gen_i::ComputeDirManagement(SMESHHOMARD::HOMARD_Cas_var myCase,
//============================================================================= //=============================================================================
// Calcul d'une iteration : gestion du répertoire de calcul de l'iteration parent // Calcul d'une iteration : gestion du répertoire de calcul de l'iteration parent
//============================================================================= //=============================================================================
char* HOMARD_Gen_i::ComputeDirPaManagement(SMESHHOMARD::HOMARD_Cas_var myCase, char* HOMARD_Gen_i::ComputeDirPaManagement()
SMESHHOMARD::HOMARD_Iteration_var myIteration)
{ {
MESSAGE ("ComputeDirPaManagement : répertoires pour le calcul"); MESSAGE ("ComputeDirPaManagement : répertoires pour le calcul");
// Le répertoire du cas // Le répertoire du cas
@ -2421,7 +2242,7 @@ char* HOMARD_Gen_i::ComputeDirPaManagement(SMESHHOMARD::HOMARD_Cas_var myCase,
// 2. les liens avec les groupes // 2. les liens avec les groupes
// 3. un entier resumant le type de comportement pour les frontieres // 3. un entier resumant le type de comportement pour les frontieres
//============================================================================= //=============================================================================
int HOMARD_Gen_i::DriverTexteBoundary(SMESHHOMARD::HOMARD_Cas_var myCase, SMESHHOMARDImpl::HomardDriver* myDriver) int HOMARD_Gen_i::DriverTexteBoundary(SMESHHOMARDImpl::HomardDriver* myDriver)
{ {
MESSAGE ("... DriverTexteBoundary"); MESSAGE ("... DriverTexteBoundary");
// 1. Recuperation des frontieres // 1. Recuperation des frontieres

View File

@ -138,27 +138,6 @@ private:
SMESHHOMARD::HOMARD_Gen_var _gen_i; SMESHHOMARD::HOMARD_Gen_var _gen_i;
}; };
class SMESH_I_EXPORT HOMARD_Hypothesis_i : public virtual SALOME::GenericObj_i,
public virtual POA_SMESHHOMARD::HOMARD_Hypothesis
{
public:
HOMARD_Hypothesis_i(SMESHHOMARD::HOMARD_Gen_var gen_i);
HOMARD_Hypothesis_i();
virtual ~HOMARD_Hypothesis_i();
// Generalites
void SetExtraOutput(CORBA::Long ExtraOutput);
CORBA::Long GetExtraOutput();
void LinkIteration(const char* NomIteration);
void UnLinkIteration(const char* NomIteration);
private:
SMESHHOMARDImpl::HOMARD_Hypothesis* myHomardHypothesis;
SMESHHOMARD::HOMARD_Gen_var _gen_i;
};
class SMESH_I_EXPORT HOMARD_Iteration_i : public virtual SALOME::GenericObj_i, class SMESH_I_EXPORT HOMARD_Iteration_i : public virtual SALOME::GenericObj_i,
public virtual POA_SMESHHOMARD::HOMARD_Iteration public virtual POA_SMESHHOMARD::HOMARD_Iteration
{ {
@ -200,15 +179,10 @@ public:
void LinkNextIteration(const char* NomIteration); void LinkNextIteration(const char* NomIteration);
void UnLinkNextIteration(const char* NomIteration); void UnLinkNextIteration(const char* NomIteration);
void SetIterParentName(const char* NomIterParent);
char* GetIterParentName();
// Liens avec les autres structures // Liens avec les autres structures
void SetCaseName(const char* NomCas); void SetCaseName(const char* NomCas);
char* GetCaseName(); char* GetCaseName();
void SetHypoName(const char* NomHypo);
// Drivers // Drivers
void SetInfoCompute(CORBA::Long MessInfo); void SetInfoCompute(CORBA::Long MessInfo);
CORBA::Long GetInfoCompute(); CORBA::Long GetInfoCompute();
@ -284,18 +258,12 @@ public:
char* CreateDirNameIter(const char* nomrep, CORBA::Long num); char* CreateDirNameIter(const char* nomrep, CORBA::Long num);
CORBA::Long Compute(); CORBA::Long Compute();
CORBA::Long ComputeAdap(SMESHHOMARD::HOMARD_Cas_var myCase, CORBA::Long ComputeAdap(SMESHHOMARDImpl::HomardDriver* myDriver);
SMESHHOMARD::HOMARD_Iteration_var myIteration, CORBA::Long ComputeCAO();
SMESHHOMARDImpl::HomardDriver* myDriver); CORBA::Long ComputeCAObis();
CORBA::Long ComputeCAO(SMESHHOMARD::HOMARD_Cas_var myCase, char* ComputeDirManagement();
SMESHHOMARD::HOMARD_Iteration_var myIteration); char* ComputeDirPaManagement();
CORBA::Long ComputeCAObis(SMESHHOMARD::HOMARD_Iteration_var myIteration); int DriverTexteBoundary(SMESHHOMARDImpl::HomardDriver* myDriver);
char* ComputeDirManagement(SMESHHOMARD::HOMARD_Cas_var myCase,
SMESHHOMARD::HOMARD_Iteration_var myIteration);
char* ComputeDirPaManagement(SMESHHOMARD::HOMARD_Cas_var myCase,
SMESHHOMARD::HOMARD_Iteration_var myIteration);
int DriverTexteBoundary(SMESHHOMARD::HOMARD_Cas_var myCase,
SMESHHOMARDImpl::HomardDriver* myDriver);
void PublishResultInSmesh(const char* NomFich, CORBA::Long Option); void PublishResultInSmesh(const char* NomFich, CORBA::Long Option);
void DeleteResultInSmesh(std::string NomFich, std::string MeshName); void DeleteResultInSmesh(std::string NomFich, std::string MeshName);
@ -323,7 +291,6 @@ private:
private: private:
SMESHHOMARDImpl::HOMARD_Gen* myHomard; SMESHHOMARDImpl::HOMARD_Gen* myHomard;
std::map<std::string, SMESHHOMARD::HOMARD_Boundary_var> _mesBoundarys; std::map<std::string, SMESHHOMARD::HOMARD_Boundary_var> _mesBoundarys;
SMESHHOMARD::HOMARD_Hypothesis_var myHypothesis;
SMESHHOMARD::HOMARD_Iteration_var myIteration0; SMESHHOMARD::HOMARD_Iteration_var myIteration0;
SMESHHOMARD::HOMARD_Iteration_var myIteration1; SMESHHOMARD::HOMARD_Iteration_var myIteration1;
SMESHHOMARD::HOMARD_Cas_var myCase; SMESHHOMARD::HOMARD_Cas_var myCase;