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

📄 mainelevationtest.html

📁 有限元学习研究用源代码(老外的),供科研人员参考
💻 HTML
字号:
<TITLE>COG 1.0 - CogenElevation</TITLE>

<H1>class CogenElevation</H1>

<PRE>
#include "<A HREF="cogenelevation.hxx">cogenelevation.hxx</A>"
</PRE>

The class <B>CogenElevation</B> defined in <A
HREF="cogenelevation.cxx">cogenelevation.cxx</A> creates the following grid 

 <P><IMG SRC="elevationtest.gif">
 <P>for a geometry defined by the picture:
 <P><IMG SRC="elevationinput.gif">

<H2>Reading the elevation map</H2>

<PRE>
#include "<A HREF="coglib.hxx">cog/coglib.hxx</A>"
#include "cog1d.hxx"
int main()
{
  cogeometry geom1D = new <A HREF="cog1dtest.html">Cogeometry1D</A>(0.0,1.0,1,wzRegion(2));
  cogenElevation gen = new CogenElevation("cog/elevationinput.ppm",geom1D);
  cogFloat xmin=0,xmax=5,ymin=0,ymax=5;
  cogFloat hmin= 700, hmax=4000;         // boundaries for elevation in meter
  gen-&gt;setBorder(xmin,xmax,ymin,ymax,hmin,hmax);
</PRE>

<PRE>
  gen-&gt;refinementGlobal(0.4,0.4,0.1);
  gen-&gt;faceRefinementGlobal(0.05,1.0);
</PRE>

 <P>Now, we generate the grid and write it out as usual:

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

</PRE>

 <P>We use here an elevation map - the ppm-file <A
HREF="test/elevation.ppm">test/elevation.ppm</A>. In this file, the color
encodes a short integer which defines the elevation of the grand
canyon in meter.

 <P>The class <B>CogenElevation</B> allows to read this file
and defines the function 

<BLOCKQUOTE>
<B>f(x,y,z) = z - elevation(x,y)</B> 
</BLOCKQUOTE>

appropriately scaled. This function is used to define a geometry using
the scheme similar to <A HREF="cogfunctiontest.html#Function">
CogeometrySimpleFunction</A>. For the 

<PRE>
/*
cogeometry	test_cogeometry()
{
 CogeometryElevationMap *map;
 map    = new CogeometryElevationMap("test/elevation.ppm",geom1D);
 return map;
}
*/
</PRE>

⌨️ 快捷键说明

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