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

📄 mainoiltest.html

📁 Delaunay三角形的网格剖分程序
💻 HTML
字号:
<TITLE>COG 2.1: A bore-hole</TITLE><PRE>#include "<A HREF="coglib.hxx">cog/coglib.hxx</A>"#include &lt;math.h&gt;</PRE><H1>3D Example application: a bore-hole</H1> <P>In this example application we want to create a 3D grid with athin bore-hole consisting of a vertical part with isolation and anon-isolated horizontal part: <P><IMG SRC="oiltest.gif"><PRE>static wzRegion Ground(2);static wzRegion BoreHole(3);static wzRegion Isolation(4);static wzFace	Hole(2);  // boundary condition for the upper end of the hole.</PRE> <P>The problematic point is the relation between the distanceparameters: the diameter of the hole layer is bore-hole is 10,000times the diameter of the bore-hole. This requires highlyanisotropical grids to reduce the number of points.<PRE>static wzFloat H = 1;static wzFloat h = H / 2;static wzFloat d = H/100;static wzFloat D = 1.4 * d;static wzFloat l = 1.5*H; //5 * H;static wzFloat R = 100*H; //100 * H;</PRE> <P>We use three systems of coordinates. Inside the vertical bore-hole(vert) we use standard cylindrical coordinates (cylXY). For the groundoutside the bore-hole (oil) we use a variant: the complex exponentialfunction - this makes the coordinates conformal in xy-direction(expXY). For the horizontal bore-hole we use cylindrical coordinatesin y-direction (cylXZ). Note that we use exponential scaling along thebore-hole to avoid <A HREF="matchproblem.html">match problems</A> inradial direction.<PRE>int main(){  wz3dmap cylXY = new wz3Dcylinder;  wz3dmap expXY = new wz3Dcylindrical(new wz2Dexp);  wz3dmap cylXZ = new wz3Dcylindrical(new wz2Dpolar,new wz1Dexp);  cylXZ-&gt;switchYZ();  cogenOctree oil_base = new CogenOctree;  oil_base-&gt;addBox(Ground,   -wzInfty,log(R), -wzPi/2,wzPi/2, h-H,h);  oil_base-&gt;addBox(Isolation,  log(d),log(D), -wzPi/2,wzPi/2, 1.1*d,h);  oil_base-&gt;setBorder(           log(d*D/2),log(R), -wzPi/2,wzPi/2, h-H,h);  oil_base-&gt;addPlaneX(log(l));  oil_base-&gt;addPlaneX(log(2*D));  oil_base-&gt;addPlaneZ(d);  oil_base-&gt;addPlaneZ(1.05*d);  oil_base-&gt;addPlaneZ(1.5*d);  oil_base-&gt;addPlaneZ(3*d);  oil_base-&gt;refinementGlobal(0.2*log(R/d),0.11,0.13*H);  oil_base-&gt;faceRefinementGlobal(0.6*log(D/d),1.0);  cogenChart oil = new CogenChart(oil_base-&gt;generator(),expXY);  cogenOctree vert_base = new CogenOctree;  wzIndex boreHole  = vert_base-&gt;addBox(BoreHole, 0,d, -wzPi/2,wzPi/2,  -d,h);  wzIndex isolation = vert_base-&gt;addBox(Isolation,d,D, -wzPi/2,wzPi/2, 1.1*d,h);  vert_base-&gt;setBorder(                             0,d*D/2, -wzPi/2,wzPi/2, h-H,h);</PRE> <P>Now, we introduce the same coarse grid subdivisions in z-directionas for the ground.  Else, we obtain <A HREF="matchproblem.html">matchproblems</A> in z-direction.<PRE>  vert_base-&gt;addPlaneZ(d);  vert_base-&gt;addPlaneZ(1.05*d);  vert_base-&gt;addPlaneZ(1.5*d);  vert_base-&gt;addPlaneZ(3*d);  vert_base-&gt;setFaceOfBoxSide(Hole,boreHole,wzZ);  vert_base-&gt;refinementGlobal(0.3*d,0.11,0.13*H);  cogenChart vert = new CogenChart(vert_base-&gt;generator(),cylXY);  cogenOctree hor_base = new CogenOctree;  hor_base-&gt;addBox(BoreHole, 0.0,    d, -wzPi/2,wzPi/2, -wzInfty,log(l));  hor_base-&gt;setBorder(             0.0,3.0*d, -wzPi/2,wzPi/2, log(2*D),log(1.1*l));  cogenRefine hor_ref = new CogenRefine(hor_base-&gt;generator());  hor_ref-&gt;refinementGlobal(0.9*d,0.4,0.2*log(R/d));  cogenChart hor = new CogenChart(hor_ref-&gt;generator(),cylXZ);  cogenComposite gen = new CogenUnion;  gen-&gt;add(oil-&gt;generator());  gen-&gt;add(vert-&gt;generator());  gen-&gt;add(hor-&gt;generator());</PRE><PRE>  wzgrid grid = (*gen)();  grid->write("oil.sg");}</PRE>

⌨️ 快捷键说明

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