mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-28 07:10:33 +05:00
Improve interface
This commit is contained in:
parent
02ac7e629d
commit
082c4ab126
@ -30,8 +30,8 @@ if os.path.isfile(log_file_1):
|
|||||||
os.remove(log_file_1)
|
os.remove(log_file_1)
|
||||||
|
|
||||||
smeshhomard = smesh.Adaptation("Uniform")
|
smeshhomard = smesh.Adaptation("Uniform")
|
||||||
Case_1 = smeshhomard.CreateCase("MAILL", input_med, working_dir)
|
smeshhomard.CreateCase("MAILL", input_med, working_dir)
|
||||||
Case_1.SetConfType(0)
|
smeshhomard.SetConfType(0)
|
||||||
smeshhomard.SetKeepMedOUT(True)
|
smeshhomard.SetKeepMedOUT(True)
|
||||||
smeshhomard.SetPublishMeshOUT(True)
|
smeshhomard.SetPublishMeshOUT(True)
|
||||||
smeshhomard.SetMeshNameOUT("MAILL_Uniform_R_01")
|
smeshhomard.SetMeshNameOUT("MAILL_Uniform_R_01")
|
||||||
@ -67,10 +67,10 @@ if os.path.isfile(log_file_2):
|
|||||||
|
|
||||||
#smeshhomard = smesh.Adaptation("Uniform")
|
#smeshhomard = smesh.Adaptation("Uniform")
|
||||||
Boun_1 = smeshhomard.CreateBoundaryCylinder("Boun_1", 0.5, 0.5, 0.5, 0, 0, 1, 0.25)
|
Boun_1 = smeshhomard.CreateBoundaryCylinder("Boun_1", 0.5, 0.5, 0.5, 0, 0, 1, 0.25)
|
||||||
Case_1 = smeshhomard.CreateCaseOnMesh("MAILL", MAILL.GetMesh(), working_dir)
|
smeshhomard.CreateCaseOnMesh("MAILL", MAILL.GetMesh(), working_dir)
|
||||||
Case_1.SetConfType(0)
|
smeshhomard.SetConfType(0)
|
||||||
Case_1.AddBoundaryGroup("Boun_1", "BORD_EXT")
|
smeshhomard.AddBoundaryGroup("Boun_1", "BORD_EXT")
|
||||||
Case_1.AddBoundaryGroup("Boun_1", "MOITIE1")
|
smeshhomard.AddBoundaryGroup("Boun_1", "MOITIE1")
|
||||||
smeshhomard.SetKeepMedOUT(False)
|
smeshhomard.SetKeepMedOUT(False)
|
||||||
smeshhomard.SetPublishMeshOUT(True)
|
smeshhomard.SetPublishMeshOUT(True)
|
||||||
smeshhomard.SetMeshNameOUT("MAILL_Uniform_R_02")
|
smeshhomard.SetMeshNameOUT("MAILL_Uniform_R_02")
|
||||||
|
@ -132,9 +132,6 @@ module SMESHHOMARD
|
|||||||
void SetDirName(in string NomDir) raises (SALOME::SALOME_Exception);
|
void SetDirName(in string NomDir) raises (SALOME::SALOME_Exception);
|
||||||
string GetDirName() raises (SALOME::SALOME_Exception);
|
string GetDirName() raises (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
void SetConfType(in long ConfType) raises (SALOME::SALOME_Exception);
|
|
||||||
long GetConfType() raises (SALOME::SALOME_Exception);
|
|
||||||
|
|
||||||
void SetBoundingBox(in extrema LesExtremes) raises (SALOME::SALOME_Exception);
|
void SetBoundingBox(in extrema LesExtremes) raises (SALOME::SALOME_Exception);
|
||||||
extrema GetBoundingBox() raises (SALOME::SALOME_Exception);
|
extrema GetBoundingBox() raises (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
@ -207,6 +204,9 @@ module SMESHHOMARD
|
|||||||
long DeleteCase() raises (SALOME::SALOME_Exception);
|
long DeleteCase() raises (SALOME::SALOME_Exception);
|
||||||
void CleanCase() raises (SALOME::SALOME_Exception);
|
void CleanCase() raises (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
|
void AddBoundaryGroup(in string BoundaryName,
|
||||||
|
in string Group) raises (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
long Compute() raises (SALOME::SALOME_Exception);
|
long Compute() raises (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
string CreateDirNameIter (in string NomDir, in long num)
|
string CreateDirNameIter (in string NomDir, in long num)
|
||||||
@ -216,6 +216,7 @@ module SMESHHOMARD
|
|||||||
raises (SALOME::SALOME_Exception);
|
raises (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
// Preferences
|
// Preferences
|
||||||
|
void SetConfType(in long ConfType) raises (SALOME::SALOME_Exception);
|
||||||
void SetKeepMedOUT (in boolean theKeepMedOUT);
|
void SetKeepMedOUT (in boolean theKeepMedOUT);
|
||||||
void SetPublishMeshOUT (in boolean thePublishMeshOUT);
|
void SetPublishMeshOUT (in boolean thePublishMeshOUT);
|
||||||
void SetMeshNameOUT (in string theMeshName) raises (SALOME::SALOME_Exception);
|
void SetMeshNameOUT (in string theMeshName) raises (SALOME::SALOME_Exception);
|
||||||
|
@ -332,7 +332,7 @@ std::string HOMARD_Boundary::GetCaseCreation() const
|
|||||||
*/
|
*/
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
HOMARD_Cas::HOMARD_Cas():
|
HOMARD_Cas::HOMARD_Cas():
|
||||||
_Name(""), _NomDir("/tmp"), _ConfType(0)
|
_Name(""), _NomDir("/tmp")
|
||||||
{
|
{
|
||||||
MESSAGE("HOMARD_Cas");
|
MESSAGE("HOMARD_Cas");
|
||||||
}
|
}
|
||||||
@ -360,12 +360,10 @@ std::string HOMARD_Cas::GetName() const
|
|||||||
std::string HOMARD_Cas::GetDumpPython() const
|
std::string HOMARD_Cas::GetDumpPython() const
|
||||||
{
|
{
|
||||||
std::ostringstream aScript;
|
std::ostringstream aScript;
|
||||||
//aScript << _Name << ".SetDirName(\"" << _NomDir << "\")\n";
|
|
||||||
aScript << _Name << ".SetConfType(" << _ConfType << ")\n";
|
|
||||||
// Suivi de frontieres
|
// Suivi de frontieres
|
||||||
std::list<std::string>::const_iterator it = _ListBoundaryGroup.begin();
|
std::list<std::string>::const_iterator it = _ListBoundaryGroup.begin();
|
||||||
while (it != _ListBoundaryGroup.end()) {
|
while (it != _ListBoundaryGroup.end()) {
|
||||||
aScript << _Name << ".AddBoundaryGroup(\"" << *it << "\", \"";
|
aScript << "smeshhomard.AddBoundaryGroup(\"" << *it << "\", \"";
|
||||||
it++;
|
it++;
|
||||||
aScript << *it << "\")\n";
|
aScript << *it << "\")\n";
|
||||||
it++;
|
it++;
|
||||||
@ -407,19 +405,6 @@ std::string HOMARD_Cas::GetDirName() const
|
|||||||
return _NomDir;
|
return _NomDir;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// Le type de conformite ou non conformite
|
|
||||||
//
|
|
||||||
//=============================================================================
|
|
||||||
void HOMARD_Cas::SetConfType( int Conftype )
|
|
||||||
{
|
|
||||||
_ConfType = Conftype;
|
|
||||||
}
|
|
||||||
//=============================================================================
|
|
||||||
const int HOMARD_Cas::GetConfType() const
|
|
||||||
{
|
|
||||||
return _ConfType;
|
|
||||||
}
|
|
||||||
//
|
|
||||||
// La boite englobante
|
// La boite englobante
|
||||||
//
|
//
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
@ -119,9 +119,6 @@ public:
|
|||||||
int SetDirName( const char* NomDir );
|
int SetDirName( const char* NomDir );
|
||||||
std::string GetDirName() const;
|
std::string GetDirName() const;
|
||||||
|
|
||||||
void SetConfType( int ConfType );
|
|
||||||
const int GetConfType() const;
|
|
||||||
|
|
||||||
void SetBoundingBox( const std::vector<double>& extremas );
|
void SetBoundingBox( const std::vector<double>& extremas );
|
||||||
const std::vector<double>& GetBoundingBox() const;
|
const std::vector<double>& GetBoundingBox() const;
|
||||||
|
|
||||||
@ -140,7 +137,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
std::string _Name;
|
std::string _Name;
|
||||||
std::string _NomDir;
|
std::string _NomDir;
|
||||||
int _ConfType;
|
|
||||||
int _Etat;
|
int _Etat;
|
||||||
|
|
||||||
std::vector<double> _Boite; // cf HomardQTCommun pour structure du vecteur
|
std::vector<double> _Boite; // cf HomardQTCommun pour structure du vecteur
|
||||||
|
@ -360,9 +360,6 @@ bool SMESHGUI_HomardAdaptDlg::CheckCase(bool fixCase)
|
|||||||
InitBoundarys();
|
InitBoundarys();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Repertoire et type
|
|
||||||
myCase->SetConfType(myArgs->RBConforme->isChecked() ? 0 : 1);
|
|
||||||
|
|
||||||
// Menage des eventuelles frontieres deja enregistrees
|
// Menage des eventuelles frontieres deja enregistrees
|
||||||
myCase->SupprBoundaryGroup();
|
myCase->SupprBoundaryGroup();
|
||||||
|
|
||||||
@ -443,6 +440,9 @@ bool SMESHGUI_HomardAdaptDlg::PushOnApply()
|
|||||||
}
|
}
|
||||||
myHomardGen->SetMeshFileOUT(aMeshFileOUT.c_str());
|
myHomardGen->SetMeshFileOUT(aMeshFileOUT.c_str());
|
||||||
|
|
||||||
|
// Conformity type
|
||||||
|
myHomardGen->SetConfType(myArgs->RBConforme->isChecked() ? 0 : 1);
|
||||||
|
|
||||||
// Advanced options
|
// Advanced options
|
||||||
myHomardGen->SetVerboseLevel(myAdvOpt->verboseLevelSpin->value());
|
myHomardGen->SetVerboseLevel(myAdvOpt->verboseLevelSpin->value());
|
||||||
myHomardGen->SetKeepWorkingFiles(myAdvOpt->keepWorkingFilesCheck->isChecked());
|
myHomardGen->SetKeepWorkingFiles(myAdvOpt->keepWorkingFilesCheck->isChecked());
|
||||||
|
@ -440,19 +440,6 @@ char* HOMARD_Cas_i::GetDirName()
|
|||||||
return CORBA::string_dup(myHomardCas->GetDirName().c_str());
|
return CORBA::string_dup(myHomardCas->GetDirName().c_str());
|
||||||
}
|
}
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
void HOMARD_Cas_i::SetConfType(CORBA::Long ConfType)
|
|
||||||
{
|
|
||||||
ASSERT(myHomardCas);
|
|
||||||
//VERIFICATION((ConfType>=-2) && (ConfType<=3));
|
|
||||||
myHomardCas->SetConfType(ConfType);
|
|
||||||
}
|
|
||||||
//=============================================================================
|
|
||||||
CORBA::Long HOMARD_Cas_i::GetConfType()
|
|
||||||
{
|
|
||||||
ASSERT(myHomardCas);
|
|
||||||
return myHomardCas->GetConfType();
|
|
||||||
}
|
|
||||||
//=============================================================================
|
|
||||||
void HOMARD_Cas_i::SetBoundingBox(const SMESHHOMARD::extrema& LesExtrema)
|
void HOMARD_Cas_i::SetBoundingBox(const SMESHHOMARD::extrema& LesExtrema)
|
||||||
{
|
{
|
||||||
ASSERT(myHomardCas);
|
ASSERT(myHomardCas);
|
||||||
@ -823,6 +810,7 @@ CORBA::Long HOMARD_Iteration_i::GetInfoCompute()
|
|||||||
*/
|
*/
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
HOMARD_Gen_i::HOMARD_Gen_i() : SALOME::GenericObj_i(SMESH_Gen_i::GetPOA()),
|
HOMARD_Gen_i::HOMARD_Gen_i() : SALOME::GenericObj_i(SMESH_Gen_i::GetPOA()),
|
||||||
|
_ConfType(0),
|
||||||
_KeepMedOUT(true),
|
_KeepMedOUT(true),
|
||||||
_PublishMeshOUT(false),
|
_PublishMeshOUT(false),
|
||||||
_KeepWorkingFiles(false),
|
_KeepWorkingFiles(false),
|
||||||
@ -900,15 +888,6 @@ CORBA::Long HOMARD_Gen_i::DeleteIteration(int numIter)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!CORBA::is_nil(myIteration1)) {
|
if (!CORBA::is_nil(myIteration1)) {
|
||||||
/*
|
|
||||||
if (CORBA::is_nil(myIteration0)) {
|
|
||||||
SALOME::ExceptionStruct es;
|
|
||||||
es.type = SALOME::BAD_PARAM;
|
|
||||||
es.text = "Invalid iteration 0";
|
|
||||||
throw SALOME::SALOME_Exception(es);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Invalide Iteration
|
// Invalide Iteration
|
||||||
if (myIteration1->GetState() > 0) {
|
if (myIteration1->GetState() > 0) {
|
||||||
myIteration1->SetState(1);
|
myIteration1->SetState(1);
|
||||||
@ -1776,8 +1755,7 @@ CORBA::Long HOMARD_Gen_i::ComputeAdap(SMESHHOMARDImpl::HomardDriver* myDriver)
|
|||||||
|
|
||||||
// D. Les données de l'adaptation HOMARD
|
// D. Les données de l'adaptation HOMARD
|
||||||
// D.1. Le type de conformite
|
// D.1. Le type de conformite
|
||||||
int ConfType = myCase->GetConfType();
|
MESSAGE (". ConfType = " << _ConfType);
|
||||||
MESSAGE (". ConfType = " << ConfType);
|
|
||||||
|
|
||||||
// D.3. Le maillage de depart
|
// D.3. Le maillage de depart
|
||||||
const char* NomMeshParent = myIteration0->GetMeshName();
|
const char* NomMeshParent = myIteration0->GetMeshName();
|
||||||
@ -1819,7 +1797,7 @@ CORBA::Long HOMARD_Gen_i::ComputeAdap(SMESHHOMARDImpl::HomardDriver* myDriver)
|
|||||||
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);
|
myDriver->TexteConfRaffDera(_ConfType);
|
||||||
|
|
||||||
// E.6. Ajout des options avancees
|
// E.6. Ajout des options avancees
|
||||||
//myDriver->TexteAdvanced(NivMax, DiamMin, AdapInit, ExtraOutput);
|
//myDriver->TexteAdvanced(NivMax, DiamMin, AdapInit, ExtraOutput);
|
||||||
@ -2530,12 +2508,12 @@ void HOMARD_Gen_i::PythonDump()
|
|||||||
MESSAGE (". Creation of the case");
|
MESSAGE (". Creation of the case");
|
||||||
|
|
||||||
if (_CaseOnMedFile) {
|
if (_CaseOnMedFile) {
|
||||||
pd << "Case_1 = smeshhomard.CreateCase(\"" << myIteration0->GetMeshName();
|
pd << "smeshhomard.CreateCase(\"" << myIteration0->GetMeshName();
|
||||||
pd << "\", \"" << myIteration0->GetMeshFile();
|
pd << "\", \"" << myIteration0->GetMeshFile();
|
||||||
pd << "\", \"" << myCase->GetDirName() << "\")\n";
|
pd << "\", \"" << myCase->GetDirName() << "\")\n";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pd << "Case_1 = smeshhomard.CreateCaseOnMesh(\"" << myIteration0->GetMeshName();
|
pd << "smeshhomard.CreateCaseOnMesh(\"" << myIteration0->GetMeshName();
|
||||||
pd << "\", " << _SmeshMesh;
|
pd << "\", " << _SmeshMesh;
|
||||||
pd << ".GetMesh(), \"" << myCase->GetDirName() << "\")\n";
|
pd << ".GetMesh(), \"" << myCase->GetDirName() << "\")\n";
|
||||||
}
|
}
|
||||||
@ -2543,6 +2521,7 @@ void HOMARD_Gen_i::PythonDump()
|
|||||||
pd << myCase->GetDumpPython();
|
pd << myCase->GetDumpPython();
|
||||||
|
|
||||||
// Preferences
|
// Preferences
|
||||||
|
pd << "smeshhomard.SetConfType(" << _ConfType << ")\n";
|
||||||
pd << "smeshhomard.SetKeepMedOUT(" << (_KeepMedOUT ? "True" : "False") << ")\n";
|
pd << "smeshhomard.SetKeepMedOUT(" << (_KeepMedOUT ? "True" : "False") << ")\n";
|
||||||
pd << "smeshhomard.SetPublishMeshOUT(" << (_PublishMeshOUT ? "True" : "False") << ")\n";
|
pd << "smeshhomard.SetPublishMeshOUT(" << (_PublishMeshOUT ? "True" : "False") << ")\n";
|
||||||
pd << "smeshhomard.SetMeshNameOUT(\"" << _MeshNameOUT << "\")\n";
|
pd << "smeshhomard.SetMeshNameOUT(\"" << _MeshNameOUT << "\")\n";
|
||||||
@ -2559,9 +2538,27 @@ void HOMARD_Gen_i::PythonDump()
|
|||||||
MESSAGE ("End PythonDump");
|
MESSAGE ("End PythonDump");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HOMARD_Gen_i::AddBoundaryGroup(const char* BoundaryName, const char* Group)
|
||||||
|
{
|
||||||
|
MESSAGE("HOMARD_Gen_i::AddBoundaryGroup : BoundaryName = " <<
|
||||||
|
BoundaryName << ", Group = " << Group);
|
||||||
|
if (myCase->_is_nil()) {
|
||||||
|
SALOME::ExceptionStruct es;
|
||||||
|
es.type = SALOME::BAD_PARAM;
|
||||||
|
std::string text = "The input mesh must be defined before boundary group addition";
|
||||||
|
es.text = CORBA::string_dup(text.c_str());
|
||||||
|
throw SALOME::SALOME_Exception(es);
|
||||||
|
}
|
||||||
|
myCase->AddBoundaryGroup(BoundaryName, Group);
|
||||||
|
}
|
||||||
|
|
||||||
//===============================================================================
|
//===============================================================================
|
||||||
// Preferences
|
// Preferences
|
||||||
//===============================================================================
|
//===============================================================================
|
||||||
|
void HOMARD_Gen_i::SetConfType(CORBA::Long theConfType)
|
||||||
|
{
|
||||||
|
_ConfType = theConfType;
|
||||||
|
}
|
||||||
void HOMARD_Gen_i::SetKeepMedOUT(bool theKeepMedOUT)
|
void HOMARD_Gen_i::SetKeepMedOUT(bool theKeepMedOUT)
|
||||||
{
|
{
|
||||||
_KeepMedOUT = theKeepMedOUT;
|
_KeepMedOUT = theKeepMedOUT;
|
||||||
|
@ -116,9 +116,6 @@ public:
|
|||||||
void SetDirName(const char* NomDir);
|
void SetDirName(const char* NomDir);
|
||||||
char* GetDirName();
|
char* GetDirName();
|
||||||
|
|
||||||
void SetConfType(CORBA::Long ConfType);
|
|
||||||
CORBA::Long GetConfType();
|
|
||||||
|
|
||||||
void SetBoundingBox(const SMESHHOMARD::extrema& LesExtremes);
|
void SetBoundingBox(const SMESHHOMARD::extrema& LesExtremes);
|
||||||
SMESHHOMARD::extrema* GetBoundingBox();
|
SMESHHOMARD::extrema* GetBoundingBox();
|
||||||
|
|
||||||
@ -254,6 +251,8 @@ public:
|
|||||||
CORBA::Long DeleteCase();
|
CORBA::Long DeleteCase();
|
||||||
CORBA::Long DeleteIteration(int numIter);
|
CORBA::Long DeleteIteration(int numIter);
|
||||||
|
|
||||||
|
void AddBoundaryGroup(const char* Boundary, const char* Group);
|
||||||
|
|
||||||
void AssociateCaseIter(int numIter, const char* labelIter);
|
void AssociateCaseIter(int numIter, const char* labelIter);
|
||||||
char* CreateDirNameIter(const char* nomrep, CORBA::Long num);
|
char* CreateDirNameIter(const char* nomrep, CORBA::Long num);
|
||||||
|
|
||||||
@ -271,8 +270,9 @@ public:
|
|||||||
void PythonDump();
|
void PythonDump();
|
||||||
|
|
||||||
// Preferences
|
// Preferences
|
||||||
void SetKeepMedOUT(bool theKeepMedOUT);
|
void SetConfType (CORBA::Long theConfType);
|
||||||
void SetPublishMeshOUT(bool thePublishMeshOUT);
|
void SetKeepMedOUT (bool theKeepMedOUT);
|
||||||
|
void SetPublishMeshOUT (bool thePublishMeshOUT);
|
||||||
void SetMeshNameOUT (const char* theMeshNameOUT);
|
void SetMeshNameOUT (const char* theMeshNameOUT);
|
||||||
void SetMeshFileOUT (const char* theMeshFileOUT);
|
void SetMeshFileOUT (const char* theMeshFileOUT);
|
||||||
|
|
||||||
@ -296,6 +296,7 @@ private:
|
|||||||
SMESHHOMARD::HOMARD_Cas_var myCase;
|
SMESHHOMARD::HOMARD_Cas_var myCase;
|
||||||
|
|
||||||
// Preferences
|
// Preferences
|
||||||
|
int _ConfType; // Le type de conformite ou non conformite
|
||||||
bool _KeepMedOUT;
|
bool _KeepMedOUT;
|
||||||
bool _PublishMeshOUT;
|
bool _PublishMeshOUT;
|
||||||
bool _KeepWorkingFiles;
|
bool _KeepWorkingFiles;
|
||||||
|
Loading…
Reference in New Issue
Block a user