File: cube.htm

package info (click to toggle)
evolver 2.70+ds-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 17,148 kB
  • sloc: ansic: 127,395; makefile: 209; sh: 98
file content (250 lines) | stat: -rw-r--r-- 9,961 bytes parent folder | download | duplicates (2)
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
<!DOCTYPE HTML>
<html>
<head>
<title>Surface Evolver cube example</title>
<link rel="stylesheet" type="text/css" href="evdoc-style.css" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
</head>
<BODY>

<h1 class="center">
<a href="http://www.susqu.edu/brakke/evolver/evolver.htm" class="comic">
Surface Evolver</a> Documentation</h1>

<a href="evolver.htm#doc-top">Back to top of Surface Evolver documentation.</a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="index.htm">Index.</a> <br>
<a href="tutorial.htm#tutorial">Back to top of tutorial.</a> <br>
<a href="mound.htm">Next: Mound example.</a>

<a   id="cube-example"></a>
<h1> Example: Cube evolving into a sphere. </h1>

        A sample datafile cube.fe comes with Evolver.
        The initial surface is a unit cube.  The surface
        bounds one body, and the body is constrained to
        have volume 1.  There is no gravity or any other force besides
        surface tension.
        Hence the minimal energy surface will turn out to be a sphere.
        This example illustrates the basic datafile format
        and some basic commands. <P>

<img src="cubebare.gif" alt="cube skeleton">  
The initial cube skeleton, with
vertices and edges numbered. <p>

This is  the datafile that specifies the initial
         unit cube:
<pre>
// cube.fe
// Evolver data for cube of prescribed volume.

vertices  /* given by coordinates */
1  0.0 0.0 0.0 
2  1.0 0.0 0.0
3  1.0 1.0 0.0
4  0.0 1.0 0.0
5  0.0 0.0 1.0
6  1.0 0.0 1.0
7  1.0 1.0 1.0
8  0.0 1.0 1.0

edges  /* given by endpoints */
1   1 2   
2   2 3   
3   3 4  
4   4 1 
5   5 6
6   6 7  
7   7 8 
8   8 5
9   1 5   
10  2 6  
11  3 7 
12  4 8

faces  /* given by oriented edge loop */
1   1 10 -5  -9
2   2 11 -6 -10
3   3 12 -7 -11
4   4  9 -8 -12
5   5  6  7   8
6  -4 -3 -2  -1

bodies  /* one body, defined by its oriented faces */
1   1 2 3 4 5 6  volume 1

// end of cube.fe
</pre>
   The datafile is organized in lines, with one 
   geometric element defined per line.  Vertices
   must be defined first, then edges, then faces,
   then bodies.  Each element is numbered for later
   reference in the datafile.  <P>
 
   Comments are delimited by <code>/*</code> to begin 
   and <code>*/</code> to close 
   as in C, or from <code>//</code> until the end of the line as in C++.
   Case is not significant, and all input is made
   lower-case immediately.  Hence error messages
   about your datafiles will refer to items in lower
   case, even when you typed them in upper case. <P>

   The datafile syntax is based on keywords.  The  
   keywords <code>VERTICES</code>, <code>EDGES</code>,  <code>FACES</code>, and
   <code>BODIES</code> signal the start of the respective sections.
   Note that the faces are not necessarily triangles
   (which is why they are called <code>FACES</code> 
   and not <code>FACETS</code>).
   Any non-triangular face will be automatically
   triangulated by putting a vertex at its center and
   putting in edges to each of the original vertices.
   Faces don't have to be planar.  Note that a minus 
   sign on an edge means that the edge is traversed
   in the opposite direction from that defined for it in the
   <code>EDGES</code> section.  A face's oriented normal is defined
   by the usual right hand rule.  The cube faces all have
   outward normals, so they all are positive in the body list.
   In defining a body, the boundary
   faces must have outward normals.  If a face as 
   defined has an inward normal, it must be listed
   with a minus sign. <P>

   That the body is constrained to have a volume of 1  
   is indicated by the keyword <code>VOLUME</code> after the body
   definition, with the value of the volume following.
   Any attributes or properties an element 
   has are given on the same line after its definition.<P>




        Start Evolver and load the datafile with the command line
<pre>
     evolver cube.fe
</pre>
        You should get a prompt
<pre>
     Enter command:
</pre>
        Give the command <a href="single.htm#s" class="keyword">s</a> to
        show the surface.  You should see a square divided into 
        four triangles by diagonals.  This is the front side
        of the cube; you are looking in along the positive x-axis,
	with the z axis vertical and the positive y axis to the right.
	On most systems, you can manipulate the displayed surface with the 
        mouse: dragging the mouse over the surface with the left button
        down rotates the surface; you can change to "zoom" mode by hitting
       the z key, to "translate" by hitting t, to "spin" by hitting c, and
       back to "rotate" by hitting r. Hit the 'h' key with the mouse focus
	in the graphics window to get a summary of the possibilities.
       You can also give graphics commands at the graphics command prompt;
       this is good for precise control.  The graphics command prompt is 
<pre>
     Graphics command:
</pre>
        It takes strings of letters, each letter making a
        viewing transformation on the surface:
         The most used ones are
<pre>
  r   rotate right by 6 degrees 
  l   rotate left by 6 degrees
  u   rotate up by 6 degrees  
  d   rotate down by 6 degrees 
  R   reset to original position
  q   quit back to main command prompt  
</pre>
        Try typing <code>rrdd</code> to get an oblique view of the cube.  Any
        transformations you make will remain in effect the next
        time you show the surface.  Now do <code>q</code> to get back to
        the main prompt. <P>

        If you are using  geomview for graphics, do command <code>P</code> 
        option 8 to get
        a display, or just "<code>P 8</code>" for short.
	Geomview takes a couple of seconds to initialize.
	 You can manipulate the geomview display as usual
        independently of the Evolver.  Evolver will automatically update
        the image whenever the surface changes.  <P>


        Now do some iterations. Give the command "<code>g 5</code>" to do
        5 iterations.  You should get this:   
<pre>
  5. area:  5.11442065156005 energy:  5.11442065156005  scale: 0.186828
  4. area:  5.11237323810972 energy:  5.11237323810972  scale: 0.21885
  3. area:  5.11249312304592 energy:  5.11249312304592  scale: 0.204012
  2. area:  5.11249312772740 energy:  5.11249312772740  scale: 0.204386
  1. area:  5.11249312772740 energy:  5.11249312772740  scale: 0
Enter command: 
</PRE>
        Note that after each iteration a line
        is printed with the iterations countdown, 
	area, energy, and current scale
        factor.  By default, the Evolver seeks the optimal
        scale factor to minimize energy.  At first, there are
        large motions, and the volume constraint may not be
        exactly satisfied.  There may be an energy increase 
        due to the volume constraint taking hold. At the end,
        the scale is 0 because the surface has converged as well as
        it can at this coarse a triangulation. (Different systems
        may not give a zero scale here due to numerics.)

        Volume constraints are not exactly enforced, but each
        iteration tries to bring the volume closer to the target.
        Here that results in increases in area.  You can find
        the current volumes with the 
        <a href="single.htm#v" class="keyword">v</a> command:
<pre>
Body       target volume         actual volume        pressure
  1     1.000000000000000     0.999999779366360   3.408026016427987
</pre>
        The pressure in the last column is actually the Lagrange 
	multiplier for the volume constraint.
        Now let's refine the triangulation with the 
        <a href="single.htm#r" class="keyword">r</a> command.
        This subdivides each facet into four smaller similar
        facets.  The printout here gives  the counts of the
        geometric elements and the memory they take:        
<pre>
Vertices: 50 Edges: 144 Facets: 96  Facetedges: 288 Memory: 27554
</pre>
        Iterate another 10 times:
<pre>
 10. area: 4.908899804670224 energy: 4.908899804670224  scale: 0.268161
  9. area: 4.909526310166165 energy: 4.909526310166165  scale: 0.204016
  8. area: 4.909119925577212 energy: 4.909119925577212  scale: 0.286541
  7. area: 4.908360229118204 energy: 4.908360229118204  scale: 0.304668
  6. area: 4.907421919968726 energy: 4.907421919968726  scale: 0.373881
  5. area: 4.906763705259419 energy: 4.906763705259419  scale: 0.261395
  4. area: 4.906032256943935 energy: 4.906032256943935  scale: 0.46086
  3. area: 4.905484754688263 energy: 4.905484754688263  scale: 0.238871
  2. area: 4.904915540917190 energy: 4.904915540917190  scale: 0.545873
  1. area: 4.904475138593070 energy: 4.904475138593070  scale: 0.227156
</pre>
         You can continue iterating and refining as long as you 
         have time and memory.  <P>
         
         Eventually, you will want to quit.  So give the 
         <a href="single.htm#q" class="keyword">q</a> command.
         You get 
<pre>
     Enter new datafile name (none to continue, q to quit): 
</pre>
         You can start a new surface by entering a datafile name
         (it can be the same one you just did, to start over), or
         continue with the present surface by hitting ENTER with
         no name (in case you pressed <code>q</code> by accident, or suddenly
         you remember something you didn't do), or you can really
         quit with another <code>q</code>. <P>

<hr>
<a href="mound.htm">Next: Mound example.</a><br>
<a href="tutorial.htm#tutorial">Back to top of tutorial.</a>
<br>
<a href="evolver.htm#doc-top">Back to top of Evolver documentation.</a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="index.htm">Index.</a>

</body>
</html>