Rather than creating meshes for surface evolver
http://facstaff.susqu.edu/brakke/evolver/evolver.html by hand I've used
ANSYS http://www.ansys.com/ which correctly orients the surfaces
volumes. Following is a script to convert ANSYS .node and .elem files
to the surface evolver geometry definition section. You may need to
adjust the volume as the last word in the .fe file. The ANSYS vsum
command computes volume volume. I've installed j as ijconsole to match
linux systems. The example use is set up for my particular files named
using bash notation: {8,16,32,64,128}.{node,elem}
Note 'convert file.node file.elem to surface evolver .fe geometry'
Use, DOS: ijconsole -js "'d:/evolver/test'main
2^3+i.5[load'd:/evolver/ansys_to_evolver.ijs'"
prepare ANSYS with 3 node triangular elements facing outward on volumes.
ET,1,SHELL181
KEYOPT,1,1,0
KEYOPT,1,3,0
KEYOPT,1,8,0
KEYOPT,1,9,0
MSHAPE,1,2D ! probably selects triangular mesh
MSHKEY,0
ames,all
nwri ! write the node and element data
ewri
also need the volume.
file.node may have missing coordinates. For example, where's z?
1 0.000000000000 5.000000000000
2
3 0.000000000000 4.666666666667
file.elem
)
NB. file operations
delete=: ([: 1!:55 boxopen) ::([:smoutput ,&' did not exist to delete')
read=: CR -.~ 1!:1@:boxopen
open=: 1!:21@:boxopen
close=: 1!:22@:boxopen
append=: 1!:3~ ,&LF
current_time=: 6!:0
rank=: #@:$
Until=: 2 :'u^:(0-:v)^:_'
to_minus=: (=&'_')`(,:&'-')}
to_literal=: ([: to_minus (([:,/,.&LF)"2 Until (2 > rank)))@:":
NB. use the first occurrence of the vertex pair, changing sign as necessary
map_to_index =: ((i.~ |."1) (<. ([ * _1 2 p. =) ])&:>: i.@:#) :[: NB. y
is a list of edges
MAIN =: 'd:/evolver'&$: :(4 :0)"_ 0
DIRECTORY =. '/' ,~ Until (= {:) x NB. append / if necessary
BASENAME =. '.' ,~ Until (= {:) ": y NB. append . if necessary, and
in my case y is an integer
PATH =. DIRECTORY , BASENAME
NODES =. _ 4 {. _&".;._2 CR -.~ read PATH , 'node'
VERTICES =. (8 , 3 # 16j4) ": NODES
ELEMENTS =. ((<:i.4) { _&".);._2 CR -.~ read PATH , 'elem'
EDGES =. _2 [\ , 1 2 2 3 3 1 {"1 ELEMENTS
FACES =. (_3 [\ map_to_index) EDGES
OUTPUT =. PATH , 'fe'
delete OUTPUT
EVOLVER =. open OUTPUT
a =. EVOLVER&append
a '//Created by ansys_to_evolver.ijs, David Lambert'
a 'VERTICES//' , current_time 'YYYY-MM-DD:hh:mm'
a to_literal VERTICES
a 'EDGES//'
a to_literal (0&<@:,FACES) # (,.~ >:@:i.@:#) EDGES NB. remove bare
edges to avoid warnings.
a 'FACES//'
a 12 to_literal (,.~ >:@:i.@:#),.FACES
a 'BODIES//'
a ' volume 1' ,~ to_literal 1 , , {."1 ELEMENTS
OUTPUT [ close EVOLVER
)
main =: ([ smoutput)@:(MAIN :: ([: exit 0:))
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm