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

📄 cogfacetest.html

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

<H2>Class CogeometryWithFaces</H2>

<PRE>
#include &lt;math.h&gt;
#include "cogfaces.hxx"
</PRE>

 <P>Here we want to introduce a possibility to modify cogeometries
which may be used to define boundary conditions.  It is very variable
- it allows to use the full power of C++ as an input language for
geometry definition.

 <P>All what you need is to understand how to obtain coordinates,
region numbers and other information from a point (<A
HREF="wzpointtest.html">wzPoint</A>).

<H2>class <A NAME="Faces">CogeometryWithFaces</A></H2>

The first possibility is to define the face (<A
HREF="wzsegmenttest.html">cogFace</A>) of a given boundary point by a
C++ function of the following type:

<PRE>
static cogSegment Faces(const cogPoint& x)
{
 if(x[1] > 0.5)
	return wzFace(2);
 else	return wzFace(3);
}
</PRE>

 <P>Don't bother that the return type is <B>cogSegment</B>, return a
<B>cogFace</B>, there is an automatical conversion to
<B>cogSegment</B>.  (The reason is that the same function type will be
used elsewhere.)

 <P>Note that there are two possibilities to use the function:
 <B>CogeometryOfFaces</B> sets only inner boundary faces,
 <B>CogeometryOfBoundary</B> sets the outer boundary faces too.

<PRE>
#include "cogsimple.hxx"
cogeometry	test_cogeometry()
{
 cogeometry sphere = new CogeometryEllipsoid(0.2,0.8,0.7,0.5,0.5,0.5);
 return new CogeometryOfFaces(<A HREF="#Faces">Faces</A>,sphere);
// return new CogeometryOfBoundary(<A HREF="#Faces">Faces</A>,sphere);
}
</PRE>

⌨️ 快捷键说明

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