Surface Evolver Documentation

Evolver datafile format

The initial configuration of the surface is read from an ASCII datafile. See the cube or mound examples for samples. The datafile is organized into six parts: General datafile topics: In the syntax descriptions below, keywords will be in upper case. constexpr means a constant expression, and expr means any expression. n or k means an integer, which may be signed if it is being used as an oriented element label. Square brackets denote optional items. '|' means 'or'.

Include files

The standard C language method of including other files is available. The file name must be in double quotes. If the file is not in the current directory, EVOLVERPATH will be searched. Includes may be nested to 10 deep. Example:
	#include  "common.stuff"

Macros

Macros are text substitutions done by replacing an identifier by a string of characters before parsing. Macros are only defined in the datafile, and do not work from the command prompt. Simple macros (no parameters) may be defined as in C:
         #DEFINE  identifier  string
identifier must be an identifier without other special meaning to the parser. string is the rest of the logical line, not including comments. It will be substituted for identifier whenever identifier occurs as a token subsequently. Substitutions are re-scanned. No checks for recursiveness are made. There is a maximum length (currently 500 characters) on a macro definition. Note: macro identifiers are separate tokens, so if "-M" translates into "-2", this will be read as two tokens, not a signed number. The keyword keep_macros in the datafile will keep macro definitions active during runtime, until the next datafile is loaded.

Datafile top section

The datafile begins with optional definitions and specifications. These are definitions that need to be made before the geometric elements are defined, or for which command syntax is lacking or awkward. Other initializations can be made at the end of the datafile in the
read section using the command language. Each line starts with a keyword. The order is immaterial, except for the usual rule that items must be defined before use. None of these are required if you are willing to accept various defaults.

Version


If a datafile contains features present only after a certain version of the Evolver, the datafile can contain a line of the form
evolver_version "2.10"
This will generate a version error message if the current version is earlier, or just a syntax error if run on an Evolver version earlier than 2.10.

Definitions of variables

Variables may be defined in the datafile top section with this syntax:
      PARAMETER identifier = constexpr
This declares identifier to be a variable with the given initial value. The value may be changed at runtime with the
A command, or by assignment. Variables may be used in any subsequent expression or constant expression. Changing variables defined here results in automatic recalculation of the surface when autorecalc is been toggled on. Hence only variables needed in other top section declarations should be defined here.

Optimizing parameter

A variable may be made subject to optimization during iteration or hessian commands with the datafile declaration
      OPTIMIZING_PARAMETER identifier = constexpr PDELTA = constexpr SCALE = constexpr
Such a variable joins the vertex coordinates as an independent variable during optimization. However, it differs from a coordinate in that gradients with respect to it are calculated numerically, rather than analytically. Thus it may be used anywhere a variable is permitted. Hessians with optimizing parameters are implemented. The optional pdelta value is the parameter difference to use in finite differences; the default value is 0.0001. The optional scale value is a multiplier for the parameter's motion, to do "impedance matching" of the parameter to the surface energy. These attributes may be set on any parameter, for potential use as an optimizing parameter. At runtime, a parameter may be toggled to be optimizing or not with the FIX and UNFIX commands. That is, fix radius would make the radius variable non-optimizing (fixed value). "Optimising_parameter" is a synonym. Note: the natural scale factor for gradient descent with optimizing parameters may be much different than without, and the evolution may be awkward when far from equilibrium. Therefore, parameters have a "scale" attribute that multiplies the parameter change. It may set in the datafile.

Surface dimension

The default dimension of the surface is 2. If not, it must be declared in the top section of the datafile. For a 1-dimensional surface (the string model), simply include the line
 STRING
The default dimension 2 soapfilm model is equivalent to using
 SOAPFILM
In general, the line
 SURFACE_DIMENSION n
defines the surface to have dimension n. Dimension over 2 is valid only in the simplex model. The surface dimension may be accessed at runtime through the read-only variable surface_dimension.

Space dimension

The default dimension of space is 3. Otherwise it must be declared in the top section of the datafile, with syntax
SPACE_DIMENSION n
The dimension must be at most the value of MAXCOORD in model.h, which is 4 in the distributed version. The space dimension may be accessed at runtime through the read-only variable space_dimension.

Torus model declaration

To declare periodic boundary conditions (i.e. make the domain a flat torus), include in the top section of the datafile the line
TORUS
All space dimensions will be periodic, with the period vectors given in the periods declaration. If the domain is completely filled by bodies with prescribed volumes, then the line
TORUS_FILLED
should be used instead to prevent degenerate volume constraints.

Torus periods

If periodic boundary conditions are used (the torus model) , the period vectors of the fundamental unit cell parallelpiped may be defined in the top section of the datafile. Default is the unit cube. The syntax is the keyword PERIODS followed by expressions for the components of each period vector:
PERIODS 
expr expr expr
expr expr expr
expr expr expr
The size of this matrix depends on the space dimension. Variables may be used in the expressions, so the fundamental domain may be changed interactively by assigning new values to the variables. Be sure to give a recalc command whenever you change such a variable, in order to get the period matrix re-evaluated.

Symmetry group declaration

To declare that the domain is the quotient space of a symmetry group, the top section of the datafile must contain a line of the form
SYMMETRY_GROUP "name" 
"name" is a double-quoted name that is matched against the list of defined symmetry groups.

Quadratic declaration

To declare that the datafile lists a surface in the
quadratic model, the top section of the datafile should contain the line
QUADRATIC
The only effect on datafile syntax is that the edge section may list edge midpoint vertices.

Simplex model declaration

To declare that the datafile lists a surface in the simplex model, the top section ot the datafile should contain the line
SIMPLEX_REPRESENTATION
The main effect on the datafile is that faces are defined by oriented vertex lists rather than edge lists.

Extra attribute declarations

It is possible for the user to define extra attributes for elements, which may be single values or vectors. If these attributes are to be included in the datafile, then the top section of the datafile must contain appropriate definitions. The definition syntax is the same as used by the define command:
 DEFINE elementtype ATTRIBUTE name type dim
where elementtype is vertex, edge, facet, or body, name is an identifier of your choice, type is REAL or INTEGER (internally, there is also a ULONG unsigned long type also), and dim is an optional expression for the vector dimension. There is no practical distinction between real and integer types at the moment, since everything is stored internally as reals. But there may be more datatypes added in the future. Extra attributes are inherited by elements of the same type generated by subdivision. Examples:
  define edge attribute charlie real 
  define vertex attribute oldx real[3] 

Scale limit

To set an upper bound of valueon the gradient descent scale factor, include the line
   SCALE_LIMIT value
in the top section of the datafile. The upper bound can be changed at runtime with the m command.

Dynamic load library

To load a dynamic library of compiled functions, the syntax is
 LOAD_LIBRARY "filename"
where the double-quoted filename is the library. The current directory and the EVOLVERPATH will be searched for the library.

Crystalline integrands

To declare that surface area energy should be calculated with a crystalline integrand, the top section of the datafile should contain a line of the form
 WULFF "filename"
The double-quoted filename (with path) refers to a file giving the Wulff vectors of the integrand. The format of the file is one Wulff vector per line with its components in ASCII decimal format separated by spaces. The first blank line ends the specification. Some special integrands can be used by giving a special name in place of the file name. Currently, these are "hemisphere" for a Wulff shape that is an upper unit hemisphere, and "lens" for two unit spherical caps of thickness 1/2 glued together on a horizontal plane. These two don't need separate files.

Phase file declaration

To declare that the surface tension of an edge or facet depends on the phases of its adjacent facets or bodies, the top section of the datafile should contain a line of the form
 PHASEFILE "filename" 
The information is read from an ASCII file, whose name is given in a double-quoted string. The first line of the file has the number of different phases. Each line after consists of two phase numbers and the surface tension between them. Lines not starting with a pair of numbers are taken to be comments. If a pair of phases is not mentioned, the surface tension between them is taken to be 1.0. Facets in the string model or bodies in the soapfilm model can be labelled with phases with the PHASE n phrase in the datafile.

Ideal gas model

A line in the top section of the datafile of the form
PRESSURE constexpr
specifies that bodies are compressible and the ambient pressure is the value of constexpr. The default is that bodies with given volume are not compressible.

Level set constraint declarations

The format for declaring a level set constraint in the top section of the datafile is
CONSTRAINT n [GLOBAL] [CONVEX] [NONNEGATIVE] [NONPOSITIVE]
FORMULA FUNCTION  expr
[ENERGY:
 E1: expr
 E2: expr
 E3: expr]
[CONTENT:
 C1: expr
 C2: expr
 C3: expr]
You may use EQUATION or FUNCTION as synonyms for FORMULA. This defines constraint number n, where n is an integer between 0 and MAXCONSTR (currently 127). The optional keyword GLOBAL means the constraint automatically applies to all vertices (but not automatically to edges or faces). GLOBAL constraints count in the number limit. If CONVEX is given, then an additional gap energy is attributed to edges on the constraint to prevent them from trying to short-circuit a convex boundary. If NONNEGATIVE or NONPOSITIVE is given, then this is a one-sided constraint, and all vertices will be forced to conform appropriately to the constraint at each iteration. The FORMULA expression defines the zero level set which is the actual constraint. It may be written as an equation, since '=' is parsed as a low-precedence minus sign. 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 (be sure to fix up zfix after refining or otherwise creating vertices). Do not use '>' or '<' to indicate inequalities; use NONNEGATIVE or NONPOSITIVE. Conditional expressions, as in C language, are useful for defining constraints composed of several surfaces joined smoothly, such as a cylinder with hemispherical caps. Assignments to variables may be made at the start of expressions, mainly for the purpose of evaluating common subexpressions only once in the integrands. The syntax for such a compound expression is
    variable :=  expr, expr
The value of the expression is the value of the second expression.

The optional ENERGY section signifies that vertices or edges on the constraint are deemed to have an energy. In the soapfilm model, the next lines give components of a vectorfield that will be integrated along each edge on the constraint. In the string model, just one component is needed, which is evaluated at each vertex on the constraint. The main purpose of this is to permit facets entirely on the constraint to be omitted. Any energy they would have had should be included here. One use is to get prescribed contact angles at a constraint. This energy should also include gravitational potential energy due to omitted facets. Integrals are now also evaluated on fixed edges, which is a change from earlier versions of Evolver.

The optional CONTENT section signifies that vertices (string model ) or edges (soapfilm model) on the constraint contribute to the area or volume of bodies. If the part of a body boundary that is on a constraint is not defined by facets, then the body volume must get a contribution from a content integral. 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. Always check a new datafile when you load it to be sure the integrals come out right.

Warning: These integrals are evaluated only for edges which are on the constraints and both of whose endpoints are on the constraints. It is a bad idea to put any of these integrals on one-sided constraints, as both endpoints must actually hit the constraint to count.


Constraint tolerance

This is datafile declaration of the tolerance within which a vertex is deemed to satisfy a level-set constraint. Default is 1e-12. Syntax:
  CONSTRAINT_TOLERANCE const_expr 
Sets the value of the internal variable constraint_tolerance.

Gravity constant declaration

The initial value of the gravitational constant may be set in the datafile with the syntax
  GRAVITY_CONSTANT value 
The default value is 1.

Gap constant declaration

The initial value of the gap constant for gap energy may be set in the datafile with the syntax
  GAP_CONSTANT value 
The default value is 1. Synonym: spring_constant.

Parameterized boundary declaration

A parameterized boundary may be declared in the top section of the datafile with the syntax
BOUNDARY n PARAMETERS k [CONVEX] 
X1: expr 
X2: expr
X3: expr
This defines boundary number n, where n is an integer between 1 and MAXBDRY (currently 20) and k is the number of parameters. If CONVEX is given, then an additional gap energy is attributed to edges on the boundary to prevent them from trying to short-circuit a convex boundary. The following lines have the functions for the coordinates in terms of the parameters P1 and maybe P2, P3,.... See the catenoid example. Energy and content integrals for boundaries are implemented, with the same syntax as for a . level set constraint.

Interpolation of parameters

To use interpolation instead of extrapolation in calculating the parameters of edge midpoints during refining, use the keyword
   INTERP_BDRY_PARAM
This should be done only if there are no periodic parameters.

Everything_quantities

Keyword in top section of the datafile. Causes all areas, volumes, etc. to be converted to named quantities and methods. Equivalent to the command line option -q, or the convert_to_quantities command.

Named quantities

The syntax for defining a named quantity in the data file is:

 QUANTITY name   ENERGY | FIXED value | INFO_ONLY [LAGRANGE_MULTIPLIER constexpr]
[TOLERANCE constexpr]  [MODULUS constexpri] methodlist | FUNCTION methodexpr

Here name is an identifier assigned by the user in order to refer to the quantity. Any quantities must be declared to be one of three types:

For fixed quantities, the optional Lagrange multiplier value supplies the initial value of the Lagrange multiplier (the "pressure" attribute of the quantity). It is meant for dump files, so on reloading no iteration need be done to have a valid Lagrange multiplier.

For fixed quantities, the tolerance attribute is used to judge convergence. A surface is deemed converged when the sum of all ratios of quantity discrepancies to tolerances is less than 1. This sum also includes bodies of fixed volume. If the tolerance is not set or is negative, the value of the variable target_tolerance is used, which has a default value of 0.0001.

Each quantity has a modulus, which is just a scalar multiplier of the whole quantity. A modulus of 0 will turn off an energy quantity. The default modulus is 1. The methodlist version of the quantity definition may contain one or more method instances. To incorporate a previously explicitly defined instance, include METHOD instancename. GLOBAL_METHOD may be used instead of METHOD to indicate the method applies to all elements of the appropriate type; it is equivalent to using GLOBAL in the method definition. To instantiate a method in the quantity definition, you essentially incorporate the instance definition, but without an instance name. Example of a quantity with one predefined method instance and one implicitly defined instance:

   method_instance qwerty method facet_scalar_integral
     scalar_integrand: x^2
   quantity foobar energy method qwerty method edge_scalar_integral
     scalar_integrand: y^3

Usually the second, implicit definition will be more convenient. Several method instances may be included in one methodlist (up to a current limit of 50), and their values are added together and multiplied by the quantity modulus to get the quantity value. The FUNCTION methodexpr variant defines the quantity as a function of previously defined method instances. Example:

   method_instance qwerty method facet_scalar_integral
     scalar_integrand: x^2
   quantity foobar energy function qwerty^3

Non-global quantities may be applied to elements individually by adding the quantity name to the datafile line defining an element. They may also be applied or unapplied at runtime with the set and unset commands. Orientable methods can be applied with negative orientation in the datafile by following the name with a dash. The orientation in a set command follows the orientation the element is generated with.

Methods applying to different types of elements may be combined in one quantity. If such a quantity is applied to an element, then all method instances of that quantity of the appropriate type are applied to the element. Original attachments of quantities are remembered, soIf an edge method is applied to a facet, then edges created from refining that facet will inherit the edge method.


Named method instances

Usually, method instances are defined as part of the definition of a named quantity, but there are circumstances where a quantity is composed of several method instances and the method instances need to be referred to individually; perhaps the user wants to know the values of the individual instances. The general syntax for defining an instance of a named method in a datafile is:
  METHOD_INSTANCE name METHOD methodname [MODULUS constexpr] 
     [GLOBAL] [parameters]
Here, name is a user-assigned name for referring to this particular instance. methodname is one of the pre-defined methods in Evolver. The modulus value multiplies the method value to give the instance value. The default modulus is 1. GLOBAL makes the method apply to all elements of the appropriate type. Non-global instances may be applied to elements individually by adding the instance name to the datafile line defining an element. They may also be applied or unapplied at runtime with the set and unset commands. Orientable methods can be applied with negative orientation in the datafile by following the name with a dash. The orientation in a set command follows the orientation the element is generated with.

Each method may have various parameters to specialize it to an instance. Currently the only parameters specified are:

SCALAR_INTEGRAND: expr
where expr is a scalar function of coordinates (and of tangent or normal vector components in edge_general_integral or facet_general_integral). Element attributes of the appropriate type element may also be used.

VECTOR_INTEGRAND:
Q1: expr
Q2: expr
Q3: expr
where the expressions are functions of the coordinates. Element attributes of the appropriate type element may also be used.

FORM_INTEGRAND:
Q1: expr
Q2: expr
Q3: expr
...
where the expressions are functions of the coordinates. Element attributes of the appropriate type element may also be used. When used in the facet_2form_integral method. The form components are listed in lexicographic order, i.e. in 4D the six components 12,13,14,23,24,34 would be listed as Q1 through Q6.

PARAMETER_1 constexpr
For specifying miscellaneous numeric parameters to certain methods.

K_FORM_ORDER constexpr
For methods that use differential k-forms, this specifies the value of k. Should occur before FORM_INTEGRAND when needed.

Mobility declaration

A
mobility matrix may be defined in the top section of the datafile by the syntax
MOBILITY_TENSOR
expr expr expr
expr expr expr
expr expr expr
or
MOBILITY expr
The first form gives the full mobility matrix, and the second form gives the matrix as a scalar multiple of the identity matrix.

Metric declaration

A Riemannian metric on the ambient space may be declared in the top section of the datafile with the syntax
METRIC
expr expr expr
expr expr expr
expr expr expr
or
CONFORMAL_METRIC expr
or
KLEIN_METRIC
The keyword METRIC is followed by the N^2 components of the metric tensor, where N is the dimension of space. The components do not have to obey any particular line layout; they may be all on one line, or each on its own line, or any combination. It is up to the user to maintain symmetry. A conformal metric is a scalar multiple of the identity matrix, and only the multiple need be given. A conformal metric will run about twice as fast. The Klein metric is a built-in metric for hyperbolic n-space modelled on the unit disk or ball.

Viewing matrix

The top section of the datafile may contain an initial viewing matrix:
VIEW_MATRIX
  constexpr constexpr constexpr constexpr
  constexpr constexpr constexpr constexpr
  constexpr constexpr constexpr constexpr
  constexpr constexpr constexpr constexpr
The matrix is in homogeneous coordinates with translations in the last column. The size of the matrix is one more than the space dimension. This matrix will be part of all dump files, so the view can be saved between sessions. This matrix is used and set by native screen graphics ('s' command) and only applies to internal graphics (Postscript, Xwindows, etc.) but not external graphics (geomview). The elements may be read at runtime by view_matrix[i][j], where the indices start at 1.

View transforms

For the display of several transformations of the surface simultaneously, a number of viewing transformation matrices may be given in the top section of the datafile:
VIEW_TRANSFORMS n 
COLOR color
SWAP_COLORS
  constexpr constexpr constexpr constexpr
  constexpr constexpr constexpr constexpr
  constexpr constexpr constexpr constexpr
  constexpr constexpr constexpr constexpr
    ...
The transforms apply to all graphics, internal and external, and are prior to the viewing matrix for internal graphics. The identity transform is always done, so it does not need to be specified. The number of matrices follows the keyword VIEW_TRANSFORMS. Each matrix is in homogeneous coordinates, with translation in the last column. The size of each matrix is one more than the space dimension. Individual matrices need no special separation; Evolver just goes on an expression reading frenzy until it has all the numbers it wants. Each matrix may be preceded by an optional color that applies to facets transformed by that matrix. The color applies to one transform only; it does not continue until the next color specification. If SWAP_COLORS is present instead, facet frontcolor and backcolor will be swapped when this matrix is applied. Transforms may be activated or deactivated interactively with the transforms toggle. View transform generators are a more sophisticated way to control view transforms.

View transform generators

Listing all the view transforms is tedious and inflexible. An alternative is to list just a few matrices that can generate transforms. See the transform_expr command for instructions on entering the expression that generates the actual transforms. Special Note: in the torus model, the period translations are automatically added to the end of the list. So in the torus model, these are always available, even if you don't have view_transform_generators in the datafile. Syntax in the top of the datafile:
VIEW_TRANSFORM_GENERATORS n 
SWAP_COLORS
  constexpr constexpr constexpr constexpr
  constexpr constexpr constexpr constexpr
  constexpr constexpr constexpr constexpr
  constexpr constexpr constexpr constexpr
    ...
The number of matrices follows the keyword VIEW_TRANSFORM_GENERATORS. Each matrix is in homogeneous coordinates, with translation in the last column. The size of each matrix is one more than the space dimension. Individual matrices need no special separation; Evolver just goes on an expression reading frenzy until it has all the numbers it wants. If SWAP_COLORS is present, facet frontcolor and backcolor will be swapped when this matrix is applied.

Merit factor

If the keyword MERIT_FACTOR is present, then the i command will print the ratio total_area^3/total_volume^2, which measures the efficiency of area enclosing volume. A holdover from the early days of trying to beat Kelvin's partition of space.

Squared mean curvature

To add an energy of squared mean curvature, include a line in the top of the datafile
  SQUARED_CURVATURE modulus
The modulus is a multiplier for the energy. This is the original squared mean curvature energy; later versions are in the squared curvature named methods.

Squared Gaussian curvature

To add an energy of squared Gaussian curvature, include a line in the top of the datafile
  SQUARED_GAUSSIAN_CURVATURE modulus
The modulus is a multiplier for the energy. Synonyms: square_gaussian_curvature, sqgauss

Symmetric content

The datafile keyword SYMMETRIC_CONTENT triggers the use of an alternate surface integral for calculating body volumes, namely the vectorfield (x,y,z)/3. It is useful if unmodelled sides of a body are radial from the origin, or if constraint content integrals (which is evaluated by an approximation) lead to asymmetric results on what should be a symmetric surface.

Zoom_vertex

Datafile keyword setting the current zoom vertex. Used in dump files after a zoom command has been given.

Zoom_radius

Datafile keyword setting the current zoom radius. Used in dump files after a zoom command has been given.

Element lists

The lists of geometric elements follow a general format. Each element is defined on one line. The first entry on a line is the element number. Numbering need not be consecutive, and may omit numbers, but be aware that internally elements will be renumbered in order. The original number in the datafile is accessible as the original attribute of an element. After the element number comes the basic defining data, followed by optional attributes in arbitrary order. Besides the particular attributes for each element type listed below, one may specify values for any extra attributes defined earlier. The syntax is attribute name followed by the appropriate number of values. Also an arbitrary number of named quantities or method instances may be listed. These add method values for this element to the named quantity. The named quantity or instance must have been declared in the top section of the datafile.

Vertex list

The datafile vertex list is started by the keyword VERTICES at the start of a line. It is followed by lines with one vertex specification per line. If the vertex is not on a parametric boundary, the syntax is
k   x y ... [FIXED] [CONSTRAINT c1 c2 ...]  [BARE]
            [quantityname ...] [methodname ...]
The syntax for a vertex on a parametric boundary is
k p1 [p2 ...]  BOUNDARY b [FIXED] [BARE] [quantityname ...] 
   [methodname ...] 
Here k is the vertex number, a positive integer. Vertices do not need to be listed in order, and there may be gaps in the numbering. However, if they are not in consecutive order, then the numbering in dump files will be different. x y ... are constant expressions for coordinates. In the parametric boundary format, the boundary parameter values are given instead of the coordinates. If FIXED is given, then the vertex never moves, except possibly for an initial projection to constraints. If CONSTRAINT is given, then one or more constraint numbers must follow. You can list as many constraints as you want, as long as those that apply exactly at any time are consistent and independent. The given coordinates need not lie exactly on the constraints; they will be projected onto them. A vertex on a parametric boundary cannot also be on a constraint.

The BARE attribute is just an instruction to the checking routines that this vertex is not supposed to have an adjacent facet in the soapfilm model, so spurious warnings will not be generated. This is useful when you want to show bare wires or outline fundamental domains.

An arbitrary number of named quantities or method instances may be listed. These add method values for this element to the named quantity. The named quantity or instance must have been declared in the top section of the datafile.


Edge list

The datafile edge list follows the vertex list, and is started by the keyword EDGES at the start of a line. It is followed by lines with one edge specification per line in this format (linespliced here):
k v1 v2 [midv] [s1 s2 s3] [WRAP w] [FIXED] [BOUNDARY b] \
   [CONSTRAINTS c1 [c2 ...]] [TENSION constexpr] [COLOR n] \
     [BARE]  [quantityname ...] [methodname ...] 
Here k is the edge number, with numbering following the same rules as for vertices. v1 and v2 are the numbers of the tail and head vertices of the edge. In the quadratic model, the edge midpoint may be listed as a third vertex midv (otherwise a midpoint vertex will be created). In the torus model, there must follow signs s1 s2 s3 indicating how the edge wraps around each unit cell direction: + for once positive, * for none, and - for once negative. In non-torus symmetry groups, each edge should have a WRAP symmetry group element encoded as an integer. FIXED means that all vertices and edges resulting from subdividing this edge will have the FIXED attribute; it does not mean that the endpoints will be automatically fixed. Likewise the BOUNDARY and CONSTRAINT attributes will be inherited by all edges and vertices derived from this edge. If a constraint has energy or content integrands, these will be done for this edge. IMPORTANT: If a constraint number is given as negative, the edge energy and content integrals will be done in the opposite orientation. In the string model, the default tension is 1, and in the soapfilm model, the default tension is 0. However, edges may be given nonzero tension in the soapfilm model, and they will contribute to the energy.

If the simplex model is in effect, edges are one less dimension than facets and given by an ordered list of vertices. Only edges on constraints with integrals need be listed.

The BARE attribute is just an instruction to the checking routines that this ede is not supposed to have an adjacent facet in the soapfilm model, so spurious warnings will not be generated. This is useful when you want to show bare wires or outline fundamental domains.

An arbitrary number of named quantities or method instances may be listed. These add method values for this element to the must have been declared in the top section of the datafile. If the quantity or instance has orientation-dependent methods, the name may be followed by a dash to reverse the applied orientation.


Face list

The datafile face list follows the edge list, and is started by the keyword FACES at the start of a line. It is followed by lines with one facets specification per line in this format:
  k   e1 e2 ...  [FIXED] [TENSION constexpr] [BOUNDARY b] \
  [CONSTRAINTS c1 [c2 ...]]     [NODISPLAY]   \
   [COLOR n]} [FRONTCOLOR n] [BACKCOLOR n] \
   [PHASE n] [quantityname ...] [methodname ...] 
Here k is the face number, with numbering following the same rules as for vertices. There follows a list of oriented edge numbers in counterclockwise order around the face. A negative edge number means the opposite orientation of the edge from that defined in the edge list. The head of the last edge must be the tail of the first edge (except if you're being tricky in the string model). There is no limit on the number of edges. The face will be automatically subdivided into triangles if it has more than three edges in the soapfilm model. The TENSION (synonym: DENSITY) value is the energy per unit area (the surface tension) of the facet; the default is 1. Density 0 facets exert no force, and can be useful to define volumes or in displays. Fractional density is useful for prescribed contact angles. NODISPLAY prevents the facet from being displayed. The COLOR attribute applies to both sides of a facet; FRONTCOLOR applies to the positive side (edges going counterclockwise) and BACKCOLOR to the negative side. The PHASE number is used in the string model to determine the surface tension of edges between facets of different phases, if phases are used.

If the simplex model is in effect, the edge list should be replaced by an oriented list of vertex numbers.

An arbitrary number of named quantities or method instances may be listed. These add method values for this element to the must have been declared in the top section of the datafile. If the quantity or instance has orientation-dependent methods, the name may be followed by a dash to reverse the applied orientation.

The faces section is optional in the string model.


Body list

The datafile body list follows the face list, and is started by the keyword BODIES at the start of a line. It is followed by lines with one body specification per line in this format:
k  f1 f2 f3 .... [VOLUME constexpr] [VOLCONST constexpr] [ACTUAL_VOLUME constexpr] \
[PRESSURE p] [DENSITY constexpr] [PHASE ] 
Here k is the body number, and f1 f2 f3 ... is an unordered list of signed facet numbers. Positive sign indicates that the facet normal (as given by the right-hand rule from the edge order in the facet list) is outward from the body and negative means the normal is inward. Giving a VOLUME value constexpr means the body has a volume constraint, unless the ideal gas model is in effect, in which case constexpr is the volume at the ambient pressure. VOLCONST is a value added to the volume; it is useful when the volume calculation from facet and edge integrals differs from the true volume by a constant amount, as may happen in the torus model. ACTUAL_VOLUME is a number that can be specified in the rare circumstances where the torus volume volconst calculation gives the wrong answer; volconst will be adjusted to give this volume of the body. Giving a PRESSURE value means that the body is deemed to have a constant internal pressure; this is useful for prescribed mean curvature problems. It is incompatible with prescribed volume. Giving a DENSITY value means that gravitational potential energy will be included.

To endow a facet with VOLUME, PRESSURE, or DENSITY attributes in the string model, define a body with just the one facet.

The PHASE number is used in the soapfilm model to determine the surface tension of facets between bodies of different phases, if phases are used.

The BODIES section is optional.


READ section

The final section of the datafile may contain commands. These commands are read and executed immediately, just as if they had been entered at the command prompt. Encountering the keyword READ in the datafile causes the Evolver to switch from datafile mode to command mode and read the rest of the datafile as command input. This feature is useful for automatic initialization of the surface with refining, iteration, defining your own commands, etc.
Back to top of Surface Evolver documentation.