Elements:

Vertex attributes (grouped somewhat relatedly):

Edge attributes (grouped somewhat relatedly>:

In the string model, a facet is a chain of an arbitrary number of edges. The chain need not be closed. Usually a facet is defined in the string model in order to define a body, so the space dimension is 2 and the facet is planar, one facet corresponding to a body. Facets carry no energy by themselves.

In the simplex model,
a facet is a simplex of dimension
surface_dimension
defined by surface_dimension+1 vertices. The `surface_dimension`

may be any dimension less than or equal to the
space_dimension.
The simplex is oriented according to the order of the vertices.
By default, a simplex carries a surface tension energy
proportional to its volume.

Facets may carry additional energy by having named quantity energies applied to them.

The facets of the original surface are defined in the faces section of the datafile.

Facet attributes (grouped somewhat relatedly):

Body attributes:

`Facetedge`

can
be used as an element generator.
Facetedge attributes:

list vertex where id < 10 set edge color red where id == 4 or id == 6 or id == 9 foreach facet ff do { printf "%d %d %d %d\n",ff.id,ff.edge[1].id,ff.edge[2].id,ff.edge[3].id }

foreach facet ff do { printf "%d %d %d %d\n",ff.id,ff.edge[1].oid, ff.edge[2].oid,ff.edge[3].oid }

`fixed`

means they don't move during various evolution
and triangulation grooming commands. For edges and facets, `fixed`

means vertices generated from them by refinement
are `fixed`

, although declaring
a facet or edge fixed does not automatically make its vertices `fixed`

.
For a body, `fixed`

means its volume is constrained to be its
target value. Likewise, `fixed`

as an attribute
of a named quantity means the quantity
value is constrained.

Fixedness can be changed with the fix and unfix commands.

Examples:

fix vertex where z = 0 unfix vertex where on_constraint 1 list edge where fixed print body[1] fixed

`on_constraint`

list edge where on_constraint 3 print vertex[3].on_constraint floorcon

`on_boundary `

list vertex where on_boundary 1 list edge where on_boundary topbdry

`on_quantity`

list facet where on_quantity center_of_mass_x print vertex[3].on_quantity blue_area

`on_method_instance`

list facet where on_method_instance center_of_mass_x_edges print vertex[3].on_method_instance blue_area_1

set facet color red where original == 1

foreach facet do printf "%d %f\n",id,xmoment list facet where xmoment > 4

define vertex attribute newx real define vertex attribute vmat real[3][2] vertices 1 2 0 0 newx 3 vmat {{1,2},{3,4},{5,6}}The command language can use the name with the same syntax as built-in attributes, and can define extra attributes at run time:

set vertex newx x define edge attribute vibel real[2] set edge[2] vibel[1] 3; set edge[2] vibel[2] 4 print vertex[3].newxAttribute array sizes may be changed at run time by executing another definition of the attribute, but the number of dimensions must be the same. Array entry values are preserved as far as possible when sizes are changed.

The value of an extra attribute can also be calculated by user-supplied code. The attribute definition is followed by the keyword "function" and then the code in brackets. In the code, the keyword "self" is used to refer to the element the attribute is being calculated for. Example: To implement the lowest z value of a facet as an attribute:

define facet attribute minz real function {self.minz := min(self.vertex,z);}

`x`

,`y`

,`z`

,
`w`

or `x1`

,`x2`

,`x3`

,..,
or `x[1]`

, `x[2]`

, `x[3]`

, ... or
`__x[1]`

, `__x[2]`

, `__x[3]`

, ....
In the vertices section
of the datafile,
vertices of the original surface have their coordinates given
unless
they are on a parametric
boundary. Vertices on parametric boundaries have their coordinates
calculated from their parameter values. Coordinates may be read or
modified with the command language. The form `__x`

is useful to refer
to the coordinates as a vector, for example in dot products.
Examples:
foreach vertex do printf "%d %f %f %f\n",id,x,y,z set vertex z z+.1*x print vertex[3].x[2] dotprod := vertex[1].__x * vertex[2].__x

list vertex[3].edges foreach vertex vv do { foreach vv.edge do print id }Always use "

`.edges`

" to generate vertex edges; using "edges" with
an implicit element, as in "`foreach vertex do list edges`

"
will list all edges in the surface over and over again.
list vertex[3].facets foreach vertex vv do { foreach vv.facet do print id }Always use "

`.facets`

" to generate vertex facets; using "facets" with
an implicit element, as in "`foreach vertex do list facets`

"
will list all facets in the surface over and over again.
list vertices where valence == 6 histogram(vertex,valence)

`bare`

says that a vertex is not supposed to have
any adjacent edges.
Useful in avoiding warning messages. A vertex may be declared bare
in the vertices section
of the datafile by adding the keyword `bare`

to the line
defining the vertex. `Bare`

is not simply a synonym for zero
valence; it is a separate attribute
you set to say you intend for it to have zero valence.
Examples:
set vertex bare where valence==0 list vertex where bare

`fixed`

on the line defining the vertex, after the
coordinates. From the command prompt, one can fix or unfix vertices
with the fix and
unfix commands.
Examples:
formula
list vertex where fixed fix vertex where on_constraint 1 unfix vertices where on_boundary 1

`nonnegative`

in the
datafile
forces a vertex to have a nonnegative
value of the function. A `nonpositive`

constraint forces a vertex
to have a nonpositive value of the function.
A constraint may be declared `global`

,
in which case it applies to all vertices. A vertex may
be put on a constraint in the
vertices section
of the datafile by listing the constraint numbers after the keyword
`constraint`

.
See mound.fe for an example.
In commands, the status of a vertex can be read with the
on_constraint and
hit_constraint
attributes. The status can be changed with the
set or
unset
commands.
Examples:
Datafile:

constraint 1 formula: z = 0 constraint wallcon nonpositive formula: x = 4Runtime:

list vertex where on_constraint wallcon set vertex constraint 1 where id == 4 or id == 6 unset vertex constraint 1

See the on_constraint attribute for general elements.

`hit_constraint`

list vertex where hit_constraint 3 print vertex[3].hit_constraint 1

`value_of_constraint`

print vertex[4] value_of_constraint 1 list vertex where on_constraint topcon and value_of_constraint topcon > 1e-5

`v_constraint_list[1]`

is the number of constraints in
the list, followed by the numbers of the constraints. Note that for
named constraints, the internally assigned numbers are used. Because this is
the actual internal datastructure, the entries may have some high bits used
as flags, so to get the plain constraint numbers you should mask out the
high bits with "`imod 0x100000`

".
Example:
foreach vertex vv do { for ( spot := 2 ; spot <= vv.v_constraint_list[1]+1 ; spot++ ) { connum := vv.v_constraint_list[spot] imod 0x100000; if vv hit_constraint connum then printf "Vertex %d hits constraint %d.\n",vv.id,connum; } };

constraint[number].normal or constraint[name].normal"number" may be an expression; "name" is the unquoted name of the constraint, if it has one. Example:

print vertex[1].constraint[floorcon].normalwould print the unit normal of constraint floorcon at vertex 1. And you can put on a subscript to get individual components. For example, the y component:

print vertex[1].constraint[floorcon].normal[2]There is no necessity for the constraint to be applied to the vertex; the vertex is just used as a source of coordinates for evaluating the gradient of the constraint formula.

`boundary`

is used as
an attribute only in the datafile declaration of elements being on boundaries.
At runtime, one uses the attributes
p1, p2, ..
for the parameter values, on_boundary
to see if a vertex is on a particular boundary, and v_boundary to get the number of the boundary. If you
want to set a vertex on a boundary at runtime (tricky, since you have to set
the parameters yourself), the use the
"set vertex boundary ..." command.
`p1`

,`p2`

,... Usually
only `p1`

is used, since one-parameter curves used as boundary wires
are most common. There is also an array form of the name, `p`

, which
is useful in array computations such as dot product in the case of
multiple parameters. Such vertices in the original surface have
their parameter values given in the
vertices section of the datafile
instead of their coordinates. Vertex parameters may be read or modified
with the command language. Example:
foreach vertex do printf "%d %f\n",id,p1 set vertex[1] p1 1.2 dotprod := vertex[1].p * vertex[2].p

print vertex[3].vertex_normal[1]; print vertex[3].vertex_normal[2]; print vertex[3].vertex_normal[3];The vertex_normal can also be printed as an array:

print vertex[3].vertex_normal

`Vertexnormal`

is an old synonym for `vertex_normal`

.
list edge[23].vertex vv where vv.mid_edge

list facet[23].vertex vv where vv.mid_facet

`Sqcurv`

is the squared mean curvature at a vertex. This is only a discrete
approximation, of course, The method used to calculate it is the
same as the sq_mean_curvature
named method, except if the
normal_curvature toggle is on, in which case the calculation is as in
the
normal_sq_mean_curvature named method. Does not require any other square
mean curvature features to be active.
`axial_point`

, since these
vertices pose special problems for the wrap algorithms.
If you are only using a subgroup of the full group, then you
only need to label vertices on the axes of the subgroup.
The net wrap around a facet containing an axial point need not
be the identity. Edges out of an
axial point must have the axial point at their tail, and must have zero
wrap. Facets including an axial point must have the axial point at
the tail of the first edge in the facet. It is your responsibility
to use constraints to guarantee the vertex remains on the axis.
set vertex no_hessian_normal where z > 1.2

histogram(edge where on_constraint 1, length) print edge[3].length

`tension`

set edge tension .5 where id < 10 loghistogram(edge,density)

`fixed`

to the line defining the edge.
From the command prompt, one can fix or unfix edges
with the fix and
unfix commands.
Examples:
fix edge where on_constraint 1 list edges where fixed set edge color red where fixed unfix edge[3]

list edge[2].vertices list edge ee where ee.vertex[1].on_constraint 1

print edge[23].midv

list edge[2].facets foreach edge ee do print max(ee.facets,area)

list edges where valence == 1 refine edge where valence != 2

`bare`

to the line defining an edge.
Useful in avoiding warning
messages. Bare edges are useful to show wires, frameworks, outlines, axes,
etc. in graphics. Example:
list edge where bare

`constraint`

on the line defining the edge.
Putting an edge
on a constraint does not put its existing vertices on the constraint.
In commands, the status of an edge can be read with the
"on_constraint"
attribute. The status can be changed with the
set or unset
commands.
Examples:
list edge where on_constraint 2 set edge constraint 1 where id == 4 or id == 6 unset edge constraint 3

list edges where on_boundary 1 unset edges boundary 2

set edge color red where length > 1 show edge where color != black

list edges where z^2 > 10*(x^2 + y^2) print edge[1].edge_vector * edge[2].edge_vector

`no_refine`

attribute
may be specified on the datafile line for an edge, or
the set command may be used.
Examples:
set edge no_refine where fixed unset edge[2] no_refine list edge where no_refine print edge[3].no_refine

set edge no_transform where valence == 0

`*`

for no wrap, `+`

for positive wrap, and `-`

for negative wrap.
Wraps are maintained automatically by Evolver during surface manipulations.
The numeric edge wrap values can be queried with attribute syntax. Example:
list edge where wrap != 0Unfortunately, the torus model wraps come out rather opaquely, since one cannot print hex. The torus wrap number is the sum of numbers for the individual directions: +x = 1; -x = 31; +y = 64; -y = 1984; +z = 4096; -z = 127040. Caution: even though this attribute can be written by the user at runtime, only gurus should try it.

print edge[3].wrap_list[1]

set edge[2] orientation -1

set edge noncontent where on_constraint 1

`tension`

set facet tension 3 where original == 1 list facet where density < .4

list facet where area < .1

`fixed`

on the line defining the face, after the
coordinates. From the command prompt, one can fix or unfix facets
with the fix and
unfix commands.
list facet[3].vertex

list facet[3].edges list facet[-3].edges

list facet[2] bodies

newb := new_body; set facet frontbody newb where color == red print facet[2].frontbodyFrontbody also works for adding edges to a facet in the string model, but the added edge must be attach to one end of the edge arc, or close the arc.

newb := new_body; set facet[1] frontbody newb; set facet backbody newb where id == 2 or id == 4; print facet[4].backbodyBackbody also works for adding edges to a facet in the string model, but the added edge must be attach to one end of the edge arc, or close the arc.

list facets where valence != 3

Facet read-write attribute.
Putting a facet on a
constraint
means that every vertex, edge, or facet
generated by refining the facet will inherit that constraint. Setting
a facet on a constraint does not set any of its existing edges or vertices
on the constraint. Facets may be put on constraints in the
datafile by listing the
constraint numbers after the keyword `constraint`

on the line
defining the facet, or with the
set command. They may be removed
with the unset command.
Examples:

list facets where on_constraint 1 set facet[2] constraint 2 unset facet constraint 1

list facets where on_boundary 1 unset facet[2] boundary 2

Faces 1 1 2 3 color redCommand examples:

list facets where color == red set facet[3] color green set facet color red where area > 2

Faces 1 1 2 3 frontcolor green backcolor redCommand examples:

list facets where frontcolor == red set facet[3] frontcolor green set facet frontcolor red where area > 2

Faces 1 1 2 3 frontcolor green backcolor redCommand examples:

list facets where backcolor == red set facet[3] backcolor green set facet backcolor red where area > 2

Faces 1 1 2 3 opacity 0.5Command examples:

set facet opacity 0.6 set facet opacity 0.6 where original == 2

`nodisplay`

to the line defining the facet. Can
also be manipulated by the set
and unset commands. `No_display`

is a synonym provided since that's what I kept typing in.
Example:
set facet nodisplay where color != red

`no_refine`

attribute has no effect except that edges created within the
facet by refining will inherit the `no_refine`

attribute. So to
avoid refinement of a plane, all edges and facets in the plane
must be given the `no_refine`

attribute. The `no_refine`

attribute
may be specified on the datafile line for a facet, or
the set command may be used.
Examples:
set facet no_refine where fixed unset facet[2] no_refine list facet where no_refine print facet[3].no_refine

set facet no_transform where color == brown

set facet[123] orientation -1Also see the reverse_orientation command to physically reverse a facet's orientation.

set facet noncontent where on_constraint 1

list facet where phase == 1

list body[1].facets

print body[2].density set body density 3 body[2].density := 5

- An integral over the facets bounding the body. This is \int z dx dy normally, but \int (x dy dz + y dz dx + z dx dy)/3 if symmetric_content is in effect.
- Any constraint content edge integrals applying to the body.
- The body's volconst attribute.

- An integral over the edges bounding the body's facet. This is \int -y dx.
- Any constraint content vertex integrals applying to the body.
- The body's volconst attribute.

print body[1].volume foreach body where volume > 2 do print id

set body[1] target 23 unset body target where id == 2 print body[2].target

print body[1].volconst set body[2] volconst 1.2 body[2].volconst := 1.2It is best to avoid using volconst except in the torus model. Rather, use edge content integrals so that the proper adjustments will be made if the boundary of the surface is moved, or rebody is done.

print body[2].pressure body[2].pressure := 1.3 set body[2] pressure 1.3

list body where phase == 1

set bodies centerofmass

print facetedge[1].edge[1].id

print facetedge[1].facet[1].id

Back to top of Surface Evolver documentation. Index.

Susquehanna University assumes no responsibility for the content of this personal Web page. Please read the disclaimer.