mainoctreereftest.html
来自「有限元学习研究用源代码(老外的),供科研人员参考」· HTML 代码 · 共 57 行
HTML
57 行
<TITLE>COG 2.0: refinement</TITLE>
<H1>COG 2.0: Refinement of a box</H1>
<P>Some minimal standard possibilities for refinement are defined
for the class <B>CogenOctree</B> - it is homogeneous refinement
and refinement inside a box. Let's start with the
<A HREF="mainoctreetest.html">simple octree example</A>:
<PRE>
#include "<A HREF="coglib.hxx">cog/coglib.hxx</A>"
int main()
{
cogenOctree gen = new CogenOctree();
gen->addBox(wzRegion(2), 0.0,0.4, 0.0,0.5);
wzIndex i3 = gen->addBox(wzRegion(3), 0.2,0.8, 0.3,1.0);
wzIndex i4 = gen->addBox(wzRegion(4), 0.2,1.0, 0.7,1.0);
</PRE>
<P>The only difference as far is that we get identifiers for the
boxes <B>i3</B> and <B>i4</B>.
<P>These identifiers may be used to define isotropical or
anisotropical refinement separately in each box.
<PRE>
gen->refinementGlobal(0.2,0.1,1);
gen->refinementIsotropicalInBox(0.05, i3);
gen->refinementInBox(0.01,0.05,1, i4);
</PRE>
<P>There are three floating parameters <B>dx, dy, dz</B> in the call
of <B>refinemenGlobal</B> and <B>refinementInBox</B>. They define the
maximal distances between nodes in direction x, y, z. The algorithm
refines the grid by bisection until the distance is below this value.
Thus, the distances are usually smaller than dx, dy, dz, but greater
than half of this value.
<P>In our two-dimensional example the value of <B>dz</B> doesn't
matter. But we recommend to use nonetheless a reasonable (better
large) value: maybe, you later want to modify the example to create a
3D grid.
<H2>Known Bugs</H2>
<P>For overlapping boxes, the refinement criterion remains valid also
for the hidden part.
<P>This may be even considered as a feature ;-).
<PRE>
wzgrid grid = (*gen)();
grid->write("test.sg");
}
</PRE>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?