📄 mainmaterialtest.html
字号:
<TITLE>COG 2.1: Materials</TITLE><H1>COG 2.1: Writing out materials</H1> <P>Different regions are distinguished by different numbers.Sometimes these numbers are not what you need in your application.There are two reasons: <UL> <LI> You need only some of the regions. For example, usually you donot need the grid in the region "outside". <LI> Sometimes an artificial subdivision of a domain into parts isuseful for the grid generation. But in the application you want to"reunify" them. </UL> <P>For this purposes, we have a possibility to write out materialnumbers instead of the region numbers. It allows to define a materialnumber for every region. The same is possible for faces. Somematerials may be invalidated and then will not be written out: <P><IMG SRC="materialtest.gif"> <P>Now, there exists already a default segment description<B>wzDefaultSegmentDescription</B>, which is declared in <A HREF="wzdefault.hxx">wzdefault.hxx</A> and defined in <A HREF="wzdefault.cxx">wzdefault.cxx</A>. It may be modified orused as a pattern.<PRE>#include "<A HREF="coglib.hxx">cog/coglib.hxx</A>"int main(){ cogenOctree gen = new CogenOctree(); wzIndex i1 = gen->addBox(wzRegion(2), 0.0,0.4, 0.0,0.5); wzIndex i2 = gen->addBox(wzRegion(3), 0.2,0.8, 0.3,1.0); wzIndex i3 = gen->addBox(wzRegion(4), 0.4,1.0, 0.6,1.0); gen->setFaceOfBox(wzFace(2),i2); gen->setFaceOfBox(wzFace(3),i3); gen->refinementGlobal(0.1,0.05); wzgrid grid = (*gen)();</PRE><PRE> wzDefaultSegmentDescription.use(); // that's default. wzRegion(1).material().invalidate(); // region 1 should not be written out wzRegion(4).material() = wzRegion(3); // write out region 4 as region 3; wzFace(1).type().invalidate(); // face 1 should not be written out; wzFace(3).type() = wzFace(2); // write out face 3 as face 2; grid->write("test.sg",wzDefaultSegmentDescription);}</PRE><H3>Usage of face numbers to protect edges</H3> <P>Note that two of the three regions have the same region number3. This defines a non-convex region 3. Without any boundaryconditions, the inner edge may be cut off - the grid generator doesnot know that this point is something special. But now the edge isthe place where the boundary condition changes, thus, a special pointwhich has to be computed exactly.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -