⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainrefanisotest.html

📁 Delaunay三角形的网格剖分程序
💻 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&amp; p){  return 0.1 + 0.4*(p[0]*p[0]+p[1]*p[1]);}wzFloat dy(const wzPoint&amp; 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-&gt;setBorder(0.0,1.0, 0.0,1.0);  cogeometry geom0 = base-&gt;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-&gt;generator(),px,dim);</PRE> <P>What remains is standard:<PRE>  wzgrid grid = (*gen)(geom);  grid-&gt;write("test.sg");}</PRE>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -