2005-11-28 14:57:47 +05:00
<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
< html >
< head >
< title > Viewing Meshes< / title >
< meta http-equiv = "content-type" content = "text/html; charset=windows-1252" >
< meta name = "generator" content = "RoboHelp by eHelp Corporation www.ehelp.com" > < style type = "text/css" >
<!--
p.whs1 { font-family:'Lucida Console' , monospace; margin-top:0pt; margin-bottom:0pt; }
p.whs2 { margin-top:0pt; margin-bottom:0pt; font-family:'Times New Roman' , serif; }
-->
< / style > < script type = "text/javascript" language = "JavaScript" >
<!--
if ((navigator.appName == "Netscape") & & (parseInt(navigator.appVersion) == 4))
{
var strNSS = "< style type = 'text/css' > " ;
strNSS += "p.whs1 {margin-top:1pt;margin-bottom:1pt; }";
strNSS += "p.whs2 {margin-top:1pt;margin-bottom:1pt; }";
strNSS +="< / style > ";
document.write(strNSS);
}
//-->
< / script >
< script type = "text/javascript" language = "JavaScript" title = "WebHelpInlineScript" >
<!--
function reDo() {
if (innerWidth != origWidth || innerHeight != origHeight)
location.reload();
}
if ((parseInt(navigator.appVersion) == 4) & & (navigator.appName == "Netscape")) {
origWidth = innerWidth;
origHeight = innerHeight;
onresize = reDo;
}
onerror = null;
//-->
< / script >
< style type = "text/css" >
<!--
div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }
2006-06-01 17:39:17 +06:00
p.WebHelpNavBar { text-align:right; }
2005-11-28 14:57:47 +05:00
-->
< / style > < script type = "text/javascript" language = "javascript1.2" src = "whmsg.js" > < / script >
< script type = "text/javascript" language = "javascript" src = "whver.js" > < / script >
< script type = "text/javascript" language = "javascript1.2" src = "whproxy.js" > < / script >
< script type = "text/javascript" language = "javascript1.2" src = "whutils.js" > < / script >
< script type = "text/javascript" language = "javascript1.2" src = "whtopic.js" > < / script >
2006-06-01 17:39:17 +06:00
< script type = "text/javascript" language = "javascript1.2" >
2005-11-28 14:57:47 +05:00
<!--
if (window.gbWhTopic)
{
2006-06-01 17:39:17 +06:00
if (window.setRelStartPage)
2005-11-28 14:57:47 +05:00
{
addTocInfo("MESH module\nTUI Scripts\nViewing Meshes");
2006-06-01 17:39:17 +06:00
addButton("show",BTN_IMG,"Show","","","","",0,0,"whd_show0.gif","whd_show2.gif","whd_show1.gif");
addButton("hide",BTN_IMG,"Hide","","","","",0,0,"whd_hide0.gif","whd_hide2.gif","whd_hide1.gif");
2005-11-28 14:57:47 +05:00
}
if (window.setRelStartPage)
{
2006-06-01 17:39:17 +06:00
setRelStartPage("index.htm");
2005-11-28 14:57:47 +05:00
autoSync(1);
sendSyncInfo();
sendAveInfoOut();
}
2006-06-01 17:39:17 +06:00
2005-11-28 14:57:47 +05:00
}
else
if (window.gbIE4)
document.location.reload();
//-->
< / script >
2006-06-01 17:39:17 +06:00
< / head >
< body > < script type = "text/javascript" language = "javascript1.2" >
<!--
if (window.writeIntopicBar)
writeIntopicBar(4);
//-->
< / script >
2005-11-28 14:57:47 +05:00
< h1 > Viewing Meshes< / h1 >
< h3 > Viewing Mesh Infos< / h3 >
2006-06-08 20:05:08 +06:00
< p > Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use < b > smesh< / b > package.
< br >
2005-11-28 14:57:47 +05:00
< p class = "whs1" > import salome< / p >
< p class = "whs1" > import geompy< / p >
< p class = "whs1" > import SMESH< / p >
< p class = "whs1" > import StdMeshers< / p >
< p class = "whs1" > < / p >
< p class = "whs1" > smesh = salome.lcc.FindOrLoadComponent(" FactoryServer" ,
" SMESH" )< / p >
< p class = "whs1" > smesh.SetCurrentStudy(salome.myStudy)< / p >
< p class = "whs1" > < / p >
< p class = "whs1" > box =
geompy.MakeBox(0., 0., 0., 20., 20., 20.)< / p >
< p class = "whs1" > idbox = geompy.addToStudy(box, " box" )< / p >
< p class = "whs1" > < / p >
< p class = "whs1" > subShapeList = geompy.SubShapeAll(box,
geompy.ShapeType[" EDGE" ])< / p >
< p class = "whs1" > edge =
subShapeList[0]< / p >
< p class = "whs1" > name =
geompy.SubShapeName(edge, box)< / p >
< p class = "whs1" > idedge = geompy.addToStudyInFather(box,
edge, name)< / p >
< p class = "whs1" > < / p >
< p class = "whs1" > box =
salome.IDToObject(idbox)< / p >
< p class = "whs1" > edge = salome.IDToObject(idedge)< / p >
< p class = "whs1" > < / p >
< p class = "whs1" > hyp1 = smesh.CreateHypothesis(" NumberOfSegments" ,
" libStdMeshersEngine.so" )< / p >
< p class = "whs1" > hyp1.SetNumberOfSegments(3)< / p >
< p class = "whs1" > hyp2 = smesh.CreateHypothesis(" MaxElementArea" ,
" libStdMeshersEngine.so" )< / p >
< p class = "whs1" > hyp2.SetMaxElementArea(10)< / p >
< p class = "whs1" > hyp3 = smesh.CreateHypothesis(" Arithmetic1D" ,
" libStdMeshersEngine.so" )< / p >
< p class = "whs1" > hyp3.SetLength(1,1)< / p >
< p class = "whs1" > hyp3.SetLength(6,0)< / p >
< p class = "whs1" > hyp4 = smesh.CreateHypothesis(" Propagation" ,
" libStdMeshersEngine.so" )< / p >
< p class = "whs1" > < / p >
< p class = "whs1" > algo1 = smesh.CreateHypothesis(" Regular_1D" ,
" libStdMeshersEngine.so" )< / p >
< p class = "whs1" > algo2 = smesh.CreateHypothesis(" MEFISTO_2D" ,
" libStdMeshersEngine.so" )< / p >
< p class = "whs1" > mesh = smesh.CreateMesh(box)< / p >
< p class = "whs1" > < / p >
< p class = "whs1" > mesh.AddHypothesis(box,hyp1)< / p >
< p class = "whs1" > mesh.AddHypothesis(box,hyp2)< / p >
< p class = "whs1" > mesh.AddHypothesis(box,algo1)< / p >
< p class = "whs1" > mesh.AddHypothesis(box,algo2)< / p >
< p class = "whs1" > mesh.AddHypothesis(edge,hyp3)< / p >
< p class = "whs1" > mesh.AddHypothesis(edge,hyp4)< / p >
< p class = "whs1" > mesh.AddHypothesis(edge,algo1)< / p >
< p class = "whs1" > smesh.Compute(mesh,box)< / p >
< p class = "whs1" > salome.sg.updateObjBrowser(1)< / p >
< p class = "whs1" > < / p >
< p class = "whs2" > # remove one hypothesis< / p >
< p class = "whs1" > mesh.RemoveHypothesis(edge,hyp4)< / p >
< p class = "whs1" > smesh.Compute(mesh,box)< / p >
< p class = "whs1" > salome.sg.updateObjBrowser(1)< / p >
< p class = "whs1" > < / p >
< p class = "whs2" > # change the value
of the hypothesis< / p >
< p class = "whs1" > hyp2.SetMaxElementArea(2)< / p >
< p class = "whs1" > mesh.AddHypothesis(box,hyp2)< / p >
< p class = "whs1" > smesh.Compute(mesh,box)< / p >
< p class = "whs1" > print " Information about mesh:" < / p >
< p class = "whs1" > print " Number of nodes :
" , mesh.NbNodes()< / p >
< p class = "whs1" > print " Number of edges :
" , mesh.NbEdges()< / p >
< p class = "whs1" > print " Number of faces :
" , mesh.NbFaces()< / p >
< p class = "whs1" > print " Number of triangles :
" , mesh.NbTriangles()< / p >
< p class = "whs1" > print " Number of quadrangles : " ,
mesh.NbQuadrangles()< / p >
< p class = "whs1" > print " Number of polygons :
" , mesh.NbPolygons()< / p >
< p class = "whs1" > print " Number of volumes :
" , mesh.NbVolumes()< / p >
< p class = "whs1" > print " Number of tetrahedrons: " ,
mesh.NbTetras()< / p >
< p class = "whs1" > print " Number of hexahedrons : " ,
mesh.NbHexas()< / p >
< p class = "whs1" > print " Number of prisms :
" , mesh.NbPrisms()< / p >
< p class = "whs1" > print " Number of pyramids :
" , mesh.NbPyramids()< / p >
< p class = "whs1" > print " Number of polyhedrons : " ,
mesh.NbPolyhedrons()< / p >
< p class = "whs1" > salome.sg.updateObjBrowser(1) < / p >
< p class = "whs1" > < / p >
< script type = "text/javascript" language = "javascript1.2" >
<!--
if (window.writeIntopicBar)
writeIntopicBar(0);
//-->
< / script >
< / body >
< / html >