1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
<title>Surface Evolver Documentation - Constraints</title>
<meta name="GENERATOR" content="Mozilla/2.0GoldB1 (Win32)">
</head>
<body>
<center>
<h1><a href="http://www.susqu.edu/facstaff/b/brakke/evolver/evolver.htm">
Surface Evolver</a> Documentation</h1>
</center>
<a href="evolver.htm#doc top">Back to top of Surface Evolver documentation.</a>
<a href="index.htm">Index.</a>
<a name="general constraints"></a>
<h1>Constraints and Boundaries</h1>
<a name="global constraints"></a>
<a name="pointwise constraints"></a>
<p>The usual mode of operation of the Surface Evolver is to minimize energy
subject to constraints. There are two broad categories of constraints:
</p>
<ul>
<li>Pointwise constraints: </li>
<li>
<ul>
<li><a HREF="elements.htm#fixed vertex">Fixed vertices</a> </li>
<li><a HREF="#level set constraints">Level set constraints</a> </li>
<li><a HREF="#one-sided constraints">One-sided constraints</a> </li>
<li><a HREF="#parametric boundaries">Parametric "boundary" curves and surfaces</a>
</li>
</ul>
</li>
<li>Global constraints: </li>
<li>
<ul>
<li><a HREF="elements.htm#target volume">Volume constraints</a> </li>
<li><a HREF="#named quantity constraints">Named quantity constraints</a>
</li>
</ul>
</ul>
<p>
<hr><a name="level set constraints"></a>
<h2>Level set constraints</h2>
A level-set constraint is a restriction of vertices to lie on the zero
level-set of a function.
The formula may include any expressions whose values
are known to the Evolver, given the particular vertex.
Most commonly one just uses the coordinates (x,y,z) of the
vertex, but one can use variables, quantity values,
or vertex extra attributes. Using a vertex extra
attribute is a good way to customize one formula to
individual vertices. For example, if there were a
vertex extra attribute called zfix, one could force
vertices to individual z values with one constraint
with the formula z = zfix, after of course assigning
proper values to zfix for each vertex.
A level set constraint may have several roles:
<p>
<ul>
<li>Vertices may be required to lie on a constraint (equality constraint)
or on one side (<a HREF="#one-sided constraints">inequality constraint</a>).
A constraint may be declared
<a href="datafile.htm#constraint decl">GLOBAL</a>,
in which case it applies to all vertices.
See <a HREF="mound.htm">mound.fe</a> for an example. </li>
<li>A constraint may have an
<a href="datafile.htm#constraint decl">energy vectorfield</a>
associated with it that is integrated
over edges lying in the constraint to give an
<a href="energies.htm#constraint energy integrals">energy</a>.
This is useful for
specifying wall contact angles and for calculating gravitational energy.
Integrals are not evaluated over edges that are FIXED. See
<a href="mound.htm">mound.fe</a> for
an example.
In the <a href="model.htm#string model">string model</a>,
the energy integrand is a single component evaluated on vertices
on the constraint.</li>
<li> A constraint may have a
<a href="datafile.htm#constraint decl">content vectorfield</a>
associated with it that is integrated
over edges lying in the constraint to give a <a href="elements.htm#body volume">
volume</a> contribution to a body
whose boundary facets contain the edges. This is useful for getting correct
volumes for bodies without completely surrounding them with otherwise useless
facets. It is important to understand how the content is added to the body
in order to get the signs right. The integral is evaluated along the positive
direction of the edge. If the edge is positively oriented on a facet, and
the facet is positively oriented on a body, then the integral is added
to the body. This may wind up giving the opposite sign to the integrand
from what you think may be natural. Integrals are not evaluated over edges
that are FIXED. See tankex.fe for an example.
In the <a href="model.htm#string model">string model</a>,
the content integrand is a single component evaluated on vertices
on the constraint.</li>
<li><a name="convex constraint"></a>A constraint may be declared
<a href="datafile.htm#constraint decl">CONVEX</a>,
in which case edges in the
constraint have an energy associated with them that is proportional to
the area between the straight edge and the curved wall. This energy (referred
to as "<a href="energies.htm#gap energy">gap energy</a>")
is meant to compensate for the tendency for flat
facets meeting a curved wall to minimize their area by lengthening some
edges on the wall and shortening others, with the net effect of increasing
the net gap between the edges and the wall. See tankex.fe for an example.
</li>
</ul>
<p>Level set constraints are declared in the top section of the <a HREF="datafile.htm#constraint decl">datafile</a>.
They may be applied to <a HREF="elements.htm#vertex constraints">vertices</a>,
<a HREF="elements.htm#edge constraints">edges</a>, or <a HREF="elements.htm#facet constraints">facets</a>.
Constraints are usually applied to vertices and edges, as in
<a href="mound.htm">mound.fe</a>. Remember that you need to apply a constraint
to an edge to get that constraint to apply to vertices created on that edge
by refining. Sometimes one applies constraints to facets, usually to get
the facet to conform to a predetermined shape. Be sure that the constraints
applied to a vertex are linearly independent at the vertex.
<p>
Constraints are usually applied in the datafile
<a href="datafile.htm#vertices section">vertices</a>,
<a href="datafile.htm#edges section">edges</a>, and
<a href="datafile.htm#faces section">faces</a> sections, but they
may also be set or removed with the <a href="commands.htm#set">set</a>
or <a href="commands.htm#unset">unset</a> commands. Example:
<pre> set vertex[4] constraint 4
unset edge constraint 1 where id < 10
</pre>
It does not hurt to unset an element that isn't on the constraint.
When a vertex is set to a constraint, the vertex coordinates are
immediately projected to the constraint. Setting an edge on a
constraint does not set its vertices. Likewise for facets.
<a name="one_sided_lagrange"></a>
<hr><a name="one-sided constraints"></a>
<h2>One-sided constraints</h2>
If a <a HREF="#level set constraints">level set constraint</a> is declared
<tt>NONNEGATIVE</tt> or <tt>NONPOSITIVE</tt> in the <a HREF="datafile.htm#constraint decl">datafile</a>,
the vertices subject to the constraint must stay in that part of the domain
of the level set function. It is usually unwise to give edge integrals
to edges on one-sided constraints, or to declare them <a HREF="energies.htm#gap energy">CONVEX</a>.
Whether a vertex exactly satisfies the constraint may be queried with the
vertex <a HREF="elements.htm#hit_constraint">hit_constraint</a> attribute.
The 'g' iteration step will check for a vertex wanting to leave a one-sided
constraint it has hit, but hessian commands do not; therefore it is wise
to intersperse 'g' with hessian or hessian_seek when there are one-sided
constraints involved.
<p>
Example: Suppose one wanted to keep a bubble inside a spherical tank
of radius 5. Then one would define the constraint in the datafile
<pre>constraint 1 nonpositive
formula: x^2 + y^2 + z^2 = 25
</pre>
For purposes of evaluating nonnegativity or nonpositivity, all terms are
shifted to the left side of the formula. One would then apply this
constraint to all vertices, edges, and facets of the bubble surface.
<p>
If you define the real-valued vertex extra attribute one_sided_lagrange, the
Lagrange multipliers for vertices hitting one-sided constraints will
be recorded. one_sided_lagrange may be defined as an array. If a vertex
hits more constraints than the size of one_sided_lagrange, then the
first ones that fit will be recorded.
<p>
<br>
<hr><a name="boundary"></a>
<a name="boundaries"></a>
<a name="parametric boundaries"></a>
<h2>Parametric "boundary" curves and surfaces</h2>
Vertex locations may be given in terms of parameters on a parameterized
curve or surface. Such curves or surfaces are called "boundaries"
in Evolver terminology, since they are usually used as boundary curves
of surfaces, for example a soap film on a wire loop could have the wire
implemented as a boundary. Vertices, edges, and facets may be deemed to
lie in a boundary. For a vertex, this means that the fundamental parameters
of the vertex are the parameters of the boundary, and its coordinates are
calculated from these. Vertices on boundaries may move during iteration,
unless declared fixed. See <a href="catenoid.htm">cat.fe</a> for an example. <p>
<p>
Boundaries are defined in the top section of the
<a href="datafile.htm#boundary decl">datafile</a>. Vertices on boundaries
are listed in the datafile with their parameter values instead of their
coordinates, with "<tt>boundary </tt><i>n</i>" appended to each such
<a href="datafile.htm#vertices section">vertex definition</a>.
Edges and faces on boundaries are defined as usual, but with
"<tt>boundary </tt><i>n</i>" appended to each definition.
So the datafile has lines like these:
<pre>
boundary 1 parameters 1
x1: cos(p1)
x2: sin(p1)
x3: 0.75
...
Vertices
1 0.0 boundary 1
2 pi/3 boundary 1
...
Edges
1 1 2 boundary 1
...
</pre>
<p>Putting an edge on a boundary means that vertices created on that edge
will be on the boundary. An edge on a boundary must have at least one
endpoint on the boundary, for use in extrapolating the boundary parameters
of any created vertices. Extrapolating instead of interpolating
midpoint parameters solves the problem of wrap-arounds on a boundary such as
a circle or cylinder. However if you do want interpolation, you can use
the keyword
<tt><a href="datafile.htm#interp_bdry decl">INTERP_BDRY_PARAM</a></tt>
in the top of the datafile, or use the
toggle command <a href="toggle.htm#interp_bdry_param">interp_bdry_param</a>.
<a name="extra_boundary"></a><a name="extra_boundary_param"></a>
Interpolation requires that both endpoints of an edge be on the same
boundary, which cannot happen where edges on different boundaries meet.
To handle that case, it is possible to add extra boundary information to
a vertex by declaring two particular vertex extra attributes,
<tt>extra_boundary</tt> and <tt>extra_boundary_param</tt>:
<pre>
interp_bdry_param
define vertex attribute extra_boundary integer
define vertex attribute extra_boundary_param real[1]
</pre>
Then declare attribute values on key vertices, for example
<pre>
vertices
1 0.00 boundary 1 fixed extra_boundary 2 extra_boundary_param 2*pi
</pre>
If the extra_boundary attribute is not set on a vertex when wanted,
Evolver will silently fall back on interpolation.
<p> Putting a face on a boundary means that all edges and vertices created
from refining the face will be on the boundary. In this case, the boundary
should have two parameters (or whatever the dimension of the surface is).
This is good for getting a surface to conform to a known parametric
shape.
<p>
Edges on boundaries have energy and content integrals like level-set
constraints edges, but they are internally implemented as.
<a href="quants.htm#named quantities">named quantities</a>.
</p>
<p>
Whether an element is on a particular boundary can be queried with
the <a href="elements.htm#on_boundary">on_boundary</a> Boolean attribute.
Elements can be removed from boundaries with the
<a href="commands.htm#unset">unset</a> command, but they cannot be
<a href="commands.htm#set">set</a> on boundaries. A typical use
of <tt>unset</tt> is to define an initial surface using a 2-parameter
boundary, refine a couple of times, then unset. Examples:
<pre> list vertex where on_boundary 2
unset vertex boundary 1 where on_boundary 1
unset edge boundary 1
unset facet boundary 1
</pre>
It does not hurt to unset an element not on the boundary.
<p>
Vertex parameters can be accessed in expressions as the attribute
p1 (and p2,... for further parameters).
Vertex parameters can be changed with the <a href="commands.htm#set">set</a>
command. Example:
<pre> print vertex[5].p1
set vertex p1 p1+.1 where id < 4
vertex[2].p1 := 3
</pre>
It is not an error to access the parameters of a vertex not on a boundary
as long as some vertex is on a boundary (so that space is allocated in
the vertex structure for parameters).
<p>A general guideline is to use constraints for two-dimensional walls
and boundaries for one-dimensional wires. If you are using a boundary wire,
you can probably declare the vertices and edges on the boundary to be FIXED.
Then the boundary becomes just a guide for refining the boundary edges.
</p>
<p>NOTE: A vertex on a boundary cannot also have constraints.
<hr><a name="named quantity constraints"></a>
<h2>Named quantity constraints</h2>
See <a href="quants.htm#named quantities">fixed named quantities</a>.
<hr><a HREF="evolver.htm#doc top">Back to top of Surface Evolver documentation.</a>
<p>
</body>
</html>
|