📄 mainspheretest.html
字号:
<TITLE>COG 2.1: Spherical coordinates</TITLE><H1>COG 2.1: spherical coordinates</H1> <P>See <A HREF="mainpolartest.html">the polar coordinate example</A>for general instructions about curved coordinates. <P>The first coordinate is the radius <B>r</B>, then the angle<B>theta</B> (between -wzPi/2 and wzPi/2), the last is the angle<B>phi</B> (between -wzPi and wzPi). <P>The example below creates a spherical grid with varioussubregions which are box-like in these coordinates. <P><IMG SRC="spheretest.gif"><PRE>#include "<A HREF="coglib.hxx">cog/coglib.hxx</A>"int main(){ cogenOctree base = new CogenOctree(); wzIndex i2 = base->addBox(wzRegion(2), 0.2,0.3,-wzPi/2,-1.0,-wzPi,wzPi); wzIndex i3 = base->addBox(wzRegion(3), 0.3,0.4, 0.0,wzPi/2, -1.9, -1.0); wzIndex i4 = base->addBox(wzRegion(6), 0.0,0.4, -0.5,0.5, 0.0,1.0); base->setFaceOfBox(wzFace(2),i2); base->setFaceOfBox(wzFace(3),i3); base->setFaceOfBox(wzFace(6),i4); base->refinementGlobal(0.1,0.4, 0.4); base->addPlaneX(0.1); base->addPlaneX(0.25); base->addPlaneX(0.35); base->addPlaneY(wzPi/2); base->addPlaneY(-wzPi/2); base->addPlaneZ(wzPi); base->addPlaneZ(-wzPi); wz3dmap sphere = new wz3Dspherical; cogenChart gen = new CogenChart(base->generator(),sphere); wzgrid grid = (*gen)(); grid->write("test.sg");}</PRE><H2>Known Problems</H2> <P>"edge problems" sometimes occur if, as in this example, thecritical regions of the coordinates (the axis (r == 0), the origin)are part of the boundary. They may be ignored. <P>Defining regions outside the domain of definition causes errors.Be careful if the boundaries are correct: non-negative for X, -wzPi/2to wzPi/2 for Y, -wzPi to wzPi for Z <P>Defining different regions for (phi==wzPi) and (phi==-wzPi) causeserrors. Be careful that the region numbers coinside there.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -