📄 mainwedgetest.html
字号:
<TITLE>COG 2.1: Wedges</TITLE><H1>Wedges</H1> <P>A <B>wedge</B> is a triangle in 2D and a prism in 3D - one half ofa rectangle. All except one side of the wedge are coordinate planes. <P>Wedges may be used, at least in principle, to implement regionswith arbitrary polygonal boundaries. But if the number of points inthis polygon is large, this does not seem to be a nice job. This isintentional: there are other algorithms which are more appropriate forregions with polygonal boundaries and large numbers of boundarypoints. <P>The point is that for every corner point of the wedge allcoordinate lines (in 3D planes) containing this point are part of thegrid: <P><IMG SRC="wedgetest.gif"> <P>For a large number of points this leads to a very fine initialgrid. But the initial grid should be, in the ideal, a coarse grid.Thus, this algorithm is appropriate only for a few number oftriangles.<PRE>#include "<A HREF="coglib.hxx">cog/coglib.hxx</A>"int main(){ cogenOctree gen = new CogenOctree(); gen->setBorder(0.0,1.0,0.0,1.0);</PRE> <P>Now, the creation of a wedge is similar to the creation of a box.There is only one additional parameter - the direction:<PRE> wzIndex i2,i3,i4,i5; i2 = gen->addWedge(wzRegion(2), wzWedgeLeftUp, 0.1,0.9, 0.2,0.8); i3 = gen->addWedge(wzRegion(3), wzWedgeRightDown, 0.5,0.9, 0.1,0.7); i4 = gen->addWedge(wzRegion(4), wzWedgeRightUp, 0.2,0.4, 0.5,0.9); i5 = gen->addWedge(wzRegion(5), wzWedgeLeftDown, 0.6,0.8, 0.3,0.9);</PRE> <P>The boundary faces for the wedges may be defined in a similar wayas for <A HREF="mainfacetest.html">boxes</A>, using<B>setFaceOfWedge</B>.<PRE> gen->setFaceOfWedge(wzFace(2),i2); gen->setFaceOfWedge(wzFace(3),i3); gen->setFaceOfWedge(wzFace(4),i4); gen->setFaceOfWedge(wzFace(5),i5);</PRE> <P> The box-dependend refinement works in the same way as for <AHREF="mainoctreereftest.html">boxes</A> with<B>refinementIsotropicInBox</B>, <B>refinementInBox</B>:<PRE> gen->refinementInBox(0.05,0.2,0, i3); gen->refinementIsotropicInBox(0.05, i4);</PRE> <P>What remains is as usual:<PRE> wzgrid grid = (*gen)(); grid->write("test.sg");}</PRE><H2>Known Bugs</H2> <P>It is possible to define nonconvex regions as a union of wedges.In this case, the inner edge is cut off. <P>To avoid this, to use different region numbers (artificialsubdivision of regions). This avoids non-convex regions. For thispossibility it is useful to write out <A HREF="mainmaterialtest.html">material numbers</A> instead ofregion numbers. <P>The other possibility is to define different <A HREF="mainfacetest.html">boundary conditions</A> on differentparts of the boundary (artificial subdivision of boundary faces).This avoids non-convex boundary faces.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -