?? mainrefanisotest.html
字號:
<TITLE>COG 2.1: Anisotropic refinement with a function</TITLE><PRE>#include "<A HREF="coglib.hxx">cog/coglib.hxx</A>"</PRE><H1>Anisotropic Refinement Using Functions</H1> <P>In COG, the refinement may be controlled by <A HREF="mainfunctiontest.html">functions</A> which define themaximal distance in each direction around a given node - the<B>anisotropic refinement function</B>. <P>For example, to define the refinement in this picture: <P><IMG SRC="refanisotest.gif"> <P>you can use the following simple function:<PRE>wzFloat dx(const wzPoint& p){ return 0.1 + 0.4*(p[0]*p[0]+p[1]*p[1]);}wzFloat dy(const wzPoint& p){ return 0.1 + 0.4*((1-p[0])*(1-p[0])+p[1]*p[1]);}</PRE> <P>There are also a lot of <A HREF="mainfunctiontest.html">otherpossibilities to define functions</A>. Now we define a simple octreegrid generator and define these functions <I>dx, dy</I> on it'sgeometry <A HREF="mainfunctiontest.html">as usual</A>:<PRE>int main(){ cogenOctree base = new CogenOctree(); base->setBorder(0.0,1.0, 0.0,1.0); cogeometry geom0 = base->geometry(); wzIndex px = 0, py = 1; cogeometry geom1 = new CogeometryFunctionOnRegions(geom0,dx,px); cogeometry geom = new CogeometryFunctionOnRegions(geom1,dy,py);</PRE> <P>Now we have to create a grid generator which uses the function at<I>place</I> as the isotropic refinement criterion. This is done by<PRE> wzIndex dim = 2; cogenerator gen; gen = new CogenRefinementFunctionAnisotropic(base->generator(),px,dim);</PRE> <P>What remains is standard:<PRE> wzgrid grid = (*gen)(geom); grid->write("test.sg");}</PRE>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -