smesh/doc/salome/gui/SMESH/viewing_meshes.htm

189 lines
5.5 KiB
HTML
Raw Normal View History

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; }
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>
<script type="text/javascript" language="javascript1.2">
2005-11-28 14:57:47 +05:00
<!--
if (window.gbWhTopic)
{
if (window.setRelStartPage)
2005-11-28 14:57:47 +05:00
{
addTocInfo("MESH module\nTUI Scripts\nViewing Meshes");
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)
{
setRelStartPage("index.htm");
2005-11-28 14:57:47 +05:00
autoSync(1);
sendSyncInfo();
sendAveInfoOut();
}
2005-11-28 14:57:47 +05:00
}
else
if (window.gbIE4)
document.location.reload();
//-->
</script>
</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>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">import
geompy</span></p>
<p class="whs1">import smesh</p>
2005-11-28 14:57:47 +05:00
<p class="whs1">&nbsp;</p>
<p class="whs2"># create a box</p>
2005-11-28 14:57:47 +05:00
<p class="whs1">box = geompy.MakeBox(0., 0., 0., 20.,
20., 20.)</p>
2005-11-28 14:57:47 +05:00
<p class="whs1">geompy.addToStudy(box, &quot;box&quot;)</p>
2005-11-28 14:57:47 +05:00
<p class="whs1">&nbsp;</p>
<p class="whs2"># create a mesh</p>
2005-11-28 14:57:47 +05:00
<p class="whs1">tetra = smesh.Mesh(box, &quot;MeshBox&quot;)</p>
2005-11-28 14:57:47 +05:00
<p class="whs1">&nbsp;</p>
<p class="whs1">algo1D = tetra.Segment()</p>
2005-11-28 14:57:47 +05:00
<p class="whs1">algo1D.NumberOfSegments(3)</p>
2005-11-28 14:57:47 +05:00
<p class="whs1">&nbsp;</p>
<p class="whs1">algo2D = tetra.Triangle()</p>
2005-11-28 14:57:47 +05:00
<p class="whs1">algo2D.MaxElementArea(10.)</p>
2005-11-28 14:57:47 +05:00
<p class="whs1">&nbsp;</p>
<p class="whs1">algo3D = tetra.Tetrahedron(smesh.NETGEN)</p>
2005-11-28 14:57:47 +05:00
<p class="whs1">algo3D.MaxElementVolume(900.)</p>
2005-11-28 14:57:47 +05:00
<p class="whs1">&nbsp;</p>
<p class="whs2"># compute the mesh</p>
2005-11-28 14:57:47 +05:00
<p class="whs1">tetra.Compute()</p>
2005-11-28 14:57:47 +05:00
<p class="whs1">&nbsp;</p>
<p class="whs2"># print informations
about the mesh</p>
2005-11-28 14:57:47 +05:00
<p class="whs1">mesh = tetra.GetMesh()</p>
2005-11-28 14:57:47 +05:00
<p class="whs1">print &quot;Information about mesh:&quot;</p>
<p class="whs1">print &quot;Number of nodes &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
&quot;, mesh.NbNodes()</p>
<p class="whs1">print &quot;Number of edges &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
&quot;, mesh.NbEdges()</p>
<p class="whs1">print &quot;Number of faces &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
&quot;, mesh.NbFaces()</p>
<p class="whs1">print &quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;triangles
&nbsp;&nbsp;:
2005-11-28 14:57:47 +05:00
&quot;, mesh.NbTriangles()</p>
<p class="whs1">print &quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;quadrangles
: &quot;, mesh.NbQuadrangles()</p>
2005-11-28 14:57:47 +05:00
<p class="whs1">print &quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;polygons
&nbsp;&nbsp;&nbsp;:
2005-11-28 14:57:47 +05:00
&quot;, mesh.NbPolygons()</p>
<p class="whs1">print &quot;Number of volumes &nbsp;&nbsp;&nbsp;&nbsp;:
&quot;, mesh.NbVolumes()</p>
<p class="whs1">print &quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tetrahedrons:
&quot;, mesh.NbTetras()</p>
2005-11-28 14:57:47 +05:00
<p class="whs1">print &quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hexahedrons
: &quot;, mesh.NbHexas()</p>
2005-11-28 14:57:47 +05:00
<p class="whs1">print &quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prisms
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
2005-11-28 14:57:47 +05:00
&quot;, mesh.NbPrisms()</p>
<p class="whs1">print &quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pyramids
&nbsp;&nbsp;&nbsp;:
2005-11-28 14:57:47 +05:00
&quot;, mesh.NbPyramids()</p>
<p class="whs1">print &quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;polyhedrons
: &quot;, mesh.NbPolyhedrons() </p>
2005-11-28 14:57:47 +05:00
<script type="text/javascript" language="javascript1.2">
<!--
if (window.writeIntopicBar)
writeIntopicBar(0);
//-->
</script>
</body>
</html>