📄 mainteam7test.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 <math.h>#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->addBox(rAlu, 0.0,lAlu, 0.0,lAlu, 0.0,hAlu); alu->addBox(rHole, bHole,eHole, bHole,eHole, 0.0,hAlu); alu->setBorder(-envAlu,uAlu,-envAlu,uAlu,-envAlu,hAlu+envAlu); alu->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& cc = * new wz2DroundedBox(mCoil,mCoil,2*mCoil); cc.shift(xCoil,yCoil); wz3dmap c3 = new wz3Dcylindrical(&cc); cogenOctree coilbase = new CogenOctree(); coilbase->addBox(rCoil, radius-dCoil,radius, cc.chart.min[1],cc.chart.max[1], bCoil,eCoil); coilbase->setBorder(0,2*radius, cc.chart.min[1],cc.chart.max[1],-50,eCoil+100); coilbase->refinementGlobal(20,40,50); coilbase->omitEdgeComputation(); cogenOctree coilinside = new CogenOctree(); coilinside->setBorder(xCoil-mCoil,xCoil+mCoil, yCoil-mCoil,yCoil+mCoil, bCoil,eCoil); coilinside->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->addPlaneZ(bCoil-10); coilbase->addPlaneZ(hAlu); coilbase->addPlaneZ(hAlu+envAlu); coilbase->addPlaneZ(0.0); coilbase->addPlaneZ(-envAlu); coilinside->addPlaneZ(bCoil-10); coilinside->addPlaneZ(hAlu); coilinside->addPlaneZ(hAlu+envAlu); coilinside->addPlaneZ(0.0); coilinside->addPlaneZ(-envAlu); cogenChart coil = new CogenChart(coilbase->generator(),c3); cogenComposite gen = new CogenUnion; gen->add(alu->generator()); gen->add(coil->generator()); gen->add(coilinside->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 + -