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

📄 mainprofiletest.html

📁 Delaunay三角形的网格剖分程序
💻 HTML
字号:
<TITLE>COG 1.0 - CogenProfile</TITLE><H1>class CogenProfile</H1><PRE>#include "<A HREF="cogenprofile.hxx">cogenprofile.hxx</A>"</PRE> <P>The class <B>CogenProfile</B> was developed for geologicalapplications. It is defined in <A HREF="cogenprofile.cxx">cogenprofile.cxx</A> creates a geometryand a grid for geological profiles.  These profiles are multi-layerstructures, and the boundaries between the layers are defined byfunctions x = f(y,z) where x is the coordinate in vertical directionand y,z coordinates in the horizontal directions. <P>The cogeometry is defined in a rather obvious way by the valuesf(x,y) for a regular grid of y- and z-values. <P>The more interesting part is the related grid generationalgorithm.  In the geological applications, we have a ratherinteresting property: much larger distances in the horizontaldirections (kilometers) than in horizontal directions (meters).Therefore, we need highly anisotropical grids.  Isotropically refinedgrids require far too much points.  Moreover, we have very thin,slightly skew layers.  The usual octree strategy requires a lot ofrefinement in this situation. It requires a lower number of points incomparison with isotropical refinement, but the number of additionalnodes remains much too high.  <P>Now, in this situation a grid with a much lower number of nodes ispossible if we do not require the Delaunay property.  The purpose ofcogenProfile is to create these non-Delaunay grids.  An example of agrid created by this algorithm is the following: <P><IMG SRC="profiletest.gif">    <IMG SRC="profilegrid.gif"> <P>At a first look, there are a lot of obtuse triangles with largeobtuse angles.  But note that the picture is very much compressed inhorizontal direction (~ 1:30).  Therefore, in the real grid thetriangles remain obtuse, but the angles are much more close to 90degrees than it looks in the picture.  The main property is that evenfor very thin skew layers the geometry is defined correctly, and withvery few nodes.<H2>Reading the data</H2><P>First, we read the data from a file written in a very simple dataformat:<PRE>#include "<A HREF="coglib.hxx">cog/coglib.hxx</A>"#include "cog1d.hxx"int main(){  cogenProfile gen = new CogenProfile("cog/profileinput.gfz");</PRE><H2>Controlling non-Delaunay grid generation</H2> <P>To obtain the non-Delaunay grids using the usual Delaunay gridgenerator we shift the nodes with different materials away from eachother in vertical direction.  Then we compute the Delaunay grid andshift back.  This shift is controlled by the<B>materialShiftFactor</B>:<PRE>  gen-&gt;materialShiftFactor = 1.0;</PRE> <P>Setting this factor zero creates a Delaunay grid, but for skewboundaries the probability is very low that this grid has the correctgeometry.  The shift is relative, 1.0 means the whole verticalrange.  Values larger than 1.0 are unreasonable.  But lower values maybe appropriate. <P>A problem is that for large shift values the resulting grid mayhave triangles with negative area.  This happens if the distancebetween neighbour points in horizontal direction is comparable withthe shift.  If this happens, there is a possibility to avoid this: toset the <B>horizontalFactor</B> greater than 1.0:<PRE>  gen-&gt;horizontalFactor = 10.0;</PRE> <P>This possibly results in some additional non-Delaunay simplices,but there is reasonable hope that this does not happen.<H2>Defining the box</H2> <P>It seems meaningful to define the box in relative values - valueswhich depend on the data defined in the input file.  The first fourparameters define the part of the index range which should be used,using large enough values like (0,10000,0,10000,...) has the effect ofusing the full range as given in the Profile file.  Then, some subrange oflayers may be defined, again with (...,0,10000,...) for all layers. <P>The last two parameters define the relative range in verticaldirection, with (...,0,1) as the range defined in the input file. Werecommend to use a greater range:<PRE>  gen-&gt;setRelativeBox(0,1000,0,1,0,10000,-0.5,1.5);</PRE><H2>Refinement</H2> <P>Now, we can define refinement parameters relative to the inputdata too:<PRE>  gen-&gt;refinementGlobal(	0.04*(gen-&gt;xmax-gen-&gt;xmin),	0.16*(gen-&gt;ymax-gen-&gt;ymin),	2.1*(gen-&gt;zmax-gen-&gt;zmin));//  gen-&gt;faceRefinementGlobal(0.05,1.0);</PRE><H2>Grid generation</H2> <P>Now, we generate the grid and write it out as usual:<PRE>  wzgrid grid = (*gen)(gen-&gt;geometry());  grid->write("test.sg");  v();}</PRE>

⌨️ 快捷键说明

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