seg1test.html
来自「有限元学习研究用源代码(老外的),供科研人员参考」· HTML 代码 · 共 92 行
HTML
92 行
<title>segment - test example</title>
<h1>Test Example for Segment Description</h1>
<p>It is <b>required</b> to declare one instance of the class
<b>wzSegmentDescription</b>. We recommend to use this class in the
following way:
<ol>
<li> define a derived class of wzSegmentDescription (wzSegmentExample)
<li> include all materials, boundary conditions and material functions
into this class.
<li> create one instance (wzsegmentexample)
</ol>
<p>It can be also useful to use this scheme only for materials.
Different regions of the same material may be defined like it is done
here:
<PRE>
#include "<A HREF="wzsegment.hxx">wzsegment.hxx</A>"
typedef enum{Dirichlet,Neumann,Cauchy} BoundaryCondition;
const wzIndex wzexampleregions = 20;
class test_segment_decription: public wzSegmentDescription
public:
test_segment_desription();
// this order is relevant for the assignment of numbers:
wzMaterial air; // default: 1
wzMaterial ground; // 2
wzMaterial water; // 3
wzMaterial stone; // 4
wzMaterial sand; // 5
wzMaterial clay; // 6 (Lehm)
wzMaterial lawn; // 7 (Rasen)
wzMaterial forest; // 8
wzMaterial concrete; // 9 (Beton)
wzMaterial asphalt; // 10
wzMaterial steel; // 11 (Stahl)
wzRegion reg[wzexampleregions];
wzFace boundary; // default
wzFace porous;
wzFace impermeable;
wzEdge edge; // default
wzVertex vertex; // default
wzArray<wzFloat> matCoeff;
wzArray<wzFloat> bCoeff;
wzArray<BoundaryCondition> bCondition;
};
</PRE>
<PRE>
test_segment_desription::test_segment_desription()
:wzSegmentDescription()
// this order is not relevant for the assignment of numbers:
,air("air",wzColor("#099011311"))
,ground("ground",wzColor("#201000"))
,water("water",wzColor("#000300611"))
,stone("stone",wzColor("#111111111"))
,sand("sand",wzColor("#b11a00155"))
,clay("clay",wzColor("#311200211"))
,lawn("lawn",wzColor("#000d11100"))
,forest("forest",wzColor("#100300111"))
,concrete("concrete",wzColor("#300300300"))
,asphalt("asphalt",wzColor("#100011211"))
,steel("steel",wzColor("#400711911"))
,boundary("boundary", wzColor(0x00,0x00,0x00))
,porous("porous", wzColor(0x00,0x20,0xff))
,impermeable("impermeable", wzColor(0x00,0x20,0xff))
,edge("edge", wzColor(0x00,0x00,0xff))
,vertex("vertex", wzColor(0x00,0xff,0x00))
,matCoeff(Region) // matCoeff is defined on materials/regions
,bCoeff(Face) // bCoeff is defined on boundary conditions
,bCondition(Face)
{int i; char *s;
for(i=0;i<wzexampleregions;i++){
s = new char[20];
sprintf(s,"region %d",i);
reg[i] = wzRegion(s,wzColor(0x00+i*0x4,0x20,0x0));
}
matCoeff[air]=0.01;
matCoeff[water]=2.09;
bCoeff[boundary]=0.01;
bCoeff[porous]=0.81;
bCoeff[impermeable]=0.042;
bCondition[boundary]=Neumann;
bCondition[porous]=Neumann;
bCondition[impermeable]=Cauchy;
}
</PRE>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?