⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainteam7test.html

📁 Delaunay三角形的网格剖分程序
💻 HTML
字号:
<TITLE>COG 2.1: TEAM example 7</TITLE><H1>TEAM example nr.7</H1> <P>This is a grid to describe the geometry of the TEAM (TestingElectromagnetic Analysis Methods) Workshops nr. 7.  It contains analuminium plate with a rectangular hole and a coil over the plate: <P><IMG SRC="team7test.gif"><PRE>#include &lt;math.h&gt;#include "<A HREF="coglib.hxx">cog/coglib.hxx</A>"</PRE> <P>First, we introduce self-commenting names for regions, faces andthe distances we need:<PRE>wzRegion rAir  = 1;wzRegion rAlu  = 2;wzRegion rCoil = 3;wzRegion rHole = 4;wzFloat lAlu  = 294, hAlu  =  19;	// sizes of the aluminium platewzFloat bHole =  18, eHole = 126;	// sizes of the hole in the platewzFloat lCoil = 200, dCoil =  25;	// sizes of the coilwzFloat bCoil = hAlu  +  30;	// minimal z-value of the coilwzFloat eCoil = bCoil + 100;	// maximal z-value of the coilwzFloat radius = 50;	// radius of the rounded part of the coilwzFloat envAlu = 15;	// environment of the aluminium plate discretizedwzFloat uAlu = lAlu+envAlu;	// upper limit for aluminium gridint main(){</PRE> <P>This defines the aluminium plate:<PRE>  cogenOctree alu = new CogenOctree();  alu-&gt;addBox(rAlu,  0.0,lAlu,    0.0,lAlu,    0.0,hAlu);  alu-&gt;addBox(rHole, bHole,eHole,	bHole,eHole, 0.0,hAlu);  alu-&gt;setBorder(-envAlu,uAlu,-envAlu,uAlu,-envAlu,hAlu+envAlu);  alu-&gt;refinementGlobal(20,20,10);</PRE> <P>For the coil we use two systems of coordinates: rectangularcoordinates inside (<B>coilinside</B>) and a "rounded box" (acombination of rectangular coordinates and polar coordinates near thecorners) for the coil itself and the domain outside (<B>coilbase,coil</B>).<PRE>  wzFloat yCoil=lCoil/2,xCoil=lAlu-yCoil,mCoil=yCoil-radius;  wz2DroundedBox&amp; cc = * new      	wz2DroundedBox(mCoil,mCoil,2*mCoil);  cc.shift(xCoil,yCoil);  wz3dmap c3 = new wz3Dcylindrical(&amp;cc);  cogenOctree coilbase = new CogenOctree();  coilbase-&gt;addBox(rCoil, radius-dCoil,radius,      	cc.chart.min[1],cc.chart.max[1], bCoil,eCoil);  coilbase-&gt;setBorder(0,2*radius, cc.chart.min[1],cc.chart.max[1],-50,eCoil+100);  coilbase-&gt;refinementGlobal(20,40,50);  coilbase-&gt;omitEdgeComputation();  cogenOctree coilinside = new CogenOctree();  coilinside-&gt;setBorder(xCoil-mCoil,xCoil+mCoil,      	yCoil-mCoil,yCoil+mCoil, bCoil,eCoil);  coilinside-&gt;refinementGlobal(40,40,50);</PRE> <P>To add some planes which are part of the other grid increases gridquality in the intermediate region:<PRE>  coilbase-&gt;addPlaneZ(bCoil-10);  coilbase-&gt;addPlaneZ(hAlu);  coilbase-&gt;addPlaneZ(hAlu+envAlu);  coilbase-&gt;addPlaneZ(0.0);  coilbase-&gt;addPlaneZ(-envAlu);  coilinside-&gt;addPlaneZ(bCoil-10);  coilinside-&gt;addPlaneZ(hAlu);  coilinside-&gt;addPlaneZ(hAlu+envAlu);  coilinside-&gt;addPlaneZ(0.0);  coilinside-&gt;addPlaneZ(-envAlu);  cogenChart coil = new CogenChart(coilbase-&gt;generator(),c3);  cogenComposite gen = new CogenUnion;  gen-&gt;add(alu-&gt;generator());  gen-&gt;add(coil-&gt;generator());  gen-&gt;add(coilinside-&gt;generator());  wzgrid grid = (*gen)();</PRE> <P>What remains is to define the material numbers - they are usefulin our output function - and to look at the grid:<PRE>  rAir.material()  = rAir;  rAlu.material()  = rAlu;  rCoil.material() = rCoil;  rHole.material() = rAir;  grid->write("test.sg");}</PRE>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -