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

📄 maincogtest.html

📁 有限元学习研究用源代码(老外的),供科研人员参考
💻 HTML
字号:
<TITLE>COG 2.0: arbitrary cogeometries</TITLE>
<PRE>
#include "<A HREF="coglib.hxx">cog/coglib.hxx</A>"
</PRE>

<H1>COG 2.0: 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 geometry
description.  Until now, we have created grid generator data (coarse
grid, 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 about
this, it is possible to combine any grid generator with any geometry
description.  Here is how to do this.

 <P>First, we need some cogeometry.  There are various methods how to
do this, for example you can use the cogeometry of an arbitrary
cogenerator <B>gen</B> with <B>gen-&gt;cogeometry()</B>.  This part
will be done in the file <A HREF="cogtest.html">cogtest.cxx</A>, which
defines 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 the
domain 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 the
additional argument <B>geom</B> in the grid generator call:

<PRE>
  wzgrid grid = (*gen)(geom);
  ibgOutput(grid);
  grid->write("test.sg");
}
</PRE>

<H2>Modular Separation between Cogeometry and Cogenerator</H2>

 <P>There are some interesting unexpected properties of the
cogeometry:

 <UL>
 <LI> The cogeometry is global - there is no "box" containing the
cogeometry.  The definition of the box is part of the cogenerator.
You can use the same cogeometry and create grids for various parts of
the global cogeometry.

 <LI> Even the dimension of the cogeometry is undefined. You can use
each cogeometry to create 1D, 2D and 3D grids - intersections of the
global cogeometry with various lines, rectangles and cubes.
 </UL>

 <P>To illustrate these properties, we have some other examples using
the same cogeometry.  You can change independently the cogeometry used
here and in the following examples, and the cogenerator.

 <P><B>&gt; use cog xyz</B> extracts the code for the cogeometry
described 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 computation
domains in different sample programs:

 <p><B>&gt; run main cog</B> uses this example;

 <p><B>&gt; run main <A HREF="maincog3dtest.html">cog3d</A></B> uses a
3D box with boundaries [0,1];

 <p><B>&gt; run main <A HREF="maincog2dtest.html">cog2d</A></B> uses a
2D rectangular box;

 <p><B>&gt; run main <A HREF="maincog1dtest.html">cog1d</A></B> uses
an 1D box;

 <p><B>&gt; run main <A HREF="maincogpolartest.html">cogpolar</A></B>
uses a disc with polar coordinates;

⌨️ 快捷键说明

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