📄 mainoctreereftest.html
字号:
<TITLE>COG 2.1: Refinement in a box</TITLE><H1>Refinement in a Box</H1> <P><IMG SRC="octreereftest.gif"> <P>Some possibilities for refinement are already defined for theclass <B>CogenOctree</B> - it is homogeneous refinement and refinementinside a box. Let's start with the simple octree example used in the <A HREF="mainreftest.html">general local refinement example</A>:<PRE>#include "<A HREF="coglib.hxx">cog/coglib.hxx</A>"int main(){ cogenOctree gen = new CogenOctree(); wzIndex i1 = gen->addBox(wzRegion(2), 0.0,1.0,0.0,1.0); wzIndex i2 = gen->addBox(wzRegion(3), 0.1,0.2, 0.7,0.9); wzIndex i3 = gen->addBox(wzRegion(3), 0.3,0.4, 0.6,0.8); wzIndex i4 = gen->addBox(wzRegion(4), 0.7,0.9, 0.1,0.5);</PRE> <P>The only difference as far is that we get identifiers for theboxes <i>i1, i2, i3, i4</i>. These identifiers may be used to defineisotropical or anisotropical refinement separately in each box, not(as with <A HREF="mainreftest.html">CogenRefine</A>) for the wholeregion.<PRE> gen->refinementGlobal(0.2,0.1,1); gen->refinementIsotropicInBox(0.04, i2); gen->refinementInBox(0.2,0.04,0, i3); gen->refinementInBox(0.04,0.2,0, i4);</PRE> <P>There are three float parameters <i>dx, dy, dz</i> in the call of<B>refinemenGlobal</B> and <B>refinementInBox</B>. They define themaximal distances between nodes in direction <i>x, y, z</i>. Thealgorithm refines the grid by bisection until the distance is belowthis value. Thus, the distances are usually smaller than <i>dx, dy,dz</i>, but greater than half of this value. <P>In our two-dimensional example the value of <i>dz</i> doesn'tmatter. But we recommend to use nonetheless a reasonable (betterlarge) value: maybe, you later want to modify the example to create a3D grid.<H2>Known Bugs</H2> <P>For overlapping boxes, the refinement criterion remains valid alsofor the hidden part. <P>This may be even considered as a feature ;-). <P><HR><PRE> wzgrid grid = (*gen)(); grid->write("test.sg");}</PRE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -