mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-26 21:40:33 +05:00
Debug, example
This commit is contained in:
parent
a60c339d77
commit
67d70c9621
@ -42,7 +42,7 @@ SALOME_INSTALL_SCRIPTS("${EXAMPLES_TESTS}" ${SALOME_INSTALL_DOC}/examples/SMESH)
|
|||||||
|
|
||||||
SET(TEST_INSTALL_DIRECTORY ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test)
|
SET(TEST_INSTALL_DIRECTORY ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test)
|
||||||
INSTALL(FILES ${GOOD_TESTS} ${BAD_TESTS} ${SESSION_FREE_TESTS} DESTINATION ${TEST_INSTALL_DIRECTORY})
|
INSTALL(FILES ${GOOD_TESTS} ${BAD_TESTS} ${SESSION_FREE_TESTS} DESTINATION ${TEST_INSTALL_DIRECTORY})
|
||||||
INSTALL(FILES Mesh_tri.med DESTINATION ${TEST_INSTALL_DIRECTORY})
|
INSTALL(FILES Mesh_tri.med test_homard_adapt.med DESTINATION ${TEST_INSTALL_DIRECTORY})
|
||||||
|
|
||||||
INSTALL(FILES CTestTestfileInstall.cmake
|
INSTALL(FILES CTestTestfileInstall.cmake
|
||||||
DESTINATION ${TEST_INSTALL_DIRECTORY}
|
DESTINATION ${TEST_INSTALL_DIRECTORY}
|
||||||
|
BIN
doc/salome/examples/test_homard_adapt.med
Normal file
BIN
doc/salome/examples/test_homard_adapt.med
Normal file
Binary file not shown.
96
doc/salome/examples/test_homard_adapt.py
Normal file
96
doc/salome/examples/test_homard_adapt.py
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import salome
|
||||||
|
salome.salome_init()
|
||||||
|
|
||||||
|
import SMESH, SALOMEDS
|
||||||
|
from salome.smesh import smeshBuilder
|
||||||
|
import SMESHHOMARD
|
||||||
|
|
||||||
|
smesh = smeshBuilder.New()
|
||||||
|
|
||||||
|
import os, inspect, tempfile, shutil
|
||||||
|
|
||||||
|
data_dir = os.path.dirname(inspect.getfile(lambda: None))
|
||||||
|
working_dir = tempfile.mkdtemp()
|
||||||
|
|
||||||
|
input_med = os.path.join (data_dir, "test_homard_adapt.med")
|
||||||
|
output_med_1 = os.path.join (working_dir, "test_1.00_Uniform_R_01.med")
|
||||||
|
output_med_2 = os.path.join (working_dir, "test_1.00_Uniform_R_02.med")
|
||||||
|
log_file_1 = os.path.join (working_dir, "test_1.00_Uniform_R_01.med.log")
|
||||||
|
log_file_2 = os.path.join (working_dir, "test_1.00_Uniform_R_02.med.log")
|
||||||
|
|
||||||
|
# Case 1: input: med file
|
||||||
|
# output: med file, log file, published mesh
|
||||||
|
if os.path.isfile(output_med_1):
|
||||||
|
os.remove(output_med_1)
|
||||||
|
if os.path.isfile(log_file_1):
|
||||||
|
os.remove(log_file_1)
|
||||||
|
|
||||||
|
smeshhomard = smesh.Adaptation("Uniform")
|
||||||
|
Case_1 = smeshhomard.CreateCase("MAILL", input_med, working_dir)
|
||||||
|
Case_1.SetConfType(0)
|
||||||
|
smeshhomard.SetKeepMedOUT(True)
|
||||||
|
smeshhomard.SetPublishMeshOUT(True)
|
||||||
|
smeshhomard.SetMeshNameOUT("MAILL_Uniform_R_01")
|
||||||
|
smeshhomard.SetMeshFileOUT(output_med_1)
|
||||||
|
smeshhomard.SetKeepWorkingFiles(False)
|
||||||
|
smeshhomard.SetLogInFile(True)
|
||||||
|
smeshhomard.SetLogFile(log_file_1)
|
||||||
|
smeshhomard.SetRemoveLogOnSuccess(False)
|
||||||
|
smeshhomard.SetVerboseLevel(3)
|
||||||
|
smeshhomard.Compute()
|
||||||
|
|
||||||
|
if os.path.isfile(output_med_1):
|
||||||
|
os.remove(output_med_1)
|
||||||
|
else:
|
||||||
|
print("Test Uniform refinement Case 1: Error: no output med file")
|
||||||
|
assert(False)
|
||||||
|
|
||||||
|
if os.path.isfile(log_file_1):
|
||||||
|
os.remove(log_file_1)
|
||||||
|
else:
|
||||||
|
print("Test Uniform refinement Case 1: Error: no log file")
|
||||||
|
assert(False)
|
||||||
|
|
||||||
|
# Case 2: input: mesh, boundaries
|
||||||
|
# output: published mesh
|
||||||
|
if os.path.isfile(output_med_2):
|
||||||
|
os.remove(output_med_2)
|
||||||
|
if os.path.isfile(log_file_2):
|
||||||
|
os.remove(log_file_2)
|
||||||
|
|
||||||
|
# prepare input mesh
|
||||||
|
([MAILL], status) = smesh.CreateMeshesFromMED( input_med )
|
||||||
|
|
||||||
|
#smeshhomard = smesh.Adaptation("Uniform")
|
||||||
|
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)
|
||||||
|
Case_1.SetConfType(0)
|
||||||
|
Case_1.AddBoundaryGroup("Boun_1", "BORD_EXT")
|
||||||
|
Case_1.AddBoundaryGroup("Boun_1", "MOITIE1")
|
||||||
|
smeshhomard.SetKeepMedOUT(False)
|
||||||
|
smeshhomard.SetPublishMeshOUT(True)
|
||||||
|
smeshhomard.SetMeshNameOUT("MAILL_Uniform_R_02")
|
||||||
|
smeshhomard.SetMeshFileOUT(output_med_2)
|
||||||
|
smeshhomard.SetKeepWorkingFiles(False)
|
||||||
|
smeshhomard.SetLogInFile(True)
|
||||||
|
smeshhomard.SetLogFile(log_file_2)
|
||||||
|
smeshhomard.SetRemoveLogOnSuccess(True)
|
||||||
|
smeshhomard.SetVerboseLevel(0)
|
||||||
|
smeshhomard.Compute()
|
||||||
|
|
||||||
|
if os.path.isfile(output_med_2):
|
||||||
|
print("Test Uniform refinement Case 2: Error: output med file has not been removed")
|
||||||
|
assert(False)
|
||||||
|
|
||||||
|
if os.path.isfile(log_file_2):
|
||||||
|
print("Test Uniform refinement Case 2: Error: log file has not been removed")
|
||||||
|
assert(False)
|
||||||
|
|
||||||
|
shutil.rmtree(working_dir)
|
||||||
|
|
||||||
|
if salome.sg.hasDesktop():
|
||||||
|
salome.sg.updateObjBrowser()
|
@ -46,6 +46,7 @@ SET(BAD_TESTS
|
|||||||
test_smeshplugin_mg_tetra_parallele.py
|
test_smeshplugin_mg_tetra_parallele.py
|
||||||
test_smeshplugins.py
|
test_smeshplugins.py
|
||||||
MGAdaptTests_without_session.py
|
MGAdaptTests_without_session.py
|
||||||
|
test_homard_adapt.py
|
||||||
blocFissure_01_without_session.py
|
blocFissure_01_without_session.py
|
||||||
blocFissure_02_without_session.py
|
blocFissure_02_without_session.py
|
||||||
blocFissure_03_without_session.py
|
blocFissure_03_without_session.py
|
||||||
|
@ -1182,20 +1182,19 @@ HomardDriver::HomardDriver(const std::string siter, const std::string siterp1):
|
|||||||
_Texte( "" ), _bLu( false )
|
_Texte( "" ), _bLu( false )
|
||||||
{
|
{
|
||||||
MESSAGE("siter = "<<siter<<", siterp1 = "<<siterp1);
|
MESSAGE("siter = "<<siter<<", siterp1 = "<<siterp1);
|
||||||
// Le repertoire ou se trouve l'executable HOMARD
|
// Le repertoire ou se trouve l'executable HOMARD
|
||||||
std::string dir ;
|
std::string dir ;
|
||||||
if ( getenv("HOMARD_REP_EXE_PRIVATE") != NULL ) { dir = getenv("HOMARD_REP_EXE_PRIVATE") ; }
|
// TODO?
|
||||||
else { dir = getenv("HOMARD_REP_EXE") ; }
|
if ( getenv("HOMARD_ROOT_DIR") != NULL ) { dir = getenv("HOMARD_ROOT_DIR") ; }
|
||||||
|
dir += "/bin/salome";
|
||||||
MESSAGE("dir ="<<dir);
|
MESSAGE("dir ="<<dir);
|
||||||
// L'executable HOMARD
|
// L'executable HOMARD
|
||||||
std::string executable ;
|
std::string executable = "homard";
|
||||||
if ( getenv("HOMARD_EXE_PRIVATE") != NULL ) { executable = getenv("HOMARD_EXE_PRIVATE") ; }
|
|
||||||
else { executable = getenv("HOMARD_EXE") ; }
|
|
||||||
MESSAGE("executable ="<<executable);
|
MESSAGE("executable ="<<executable);
|
||||||
// Memorisation du nom complet de l'executable HOMARD
|
// Memorisation du nom complet de l'executable HOMARD
|
||||||
_HOMARD_Exec = dir + "/" + executable ;
|
_HOMARD_Exec = dir + "/" + executable ;
|
||||||
MESSAGE("==> _HOMARD_Exec ="<<_HOMARD_Exec) ;
|
MESSAGE("==> _HOMARD_Exec ="<<_HOMARD_Exec) ;
|
||||||
//
|
//
|
||||||
_siter = siter ;
|
_siter = siter ;
|
||||||
_siterp1 = siterp1 ;
|
_siterp1 = siterp1 ;
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,6 @@ SMESHGUI_HomardAdaptDlg::SMESHGUI_HomardAdaptDlg(SMESHHOMARD::HOMARD_Gen_ptr myH
|
|||||||
myAdvOpt->removeLogOnSuccessCheck ->setText (tr( "REMOVE_LOG_ON_SUCCESS" ));
|
myAdvOpt->removeLogOnSuccessCheck ->setText (tr( "REMOVE_LOG_ON_SUCCESS" ));
|
||||||
myAdvOpt->keepWorkingFilesCheck ->setText (tr( "KEEP_WORKING_FILES" ));
|
myAdvOpt->keepWorkingFilesCheck ->setText (tr( "KEEP_WORKING_FILES" ));
|
||||||
|
|
||||||
// disable // TODO???
|
|
||||||
myAdvOpt->logInFileCheck->setChecked(true);
|
myAdvOpt->logInFileCheck->setChecked(true);
|
||||||
myAdvOpt->removeLogOnSuccessCheck->setChecked(false);
|
myAdvOpt->removeLogOnSuccessCheck->setChecked(false);
|
||||||
|
|
||||||
@ -151,7 +150,6 @@ SMESHGUI_HomardAdaptDlg::SMESHGUI_HomardAdaptDlg(SMESHHOMARD::HOMARD_Gen_ptr myH
|
|||||||
l->addLayout( btnLayout );
|
l->addLayout( btnLayout );
|
||||||
|
|
||||||
// dialog name and size
|
// dialog name and size
|
||||||
/*
|
|
||||||
resize(600, 1150);
|
resize(600, 1150);
|
||||||
QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||||
sizePolicy.setHorizontalStretch(0);
|
sizePolicy.setHorizontalStretch(0);
|
||||||
@ -160,9 +158,8 @@ SMESHGUI_HomardAdaptDlg::SMESHGUI_HomardAdaptDlg(SMESHHOMARD::HOMARD_Gen_ptr myH
|
|||||||
setSizePolicy(sizePolicy);
|
setSizePolicy(sizePolicy);
|
||||||
setMinimumSize(QSize(600, 320));
|
setMinimumSize(QSize(600, 320));
|
||||||
setSizeIncrement(QSize(1, 1));
|
setSizeIncrement(QSize(1, 1));
|
||||||
setBaseSize(QSize(600, 320));
|
setBaseSize(QSize(600, 600));
|
||||||
setAutoFillBackground(true);
|
setAutoFillBackground(true);
|
||||||
*/
|
|
||||||
|
|
||||||
SetBoundaryNo();
|
SetBoundaryNo();
|
||||||
InitConnect();
|
InitConnect();
|
||||||
@ -216,7 +213,6 @@ void SMESHGUI_HomardAdaptDlg::InitConnect()
|
|||||||
connect( buttonHelp, SIGNAL(pressed()), this, SLOT(PushOnHelp()));
|
connect( buttonHelp, SIGNAL(pressed()), this, SLOT(PushOnHelp()));
|
||||||
|
|
||||||
connect(myArgs, SIGNAL(updateSelection()), this, SLOT(updateSelection()));
|
connect(myArgs, SIGNAL(updateSelection()), this, SLOT(updateSelection()));
|
||||||
connect(myArgs, SIGNAL(toExportMED(const char*)), this, SLOT(exportMED(const char*)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -383,8 +379,6 @@ bool SMESHGUI_HomardAdaptDlg::PushOnApply()
|
|||||||
if (!CheckCase(true))
|
if (!CheckCase(true))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
MESSAGE("PushOnApply: *** aaajfa *** 12");
|
|
||||||
|
|
||||||
// Create boundaries
|
// Create boundaries
|
||||||
if (myArgs->RBBoundaryCAO->isChecked()) {
|
if (myArgs->RBBoundaryCAO->isChecked()) {
|
||||||
QString monBoundaryCAOName = myArgs->CBBoundaryCAO->currentText();
|
QString monBoundaryCAOName = myArgs->CBBoundaryCAO->currentText();
|
||||||
@ -415,7 +409,6 @@ bool SMESHGUI_HomardAdaptDlg::PushOnApply()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MESSAGE("PushOnApply: *** aaajfa *** 13");
|
|
||||||
|
|
||||||
// Output MED and MESH parameters
|
// Output MED and MESH parameters
|
||||||
myHomardGen->SetKeepMedOUT(myArgs->myOutMedFileChk->isChecked());
|
myHomardGen->SetKeepMedOUT(myArgs->myOutMedFileChk->isChecked());
|
||||||
@ -475,7 +468,6 @@ bool SMESHGUI_HomardAdaptDlg::PushOnApply()
|
|||||||
MESSAGE("myHomardGen->SetLogFile(" << anOutLog.toStdString().c_str() << ")");
|
MESSAGE("myHomardGen->SetLogFile(" << anOutLog.toStdString().c_str() << ")");
|
||||||
myHomardGen->SetLogFile(anOutLog.toStdString().c_str());
|
myHomardGen->SetLogFile(anOutLog.toStdString().c_str());
|
||||||
}
|
}
|
||||||
MESSAGE("PushOnApply: *** aaajfa *** 14");
|
|
||||||
|
|
||||||
// Compute and publish
|
// Compute and publish
|
||||||
bool isSuccess = true;
|
bool isSuccess = true;
|
||||||
@ -487,7 +479,6 @@ bool SMESHGUI_HomardAdaptDlg::PushOnApply()
|
|||||||
QObject::tr(CORBA::string_dup(S_ex.details.text)) );
|
QObject::tr(CORBA::string_dup(S_ex.details.text)) );
|
||||||
isSuccess = false;
|
isSuccess = false;
|
||||||
}
|
}
|
||||||
MESSAGE("PushOnApply: *** aaajfa *** 15");
|
|
||||||
|
|
||||||
// Update Object Browser
|
// Update Object Browser
|
||||||
if (isSuccess) {
|
if (isSuccess) {
|
||||||
@ -507,7 +498,6 @@ bool SMESHGUI_HomardAdaptDlg::PushOnApply()
|
|||||||
myAdvOpt->workingDirectoryLineEdit->setReadOnly(false);
|
myAdvOpt->workingDirectoryLineEdit->setReadOnly(false);
|
||||||
myAdvOpt->workingDirectoryPushButton->setEnabled(true);
|
myAdvOpt->workingDirectoryPushButton->setEnabled(true);
|
||||||
|
|
||||||
MESSAGE("PushOnApply: *** aaajfa *** THE END");
|
|
||||||
return isSuccess;
|
return isSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1051,7 +1041,7 @@ void SMESHGUI_HomardAdaptArguments::setupUi(QWidget *CreateCase)
|
|||||||
argumentsLayout->setColumnStretch( 1, 5 );
|
argumentsLayout->setColumnStretch( 1, 5 );
|
||||||
argumentsLayout->setRowStretch( 4, 5 );
|
argumentsLayout->setRowStretch( 4, 5 );
|
||||||
|
|
||||||
mySelectInMedFileButton->setText(QString());
|
//mySelectInMedFileButton->setText(QString());
|
||||||
CBBoundaryD->setText(QApplication::translate("CreateCase", "Discrete boundary", nullptr));
|
CBBoundaryD->setText(QApplication::translate("CreateCase", "Discrete boundary", nullptr));
|
||||||
CBBoundaryA->setText(QApplication::translate("CreateCase", "Analytical boundary", nullptr));
|
CBBoundaryA->setText(QApplication::translate("CreateCase", "Analytical boundary", nullptr));
|
||||||
PBBoundaryCAOEdit->setText(QApplication::translate("CreateCase", "Edit", nullptr));
|
PBBoundaryCAOEdit->setText(QApplication::translate("CreateCase", "Edit", nullptr));
|
||||||
|
@ -364,18 +364,19 @@ QString SMESH_HOMARD_QT_COMMUN::PushNomFichier(bool avertir, QString TypeFichier
|
|||||||
if ( TypeFichier == "med" ) { filtre = QString("Med") ; }
|
if ( TypeFichier == "med" ) { filtre = QString("Med") ; }
|
||||||
else if ( TypeFichier == "py" ) { filtre = QString("Python") ; }
|
else if ( TypeFichier == "py" ) { filtre = QString("Python") ; }
|
||||||
else { filtre = TypeFichier ; }
|
else { filtre = TypeFichier ; }
|
||||||
//
|
//
|
||||||
if ( TypeFichier != "" ) { filtre += QString(" files (*.") + TypeFichier + QString(");;") ; }
|
if ( TypeFichier != "" ) { filtre += QString(" files (*.") + TypeFichier + QString(");;") ; }
|
||||||
//
|
//
|
||||||
filtre += QString("all (*) ") ;
|
filtre += QString("all (*) ") ;
|
||||||
//
|
//
|
||||||
// B. Selection
|
// B. Selection
|
||||||
int nbSel = SMESH_HOMARD_UTILS::IObjectCount() ;
|
//int nbSel = SMESH_HOMARD_UTILS::IObjectCount() ;
|
||||||
// MESSAGE("nbSel ="<<nbSel);
|
int nbSel = 0;
|
||||||
|
// MESSAGE("nbSel ="<<nbSel);
|
||||||
// B.1. Rien n'est selectionne
|
// B.1. Rien n'est selectionne
|
||||||
if ( nbSel == 0 )
|
if ( nbSel == 0 )
|
||||||
{
|
{
|
||||||
// aFile = QFileDialog::getOpenFileName(0, QObject::tr("HOM_SELECT_FILE_0"), QString(""), QString("Med files (*.med);;all (*) ") );
|
//aFile = QFileDialog::getOpenFileName(0, QObject::tr("HOM_SELECT_FILE_0"), QString(""), QString("Med files (*.med);;all (*) ") );
|
||||||
aFile = QFileDialog::getOpenFileName(0, QObject::tr("HOM_SELECT_FILE_0"), QString(""), filtre );
|
aFile = QFileDialog::getOpenFileName(0, QObject::tr("HOM_SELECT_FILE_0"), QString(""), filtre );
|
||||||
}
|
}
|
||||||
// B.2. Un objet est selectionne
|
// B.2. Un objet est selectionne
|
||||||
|
@ -20,9 +20,12 @@
|
|||||||
#include "SMESH_Homard_i.hxx"
|
#include "SMESH_Homard_i.hxx"
|
||||||
#include "SMESH_Homard.hxx"
|
#include "SMESH_Homard.hxx"
|
||||||
|
|
||||||
#include <SMESH_Gen_i.hxx>
|
#include "SMESH_Gen_i.hxx"
|
||||||
#include "SMESH_PythonDump.hxx"
|
#include "SMESH_PythonDump.hxx"
|
||||||
|
|
||||||
|
#include "SMESH_File.hxx"
|
||||||
|
|
||||||
|
// TODO?
|
||||||
//#include "FrontTrack.hxx"
|
//#include "FrontTrack.hxx"
|
||||||
|
|
||||||
#include "utilities.h"
|
#include "utilities.h"
|
||||||
@ -933,7 +936,9 @@ HOMARD_Gen_i::HOMARD_Gen_i() : SALOME::GenericObj_i(SMESH_Gen_i::GetPOA()),
|
|||||||
_MeshNameOUT(""),
|
_MeshNameOUT(""),
|
||||||
_MeshFileOUT(""),
|
_MeshFileOUT(""),
|
||||||
_LogFile(""),
|
_LogFile(""),
|
||||||
_CaseOnMedFile(true)
|
_CaseOnMedFile(true),
|
||||||
|
_SmeshMesh(SMESH::SMESH_Mesh::_nil()),
|
||||||
|
_TmpMeshFile("")
|
||||||
{
|
{
|
||||||
MESSAGE("constructor de HOMARD_Gen_i");
|
MESSAGE("constructor de HOMARD_Gen_i");
|
||||||
myHomard = new SMESHHOMARDImpl::HOMARD_Gen;
|
myHomard = new SMESHHOMARDImpl::HOMARD_Gen;
|
||||||
@ -946,6 +951,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()
|
||||||
{
|
{
|
||||||
|
if (!myCase->_is_nil()) {
|
||||||
|
CleanCase();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
@ -1202,9 +1210,16 @@ SMESHHOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseOnMesh (const char* MeshName
|
|||||||
MESSAGE("CreateCaseOnMesh : smeshMesh is not nil");
|
MESSAGE("CreateCaseOnMesh : smeshMesh is not nil");
|
||||||
|
|
||||||
// A.3. Write mesh object in a temporary file in the working directory
|
// A.3. Write mesh object in a temporary file in the working directory
|
||||||
std::string aTmpMeshFile (theWorkingDir);
|
std::string aTmpMeshFile = theWorkingDir;
|
||||||
aTmpMeshFile += std::string("/") + std::string(MeshName) + "_saved_from_SMESH.med"; // TODO: unique
|
aTmpMeshFile = theWorkingDir;
|
||||||
const char* MeshFile = aTmpMeshFile.c_str();
|
aTmpMeshFile += std::string("/") + std::string(MeshName) + "_saved_from_SMESH";
|
||||||
|
_TmpMeshFile = aTmpMeshFile + ".med";
|
||||||
|
SMESH_File aFile (_TmpMeshFile, false);
|
||||||
|
for (int ii = 1; aFile.exists(); ii++) {
|
||||||
|
_TmpMeshFile = aTmpMeshFile + std::string("_") + std::to_string(ii) + ".med";
|
||||||
|
aFile = SMESH_File(_TmpMeshFile, false);
|
||||||
|
}
|
||||||
|
const char* MeshFile = _TmpMeshFile.c_str();
|
||||||
bool toOverwrite = true;
|
bool toOverwrite = true;
|
||||||
bool toFindOutDim = true;
|
bool toFindOutDim = true;
|
||||||
|
|
||||||
@ -1816,13 +1831,6 @@ CORBA::Long HOMARD_Gen_i::Compute()
|
|||||||
// Python Dump
|
// Python Dump
|
||||||
PythonDump();
|
PythonDump();
|
||||||
|
|
||||||
// Delete log file, if required
|
|
||||||
MESSAGE("myIteration1->GetLogFile() = " << myIteration1->GetLogFile());
|
|
||||||
if (_LogInFile && _RemoveLogOnSuccess) {
|
|
||||||
// Remove log file on success
|
|
||||||
// TODO: QFile(myIteration->GetLogFile()).remove();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clean all data
|
// Clean all data
|
||||||
CleanCase();
|
CleanCase();
|
||||||
}
|
}
|
||||||
@ -1832,6 +1840,13 @@ CORBA::Long HOMARD_Gen_i::Compute()
|
|||||||
|
|
||||||
void HOMARD_Gen_i::CleanCase()
|
void HOMARD_Gen_i::CleanCase()
|
||||||
{
|
{
|
||||||
|
// Delete log file, if required
|
||||||
|
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;
|
std::map<std::string, SMESHHOMARD::HOMARD_Boundary_var>::const_iterator it_boundary;
|
||||||
for (it_boundary = _mesBoundarys.begin();
|
for (it_boundary = _mesBoundarys.begin();
|
||||||
@ -1848,6 +1863,13 @@ void HOMARD_Gen_i::CleanCase()
|
|||||||
|
|
||||||
// Delete case
|
// Delete case
|
||||||
DeleteCase();
|
DeleteCase();
|
||||||
|
|
||||||
|
// Delete tmp mesh file
|
||||||
|
if (!_CaseOnMedFile && !_TmpMeshFile.empty()) {
|
||||||
|
SMESH_File aFile (_TmpMeshFile, false);
|
||||||
|
if (aFile.exists()) aFile.remove();
|
||||||
|
}
|
||||||
|
_SmeshMesh = SMESH::SMESH_Mesh::_nil();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
@ -2041,6 +2063,7 @@ CORBA::Long HOMARD_Gen_i::ComputeCAO(SMESHHOMARD::HOMARD_Cas_var myCase,
|
|||||||
|
|
||||||
// C. Lancement des projections
|
// C. Lancement des projections
|
||||||
MESSAGE (". Lancement des projections");
|
MESSAGE (". Lancement des projections");
|
||||||
|
// TODO?
|
||||||
//FrontTrack* myFrontTrack = new FrontTrack();
|
//FrontTrack* myFrontTrack = new FrontTrack();
|
||||||
//myFrontTrack->track(theInputMedFile, theOutputMedFile, theInputNodeFiles, theXaoFileName, theIsParallel);
|
//myFrontTrack->track(theInputMedFile, theOutputMedFile, theInputNodeFiles, theXaoFileName, theIsParallel);
|
||||||
|
|
||||||
@ -2505,6 +2528,9 @@ void HOMARD_Gen_i::PublishResultInSmesh(const char* NomFich, CORBA::Long Option)
|
|||||||
SALOMEDS::SObject_var aSmeshSO =
|
SALOMEDS::SObject_var aSmeshSO =
|
||||||
SMESH_Gen_i::GetSMESHGen()->getStudyServant()->FindComponent("SMESH");
|
SMESH_Gen_i::GetSMESHGen()->getStudyServant()->FindComponent("SMESH");
|
||||||
//
|
//
|
||||||
|
// TODO?
|
||||||
|
// Temporary suppressed depublication of mesh with the same name of file
|
||||||
|
/*
|
||||||
if (!CORBA::is_nil(aSmeshSO)) {
|
if (!CORBA::is_nil(aSmeshSO)) {
|
||||||
// On verifie que le fichier n est pas deja publie
|
// On verifie que le fichier n est pas deja publie
|
||||||
SALOMEDS::ChildIterator_var aIter =
|
SALOMEDS::ChildIterator_var aIter =
|
||||||
@ -2535,27 +2561,24 @@ void HOMARD_Gen_i::PublishResultInSmesh(const char* NomFich, CORBA::Long Option)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// On enregistre le fichier
|
// On enregistre le fichier
|
||||||
MESSAGE("Enregistrement du fichier");
|
MESSAGE("Enregistrement du fichier");
|
||||||
//
|
//
|
||||||
//SMESH::SMESH_Gen_var aSmeshEngine = this->retrieveSMESHInst();
|
//SMESH::SMESH_Gen_var aSmeshEngine = this->retrieveSMESHInst();
|
||||||
SMESH_Gen_i* aSmeshEngine = SMESH_Gen_i::GetSMESHGen();
|
SMESH_Gen_i* aSmeshEngine = SMESH_Gen_i::GetSMESHGen();
|
||||||
MESSAGE(" *** aaajfa *** !!! 1");
|
|
||||||
//
|
//
|
||||||
//ASSERT(!CORBA::is_nil(aSmeshEngine));
|
//ASSERT(!CORBA::is_nil(aSmeshEngine));
|
||||||
aSmeshEngine->UpdateStudy();
|
aSmeshEngine->UpdateStudy();
|
||||||
SMESH::DriverMED_ReadStatus theStatus;
|
SMESH::DriverMED_ReadStatus theStatus;
|
||||||
|
|
||||||
// On met a jour les attributs AttributeExternalFileDef et AttributePixMap
|
// On met a jour les attributs AttributeExternalFileDef et AttributePixMap
|
||||||
MESSAGE(" *** aaajfa *** !!! 2");
|
|
||||||
SMESH::mesh_array* mesMaillages = aSmeshEngine->CreateMeshesFromMED(NomFich, theStatus);
|
SMESH::mesh_array* mesMaillages = aSmeshEngine->CreateMeshesFromMED(NomFich, theStatus);
|
||||||
MESSAGE(" *** aaajfa *** !!! 3");
|
|
||||||
if (CORBA::is_nil(aSmeshSO)) {
|
if (CORBA::is_nil(aSmeshSO)) {
|
||||||
aSmeshSO = SMESH_Gen_i::GetSMESHGen()->getStudyServant()->FindComponent("SMESH");
|
aSmeshSO = SMESH_Gen_i::GetSMESHGen()->getStudyServant()->FindComponent("SMESH");
|
||||||
if (CORBA::is_nil(aSmeshSO)) return;
|
if (CORBA::is_nil(aSmeshSO)) return;
|
||||||
}
|
}
|
||||||
MESSAGE(" *** aaajfa *** !!! 4");
|
|
||||||
|
|
||||||
for (int i = 0; i < (int)mesMaillages->length(); i++) {
|
for (int i = 0; i < (int)mesMaillages->length(); i++) {
|
||||||
MESSAGE(". Mise a jour des attributs du maillage");
|
MESSAGE(". Mise a jour des attributs du maillage");
|
||||||
@ -2578,7 +2601,6 @@ void HOMARD_Gen_i::PublishResultInSmesh(const char* NomFich, CORBA::Long Option)
|
|||||||
else { icone = "mesh_tree_mesh.png"; }
|
else { icone = "mesh_tree_mesh.png"; }
|
||||||
anAttr2->SetPixMap(icone);
|
anAttr2->SetPixMap(icone);
|
||||||
}
|
}
|
||||||
MESSAGE(" *** aaajfa *** !!! 5");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
@ -2629,7 +2651,8 @@ void HOMARD_Gen_i::PythonDump()
|
|||||||
|
|
||||||
// SMESH_Homard
|
// SMESH_Homard
|
||||||
pd << "import SMESHHOMARD\n";
|
pd << "import SMESHHOMARD\n";
|
||||||
pd << "smeshhomard = " << SMESH_Gen_i::GetSMESHGen() << ".CreateHOMARD_ADAPT()\n";
|
//pd << "smeshhomard = " << SMESH_Gen_i::GetSMESHGen() << ".CreateHOMARD_ADAPT()\n";
|
||||||
|
pd << "smeshhomard = " << SMESH_Gen_i::GetSMESHGen() << ".Adaptation(\"Uniform\")\n";
|
||||||
|
|
||||||
// Boundaries
|
// Boundaries
|
||||||
if (_mesBoundarys.size() > 0) MESSAGE(". Creation of the boundaries");
|
if (_mesBoundarys.size() > 0) MESSAGE(". Creation of the boundaries");
|
||||||
@ -2652,21 +2675,21 @@ void HOMARD_Gen_i::PythonDump()
|
|||||||
else {
|
else {
|
||||||
pd << "Case_1 = smeshhomard.CreateCaseOnMesh(\"" << myIteration0->GetMeshName();
|
pd << "Case_1 = smeshhomard.CreateCaseOnMesh(\"" << myIteration0->GetMeshName();
|
||||||
pd << "\", " << _SmeshMesh;
|
pd << "\", " << _SmeshMesh;
|
||||||
pd << ", \"" << myCase->GetDirName() << "\")\n";
|
pd << ".GetMesh(), \"" << myCase->GetDirName() << "\")\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
pd << myCase->GetDumpPython();
|
pd << myCase->GetDumpPython();
|
||||||
|
|
||||||
// Preferences
|
// Preferences
|
||||||
pd << "smeshhomard.SetKeepMedOUT(" << _KeepMedOUT << ")\n";
|
pd << "smeshhomard.SetKeepMedOUT(" << (_KeepMedOUT ? "True" : "False") << ")\n";
|
||||||
pd << "smeshhomard.SetPublishMeshOUT(" << _PublishMeshOUT << ")\n";
|
pd << "smeshhomard.SetPublishMeshOUT(" << (_PublishMeshOUT ? "True" : "False") << ")\n";
|
||||||
pd << "smeshhomard.SetMeshNameOUT(\"" << _MeshNameOUT << "\")\n";
|
pd << "smeshhomard.SetMeshNameOUT(\"" << _MeshNameOUT << "\")\n";
|
||||||
pd << "smeshhomard.SetMeshFileOUT(\"" << _MeshFileOUT << "\")\n";
|
pd << "smeshhomard.SetMeshFileOUT(\"" << _MeshFileOUT << "\")\n";
|
||||||
|
|
||||||
pd << "smeshhomard.SetKeepWorkingFiles(" << _KeepWorkingFiles << ")\n";
|
pd << "smeshhomard.SetKeepWorkingFiles(" << (_KeepWorkingFiles ? "True" : "False") << ")\n";
|
||||||
pd << "smeshhomard.SetLogInFile(" << _LogInFile << ")\n";
|
pd << "smeshhomard.SetLogInFile(" << (_LogInFile ? "True" : "False") << ")\n";
|
||||||
if (_LogInFile) pd << "smeshhomard.SetLogFile(\"" << _LogFile << "\")\n";
|
if (_LogInFile) pd << "smeshhomard.SetLogFile(\"" << _LogFile << "\")\n";
|
||||||
pd << "smeshhomard.SetRemoveLogOnSuccess(" << _RemoveLogOnSuccess << ")\n";
|
pd << "smeshhomard.SetRemoveLogOnSuccess(" << (_RemoveLogOnSuccess ? "True" : "False") << ")\n";
|
||||||
pd << "smeshhomard.SetVerboseLevel(" << _VerboseLevel << ")\n";
|
pd << "smeshhomard.SetVerboseLevel(" << _VerboseLevel << ")\n";
|
||||||
|
|
||||||
// Compute
|
// Compute
|
||||||
|
@ -342,6 +342,7 @@ private:
|
|||||||
// Input data type
|
// Input data type
|
||||||
bool _CaseOnMedFile;
|
bool _CaseOnMedFile;
|
||||||
SMESH::SMESH_Mesh_var _SmeshMesh;
|
SMESH::SMESH_Mesh_var _SmeshMesh;
|
||||||
|
std::string _TmpMeshFile;
|
||||||
};
|
};
|
||||||
|
|
||||||
SMESH_I_EXPORT std::vector<double> GetBoundingBoxInMedFile(const char * aFile);
|
SMESH_I_EXPORT std::vector<double> GetBoundingBoxInMedFile(const char * aFile);
|
||||||
|
Loading…
Reference in New Issue
Block a user