2005-11-28 14:57:47 +05:00
|
|
|
<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
|
|
|
|
|
|
|
|
<html>
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<title>Constructing 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">
|
|
|
|
<!--
|
2006-07-14 16:40:47 +06:00
|
|
|
p.whs1 { margin-top:0pt; margin-bottom:0pt; }
|
|
|
|
p.whs2 { margin-top:0pt; margin-bottom:0pt; font-family:'Lucida Console' , monospace; }
|
|
|
|
p.whs3 { margin-top:0pt; margin-bottom:0pt; font-family:'Times New Roman' , serif; }
|
|
|
|
p.whs4 { font-family:'Lucida Console' , monospace; margin-top:0px; margin-bottom:0px; }
|
2005-11-28 14:57:47 +05:00
|
|
|
p.whs5 { margin-top:0px; margin-bottom:0px; font-family:'Times New Roman' , serif; }
|
2006-07-14 16:40:47 +06:00
|
|
|
p.whs6 { margin-top:0px; margin-bottom:0px; }
|
|
|
|
p.whs7 { margin-top:0px; margin-bottom:0px; font-family:'Lucida Console' , monospace; }
|
2005-11-28 14:57:47 +05:00
|
|
|
-->
|
|
|
|
</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 += "p.whs3 {margin-top:1pt;margin-bottom:1pt; }";
|
|
|
|
strNSS += "p.whs4 {margin-top:1pt;margin-bottom:1pt; }";
|
|
|
|
strNSS += "p.whs5 {margin-top:1pt;margin-bottom:1pt; }";
|
2006-07-14 16:40:47 +06:00
|
|
|
strNSS += "p.whs6 {margin-top:1pt;margin-bottom:1pt; }";
|
|
|
|
strNSS += "p.whs7 {margin-top:1pt;margin-bottom:1pt; }";
|
2005-11-28 14:57:47 +05:00
|
|
|
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\nCreating 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>Creating Meshes</h1>
|
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs1">First of all see <a href="smesh_py_introduction.htm">Example
|
|
|
|
of 3d mesh generation</a>, which is an example of good python script style
|
|
|
|
for Mesh module. </p>
|
2006-06-08 20:05:08 +06:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs1">Other examples of python
|
|
|
|
scripts will be also updated soon to use smesh package instead of direct
|
|
|
|
usage of idl interface. </p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<h3><a name=bookmark>Construction of a Mesh</a></h3>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">import
|
|
|
|
geompy</span></p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs2">import smesh</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
|
|
|
<p class="whs2"> </p>
|
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs3"># create a box</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs2">box = geompy.MakeBox(0.,
|
2005-11-28 14:57:47 +05:00
|
|
|
0., 0., 100., 200., 300.)</p>
|
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs2">idbox = geompy.addToStudy(box,
|
2005-11-28 14:57:47 +05:00
|
|
|
"box")</p>
|
|
|
|
|
|
|
|
<p class="whs2"> </p>
|
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs3"># create a mesh</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs2">tetra = smesh.Mesh(box,
|
|
|
|
"MeshBox")</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
|
|
|
<p class="whs2"> </p>
|
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs2">algo1D = tetra.Segment()</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs2">algo1D.NumberOfSegments(7)</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs2"> </p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs2">algo2D = tetra.Triangle()</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs2">algo2D.MaxElementArea(800.)</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
|
|
|
<p class="whs2"> </p>
|
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs2">algo3D = tetra.Tetrahedron(smesh.NETGEN)</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs2">algo3D.MaxElementVolume(900.)</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
|
|
|
<p class="whs2"> </p>
|
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs3"># compute the mesh</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs2">ret = tetra.Compute()</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs2">if ret == 0:</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs2"> print
|
|
|
|
"problem when computing the mesh"</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs2">else:</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs2"> print
|
|
|
|
"mesh computed"</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs2"> pass
|
|
|
|
</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
|
|
|
<p class="whs2"> </p>
|
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs2"> </p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
|
|
|
<h3><a name=bookmark1>Construction of a Submesh</a></h3>
|
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4"><span style="font-family: 'Lucida Console', monospace;">from
|
2005-11-28 14:57:47 +05:00
|
|
|
geompy import *</span></p>
|
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">import smesh</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs5"># create a box</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">box = MakeBoxDXDYDZ(10., 10., 10.)</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">addToStudy(box, "Box")</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs5"># select one edge of
|
|
|
|
the box for definition of a local hypothesis</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">p5 = MakeVertex(5., 0., 0.)</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">EdgeX = GetEdgeNearPoint(box, p5)</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">addToStudyInFather(box, EdgeX, "Edge
|
|
|
|
[0,0,0 - 10,0,0]")</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs5"># create a hexahedral
|
|
|
|
mesh on the box</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">quadra = smesh.Mesh(box, "Box : quadrangle
|
|
|
|
2D mesh")</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs5"># create a regular
|
|
|
|
1D algorithm for the faces</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">algo1D = quadra.Segment()</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs5"># define "NumberOfSegments"
|
|
|
|
hypothesis to cut</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs5"># all the edges in
|
|
|
|
a fixed number of segments</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">algo1D.NumberOfSegments(4)</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs5"># create a quadrangle
|
|
|
|
2D algorithm for the faces</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">quadra.Quadrangle()</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs5"># construct a submesh
|
|
|
|
on the edge with a local hypothesis</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">algo_local = quadra.Segment(EdgeX)</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs5"># define "Arithmetic1D"
|
|
|
|
hypothesis to cut the edge<span style="margin-top: 0px;
|
|
|
|
margin-bottom: 0px;
|
|
|
|
font-family: 'Times New Roman', serif;">
|
|
|
|
in several segments with increasing arithmetic length</span></p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">algo_local.Arithmetic1D(1, 4)</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs5"># define "Propagation"
|
|
|
|
hypothesis that propagates all other hypotheses</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs5"># on all edges of the
|
|
|
|
opposite side in case of quadrangular faces</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">algo_local.Propagation()</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs5"># compute the mesh</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">quadra.Compute() </p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
|
|
|
|
<h3><a name=bookmark2>Editing of a mesh</a></h3>
|
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4"><span style="font-family: 'Lucida Console', monospace;">import
|
|
|
|
geompy</span></p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">import smesh</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4"> </p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">def PrintMeshInfo(theMesh):</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4"> aMesh
|
|
|
|
= theMesh.GetMesh()</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4"> print
|
|
|
|
"Information about mesh:"</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4"> print
|
|
|
|
"Number of nodes :
|
|
|
|
", aMesh.NbNodes()</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4"> print
|
|
|
|
"Number of edges :
|
|
|
|
", aMesh.NbEdges()</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4"> print
|
|
|
|
"Number of faces :
|
|
|
|
", aMesh.NbFaces()</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4"> print
|
|
|
|
"Number of volumes :
|
|
|
|
", aMesh.NbVolumes()</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4"> pass</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4"> </p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs5"># create a box</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">box = geompy.MakeBox(0., 0., 0., 20.,
|
|
|
|
20., 20.)</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">geompy.addToStudy(box, "box")</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4"> </p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs5"># select one edge of
|
|
|
|
the box for definition of a local hypothesis</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">subShapeList = geompy.SubShapeAll(box,
|
|
|
|
geompy.ShapeType["EDGE"])</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">edge = subShapeList[0]</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">name = geompy.SubShapeName(edge, box)</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">geompy.addToStudyInFather(box, edge, name)</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4"> </p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs5"># create a mesh</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">tria = smesh.Mesh(box, "Mesh 2D")</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">algo1D = tria.Segment()</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">hyp1 = algo1D.NumberOfSegments(3)</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">algo2D = tria.Triangle()</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">hyp2 = algo2D.MaxElementArea(10.)</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4"> </p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs5"># create a sub-mesh</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">algo_local = tria.Segment(edge)</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">hyp3 = algo_local.Arithmetic1D(1, 6)</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">hyp4 = algo_local.Propagation()</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4"> </p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs5"># compute the mesh</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">tria.Compute()</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">PrintMeshInfo(tria)</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4"> </p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs5"># remove a local hypothesis</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">mesh = tria.GetMesh()</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">mesh.RemoveHypothesis(edge, hyp4)</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4"> </p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs5"># compute the mesh</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">tria.Compute()</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">PrintMeshInfo(tria)</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4"> </p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
|
|
|
<p class="whs5"># change the value
|
2006-07-14 16:40:47 +06:00
|
|
|
of the 2D hypothesis</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">hyp2.SetMaxElementArea(2.)</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs5"># compute the mesh</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">tria.Compute()</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs4">PrintMeshInfo(tria) </p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs6"> </p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<h3><a name=bookmark3>Export of a Mesh</a></h3>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs7">import geompy</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs7">import smesh</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs6"> </p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs6"># create a box</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs7">box = geompy.MakeBox(0.,
|
2005-11-28 14:57:47 +05:00
|
|
|
0., 0., 100., 200., 300.)</p>
|
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs7">idbox = geompy.addToStudy(box,
|
2005-11-28 14:57:47 +05:00
|
|
|
"box")</p>
|
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs6"> </p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs6"># create a mesh</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs7">tetra = smesh.Mesh(box,
|
2005-11-28 14:57:47 +05:00
|
|
|
"MeshBox")</p>
|
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs6"> </p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs7">algo1D = tetra.Segment()</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs7">algo1D.NumberOfSegments(7)</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs7"> </p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs7">algo2D = tetra.Triangle()</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs7">algo2D.MaxElementArea(800.)</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs7"> </p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs7">algo3D = tetra.Tetrahedron(smesh.NETGEN)</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs7">algo3D.MaxElementVolume(900.)</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs6"> </p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs6"># compute the mesh</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs7">tetra.Compute()</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs6"> </p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs6"># export the mesh in a
|
|
|
|
MED file</p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
2006-07-14 16:40:47 +06:00
|
|
|
<p class="whs7">tetra.ExportMED("/tmp/meshMED.med",
|
|
|
|
0) </p>
|
2005-11-28 14:57:47 +05:00
|
|
|
|
|
|
|
<script type="text/javascript" language="javascript1.2">
|
|
|
|
<!--
|
|
|
|
if (window.writeIntopicBar)
|
|
|
|
writeIntopicBar(0);
|
|
|
|
//-->
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|