mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-27 09:50:34 +05:00
Improve crossplatform library name of plugin
This commit is contained in:
parent
92ca4d37a1
commit
38412444f9
@ -90,12 +90,15 @@ bool SMESHGUI_XmlHandler::startElement (const QString&, const QString&,
|
|||||||
myPluginName = atts.value("name");
|
myPluginName = atts.value("name");
|
||||||
myServerLib = atts.value("server-lib");
|
myServerLib = atts.value("server-lib");
|
||||||
myClientLib = atts.value("gui-lib");
|
myClientLib = atts.value("gui-lib");
|
||||||
|
/* It's Need to tranlate lib name for WIN32 or X platform
|
||||||
|
* (only client lib, because server lib translates in SMESH_Gen_i::createHypothesis
|
||||||
|
* for normal work of *.py files )
|
||||||
|
*/
|
||||||
#ifdef WNT
|
#ifdef WNT
|
||||||
myServerLib += ".dll";
|
//myServerLib += ".dll";
|
||||||
myClientLib += ".dll";
|
myClientLib += ".dll";
|
||||||
#else
|
#else
|
||||||
myServerLib = "lib" + myServerLib + ".so";
|
//myServerLib = "lib" + myServerLib + ".so";
|
||||||
myClientLib = "lib" + myClientLib + ".so";
|
myClientLib = "lib" + myClientLib + ".so";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -307,8 +307,28 @@ SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::createHypothesis(const char* theHypName
|
|||||||
const char* theLibName)
|
const char* theLibName)
|
||||||
throw (SALOME::SALOME_Exception)
|
throw (SALOME::SALOME_Exception)
|
||||||
{
|
{
|
||||||
|
/* It's Need to tranlate lib name for WIN32 or X platform */
|
||||||
|
char* aPlatformLibName = 0;
|
||||||
|
if ( theLibName && theLibName[0] != '\0' )
|
||||||
|
{
|
||||||
|
#ifdef WNT
|
||||||
|
aPlatformLibName = new char[ strlen(theLibName) + 5 ];
|
||||||
|
aPlatformLibName[0] = '\0';
|
||||||
|
aPlatformLibName = strcat( aPlatformLibName, theLibName );
|
||||||
|
aPlatformLibName = strcat( aPlatformLibName, ".dll" );
|
||||||
|
#else
|
||||||
|
aPlatformLibName = new char[ strlen(theLibName) + 7 ];
|
||||||
|
aPlatformLibName[0] = '\0';
|
||||||
|
aPlatformLibName = strcat( aPlatformLibName, "lib" );
|
||||||
|
aPlatformLibName = strcat( aPlatformLibName, theLibName );
|
||||||
|
aPlatformLibName = strcat( aPlatformLibName, ".dll" );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Unexpect aCatch(SALOME_SalomeException);
|
Unexpect aCatch(SALOME_SalomeException);
|
||||||
if(MYDEBUG) MESSAGE( "Create Hypothesis <" << theHypName << "> from " << theLibName);
|
if(MYDEBUG) MESSAGE( "Create Hypothesis <" << theHypName << "> from " << aPlatformLibName/*theLibName*/);
|
||||||
|
|
||||||
// create a new hypothesis object servant
|
// create a new hypothesis object servant
|
||||||
SMESH_Hypothesis_i* myHypothesis_i = 0;
|
SMESH_Hypothesis_i* myHypothesis_i = 0;
|
||||||
@ -321,7 +341,7 @@ SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::createHypothesis(const char* theHypName
|
|||||||
{
|
{
|
||||||
// load plugin library
|
// load plugin library
|
||||||
if(MYDEBUG) MESSAGE("Loading server meshers plugin library ...");
|
if(MYDEBUG) MESSAGE("Loading server meshers plugin library ...");
|
||||||
LibHandle libHandle = LoadLib( theLibName );
|
LibHandle libHandle = LoadLib( aPlatformLibName/*theLibName*/ );
|
||||||
if (!libHandle)
|
if (!libHandle)
|
||||||
{
|
{
|
||||||
// report any error, if occured
|
// report any error, if occured
|
||||||
@ -362,20 +382,23 @@ SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::createHypothesis(const char* theHypName
|
|||||||
myHypCreatorMap[string(theHypName)]->Create (myPoa, GetCurrentStudyID(), &myGen);
|
myHypCreatorMap[string(theHypName)]->Create (myPoa, GetCurrentStudyID(), &myGen);
|
||||||
// _CS_gbo Explicit activation (no longer made in the constructor).
|
// _CS_gbo Explicit activation (no longer made in the constructor).
|
||||||
myHypothesis_i->Activate();
|
myHypothesis_i->Activate();
|
||||||
myHypothesis_i->SetLibName(theLibName); // for persistency assurance
|
myHypothesis_i->SetLibName(aPlatformLibName/*theLibName*/); // for persistency assurance
|
||||||
}
|
}
|
||||||
catch (SALOME_Exception& S_ex)
|
catch (SALOME_Exception& S_ex)
|
||||||
{
|
{
|
||||||
THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
|
THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( aPlatformLibName )
|
||||||
|
delete[] aPlatformLibName;
|
||||||
|
|
||||||
if (!myHypothesis_i)
|
if (!myHypothesis_i)
|
||||||
return hypothesis_i._retn();
|
return hypothesis_i._retn();
|
||||||
|
|
||||||
// activate the CORBA servant of hypothesis
|
// activate the CORBA servant of hypothesis
|
||||||
hypothesis_i = SMESH::SMESH_Hypothesis::_narrow( myHypothesis_i->_this() );
|
hypothesis_i = SMESH::SMESH_Hypothesis::_narrow( myHypothesis_i->_this() );
|
||||||
int nextId = RegisterObject( hypothesis_i );
|
int nextId = RegisterObject( hypothesis_i );
|
||||||
if(MYDEBUG) MESSAGE( "Add hypo to map with id = "<< nextId );
|
if(MYDEBUG) MESSAGE( "Add hypo to map with id = "<< nextId );
|
||||||
|
|
||||||
return hypothesis_i._retn();
|
return hypothesis_i._retn();
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ print"---------------------Hypothesis"
|
|||||||
#---------------- NumberOfSegments
|
#---------------- NumberOfSegments
|
||||||
numberOfSegment = 9
|
numberOfSegment = 9
|
||||||
|
|
||||||
hypNbSeg = smesh.CreateHypothesis( "NumberOfSegments", "libStdMeshersEngine.so" )
|
hypNbSeg = smesh.CreateHypothesis( "NumberOfSegments", "StdMeshersEngine" )
|
||||||
hypNbSeg.SetNumberOfSegments( numberOfSegment )
|
hypNbSeg.SetNumberOfSegments( numberOfSegment )
|
||||||
|
|
||||||
print hypNbSeg.GetName()
|
print hypNbSeg.GetName()
|
||||||
@ -64,7 +64,7 @@ smeshgui.SetName(salome.ObjectToID(hypNbSeg), "Nb. Segments")
|
|||||||
#--------------------------Max. Element Area
|
#--------------------------Max. Element Area
|
||||||
maxElementArea = 200
|
maxElementArea = 200
|
||||||
|
|
||||||
hypArea200 = smesh.CreateHypothesis("MaxElementArea","libStdMeshersEngine.so")
|
hypArea200 = smesh.CreateHypothesis("MaxElementArea","StdMeshersEngine")
|
||||||
hypArea200.SetMaxElementArea( maxElementArea )
|
hypArea200.SetMaxElementArea( maxElementArea )
|
||||||
print hypArea200.GetName()
|
print hypArea200.GetName()
|
||||||
print hypArea200.GetMaxElementArea()
|
print hypArea200.GetMaxElementArea()
|
||||||
@ -74,14 +74,14 @@ smeshgui.SetName(salome.ObjectToID(hypArea200), "Max. Element Area")
|
|||||||
print"---------------------Algorithms"
|
print"---------------------Algorithms"
|
||||||
|
|
||||||
#----------------------------Wire discretisation
|
#----------------------------Wire discretisation
|
||||||
algoWireDes = smesh.CreateHypothesis( "Regular_1D", "libStdMeshersEngine.so" )
|
algoWireDes = smesh.CreateHypothesis( "Regular_1D", "StdMeshersEngine" )
|
||||||
listHyp = algoWireDes.GetCompatibleHypothesis()
|
listHyp = algoWireDes.GetCompatibleHypothesis()
|
||||||
|
|
||||||
print algoWireDes.GetName()
|
print algoWireDes.GetName()
|
||||||
smeshgui.SetName(salome.ObjectToID(algoWireDes), "Ware descritisation")
|
smeshgui.SetName(salome.ObjectToID(algoWireDes), "Ware descritisation")
|
||||||
|
|
||||||
#----------------------------Triangle (Mefisto)
|
#----------------------------Triangle (Mefisto)
|
||||||
algoMef = smesh.CreateHypothesis( "MEFISTO_2D", "libStdMeshersEngine.so" )
|
algoMef = smesh.CreateHypothesis( "MEFISTO_2D", "StdMeshersEngine" )
|
||||||
listHyp = algoMef.GetCompatibleHypothesis()
|
listHyp = algoMef.GetCompatibleHypothesis()
|
||||||
|
|
||||||
print algoMef.GetName()
|
print algoMef.GetName()
|
||||||
|
@ -60,18 +60,18 @@ smeshgui = salome.ImportComponentGUI("SMESH")
|
|||||||
smeshgui.Init(salome.myStudyId)
|
smeshgui.Init(salome.myStudyId)
|
||||||
|
|
||||||
# create hypoteses
|
# create hypoteses
|
||||||
hypNbSeg1 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so")
|
hypNbSeg1 = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine")
|
||||||
hypNbSeg1.SetNumberOfSegments(18)
|
hypNbSeg1.SetNumberOfSegments(18)
|
||||||
id_hypNbSeg1 = salome.ObjectToID(hypNbSeg1)
|
id_hypNbSeg1 = salome.ObjectToID(hypNbSeg1)
|
||||||
smeshgui.SetName(id_hypNbSeg1, "NumberOfSegments 1");
|
smeshgui.SetName(id_hypNbSeg1, "NumberOfSegments 1");
|
||||||
|
|
||||||
hypNbSeg2 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so")
|
hypNbSeg2 = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine")
|
||||||
hypNbSeg2.SetNumberOfSegments(34)
|
hypNbSeg2.SetNumberOfSegments(34)
|
||||||
id_hypNbSeg2 = salome.ObjectToID(hypNbSeg2)
|
id_hypNbSeg2 = salome.ObjectToID(hypNbSeg2)
|
||||||
smeshgui.SetName(id_hypNbSeg2, "NumberOfSegments 2");
|
smeshgui.SetName(id_hypNbSeg2, "NumberOfSegments 2");
|
||||||
|
|
||||||
# create algorithmes
|
# create algorithmes
|
||||||
algoReg = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so")
|
algoReg = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine")
|
||||||
id_algoReg = salome.ObjectToID(algoReg)
|
id_algoReg = salome.ObjectToID(algoReg)
|
||||||
smeshgui.SetName(id_algoReg, "Regular_1D");
|
smeshgui.SetName(id_algoReg, "Regular_1D");
|
||||||
|
|
||||||
|
@ -57,22 +57,22 @@ smeshgui = salome.ImportComponentGUI("SMESH")
|
|||||||
smeshgui.Init(salome.myStudyId)
|
smeshgui.Init(salome.myStudyId)
|
||||||
|
|
||||||
# create hypoteses
|
# create hypoteses
|
||||||
hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so")
|
hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine")
|
||||||
hypNbSeg.SetNumberOfSegments(12)
|
hypNbSeg.SetNumberOfSegments(12)
|
||||||
idseg = salome.ObjectToID(hypNbSeg)
|
idseg = salome.ObjectToID(hypNbSeg)
|
||||||
smeshgui.SetName(idseg, "NumberOfSegments_10");
|
smeshgui.SetName(idseg, "NumberOfSegments_10");
|
||||||
|
|
||||||
hypArea = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so")
|
hypArea = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine")
|
||||||
hypArea.SetMaxElementArea(30)
|
hypArea.SetMaxElementArea(30)
|
||||||
idarea = salome.ObjectToID(hypArea)
|
idarea = salome.ObjectToID(hypArea)
|
||||||
smeshgui.SetName(idarea, "MaxElementArea_20");
|
smeshgui.SetName(idarea, "MaxElementArea_20");
|
||||||
|
|
||||||
# create algorithmes
|
# create algorithmes
|
||||||
algoReg = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so")
|
algoReg = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine")
|
||||||
idreg = salome.ObjectToID(algoReg)
|
idreg = salome.ObjectToID(algoReg)
|
||||||
smeshgui.SetName(idreg, "Regular_1D");
|
smeshgui.SetName(idreg, "Regular_1D");
|
||||||
|
|
||||||
algoMef = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so")
|
algoMef = smesh.CreateHypothesis("MEFISTO_2D", "StdMeshersEngine")
|
||||||
idmef = salome.ObjectToID(algoMef)
|
idmef = salome.ObjectToID(algoMef)
|
||||||
smeshgui.SetName(idmef, "MEFISTO_2D");
|
smeshgui.SetName(idmef, "MEFISTO_2D");
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ smeshgui.SetName( idmesh, "Nut" )
|
|||||||
#HYPOTHESIS CREATION
|
#HYPOTHESIS CREATION
|
||||||
print "-------------------------- Average length"
|
print "-------------------------- Average length"
|
||||||
theAverageLength = 5
|
theAverageLength = 5
|
||||||
hAvLength = smesh.CreateHypothesis( "LocalLength", "libStdMeshersEngine.so" )
|
hAvLength = smesh.CreateHypothesis( "LocalLength", "StdMeshersEngine" )
|
||||||
hAvLength.SetLength( theAverageLength )
|
hAvLength.SetLength( theAverageLength )
|
||||||
print hAvLength.GetName()
|
print hAvLength.GetName()
|
||||||
print hAvLength.GetId()
|
print hAvLength.GetId()
|
||||||
@ -97,7 +97,7 @@ smeshgui.SetName(salome.ObjectToID(hAvLength), "AverageLength_5")
|
|||||||
|
|
||||||
print "-------------------------- MaxElementArea"
|
print "-------------------------- MaxElementArea"
|
||||||
theMaxElementArea = 20
|
theMaxElementArea = 20
|
||||||
hArea20 = smesh.CreateHypothesis( "MaxElementArea", "libStdMeshersEngine.so" )
|
hArea20 = smesh.CreateHypothesis( "MaxElementArea", "StdMeshersEngine" )
|
||||||
hArea20.SetMaxElementArea( theMaxElementArea )
|
hArea20.SetMaxElementArea( theMaxElementArea )
|
||||||
print hArea20.GetName()
|
print hArea20.GetName()
|
||||||
print hArea20.GetId()
|
print hArea20.GetId()
|
||||||
@ -106,7 +106,7 @@ smeshgui.SetName(salome.ObjectToID(hArea20), "MaxElementArea_20")
|
|||||||
|
|
||||||
print "-------------------------- MaxElementVolume"
|
print "-------------------------- MaxElementVolume"
|
||||||
theMaxElementVolume = 150
|
theMaxElementVolume = 150
|
||||||
hVolume150 = smesh.CreateHypothesis( "MaxElementVolume", "libStdMeshersEngine.so" )
|
hVolume150 = smesh.CreateHypothesis( "MaxElementVolume", "StdMeshersEngine" )
|
||||||
hVolume150.SetMaxElementVolume( theMaxElementVolume )
|
hVolume150.SetMaxElementVolume( theMaxElementVolume )
|
||||||
print hVolume150.GetName()
|
print hVolume150.GetName()
|
||||||
print hVolume150.GetId()
|
print hVolume150.GetId()
|
||||||
@ -119,7 +119,7 @@ mesh.AddHypothesis(shape_mesh, hVolume150)
|
|||||||
|
|
||||||
print "-------------------------- Regular_1D"
|
print "-------------------------- Regular_1D"
|
||||||
|
|
||||||
algoReg1D = smesh.CreateHypothesis( "Regular_1D", "libStdMeshersEngine.so" )
|
algoReg1D = smesh.CreateHypothesis( "Regular_1D", "StdMeshersEngine" )
|
||||||
listHyp = algoReg1D.GetCompatibleHypothesis()
|
listHyp = algoReg1D.GetCompatibleHypothesis()
|
||||||
for hyp in listHyp:
|
for hyp in listHyp:
|
||||||
print hyp
|
print hyp
|
||||||
@ -128,7 +128,7 @@ print algoReg1D.GetId()
|
|||||||
smeshgui.SetName(salome.ObjectToID(algoReg1D), "Wire discretisation")
|
smeshgui.SetName(salome.ObjectToID(algoReg1D), "Wire discretisation")
|
||||||
|
|
||||||
print "-------------------------- MEFISTO_2D"
|
print "-------------------------- MEFISTO_2D"
|
||||||
algoMef = smesh.CreateHypothesis( "MEFISTO_2D", "libStdMeshersEngine.so" )
|
algoMef = smesh.CreateHypothesis( "MEFISTO_2D", "StdMeshersEngine" )
|
||||||
listHyp = algoMef.GetCompatibleHypothesis()
|
listHyp = algoMef.GetCompatibleHypothesis()
|
||||||
for hyp in listHyp:
|
for hyp in listHyp:
|
||||||
print hyp
|
print hyp
|
||||||
|
@ -112,7 +112,7 @@ print "-------------------------- NumberOfSegments"
|
|||||||
|
|
||||||
numberOfSegments = 10
|
numberOfSegments = 10
|
||||||
|
|
||||||
hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so")
|
hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine")
|
||||||
hypNbSeg.SetNumberOfSegments(numberOfSegments)
|
hypNbSeg.SetNumberOfSegments(numberOfSegments)
|
||||||
print hypNbSeg.GetName()
|
print hypNbSeg.GetName()
|
||||||
print hypNbSeg.GetId()
|
print hypNbSeg.GetId()
|
||||||
@ -124,7 +124,7 @@ print "-------------------------- MaxElementArea"
|
|||||||
|
|
||||||
maxElementArea = 0.1
|
maxElementArea = 0.1
|
||||||
|
|
||||||
hypArea = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so")
|
hypArea = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine")
|
||||||
hypArea.SetMaxElementArea(maxElementArea)
|
hypArea.SetMaxElementArea(maxElementArea)
|
||||||
print hypArea.GetName()
|
print hypArea.GetName()
|
||||||
print hypArea.GetId()
|
print hypArea.GetId()
|
||||||
@ -136,7 +136,7 @@ print "-------------------------- MaxElementVolume"
|
|||||||
|
|
||||||
maxElementVolume = 0.5
|
maxElementVolume = 0.5
|
||||||
|
|
||||||
hypVolume = smesh.CreateHypothesis("MaxElementVolume", "libStdMeshersEngine.so")
|
hypVolume = smesh.CreateHypothesis("MaxElementVolume", "StdMeshersEngine")
|
||||||
hypVolume.SetMaxElementVolume(maxElementVolume)
|
hypVolume.SetMaxElementVolume(maxElementVolume)
|
||||||
print hypVolume.GetName()
|
print hypVolume.GetName()
|
||||||
print hypVolume.GetId()
|
print hypVolume.GetId()
|
||||||
@ -148,12 +148,12 @@ print "-------------------------- create Algorithms"
|
|||||||
|
|
||||||
print "-------------------------- Regular_1D"
|
print "-------------------------- Regular_1D"
|
||||||
|
|
||||||
regular1D = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so")
|
regular1D = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine")
|
||||||
smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation")
|
smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation")
|
||||||
|
|
||||||
print "-------------------------- MEFISTO_2D"
|
print "-------------------------- MEFISTO_2D"
|
||||||
|
|
||||||
mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so")
|
mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "StdMeshersEngine")
|
||||||
smeshgui.SetName(salome.ObjectToID(mefisto2D), "MEFISTO_2D")
|
smeshgui.SetName(salome.ObjectToID(mefisto2D), "MEFISTO_2D")
|
||||||
|
|
||||||
print "-------------------------- NETGEN_3D"
|
print "-------------------------- NETGEN_3D"
|
||||||
|
@ -36,22 +36,22 @@ smeshgui.Init(salome.myStudyId)
|
|||||||
|
|
||||||
# Hypothesis
|
# Hypothesis
|
||||||
|
|
||||||
hypL1=meshgenerator.CreateHypothesis("LocalLength","libStdMeshersEngine.so")
|
hypL1=meshgenerator.CreateHypothesis("LocalLength","StdMeshersEngine")
|
||||||
hypL1.SetLength(0.25)
|
hypL1.SetLength(0.25)
|
||||||
hypL1Id = salome.ObjectToID(hypL1)
|
hypL1Id = salome.ObjectToID(hypL1)
|
||||||
smeshgui.SetName(hypL1Id, "LocalLength")
|
smeshgui.SetName(hypL1Id, "LocalLength")
|
||||||
|
|
||||||
# Algorithm
|
# Algorithm
|
||||||
|
|
||||||
alg1D=meshgenerator.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so")
|
alg1D=meshgenerator.CreateHypothesis("Regular_1D", "StdMeshersEngine")
|
||||||
alg1DId = salome.ObjectToID(alg1D)
|
alg1DId = salome.ObjectToID(alg1D)
|
||||||
smeshgui.SetName(alg1DId, "algo1D")
|
smeshgui.SetName(alg1DId, "algo1D")
|
||||||
|
|
||||||
alg2D=meshgenerator.CreateHypothesis("Quadrangle_2D", "libStdMeshersEngine.so")
|
alg2D=meshgenerator.CreateHypothesis("Quadrangle_2D", "StdMeshersEngine")
|
||||||
alg2DId = salome.ObjectToID(alg2D)
|
alg2DId = salome.ObjectToID(alg2D)
|
||||||
smeshgui.SetName(alg2DId, "algo2D")
|
smeshgui.SetName(alg2DId, "algo2D")
|
||||||
|
|
||||||
alg3D=meshgenerator.CreateHypothesis("Hexa_3D", "libStdMeshersEngine.so")
|
alg3D=meshgenerator.CreateHypothesis("Hexa_3D", "StdMeshersEngine")
|
||||||
alg3DId = salome.ObjectToID(alg3D)
|
alg3DId = salome.ObjectToID(alg3D)
|
||||||
smeshgui.SetName(alg3DId, "algo3D")
|
smeshgui.SetName(alg3DId, "algo3D")
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ print "-------------------------- NumberOfSegments"
|
|||||||
|
|
||||||
numberOfSegments = 10
|
numberOfSegments = 10
|
||||||
|
|
||||||
hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so")
|
hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine")
|
||||||
hypNbSeg.SetNumberOfSegments(numberOfSegments)
|
hypNbSeg.SetNumberOfSegments(numberOfSegments)
|
||||||
|
|
||||||
print hypNbSeg.GetName()
|
print hypNbSeg.GetName()
|
||||||
@ -81,7 +81,7 @@ print "-------------------------- MaxElementArea"
|
|||||||
|
|
||||||
maxElementArea = 500
|
maxElementArea = 500
|
||||||
|
|
||||||
hypArea = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so")
|
hypArea = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine")
|
||||||
hypArea.SetMaxElementArea(maxElementArea)
|
hypArea.SetMaxElementArea(maxElementArea)
|
||||||
|
|
||||||
print hypArea.GetName()
|
print hypArea.GetName()
|
||||||
@ -94,7 +94,7 @@ print "-------------------------- MaxElementVolume"
|
|||||||
|
|
||||||
maxElementVolume = 500
|
maxElementVolume = 500
|
||||||
|
|
||||||
hypVolume = smesh.CreateHypothesis("MaxElementVolume", "libStdMeshersEngine.so")
|
hypVolume = smesh.CreateHypothesis("MaxElementVolume", "StdMeshersEngine")
|
||||||
hypVolume.SetMaxElementVolume(maxElementVolume)
|
hypVolume.SetMaxElementVolume(maxElementVolume)
|
||||||
|
|
||||||
print hypVolume.GetName()
|
print hypVolume.GetName()
|
||||||
@ -109,12 +109,12 @@ print "-------------------------- create Algorithms"
|
|||||||
|
|
||||||
print "-------------------------- Regular_1D"
|
print "-------------------------- Regular_1D"
|
||||||
|
|
||||||
regular1D = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so")
|
regular1D = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine")
|
||||||
smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation")
|
smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation")
|
||||||
|
|
||||||
print "-------------------------- MEFISTO_2D"
|
print "-------------------------- MEFISTO_2D"
|
||||||
|
|
||||||
mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so")
|
mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "StdMeshersEngine")
|
||||||
smeshgui.SetName(salome.ObjectToID(mefisto2D), "MEFISTO_2D")
|
smeshgui.SetName(salome.ObjectToID(mefisto2D), "MEFISTO_2D")
|
||||||
|
|
||||||
print "-------------------------- NETGEN_3D"
|
print "-------------------------- NETGEN_3D"
|
||||||
|
@ -79,7 +79,7 @@ print "-------------------------- NumberOfSegments"
|
|||||||
|
|
||||||
numberOfSegments = 10
|
numberOfSegments = 10
|
||||||
|
|
||||||
hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so")
|
hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine")
|
||||||
hypNbSeg.SetNumberOfSegments(numberOfSegments)
|
hypNbSeg.SetNumberOfSegments(numberOfSegments)
|
||||||
|
|
||||||
print hypNbSeg.GetName()
|
print hypNbSeg.GetName()
|
||||||
@ -92,7 +92,7 @@ print "-------------------------- MaxElementArea"
|
|||||||
|
|
||||||
maxElementArea = 500
|
maxElementArea = 500
|
||||||
|
|
||||||
hypArea = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so")
|
hypArea = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine")
|
||||||
hypArea.SetMaxElementArea(maxElementArea)
|
hypArea.SetMaxElementArea(maxElementArea)
|
||||||
|
|
||||||
print hypArea.GetName()
|
print hypArea.GetName()
|
||||||
@ -105,7 +105,7 @@ print "-------------------------- MaxElementVolume"
|
|||||||
|
|
||||||
maxElementVolume = 500
|
maxElementVolume = 500
|
||||||
|
|
||||||
hypVolume = smesh.CreateHypothesis("MaxElementVolume", "libStdMeshersEngine.so")
|
hypVolume = smesh.CreateHypothesis("MaxElementVolume", "StdMeshersEngine")
|
||||||
hypVolume.SetMaxElementVolume(maxElementVolume)
|
hypVolume.SetMaxElementVolume(maxElementVolume)
|
||||||
|
|
||||||
print hypVolume.GetName()
|
print hypVolume.GetName()
|
||||||
@ -120,12 +120,12 @@ print "-------------------------- create Algorithms"
|
|||||||
|
|
||||||
print "-------------------------- Regular_1D"
|
print "-------------------------- Regular_1D"
|
||||||
|
|
||||||
regular1D = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so")
|
regular1D = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine")
|
||||||
smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation")
|
smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation")
|
||||||
|
|
||||||
print "-------------------------- MEFISTO_2D"
|
print "-------------------------- MEFISTO_2D"
|
||||||
|
|
||||||
mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so")
|
mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "StdMeshersEngine")
|
||||||
smeshgui.SetName(salome.ObjectToID(mefisto2D), "MEFISTO_2D")
|
smeshgui.SetName(salome.ObjectToID(mefisto2D), "MEFISTO_2D")
|
||||||
|
|
||||||
print "-------------------------- NETGEN_3D"
|
print "-------------------------- NETGEN_3D"
|
||||||
|
@ -40,7 +40,7 @@ print "-------------------------- NumberOfSegments"
|
|||||||
|
|
||||||
numberOfSegments = 10
|
numberOfSegments = 10
|
||||||
|
|
||||||
hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so")
|
hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine")
|
||||||
hypNbSeg.SetNumberOfSegments(numberOfSegments)
|
hypNbSeg.SetNumberOfSegments(numberOfSegments)
|
||||||
|
|
||||||
print hypNbSeg.GetName()
|
print hypNbSeg.GetName()
|
||||||
@ -53,7 +53,7 @@ print "-------------------------- MaxElementArea"
|
|||||||
|
|
||||||
maxElementArea = 500
|
maxElementArea = 500
|
||||||
|
|
||||||
hypArea = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so")
|
hypArea = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine")
|
||||||
hypArea.SetMaxElementArea(maxElementArea)
|
hypArea.SetMaxElementArea(maxElementArea)
|
||||||
|
|
||||||
print hypArea.GetName()
|
print hypArea.GetName()
|
||||||
@ -66,7 +66,7 @@ print "-------------------------- MaxElementVolume"
|
|||||||
|
|
||||||
maxElementVolume = 500
|
maxElementVolume = 500
|
||||||
|
|
||||||
hypVolume = smesh.CreateHypothesis("MaxElementVolume", "libStdMeshersEngine.so")
|
hypVolume = smesh.CreateHypothesis("MaxElementVolume", "StdMeshersEngine")
|
||||||
hypVolume.SetMaxElementVolume(maxElementVolume)
|
hypVolume.SetMaxElementVolume(maxElementVolume)
|
||||||
|
|
||||||
print hypVolume.GetName()
|
print hypVolume.GetName()
|
||||||
@ -81,12 +81,12 @@ print "-------------------------- create Algorithms"
|
|||||||
|
|
||||||
print "-------------------------- Regular_1D"
|
print "-------------------------- Regular_1D"
|
||||||
|
|
||||||
regular1D = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so")
|
regular1D = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine")
|
||||||
smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation")
|
smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation")
|
||||||
|
|
||||||
print "-------------------------- MEFISTO_2D"
|
print "-------------------------- MEFISTO_2D"
|
||||||
|
|
||||||
mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so")
|
mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "StdMeshersEngine")
|
||||||
smeshgui.SetName(salome.ObjectToID(mefisto2D), "MEFISTO_2D")
|
smeshgui.SetName(salome.ObjectToID(mefisto2D), "MEFISTO_2D")
|
||||||
|
|
||||||
print "-------------------------- NETGEN_3D"
|
print "-------------------------- NETGEN_3D"
|
||||||
|
@ -119,7 +119,7 @@ print "-------------------------- NumberOfSegments the global one"
|
|||||||
|
|
||||||
numberOfSegments = 10
|
numberOfSegments = 10
|
||||||
|
|
||||||
hypNbSeg=smesh.CreateHypothesis("NumberOfSegments","libStdMeshersEngine.so")
|
hypNbSeg=smesh.CreateHypothesis("NumberOfSegments","StdMeshersEngine")
|
||||||
hypNbSeg.SetNumberOfSegments(numberOfSegments)
|
hypNbSeg.SetNumberOfSegments(numberOfSegments)
|
||||||
hypNbSegID = hypNbSeg.GetId()
|
hypNbSegID = hypNbSeg.GetId()
|
||||||
print hypNbSeg.GetName()
|
print hypNbSeg.GetName()
|
||||||
@ -132,7 +132,7 @@ print "-------------------------- NumberOfSegments in the Z direction"
|
|||||||
|
|
||||||
numberOfSegmentsZ = 40
|
numberOfSegmentsZ = 40
|
||||||
|
|
||||||
hypNbSegZ=smesh.CreateHypothesis("NumberOfSegments","libStdMeshersEngine.so")
|
hypNbSegZ=smesh.CreateHypothesis("NumberOfSegments","StdMeshersEngine")
|
||||||
hypNbSegZ.SetNumberOfSegments(numberOfSegmentsZ)
|
hypNbSegZ.SetNumberOfSegments(numberOfSegmentsZ)
|
||||||
hypNbSegZID = hypNbSegZ.GetId()
|
hypNbSegZID = hypNbSegZ.GetId()
|
||||||
print hypNbSegZ.GetName()
|
print hypNbSegZ.GetName()
|
||||||
@ -147,17 +147,17 @@ print "-------------------------- create Algorithms"
|
|||||||
|
|
||||||
print "-------------------------- Regular_1D"
|
print "-------------------------- Regular_1D"
|
||||||
|
|
||||||
regular1D=smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so")
|
regular1D=smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine")
|
||||||
smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation")
|
smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation")
|
||||||
|
|
||||||
print "-------------------------- Quadrangle_2D"
|
print "-------------------------- Quadrangle_2D"
|
||||||
|
|
||||||
quad2D=smesh.CreateHypothesis("Quadrangle_2D", "libStdMeshersEngine.so")
|
quad2D=smesh.CreateHypothesis("Quadrangle_2D", "StdMeshersEngine")
|
||||||
smeshgui.SetName(salome.ObjectToID(quad2D), "Quadrangle_2D")
|
smeshgui.SetName(salome.ObjectToID(quad2D), "Quadrangle_2D")
|
||||||
|
|
||||||
print "-------------------------- Hexa_3D"
|
print "-------------------------- Hexa_3D"
|
||||||
|
|
||||||
hexa3D=smesh.CreateHypothesis("Hexa_3D", "libStdMeshersEngine.so")
|
hexa3D=smesh.CreateHypothesis("Hexa_3D", "StdMeshersEngine")
|
||||||
smeshgui.SetName(salome.ObjectToID(hexa3D), "Hexa_3D")
|
smeshgui.SetName(salome.ObjectToID(hexa3D), "Hexa_3D")
|
||||||
|
|
||||||
# ---- init a Mesh with the volume
|
# ---- init a Mesh with the volume
|
||||||
|
@ -37,7 +37,7 @@ print "-------------------------- NumberOfSegments"
|
|||||||
|
|
||||||
numberOfSegments = 5
|
numberOfSegments = 5
|
||||||
|
|
||||||
hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so")
|
hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine")
|
||||||
hypNbSeg.SetNumberOfSegments(numberOfSegments)
|
hypNbSeg.SetNumberOfSegments(numberOfSegments)
|
||||||
|
|
||||||
print hypNbSeg.GetName()
|
print hypNbSeg.GetName()
|
||||||
@ -50,19 +50,19 @@ print "-------------------------- create Algorithms"
|
|||||||
|
|
||||||
print "-------------------------- Regular_1D"
|
print "-------------------------- Regular_1D"
|
||||||
|
|
||||||
regular1D = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so")
|
regular1D = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine")
|
||||||
|
|
||||||
smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation")
|
smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation")
|
||||||
|
|
||||||
print "-------------------------- Quadrangle_2D"
|
print "-------------------------- Quadrangle_2D"
|
||||||
|
|
||||||
quad2D = smesh.CreateHypothesis("Quadrangle_2D", "libStdMeshersEngine.so")
|
quad2D = smesh.CreateHypothesis("Quadrangle_2D", "StdMeshersEngine")
|
||||||
|
|
||||||
smeshgui.SetName(salome.ObjectToID(quad2D), "Quadrangle_2D")
|
smeshgui.SetName(salome.ObjectToID(quad2D), "Quadrangle_2D")
|
||||||
|
|
||||||
print "-------------------------- Hexa_3D"
|
print "-------------------------- Hexa_3D"
|
||||||
|
|
||||||
hexa3D = smesh.CreateHypothesis("Hexa_3D", "libStdMeshersEngine.so")
|
hexa3D = smesh.CreateHypothesis("Hexa_3D", "StdMeshersEngine")
|
||||||
|
|
||||||
smeshgui.SetName(salome.ObjectToID(hexa3D), "Hexa_3D")
|
smeshgui.SetName(salome.ObjectToID(hexa3D), "Hexa_3D")
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ print "-------------------------- NumberOfSegments"
|
|||||||
|
|
||||||
numberOfSegments = 5
|
numberOfSegments = 5
|
||||||
|
|
||||||
hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so")
|
hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine")
|
||||||
hypNbSeg.SetNumberOfSegments(numberOfSegments)
|
hypNbSeg.SetNumberOfSegments(numberOfSegments)
|
||||||
|
|
||||||
print hypNbSeg.GetName()
|
print hypNbSeg.GetName()
|
||||||
@ -57,7 +57,7 @@ print "-------------------------- MaxElementArea"
|
|||||||
## print hypArea.GetMaxElementArea()
|
## print hypArea.GetMaxElementArea()
|
||||||
## smeshgui.SetName(salome.ObjectToID(hypArea), "MaxElementArea_160")
|
## smeshgui.SetName(salome.ObjectToID(hypArea), "MaxElementArea_160")
|
||||||
|
|
||||||
hypLengthFromEdges = smesh.CreateHypothesis("LengthFromEdges", "libStdMeshersEngine.so")
|
hypLengthFromEdges = smesh.CreateHypothesis("LengthFromEdges", "StdMeshersEngine")
|
||||||
smeshgui.SetName(salome.ObjectToID(hypLengthFromEdges), "LengthFromEdges")
|
smeshgui.SetName(salome.ObjectToID(hypLengthFromEdges), "LengthFromEdges")
|
||||||
|
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ print "-------------------------- MaxElementVolume"
|
|||||||
|
|
||||||
maxElementVolume = 1000
|
maxElementVolume = 1000
|
||||||
|
|
||||||
hypVolume = smesh.CreateHypothesis("MaxElementVolume", "libStdMeshersEngine.so")
|
hypVolume = smesh.CreateHypothesis("MaxElementVolume", "StdMeshersEngine")
|
||||||
hypVolume.SetMaxElementVolume(maxElementVolume)
|
hypVolume.SetMaxElementVolume(maxElementVolume)
|
||||||
|
|
||||||
print hypVolume.GetName()
|
print hypVolume.GetName()
|
||||||
@ -78,13 +78,13 @@ print "-------------------------- create Algorithms"
|
|||||||
|
|
||||||
print "-------------------------- Regular_1D"
|
print "-------------------------- Regular_1D"
|
||||||
|
|
||||||
regular1D = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so")
|
regular1D = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine")
|
||||||
|
|
||||||
smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation")
|
smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation")
|
||||||
|
|
||||||
print "-------------------------- MEFISTO_2D"
|
print "-------------------------- MEFISTO_2D"
|
||||||
|
|
||||||
mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so")
|
mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "StdMeshersEngine")
|
||||||
|
|
||||||
smeshgui.SetName(salome.ObjectToID(mefisto2D), "MEFISTO_2D")
|
smeshgui.SetName(salome.ObjectToID(mefisto2D), "MEFISTO_2D")
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ print "-------------------------- LocalLength"
|
|||||||
|
|
||||||
lengthOfSegments = 0.3
|
lengthOfSegments = 0.3
|
||||||
|
|
||||||
hypLength = smesh.CreateHypothesis("LocalLength", "libStdMeshersEngine.so")
|
hypLength = smesh.CreateHypothesis("LocalLength", "StdMeshersEngine")
|
||||||
hypLength.SetLength(lengthOfSegments)
|
hypLength.SetLength(lengthOfSegments)
|
||||||
|
|
||||||
print hypLength.GetName()
|
print hypLength.GetName()
|
||||||
@ -59,7 +59,7 @@ smeshgui.SetName(salome.ObjectToID(hypLength), "LocalLength_0.3")
|
|||||||
|
|
||||||
print "-------------------------- LengthFromEdges"
|
print "-------------------------- LengthFromEdges"
|
||||||
|
|
||||||
hypLengthFromEdge = smesh.CreateHypothesis("LengthFromEdges", "libStdMeshersEngine.so")
|
hypLengthFromEdge = smesh.CreateHypothesis("LengthFromEdges", "StdMeshersEngine")
|
||||||
|
|
||||||
print hypLengthFromEdge.GetName()
|
print hypLengthFromEdge.GetName()
|
||||||
print hypLengthFromEdge.GetId()
|
print hypLengthFromEdge.GetId()
|
||||||
@ -70,13 +70,13 @@ print "-------------------------- create Algorithms"
|
|||||||
|
|
||||||
print "-------------------------- Regular_1D"
|
print "-------------------------- Regular_1D"
|
||||||
|
|
||||||
regular1D = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so")
|
regular1D = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine")
|
||||||
|
|
||||||
smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation")
|
smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation")
|
||||||
|
|
||||||
print "-------------------------- MEFISTO_2D"
|
print "-------------------------- MEFISTO_2D"
|
||||||
|
|
||||||
mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so")
|
mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "StdMeshersEngine")
|
||||||
|
|
||||||
smeshgui.SetName(salome.ObjectToID(mefisto2D), "MEFISTO_2D")
|
smeshgui.SetName(salome.ObjectToID(mefisto2D), "MEFISTO_2D")
|
||||||
|
|
||||||
|
@ -1,66 +1,66 @@
|
|||||||
import salome
|
import salome
|
||||||
import geompy
|
import geompy
|
||||||
import SMESH
|
import SMESH
|
||||||
import StdMeshers
|
import StdMeshers
|
||||||
|
|
||||||
smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH")
|
smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH")
|
||||||
smesh.SetCurrentStudy(salome.myStudy)
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# Create box without one plane
|
# Create box without one plane
|
||||||
|
|
||||||
box = geompy.MakeBox(0., 0., 0., 10., 20., 30.)
|
box = geompy.MakeBox(0., 0., 0., 10., 20., 30.)
|
||||||
subShapeList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"])
|
subShapeList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"])
|
||||||
|
|
||||||
FaceList = []
|
FaceList = []
|
||||||
for i in range( 5 ):
|
for i in range( 5 ):
|
||||||
FaceList.append( subShapeList[ i ] )
|
FaceList.append( subShapeList[ i ] )
|
||||||
|
|
||||||
aComp = geompy.MakeCompound( FaceList )
|
aComp = geompy.MakeCompound( FaceList )
|
||||||
aBox = geompy.Sew( aComp, 1. )
|
aBox = geompy.Sew( aComp, 1. )
|
||||||
idbox = geompy.addToStudy( aBox, "box" )
|
idbox = geompy.addToStudy( aBox, "box" )
|
||||||
|
|
||||||
aBox = salome.IDToObject( idbox )
|
aBox = salome.IDToObject( idbox )
|
||||||
|
|
||||||
# Create mesh
|
# Create mesh
|
||||||
|
|
||||||
hyp1 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so")
|
hyp1 = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine")
|
||||||
hyp1.SetNumberOfSegments(5)
|
hyp1.SetNumberOfSegments(5)
|
||||||
hyp2 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so")
|
hyp2 = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine")
|
||||||
hyp2.SetMaxElementArea(20)
|
hyp2.SetMaxElementArea(20)
|
||||||
hyp3 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so")
|
hyp3 = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine")
|
||||||
hyp3.SetMaxElementArea(50)
|
hyp3.SetMaxElementArea(50)
|
||||||
|
|
||||||
algo1 = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so")
|
algo1 = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine")
|
||||||
algo2 = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so")
|
algo2 = smesh.CreateHypothesis("MEFISTO_2D", "StdMeshersEngine")
|
||||||
|
|
||||||
mesh = smesh.CreateMesh(aBox)
|
mesh = smesh.CreateMesh(aBox)
|
||||||
mesh.AddHypothesis(aBox,hyp1)
|
mesh.AddHypothesis(aBox,hyp1)
|
||||||
mesh.AddHypothesis(aBox,hyp2)
|
mesh.AddHypothesis(aBox,hyp2)
|
||||||
mesh.AddHypothesis(aBox,algo1)
|
mesh.AddHypothesis(aBox,algo1)
|
||||||
mesh.AddHypothesis(aBox,algo2)
|
mesh.AddHypothesis(aBox,algo2)
|
||||||
|
|
||||||
smesh.Compute(mesh,aBox)
|
smesh.Compute(mesh,aBox)
|
||||||
|
|
||||||
smeshgui = salome.ImportComponentGUI("SMESH")
|
smeshgui = salome.ImportComponentGUI("SMESH")
|
||||||
smeshgui.Init(salome.myStudyId);
|
smeshgui.Init(salome.myStudyId);
|
||||||
smeshgui.SetName( salome.ObjectToID( mesh ), "Mesh_freebord" );
|
smeshgui.SetName( salome.ObjectToID( mesh ), "Mesh_freebord" );
|
||||||
|
|
||||||
# Criterion : Free edges
|
# Criterion : Free edges
|
||||||
aFilterMgr = smesh.CreateFilterManager()
|
aFilterMgr = smesh.CreateFilterManager()
|
||||||
aPredicate = aFilterMgr.CreateFreeBorders()
|
aPredicate = aFilterMgr.CreateFreeBorders()
|
||||||
aFilter = aFilterMgr.CreateFilter()
|
aFilter = aFilterMgr.CreateFilter()
|
||||||
aFilter.SetPredicate( aPredicate )
|
aFilter.SetPredicate( aPredicate )
|
||||||
|
|
||||||
anIds = aFilter.GetElementsId( mesh )
|
anIds = aFilter.GetElementsId( mesh )
|
||||||
|
|
||||||
# print result
|
# print result
|
||||||
print "Criterion: Free edges Nb = ", len( anIds )
|
print "Criterion: Free edges Nb = ", len( anIds )
|
||||||
for i in range( len( anIds ) ):
|
for i in range( len( anIds ) ):
|
||||||
print anIds[ i ]
|
print anIds[ i ]
|
||||||
|
|
||||||
# create group
|
# create group
|
||||||
aGroup = mesh.CreateGroup( SMESH.EDGE, "Free edges" )
|
aGroup = mesh.CreateGroup( SMESH.EDGE, "Free edges" )
|
||||||
aGroup.Add( anIds )
|
aGroup.Add( anIds )
|
||||||
|
|
||||||
|
|
||||||
salome.sg.updateObjBrowser(1)
|
salome.sg.updateObjBrowser(1)
|
||||||
|
@ -84,20 +84,20 @@ smesh.SetCurrentStudy(salome.myStudy)
|
|||||||
# ---- create Hypothesis
|
# ---- create Hypothesis
|
||||||
print "-------------------------- create Hypothesis"
|
print "-------------------------- create Hypothesis"
|
||||||
numberOfSegments = 4
|
numberOfSegments = 4
|
||||||
hypNbSegA=smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so")
|
hypNbSegA=smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine")
|
||||||
hypNbSegA.SetNumberOfSegments(numberOfSegments)
|
hypNbSegA.SetNumberOfSegments(numberOfSegments)
|
||||||
numberOfSegments = 10
|
numberOfSegments = 10
|
||||||
hypNbSegB=smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so")
|
hypNbSegB=smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine")
|
||||||
hypNbSegB.SetNumberOfSegments(numberOfSegments)
|
hypNbSegB.SetNumberOfSegments(numberOfSegments)
|
||||||
numberOfSegments = 15
|
numberOfSegments = 15
|
||||||
hypNbSegC=smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so")
|
hypNbSegC=smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine")
|
||||||
hypNbSegC.SetNumberOfSegments(numberOfSegments)
|
hypNbSegC.SetNumberOfSegments(numberOfSegments)
|
||||||
|
|
||||||
# ---- create Algorithms
|
# ---- create Algorithms
|
||||||
print "-------------------------- create Algorithms"
|
print "-------------------------- create Algorithms"
|
||||||
regular1D=smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so")
|
regular1D=smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine")
|
||||||
quad2D=smesh.CreateHypothesis("Quadrangle_2D", "libStdMeshersEngine.so")
|
quad2D=smesh.CreateHypothesis("Quadrangle_2D", "StdMeshersEngine")
|
||||||
hexa3D=smesh.CreateHypothesis("Hexa_3D", "libStdMeshersEngine.so")
|
hexa3D=smesh.CreateHypothesis("Hexa_3D", "StdMeshersEngine")
|
||||||
|
|
||||||
# ---- init a Mesh with the geom shape
|
# ---- init a Mesh with the geom shape
|
||||||
shape_mesh = blob
|
shape_mesh = blob
|
||||||
|
@ -140,7 +140,7 @@ print "-------------------------- NumberOfSegments"
|
|||||||
|
|
||||||
numberOfSegment = 10
|
numberOfSegment = 10
|
||||||
|
|
||||||
hypNbSeg = smesh.CreateHypothesis( "NumberOfSegments", "libStdMeshersEngine.so" )
|
hypNbSeg = smesh.CreateHypothesis( "NumberOfSegments", "StdMeshersEngine" )
|
||||||
hypNbSeg.SetNumberOfSegments( numberOfSegment )
|
hypNbSeg.SetNumberOfSegments( numberOfSegment )
|
||||||
print hypNbSeg.GetName()
|
print hypNbSeg.GetName()
|
||||||
print hypNbSeg.GetId()
|
print hypNbSeg.GetId()
|
||||||
@ -152,7 +152,7 @@ print "-------------------------- MaxElementArea"
|
|||||||
|
|
||||||
maxElementArea = 25
|
maxElementArea = 25
|
||||||
|
|
||||||
hypArea25 = smesh.CreateHypothesis( "MaxElementArea", "libStdMeshersEngine.so" )
|
hypArea25 = smesh.CreateHypothesis( "MaxElementArea", "StdMeshersEngine" )
|
||||||
hypArea25.SetMaxElementArea( maxElementArea )
|
hypArea25.SetMaxElementArea( maxElementArea )
|
||||||
print hypArea25.GetName()
|
print hypArea25.GetName()
|
||||||
print hypArea25.GetId()
|
print hypArea25.GetId()
|
||||||
@ -164,7 +164,7 @@ print "-------------------------- MaxElementArea"
|
|||||||
|
|
||||||
maxElementArea = 35
|
maxElementArea = 35
|
||||||
|
|
||||||
hypArea35 = smesh.CreateHypothesis( "MaxElementArea", "libStdMeshersEngine.so" )
|
hypArea35 = smesh.CreateHypothesis( "MaxElementArea", "StdMeshersEngine" )
|
||||||
hypArea35.SetMaxElementArea( maxElementArea )
|
hypArea35.SetMaxElementArea( maxElementArea )
|
||||||
print hypArea35.GetName()
|
print hypArea35.GetName()
|
||||||
print hypArea35.GetId()
|
print hypArea35.GetId()
|
||||||
@ -174,7 +174,7 @@ smeshgui.SetName(salome.ObjectToID(hypArea35), "MaxElementArea_35")
|
|||||||
|
|
||||||
print "-------------------------- Regular_1D"
|
print "-------------------------- Regular_1D"
|
||||||
|
|
||||||
algoReg1D = smesh.CreateHypothesis( "Regular_1D", "libStdMeshersEngine.so" )
|
algoReg1D = smesh.CreateHypothesis( "Regular_1D", "StdMeshersEngine" )
|
||||||
listHyp = algoReg1D.GetCompatibleHypothesis()
|
listHyp = algoReg1D.GetCompatibleHypothesis()
|
||||||
for hyp in listHyp:
|
for hyp in listHyp:
|
||||||
print hyp
|
print hyp
|
||||||
@ -185,7 +185,7 @@ smeshgui.SetName(salome.ObjectToID(algoReg1D), "Regular_1D")
|
|||||||
|
|
||||||
print "-------------------------- MEFISTO_2D"
|
print "-------------------------- MEFISTO_2D"
|
||||||
|
|
||||||
algoMef = smesh.CreateHypothesis( "MEFISTO_2D", "libStdMeshersEngine.so" )
|
algoMef = smesh.CreateHypothesis( "MEFISTO_2D", "StdMeshersEngine" )
|
||||||
listHyp = algoMef.GetCompatibleHypothesis()
|
listHyp = algoMef.GetCompatibleHypothesis()
|
||||||
for hyp in listHyp:
|
for hyp in listHyp:
|
||||||
print hyp
|
print hyp
|
||||||
@ -196,7 +196,7 @@ smeshgui.SetName(salome.ObjectToID(algoMef), "MEFISTO_2D")
|
|||||||
|
|
||||||
print "-------------------------- SMESH_Quadrangle_2D"
|
print "-------------------------- SMESH_Quadrangle_2D"
|
||||||
|
|
||||||
algoQuad = smesh.CreateHypothesis( "Quadrangle_2D", "libStdMeshersEngine.so" )
|
algoQuad = smesh.CreateHypothesis( "Quadrangle_2D", "StdMeshersEngine" )
|
||||||
listHyp = algoQuad.GetCompatibleHypothesis()
|
listHyp = algoQuad.GetCompatibleHypothesis()
|
||||||
for hyp in listHyp:
|
for hyp in listHyp:
|
||||||
print hyp
|
print hyp
|
||||||
|
@ -142,7 +142,7 @@ print "-------------------------- NumberOfSegments"
|
|||||||
|
|
||||||
numberOfSegment = 10
|
numberOfSegment = 10
|
||||||
|
|
||||||
hypNbSeg = smesh.CreateHypothesis( "NumberOfSegments", "libStdMeshersEngine.so" )
|
hypNbSeg = smesh.CreateHypothesis( "NumberOfSegments", "StdMeshersEngine" )
|
||||||
hypNbSeg.SetNumberOfSegments( numberOfSegment )
|
hypNbSeg.SetNumberOfSegments( numberOfSegment )
|
||||||
print hypNbSeg.GetName()
|
print hypNbSeg.GetName()
|
||||||
print hypNbSeg.GetId()
|
print hypNbSeg.GetId()
|
||||||
@ -154,7 +154,7 @@ print "-------------------------- MaxElementArea"
|
|||||||
|
|
||||||
maxElementArea = 25
|
maxElementArea = 25
|
||||||
|
|
||||||
hypArea25 = smesh.CreateHypothesis( "MaxElementArea", "libStdMeshersEngine.so" )
|
hypArea25 = smesh.CreateHypothesis( "MaxElementArea", "StdMeshersEngine" )
|
||||||
hypArea25.SetMaxElementArea( maxElementArea )
|
hypArea25.SetMaxElementArea( maxElementArea )
|
||||||
print hypArea25.GetName()
|
print hypArea25.GetName()
|
||||||
print hypArea25.GetId()
|
print hypArea25.GetId()
|
||||||
@ -166,7 +166,7 @@ print "-------------------------- MaxElementArea"
|
|||||||
|
|
||||||
maxElementArea = 35
|
maxElementArea = 35
|
||||||
|
|
||||||
hypArea35 = smesh.CreateHypothesis( "MaxElementArea", "libStdMeshersEngine.so" )
|
hypArea35 = smesh.CreateHypothesis( "MaxElementArea", "StdMeshersEngine" )
|
||||||
hypArea35.SetMaxElementArea( maxElementArea )
|
hypArea35.SetMaxElementArea( maxElementArea )
|
||||||
print hypArea35.GetName()
|
print hypArea35.GetName()
|
||||||
print hypArea35.GetId()
|
print hypArea35.GetId()
|
||||||
@ -176,7 +176,7 @@ smeshgui.SetName(salome.ObjectToID(hypArea35), "MaxElementArea_35")
|
|||||||
|
|
||||||
print "-------------------------- Regular_1D"
|
print "-------------------------- Regular_1D"
|
||||||
|
|
||||||
algoReg1D = smesh.CreateHypothesis( "Regular_1D", "libStdMeshersEngine.so" )
|
algoReg1D = smesh.CreateHypothesis( "Regular_1D", "StdMeshersEngine" )
|
||||||
listHyp = algoReg1D.GetCompatibleHypothesis()
|
listHyp = algoReg1D.GetCompatibleHypothesis()
|
||||||
for hyp in listHyp:
|
for hyp in listHyp:
|
||||||
print hyp
|
print hyp
|
||||||
@ -187,7 +187,7 @@ smeshgui.SetName(salome.ObjectToID(algoReg1D), "Regular_1D")
|
|||||||
|
|
||||||
print "-------------------------- MEFISTO_2D"
|
print "-------------------------- MEFISTO_2D"
|
||||||
|
|
||||||
algoMef = smesh.CreateHypothesis( "MEFISTO_2D", "libStdMeshersEngine.so" )
|
algoMef = smesh.CreateHypothesis( "MEFISTO_2D", "StdMeshersEngine" )
|
||||||
listHyp = algoMef.GetCompatibleHypothesis()
|
listHyp = algoMef.GetCompatibleHypothesis()
|
||||||
for hyp in listHyp:
|
for hyp in listHyp:
|
||||||
print hyp
|
print hyp
|
||||||
@ -198,7 +198,7 @@ smeshgui.SetName(salome.ObjectToID(algoMef), "MEFISTO_2D")
|
|||||||
|
|
||||||
print "-------------------------- SMESH_Quadrangle_2D"
|
print "-------------------------- SMESH_Quadrangle_2D"
|
||||||
|
|
||||||
algoQuad = smesh.CreateHypothesis( "Quadrangle_2D", "libStdMeshersEngine.so" )
|
algoQuad = smesh.CreateHypothesis( "Quadrangle_2D", "StdMeshersEngine" )
|
||||||
listHyp = algoQuad.GetCompatibleHypothesis()
|
listHyp = algoQuad.GetCompatibleHypothesis()
|
||||||
for hyp in listHyp:
|
for hyp in listHyp:
|
||||||
print hyp
|
print hyp
|
||||||
|
@ -115,7 +115,7 @@ print "-------------------------- NumberOfSegments"
|
|||||||
|
|
||||||
numberOfSegment = 10
|
numberOfSegment = 10
|
||||||
|
|
||||||
hypNbSeg = smesh.CreateHypothesis( "NumberOfSegments", "libStdMeshersEngine.so" )
|
hypNbSeg = smesh.CreateHypothesis( "NumberOfSegments", "StdMeshersEngine" )
|
||||||
hypNbSeg.SetNumberOfSegments( numberOfSegment )
|
hypNbSeg.SetNumberOfSegments( numberOfSegment )
|
||||||
print hypNbSeg.GetName()
|
print hypNbSeg.GetName()
|
||||||
print hypNbSeg.GetId()
|
print hypNbSeg.GetId()
|
||||||
@ -127,7 +127,7 @@ print "-------------------------- MaxElementArea"
|
|||||||
|
|
||||||
maxElementArea = 20
|
maxElementArea = 20
|
||||||
|
|
||||||
hypArea = smesh.CreateHypothesis( "MaxElementArea", "libStdMeshersEngine.so" )
|
hypArea = smesh.CreateHypothesis( "MaxElementArea", "StdMeshersEngine" )
|
||||||
hypArea.SetMaxElementArea( maxElementArea )
|
hypArea.SetMaxElementArea( maxElementArea )
|
||||||
print hypArea.GetName()
|
print hypArea.GetName()
|
||||||
print hypArea.GetId()
|
print hypArea.GetId()
|
||||||
@ -139,7 +139,7 @@ print "-------------------------- MaxElementVolume"
|
|||||||
|
|
||||||
maxElementVolume = 20
|
maxElementVolume = 20
|
||||||
|
|
||||||
hypVolume = smesh.CreateHypothesis( "MaxElementVolume", "libStdMeshersEngine.so" )
|
hypVolume = smesh.CreateHypothesis( "MaxElementVolume", "StdMeshersEngine" )
|
||||||
hypVolume.SetMaxElementVolume( maxElementVolume )
|
hypVolume.SetMaxElementVolume( maxElementVolume )
|
||||||
print hypVolume.GetName()
|
print hypVolume.GetName()
|
||||||
print hypVolume.GetId()
|
print hypVolume.GetId()
|
||||||
@ -149,7 +149,7 @@ smeshgui.SetName(salome.ObjectToID(hypVolume), "MaxElementVolume_20")
|
|||||||
|
|
||||||
print "-------------------------- Regular_1D"
|
print "-------------------------- Regular_1D"
|
||||||
|
|
||||||
algoReg1D = smesh.CreateHypothesis( "Regular_1D", "libStdMeshersEngine.so" )
|
algoReg1D = smesh.CreateHypothesis( "Regular_1D", "StdMeshersEngine" )
|
||||||
listHyp =algoReg1D.GetCompatibleHypothesis()
|
listHyp =algoReg1D.GetCompatibleHypothesis()
|
||||||
for hyp in listHyp:
|
for hyp in listHyp:
|
||||||
print hyp
|
print hyp
|
||||||
@ -160,7 +160,7 @@ smeshgui.SetName(salome.ObjectToID(algoReg1D), "Regular_1D")
|
|||||||
|
|
||||||
print "-------------------------- MEFISTO_2D"
|
print "-------------------------- MEFISTO_2D"
|
||||||
|
|
||||||
algoMef = smesh.CreateHypothesis( "MEFISTO_2D", "libStdMeshersEngine.so" )
|
algoMef = smesh.CreateHypothesis( "MEFISTO_2D", "StdMeshersEngine" )
|
||||||
listHyp = algoMef.GetCompatibleHypothesis()
|
listHyp = algoMef.GetCompatibleHypothesis()
|
||||||
for hyp in listHyp:
|
for hyp in listHyp:
|
||||||
print hyp
|
print hyp
|
||||||
|
@ -63,7 +63,7 @@ smeshgui.Init(salome.myStudyId)
|
|||||||
print "-------------------------- create Hypothesis"
|
print "-------------------------- create Hypothesis"
|
||||||
|
|
||||||
print "-------------------------- LocalLength"
|
print "-------------------------- LocalLength"
|
||||||
hypLen1 = smesh.CreateHypothesis("LocalLength", "libStdMeshersEngine.so")
|
hypLen1 = smesh.CreateHypothesis("LocalLength", "StdMeshersEngine")
|
||||||
hypLen1.SetLength(100)
|
hypLen1.SetLength(100)
|
||||||
print hypLen1.GetName()
|
print hypLen1.GetName()
|
||||||
print hypLen1.GetId()
|
print hypLen1.GetId()
|
||||||
@ -74,7 +74,7 @@ smeshgui.SetName(idlength, "Local_Length_100");
|
|||||||
|
|
||||||
hypNbSeg = []
|
hypNbSeg = []
|
||||||
print "-------------------------- NumberOfSegments"
|
print "-------------------------- NumberOfSegments"
|
||||||
hypNbSeg1 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so")
|
hypNbSeg1 = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine")
|
||||||
hypNbSeg1.SetDistrType(0)
|
hypNbSeg1.SetDistrType(0)
|
||||||
hypNbSeg1.SetNumberOfSegments(7)
|
hypNbSeg1.SetNumberOfSegments(7)
|
||||||
print hypNbSeg1.GetName()
|
print hypNbSeg1.GetName()
|
||||||
@ -84,7 +84,7 @@ idseg1 = salome.ObjectToID(hypNbSeg1)
|
|||||||
smeshgui.SetName(idseg1, "NumberOfSegmentsReg");
|
smeshgui.SetName(idseg1, "NumberOfSegmentsReg");
|
||||||
hypNbSeg.append(hypNbSeg1)
|
hypNbSeg.append(hypNbSeg1)
|
||||||
|
|
||||||
hypNbSeg2 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so")
|
hypNbSeg2 = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine")
|
||||||
hypNbSeg2.SetDistrType(1)
|
hypNbSeg2.SetDistrType(1)
|
||||||
hypNbSeg2.SetNumberOfSegments(7)
|
hypNbSeg2.SetNumberOfSegments(7)
|
||||||
hypNbSeg2.SetScaleFactor(2)
|
hypNbSeg2.SetScaleFactor(2)
|
||||||
@ -95,7 +95,7 @@ idseg2 = salome.ObjectToID(hypNbSeg2)
|
|||||||
smeshgui.SetName(idseg2, "NumberOfSegmentsScale");
|
smeshgui.SetName(idseg2, "NumberOfSegmentsScale");
|
||||||
hypNbSeg.append(hypNbSeg2)
|
hypNbSeg.append(hypNbSeg2)
|
||||||
|
|
||||||
hypNbSeg3 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so")
|
hypNbSeg3 = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine")
|
||||||
hypNbSeg3.SetDistrType(2)
|
hypNbSeg3.SetDistrType(2)
|
||||||
hypNbSeg3.SetNumberOfSegments(7)
|
hypNbSeg3.SetNumberOfSegments(7)
|
||||||
hypNbSeg3.SetTableFunction( [0, 0.1, 0.5, 1.0, 1.0, 0.1] )
|
hypNbSeg3.SetTableFunction( [0, 0.1, 0.5, 1.0, 1.0, 0.1] )
|
||||||
@ -107,7 +107,7 @@ idseg3 = salome.ObjectToID(hypNbSeg3)
|
|||||||
smeshgui.SetName(idseg3, "NumberOfSegmentsTable");
|
smeshgui.SetName(idseg3, "NumberOfSegmentsTable");
|
||||||
hypNbSeg.append(hypNbSeg3)
|
hypNbSeg.append(hypNbSeg3)
|
||||||
|
|
||||||
hypNbSeg4 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so")
|
hypNbSeg4 = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine")
|
||||||
hypNbSeg4.SetDistrType(3)
|
hypNbSeg4.SetDistrType(3)
|
||||||
hypNbSeg4.SetNumberOfSegments(10)
|
hypNbSeg4.SetNumberOfSegments(10)
|
||||||
hypNbSeg4.SetExpressionFunction("sin(3*t)")
|
hypNbSeg4.SetExpressionFunction("sin(3*t)")
|
||||||
@ -120,7 +120,7 @@ smeshgui.SetName(idseg4, "NumberOfSegmentsExpr");
|
|||||||
hypNbSeg.append(hypNbSeg4)
|
hypNbSeg.append(hypNbSeg4)
|
||||||
|
|
||||||
print "-------------------------- MaxElementArea"
|
print "-------------------------- MaxElementArea"
|
||||||
hypArea1 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so")
|
hypArea1 = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine")
|
||||||
hypArea1.SetMaxElementArea(2500)
|
hypArea1.SetMaxElementArea(2500)
|
||||||
print hypArea1.GetName()
|
print hypArea1.GetName()
|
||||||
print hypArea1.GetId()
|
print hypArea1.GetId()
|
||||||
@ -130,7 +130,7 @@ idarea1 = salome.ObjectToID(hypArea1)
|
|||||||
smeshgui.SetName(idarea1, "MaxElementArea_2500");
|
smeshgui.SetName(idarea1, "MaxElementArea_2500");
|
||||||
|
|
||||||
print "-------------------------- MaxElementArea"
|
print "-------------------------- MaxElementArea"
|
||||||
hypArea2 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so")
|
hypArea2 = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine")
|
||||||
hypArea2.SetMaxElementArea(500)
|
hypArea2.SetMaxElementArea(500)
|
||||||
print hypArea2.GetName()
|
print hypArea2.GetName()
|
||||||
print hypArea2.GetId()
|
print hypArea2.GetId()
|
||||||
@ -140,7 +140,7 @@ idarea2 = salome.ObjectToID(hypArea2)
|
|||||||
smeshgui.SetName(idarea2, "MaxElementArea_500");
|
smeshgui.SetName(idarea2, "MaxElementArea_500");
|
||||||
|
|
||||||
print "-------------------------- Regular_1D"
|
print "-------------------------- Regular_1D"
|
||||||
algoReg = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so")
|
algoReg = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine")
|
||||||
listHyp = algoReg.GetCompatibleHypothesis()
|
listHyp = algoReg.GetCompatibleHypothesis()
|
||||||
for hyp in listHyp:
|
for hyp in listHyp:
|
||||||
print hyp
|
print hyp
|
||||||
@ -151,7 +151,7 @@ idreg = salome.ObjectToID(algoReg)
|
|||||||
smeshgui.SetName(idreg, "Regular_1D");
|
smeshgui.SetName(idreg, "Regular_1D");
|
||||||
|
|
||||||
print "-------------------------- MEFISTO_2D"
|
print "-------------------------- MEFISTO_2D"
|
||||||
algoMef = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so")
|
algoMef = smesh.CreateHypothesis("MEFISTO_2D", "StdMeshersEngine")
|
||||||
listHyp = algoMef.GetCompatibleHypothesis()
|
listHyp = algoMef.GetCompatibleHypothesis()
|
||||||
for hyp in listHyp:
|
for hyp in listHyp:
|
||||||
print hyp
|
print hyp
|
||||||
|
@ -66,7 +66,7 @@ print "-------------------------- create Hypothesis"
|
|||||||
|
|
||||||
print "-------------------------- LocalLength"
|
print "-------------------------- LocalLength"
|
||||||
|
|
||||||
hypo1 = gen.CreateHypothesis("LocalLength", "libStdMeshersEngine.so")
|
hypo1 = gen.CreateHypothesis("LocalLength", "StdMeshersEngine")
|
||||||
print hypo1.GetName()
|
print hypo1.GetName()
|
||||||
print hypo1.GetId()
|
print hypo1.GetId()
|
||||||
print hypo1.GetLength()
|
print hypo1.GetLength()
|
||||||
@ -79,7 +79,7 @@ hyp3 = gen.CreateHypothesis("bidon", "")
|
|||||||
|
|
||||||
print "-------------------------- NumberOfSegments"
|
print "-------------------------- NumberOfSegments"
|
||||||
|
|
||||||
hypo3 = gen.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so")
|
hypo3 = gen.CreateHypothesis("NumberOfSegments", "StdMeshersEngine")
|
||||||
hypo3.SetNumberOfSegments(7)
|
hypo3.SetNumberOfSegments(7)
|
||||||
print hypo3.GetName()
|
print hypo3.GetName()
|
||||||
print hypo3.GetNumberOfSegments()
|
print hypo3.GetNumberOfSegments()
|
||||||
@ -87,7 +87,7 @@ print hypo3.GetId()
|
|||||||
|
|
||||||
print "-------------------------- MaxElementArea"
|
print "-------------------------- MaxElementArea"
|
||||||
|
|
||||||
hypo4 = gen.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so")
|
hypo4 = gen.CreateHypothesis("MaxElementArea", "StdMeshersEngine")
|
||||||
hypo4.SetMaxElementArea(5000)
|
hypo4.SetMaxElementArea(5000)
|
||||||
print hypo4.GetName()
|
print hypo4.GetName()
|
||||||
print hypo4.GetMaxElementArea()
|
print hypo4.GetMaxElementArea()
|
||||||
@ -95,7 +95,7 @@ print hypo4.GetId()
|
|||||||
|
|
||||||
print "-------------------------- Regular_1D"
|
print "-------------------------- Regular_1D"
|
||||||
|
|
||||||
algo_1 = gen.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so")
|
algo_1 = gen.CreateHypothesis("Regular_1D", "StdMeshersEngine")
|
||||||
print algo_1.GetName()
|
print algo_1.GetName()
|
||||||
print algo_1.GetId()
|
print algo_1.GetId()
|
||||||
listHyp = algo_1.GetCompatibleHypothesis()
|
listHyp = algo_1.GetCompatibleHypothesis()
|
||||||
@ -105,7 +105,7 @@ print algo_1.GetId()
|
|||||||
|
|
||||||
print "-------------------------- MEFISTO_2D"
|
print "-------------------------- MEFISTO_2D"
|
||||||
|
|
||||||
algo_2 = gen.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so")
|
algo_2 = gen.CreateHypothesis("MEFISTO_2D", "StdMeshersEngine")
|
||||||
print algo_2.GetName()
|
print algo_2.GetName()
|
||||||
print algo_2.GetId()
|
print algo_2.GetId()
|
||||||
listHyp = algo_2.GetCompatibleHypothesis()
|
listHyp = algo_2.GetCompatibleHypothesis()
|
||||||
|
@ -67,7 +67,7 @@ smeshgui.Init(salome.myStudyId)
|
|||||||
print "-------------------------- create Hypothesis"
|
print "-------------------------- create Hypothesis"
|
||||||
|
|
||||||
print "-------------------------- LocalLength"
|
print "-------------------------- LocalLength"
|
||||||
hypLen1 = smesh.CreateHypothesis("LocalLength", "libStdMeshersEngine.so")
|
hypLen1 = smesh.CreateHypothesis("LocalLength", "StdMeshersEngine")
|
||||||
hypLen1.SetLength(100)
|
hypLen1.SetLength(100)
|
||||||
print hypLen1.GetName()
|
print hypLen1.GetName()
|
||||||
print hypLen1.GetId()
|
print hypLen1.GetId()
|
||||||
@ -77,7 +77,7 @@ idlength = salome.ObjectToID(hypLen1)
|
|||||||
smeshgui.SetName(idlength, "Local_Length_100");
|
smeshgui.SetName(idlength, "Local_Length_100");
|
||||||
|
|
||||||
print "-------------------------- NumberOfSegments"
|
print "-------------------------- NumberOfSegments"
|
||||||
hypNbSeg1 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so")
|
hypNbSeg1 = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine")
|
||||||
hypNbSeg1.SetNumberOfSegments(7)
|
hypNbSeg1.SetNumberOfSegments(7)
|
||||||
print hypNbSeg1.GetName()
|
print hypNbSeg1.GetName()
|
||||||
print hypNbSeg1.GetId()
|
print hypNbSeg1.GetId()
|
||||||
@ -87,7 +87,7 @@ idseg = salome.ObjectToID(hypNbSeg1)
|
|||||||
smeshgui.SetName(idseg, "NumberOfSegments_7");
|
smeshgui.SetName(idseg, "NumberOfSegments_7");
|
||||||
|
|
||||||
print "-------------------------- MaxElementArea"
|
print "-------------------------- MaxElementArea"
|
||||||
hypArea1 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so")
|
hypArea1 = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine")
|
||||||
hypArea1.SetMaxElementArea(2500)
|
hypArea1.SetMaxElementArea(2500)
|
||||||
print hypArea1.GetName()
|
print hypArea1.GetName()
|
||||||
print hypArea1.GetId()
|
print hypArea1.GetId()
|
||||||
@ -97,7 +97,7 @@ idarea1 = salome.ObjectToID(hypArea1)
|
|||||||
smeshgui.SetName(idarea1, "MaxElementArea_2500");
|
smeshgui.SetName(idarea1, "MaxElementArea_2500");
|
||||||
|
|
||||||
print "-------------------------- MaxElementArea"
|
print "-------------------------- MaxElementArea"
|
||||||
hypArea2 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so")
|
hypArea2 = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine")
|
||||||
hypArea2.SetMaxElementArea(500)
|
hypArea2.SetMaxElementArea(500)
|
||||||
print hypArea2.GetName()
|
print hypArea2.GetName()
|
||||||
print hypArea2.GetId()
|
print hypArea2.GetId()
|
||||||
@ -107,7 +107,7 @@ idarea2 = salome.ObjectToID(hypArea2)
|
|||||||
smeshgui.SetName(idarea2, "MaxElementArea_500");
|
smeshgui.SetName(idarea2, "MaxElementArea_500");
|
||||||
|
|
||||||
print "-------------------------- Regular_1D"
|
print "-------------------------- Regular_1D"
|
||||||
algoReg = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so")
|
algoReg = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine")
|
||||||
listHyp = algoReg.GetCompatibleHypothesis()
|
listHyp = algoReg.GetCompatibleHypothesis()
|
||||||
for hyp in listHyp:
|
for hyp in listHyp:
|
||||||
print hyp
|
print hyp
|
||||||
@ -118,7 +118,7 @@ idreg = salome.ObjectToID(algoReg)
|
|||||||
smeshgui.SetName(idreg, "Regular_1D");
|
smeshgui.SetName(idreg, "Regular_1D");
|
||||||
|
|
||||||
print "-------------------------- MEFISTO_2D"
|
print "-------------------------- MEFISTO_2D"
|
||||||
algoMef = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so")
|
algoMef = smesh.CreateHypothesis("MEFISTO_2D", "StdMeshersEngine")
|
||||||
listHyp = algoMef.GetCompatibleHypothesis()
|
listHyp = algoMef.GetCompatibleHypothesis()
|
||||||
for hyp in listHyp:
|
for hyp in listHyp:
|
||||||
print hyp
|
print hyp
|
||||||
|
@ -17,15 +17,15 @@ idface = geompy.addToStudyInFather(box, face, name)
|
|||||||
box = salome.IDToObject(idbox)
|
box = salome.IDToObject(idbox)
|
||||||
face = salome.IDToObject(idface)
|
face = salome.IDToObject(idface)
|
||||||
|
|
||||||
hyp1 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so")
|
hyp1 = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine")
|
||||||
hyp1.SetNumberOfSegments(10)
|
hyp1.SetNumberOfSegments(10)
|
||||||
hyp2 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so")
|
hyp2 = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine")
|
||||||
hyp2.SetMaxElementArea(10)
|
hyp2.SetMaxElementArea(10)
|
||||||
hyp3 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so")
|
hyp3 = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine")
|
||||||
hyp3.SetMaxElementArea(100)
|
hyp3.SetMaxElementArea(100)
|
||||||
|
|
||||||
algo1 = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so")
|
algo1 = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine")
|
||||||
algo2 = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so")
|
algo2 = smesh.CreateHypothesis("MEFISTO_2D", "StdMeshersEngine")
|
||||||
|
|
||||||
mesh = smesh.CreateMesh(box)
|
mesh = smesh.CreateMesh(box)
|
||||||
mesh.AddHypothesis(box,hyp1)
|
mesh.AddHypothesis(box,hyp1)
|
||||||
|
@ -34,7 +34,7 @@ def CreateMesh (theFileName, area, len = None, nbseg = None):
|
|||||||
print "-------------------------- create Hypothesis"
|
print "-------------------------- create Hypothesis"
|
||||||
if (len is not None):
|
if (len is not None):
|
||||||
print "-------------------------- LocalLength"
|
print "-------------------------- LocalLength"
|
||||||
hypLength1 = smesh.CreateHypothesis("LocalLength", "libStdMeshersEngine.so")
|
hypLength1 = smesh.CreateHypothesis("LocalLength", "StdMeshersEngine")
|
||||||
hypLength1.SetLength(len)
|
hypLength1.SetLength(len)
|
||||||
print "Hypothesis type : ", hypLength1.GetName()
|
print "Hypothesis type : ", hypLength1.GetName()
|
||||||
print "Hypothesis ID : ", hypLength1.GetId()
|
print "Hypothesis ID : ", hypLength1.GetId()
|
||||||
@ -42,7 +42,7 @@ def CreateMesh (theFileName, area, len = None, nbseg = None):
|
|||||||
|
|
||||||
if (nbseg is not None):
|
if (nbseg is not None):
|
||||||
print "-------------------------- NumberOfSegments"
|
print "-------------------------- NumberOfSegments"
|
||||||
hypNbSeg1 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so")
|
hypNbSeg1 = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine")
|
||||||
hypNbSeg1.SetNumberOfSegments(nbseg)
|
hypNbSeg1.SetNumberOfSegments(nbseg)
|
||||||
print "Hypothesis type : ", hypNbSeg1.GetName()
|
print "Hypothesis type : ", hypNbSeg1.GetName()
|
||||||
print "Hypothesis ID : ", hypNbSeg1.GetId()
|
print "Hypothesis ID : ", hypNbSeg1.GetId()
|
||||||
@ -50,7 +50,7 @@ def CreateMesh (theFileName, area, len = None, nbseg = None):
|
|||||||
|
|
||||||
if (area == "LengthFromEdges"):
|
if (area == "LengthFromEdges"):
|
||||||
print "-------------------------- LengthFromEdges"
|
print "-------------------------- LengthFromEdges"
|
||||||
hypLengthFromEdges = smesh.CreateHypothesis("LengthFromEdges", "libStdMeshersEngine.so")
|
hypLengthFromEdges = smesh.CreateHypothesis("LengthFromEdges", "StdMeshersEngine")
|
||||||
hypLengthFromEdges.SetMode(1)
|
hypLengthFromEdges.SetMode(1)
|
||||||
print "Hypothesis type : ", hypLengthFromEdges.GetName()
|
print "Hypothesis type : ", hypLengthFromEdges.GetName()
|
||||||
print "Hypothesis ID : ", hypLengthFromEdges.GetId()
|
print "Hypothesis ID : ", hypLengthFromEdges.GetId()
|
||||||
@ -58,7 +58,7 @@ def CreateMesh (theFileName, area, len = None, nbseg = None):
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
print "-------------------------- MaxElementArea"
|
print "-------------------------- MaxElementArea"
|
||||||
hypArea1 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so")
|
hypArea1 = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine")
|
||||||
hypArea1.SetMaxElementArea(area)
|
hypArea1.SetMaxElementArea(area)
|
||||||
print "Hypothesis type : ", hypArea1.GetName()
|
print "Hypothesis type : ", hypArea1.GetName()
|
||||||
print "Hypothesis ID : ", hypArea1.GetId()
|
print "Hypothesis ID : ", hypArea1.GetId()
|
||||||
@ -66,7 +66,7 @@ def CreateMesh (theFileName, area, len = None, nbseg = None):
|
|||||||
|
|
||||||
|
|
||||||
print "-------------------------- Regular_1D"
|
print "-------------------------- Regular_1D"
|
||||||
algoReg = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so")
|
algoReg = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine")
|
||||||
|
|
||||||
listHyp = algoReg.GetCompatibleHypothesis()
|
listHyp = algoReg.GetCompatibleHypothesis()
|
||||||
for hyp in listHyp:
|
for hyp in listHyp:
|
||||||
@ -76,7 +76,7 @@ def CreateMesh (theFileName, area, len = None, nbseg = None):
|
|||||||
print "Algo ID : ", algoReg.GetId()
|
print "Algo ID : ", algoReg.GetId()
|
||||||
|
|
||||||
print "-------------------------- MEFISTO_2D"
|
print "-------------------------- MEFISTO_2D"
|
||||||
algoMef = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so")
|
algoMef = smesh.CreateHypothesis("MEFISTO_2D", "StdMeshersEngine")
|
||||||
|
|
||||||
listHyp = algoMef.GetCompatibleHypothesis()
|
listHyp = algoMef.GetCompatibleHypothesis()
|
||||||
for hyp in listHyp:
|
for hyp in listHyp:
|
||||||
|
@ -92,7 +92,7 @@ class Mesh_Algorithm:
|
|||||||
"""
|
"""
|
||||||
return self.algo
|
return self.algo
|
||||||
|
|
||||||
def Create(self, mesh, geom, hypo, so="libStdMeshersEngine.so"):
|
def Create(self, mesh, geom, hypo, so="StdMeshersEngine"):
|
||||||
"""
|
"""
|
||||||
Private method
|
Private method
|
||||||
"""
|
"""
|
||||||
@ -113,7 +113,7 @@ class Mesh_Algorithm:
|
|||||||
SetName(self.algo, name + "/" + hypo)
|
SetName(self.algo, name + "/" + hypo)
|
||||||
mesh.mesh.AddHypothesis(self.geom, self.algo)
|
mesh.mesh.AddHypothesis(self.geom, self.algo)
|
||||||
|
|
||||||
def Hypothesis(self, hyp, args=[], so="libStdMeshersEngine.so"):
|
def Hypothesis(self, hyp, args=[], so="StdMeshersEngine"):
|
||||||
"""
|
"""
|
||||||
Private method
|
Private method
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user