📄 mainreftest.html
字号:
<TITLE>COG 2.1: Local refinement</TITLE><A HREF="main2Dtest.html">next</A><H1>Local refinement</H1> <P><IMG SRC="reftest.gif"> <P>Some simple general (not octree-specific) methods to define arefinement are defined in the class <B>CogenRefine</B>. At first, wehave to define some other cogenerator. In this example, we usea simple rectangular geometry:<PRE>#include "<A HREF="coglib.hxx">cog/coglib.hxx</A>"int main(){ cogenOctree base = new CogenOctree(); base->addBox(wzRegion(2), 0.0,1.0,0.0,1.0); base->addBox(wzRegion(3), 0.1,0.2, 0.7,0.9); base->addBox(wzRegion(3), 0.3,0.4, 0.6,0.8); base->addBox(wzRegion(4), 0.7,0.9, 0.1,0.5);</PRE> <P>Then this base should be used to define the cogenerator of<B>CogenRefine</B> type:<PRE> cogenRefine gen = new CogenRefine(base->generator()); gen->refinementGlobal(0.2,0.2,0.1); gen->faceRefinementGlobal(0.02,1.0);</PRE> <P>The simple global refinement calls <B>refinementGlobal</B> and<B>faceRefinementGlobal</B> are available too. But there are otherinteresting possibilities. For example, some homogeneous refinementin a given region with <B>refinementInRegion,refinementIsotropicInRegion</B>:<PRE> gen->refinementIsotropicInRegion(0.04, wzRegion(3)); gen->refinementInRegion(0.04,0.2,0, wzRegion(4));</PRE> <P>Another variant is refinement in the environment of some point.The first parameter (the first three in the anisotropic case) definethe refinement in that point: binary subdivision is used until theedges are below this distance. The next parameter (the next three)define a distance parameter which defines the size of the domainaround the point which will be refined. The last three parameters arethe coordinates of the point. <P>Note that in 2D and 1D all parameters have to be given.<PRE> gen->refinementIsotropicNearPoint(0.02, 0.1, 1,1,0); gen->refinementNearPoint(0.02,0.1,0, 0.2,0,0, 0,0,0);</PRE><PRE>// wzgrid grid = (*base)(); wzgrid grid = (*gen)(); grid->write("test.sg");}</PRE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -