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

📄 maincogtest.html

📁 Delaunay三角形的网格剖分程序
💻 HTML
字号:
<TITLE>COG 2.1: Geometries and grids</TITLE><PRE>#include "<A HREF="coglib.hxx">cog/coglib.hxx</A>"</PRE><H1>COG 2.1: Arbitrary Cogeometries</H1> <P>Now it's time to explain a remarkable property of the COG package:the modular independence of the grid generation data and the geometrydescription.  Until now, we have created grid generator data (coarsegrid, coordinates, refinement) and the geometry description together.That's often useful.  For a given geometry there is often an"appropriate" set of grid generation data. <P>Nonetheless, the grid generation algorithm does not know aboutthis, it is possible to combine any grid generator with any geometrydescription.  Here is how to do this. <P>First, we need some cogeometry.  There are various methods how todo this, for example you can use the cogeometry of an arbitrarycogenerator <B>gen</B> with <B>gen-&gt;cogeometry()</B>.  This partwill be done in the file <A HREF="cogtest.html">cogtest.cxx</A>, whichdefines a function <B>test_cogeometry()</B>:<PRE>cogeometry test_cogeometry();#include "<A HREF="cogtest.cxx">cogtest.cxx</A>"int main(){  cogeometry geom = test_cogeometry();</PRE> <P>Now, we define a cogenerator.  This includes the definition of thedomain of computation, which is not part of the geometry description.Here we define a 3D box using the class <B><A HREF="cogenoctree.html">CogenOctree</A></B>.<PRE>  cogenOctree gen = new CogenOctree();  gen-&gt;setBorder(-1.0,1.0, -1.0,1.0, -1.0,1.0);  gen-&gt;refinementGlobal(0.2,0.2,0.2);</PRE> <P>What remains is almost the same as before.  We only have theadditional argument <B>geom</B> in the grid generator call:<PRE>  wzgrid grid = (*gen)(geom);  grid->write("test.sg");}</PRE><H2>Modular Separation between Cogeometry and Cogenerator</H2> <P>There are some interesting unexpected properties of thecogeometry: <UL> <LI> The cogeometry is global - there is no "box" containing thecogeometry.  The definition of the box is part of the cogenerator.You can use the same cogeometry and create grids for various parts ofthe global cogeometry. <LI> Even the dimension of the cogeometry is undefined. You can useeach cogeometry to create 1D, 2D and 3D grids - intersections of theglobal cogeometry with various lines, rectangles and cubes. </UL> <P>To illustrate these properties, we have some other examples usingthe same cogeometry.  You can change independently the cogeometry usedhere and in the following examples, and the cogenerator. <P><B>&gt; use cog xyz</B> extracts the code for the cogeometrydescribed in the file <A HREF="cogtest.html">cogxyztest.html</A> into the file <A HREF="cogtest.cxx">cogtest.cxx</A> included here. <P>This test cogeometry may be intersected with various computationdomains in different sample programs: <p><B>&gt; cog main cog</B> uses this example; <p><B>&gt; cog main <A HREF="maincog3dtest.html">cog3d</A></B> uses a3D box with boundaries [0,1]; <p><B>&gt; cog main <A HREF="maincog2dtest.html">cog2d</A></B> uses a2D rectangular box; <p><B>&gt; cog main <A HREF="maincog1dtest.html">cog1d</A></B> usesan 1D box; <p><B>&gt; cog main <A HREF="maincogpolartest.html">cogpolar</A></B>uses a disc with polar coordinates;

⌨️ 快捷键说明

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