?? ref.html
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>QMG Reference Manual</title>
</head>
<body BGCOLOR="#E0FFE0" TEXT="#000000" LINK = "#0080C0" VLINK = "#004060" ALINK = "#FF0000" >
<center>
<table>
<tr>
<td>
<a href="qmg2_0_home.html"><img src=logo1.jpg alt="QMG logo"></a></td>
<td>
<h1>
QMG Reference Manual
</h1>
</td>
</table>
</center>
This page contains a list of the QMG functions organized by
categories of functionality. There
are some <a href="#principles">general principles</a> about QMG
functions.
<p>
The categories of functionality are:
<ul>
<li>
<a href="#constr">Brep constructors, modifiers, and checkers</a>
<li>
<a href="#mgfe">Mesh generation and finite element analysis</a>
<li>
<a href="#graphics">Graphics</a>
<li>
<a href="#io">Reading, writing and format conversion</a>
<li>
<a href="#util">Utilities and examples</a>
</ul>
You may also select from the following alphabetized list of QMG
functions. Some of the low-level and utility functions are not
documented here.
<ul>
<li>
<a href="#gm_addpropval">gm_addpropval</a>
<li>
<a href="#gmapply">gmapply</a>
<li>
<a href="#gmboundary">gmboundary</a>
<li>
<a href="#gmcavity">gmcavity</a>
<li>
<a href="#gmchecknormals">gmchecknormals</a>
<li>
<a href="#gmchecktri">gmchecktri</a>
<li>
<a href="#gmcoarsetopo">gmcoarsetopo</a>
<li>
<a href="#gm_cpoly">gm_cpoly</a>
<li>
<a href="#gmdouble">gmdouble</a>
<li>
<a href="#gmevallog">gmevallog</a>
<li>
<a href="#gmfem">gmfem</a>
<li>
<a href="#gmhelp">gmhelp</a>
<li>
<a href="#gm_list2obj">gm_list2obj</a>
<li>
<a href="#gm_lookup_prop">gm_lookup_prop</a>
<li>
<a href="#gmmake_circ">gmmake_circ</a>
<li>
<a href="#gmmake_cyl">gmmake_cyl</a>
<li>
<a href="#gmmake_torus">gmmake_torus</a>
<li>
<a href="#gm_mcompo">gm_mcompo</a>
<li>
<a href="#gmmeshgen">gmmeshgen</a>
<li>
<a href="#gmmeshsize">gmmeshsize</a>
<li>
<a href="#gmmouse">gmmouse</a>
<li>
<a href="#gm_obj2list">gm_obj2list</a>
<li>
<a href="#gm_objtype">gm_objtype</a>
<li>
<a href="#gmoffread">gmoffread</a>
<li>
<a href="#gmpolygon">gmpolygon</a>
<li>
<a href="#gm_polytri">gm_polytri</a>
<li>
<a href="#gmplot">gmplot</a>
<li>
<a href="#gmq11read">gmq11read</a>
<li>
<a href="#gm_read">gm_read</a>
<li>
<a href="#gm_rehash">gm_rehash</a>
<li>
<a href="#gmrndcolor">gmrndcolor</a>
<li>
<a href="#gmset">gmset</a>
<li>
<a href="#gmshowcolor">gmshowcolor</a>
<li>
<a href="#gmsummary">gmsummary</a>
<li>
<a href="#gm_url">gm_url</a>
<li>
<a href="#gmviz">gmviz</a>
<li>
<a href="#gmvizgui">gmvizgui</a>
<li>
<a href="#gm_write">gm_write</a>
<li>
<a href="#gmxdr_read">gmxdr_read</a>
<li>
<a href="#gmxdr_write">gmxdr_write</a>
</ul>
<h2><a name="principles">General principles about QMG functions</a></h2>
QMG functions begin with the prefix <strong>gm</strong> for geometry.
The lower
level functions begin with <strong>gm_</strong>; these
lower level functions are
often accessed through higher level functions.
Arguments to QMG functions
are passed by value. Return values are
are the actual objects rather than handles or pointers, and
they have no side effects (except for I/O routines).
(Note that both Matlab and Tcl implement a lazy copying scheme
for efficiency, so
that a return value may actually be a handle. This behavior
is not visible to the user.)
This functional
nature simplifies the model of programming but means that there may
be extra copying done in QMG.
<p>
In this reference manual, each routine is labeledaccording to whetherit is written
Matlab, Tcl or C++. Routines written in C++ are callablefrom both Matlab and Tcl.The Matlab and Tcl/Tk
calling formats are both given.
<p>
Arguments in italic curly braces are optional. (Roman boldface curly braces,
on the other hand, are part of the syntax.)
The text describes
the default values for optional arguments.
<p>
Other standard formats for arguments are as follows.
Vectors and matrices in Matlab are just ordinary vectors and
matrices. Vectors in Tcl are lists, and matrices in Tcl nested
lists. See <a href="tclsyntax.html">the Tcl syntax synopsis</a> for
an example. String literals in Matlab must be quoted with single
quotes. In Tcl/Tk double quotes are used for string literals,
and are optional unless the string has embedded
spaces.
<h2>
<a name="constr">Brep constructors, modifiers, and checkers</a>
</h2>
<h3><a name="gm_addpropval">gm_addpropval</a> (Tcl only) </h3>
<blockquote>
Tcl/Tk:
<strong>
gmset <em>newbrep</em> [gm_addpropval <em>brep facenamelist proplist vallist</em>]<br>
</strong>
</blockquote>
This function adds new property-value pairs to a face of a
brep, and returns the so-modified brep. Argument <em>facenamelist</em>
is a list of face names in the brep (strings). An empty string
in this list indicates that the property-value pair is global
for the brep. Then <em>proplist</em> and <em>vallist</em> are lists
of properties (string) and values (strings). All three lists have
the same length. The routine adds the property whose name is
taken from <em>proplist</em> to the face whose name is in the corresponding
position of
<em>facenamelist</em> with value taken from the corresponding
position in <em>vallist</em>.
If the property already exists, then this routine replaces its
old value with the specified value.
Property names and face names are not case sensitive.
<p>
To delete a property-value pair from a face, set the value to the
empty string.
<p>
Note that this function does not exist in Matlab, but it is easy
to obtain this functionality by directly modifying the zba cell
arrays that <a href="geom.html#matrep">encode a brep</a>.
<p>
Like all QMG functions, <code>gm_addpropval</code> does not
modify its argument, so it is useless without a return value.
<h3><a name="gmapply">gmapply</a> (C++)</h3>
<blockquote>
Matlab:
<strong>
<em>newobj</em>=gmapply(<em>mtx</em>, <em>obj</em>); <br>
</strong>
Tcl/Tk:
<strong>
gmset <em>newobj</em> [gmapply <em>mtx</em> <em>obj</em>] <br>
</strong>
</blockquote>
Here, <em>obj</em> is a brep or simplicial complex, and <em>mtx</em> is an
affine transformation of the correct dimension. The affine
transformation is applied to the object, and the transformed
object is returned.
<p>
This function, when applied to breps, assigns the
same property-value lists to faces of the output brep
that were assigned to the input brep.
<p>
The <em>mtx</em> argument is a matrix of
size <em>d</em>×(<em>d</em>+1), where <em>d</em> is the embedded dimension
of the object.
Partitioning <em>mat</em> as [<em>A,b</em>], where
<em>A</em>
is <em>d</em>×<em>d</em> and <em>b</em> is <em>d</em>×1,
the transformation applied is <em>x→Ax−b</em>.
<h3><a name="gmcavity">gmcavity</a> (Matlab and Tcl) </h3>
<blockquote>
Matlab:
<strong>
<em>newbrep</em>=gmcavity(<em>outerbrep, innerbrep</em>);<br>
</strong>
Tcl/Tk:
<strong>
gmset <em>newbrep</em> [gmcavity <em>outerbrep innerbrep</em>]<br>
</strong>
</blockquote>
This routine computes a new brep that results from making a cavity shaped
like <em>innerbrep</em> inside
<em>outerbrep</em>. For example, if the
outer brep is a circle and the inner brep a smaller concentric
circle, then the result would be an annulus.
This routine does not check that the inner brep is actually
inside the outer one.
<h3><a name="gmchecknormals">gmchecknormals</a> (C++)</h3>
<blockquote>
Matlab:
<strong>
[<em>maxdev,facename,cpnum</em>]=gmchecknormals(<em>brep</em>);<br>
</strong>
Tcl/Tk:
<strong>
gmset {<em>maxdev,facename,cpnum</em>} [gmchecknormals <em>brep</em>]<br>
</strong>
</blockquote>
This routine checks deviation in the normals in each topological
entity. Recall that topological entities are supposed to be
<em>G</em><sup>1</sup>, meaning that the normal vector for patches (and
normalized tangent
vector for curves) should be continuous as one jumps from one
geometric entity to the next. However, QMG allows deviations from
the <em>G</em><sup>1</sup> condition in order to allow brep that are composed
of noncoplanar flat triangular patches. The setting of
the curvature control to the mesh generator must be at least
as large as the largest normal discontinuity. This routine
measure the largest deviation from continuous normals in
all faces. The deviation is checked only at control points; it is
possible (in the case of nonlinear patches) that the largest deviation
does not occur at a control point. The first return value is the
maximum deviation and hence is a lower bound for the curvature
control in the mesh generator. The second return value is the
name of the face with the worst discontinuity in the normal.
The third return value is the control point index with
the worst discontinuity in the normal.
<h3><a name="gmcoarsetopo">gmcoarsetopo</a> (C++)</h3>
<blockquote>
Matlab:
<strong>
<em>newbrep</em>=gmcoarsetopo(<em>brep, a</em>);<br>
</strong>
Tcl/Tk:
<strong>
gmset <em>newbrep</em> [gmcoarsetopo <em>brep a</em>]<br>
</strong>
</blockquote>
This routine coarsens the topology of a brep. This means that
it tries to merge entities of dimension <em>d</em>−1, where <em>d</em>
is the dimension (both embedded and intrinsic) of the brep.
In the process of merging faces of this dimension, the routine
may also delete faces of lower dimension. Faces can be merged
only if their property-value pairs completely agree. Lower dimensional
faces with property-value pairs are not deleted. The second
argument <em>a</em> is the allowable deviation from <em>G</em><sup>1</sup>
on any face.
Merging will take place only if this allowable deviation is not
exceeded. This deviation is measured in the same way that the
curvature function is <a href="meshgen.html#curvemeas">measured</a>.
Thus, the second argument should be a positive number.
<p>
The purpose of coarsening the topology is so that the mesh generator
will produce fewer elements. The mesh generator must
respect all topological boundaries in its mesh (and hence must subdivide
its mesh more finely if there are many topological boundaries).
<p>
This routine measure deviation from <em>G</em><sup>1</sup>
only at control points. In 3D, it
is possible for the maximum deviation from <em>G</em><sup>1</sup>
to occur at an interior
point on a Bezier curve separating two patches, in which case this
routine will miss that deviation.
<p>
If the argument <em>a</em> is set (for example) to 0.6,
then the curvature-tolerance setting
for the mesh generator on the resulting new brep should not be any lower
than 0.6.
<h3><a name="gm_cpoly">gm_cpoly</a> (Matlab and Tcl) </h3>
<blockquote>
Matlab:
<strong>
<em>brep</em>=gm_cpoly(<em>verts,codes</em>);<br>
</strong>
Tcl/Tk:
<strong>
gmset <em>brep</em> [gm_cpoly <em>verts codes</em>]<br>
</strong>
</blockquote>
This routine creates a 2D brep given its list of vertices
in order. The vertices are held in the <em>verts</em> argument,
which must be a matrix with two columns. Each row of this
matrix is an (x,y) coordinate pair of a vertex. The
<em>codes</em> argument is a vector of integers whose
number of entries must equal the number of vertices.
This argument indicates how the corresponding vertex
should be interpreted. If the entry in <em>codes</em> is 0,
this means that the vertex marks the beginning of a new loop
and signals that the previous loop (if there is one) should be
closed off. The first entry in <em>codes</em> must always be
0. A code of 1 indicates that the vertex is the start of a new
topological edge. (Note that code 0 implies code 1, i.e., the start
of a new loop is also the start of a topological edge. This is
true for all the codes: code <em>i</em> implies code <em>i</em>+1, etc.)
A code of 2 indicates that the vertex is the start of a new
Bezier curve (which is part of a topological edge). Finally, a code
of 3 indicates that the vertex is a Bezier control point (but is
none of the above).
<p>
A graphical front end to this routine is provided by
<a href="#gmmouse"><code>gmmouse</code></a>.
<h3><a name="gm_lookup_prop">gm_lookup_prop</a> (Matlab and Tcl)</h3>
<blockquote>
Matlab:
<strong>
<em>val</em> = gm_lookup_prop(<em>brep, fdim, faceind, prop</em>);
</strong>
<br>
Tcl:
<strong>
gmset <em>val</em> [gm_lookup_prop <em>brepl fdim faceind prop</em>]
</strong>
<br>
</blockquote>
This routine looks up the value assigned to a property in a brep
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -