📄 maincogtest.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->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->setBorder(-1.0,1.0, -1.0,1.0, -1.0,1.0); gen->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>> 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>> cog main cog</B> uses this example; <p><B>> cog main <A HREF="maincog3dtest.html">cog3d</A></B> uses a3D box with boundaries [0,1]; <p><B>> cog main <A HREF="maincog2dtest.html">cog2d</A></B> uses a2D rectangular box; <p><B>> cog main <A HREF="maincog1dtest.html">cog1d</A></B> usesan 1D box; <p><B>> 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 + -