\section{Electrostatics Preprocessor Lua Command Set}

A number of different commands are available in the preprocessor.
Two naming conventions can be used: one which separates words in
the command names by underscores, and one that eliminates the
underscores.

\subsection{Object Add/Remove Commands}
\begin{itemize}
\item {\tt ei\_addnode(x,y)} Add a new node at x,y

\item {\tt ei\_addsegment(x1,y1,x2,y2)} Add a new line segment from node closest to
(x1,y1) to node closest to (x2,y2)

\item {\tt ei\_addblocklabel(x,y)} Add a new block label at (x,y)

\item {\tt ei\_addarc(x1,y1,x2,y2,angle,maxseg)} Add a new arc segment from the
nearest node to (x1,y1) to the nearest node to (x2,y2) with angle `angle'
divided into `maxseg' segments.

\item {\tt ei\_deleteselected} Delete all selected objects.

\item {\tt ei\_deleteselectednodes} Delete selected nodes.

\item {\tt ei\_deleteselectedlabels} Delete selected block labels.

\item {\tt ei\_deleteselectedsegments} Delete selected segments.

\item {\tt ei\_deleteselectedarcsegments} Delete selects arcs.
\end{itemize}


\subsection{Geometry Selection Commands}

\begin{itemize}
\item {\tt ei\_clearselected()} Clear all selected nodes, blocks, segments and arc
segments.

\item {\tt ei\_selectsegment(x,y)} Select the line segment closest to (x,y)

\item {\tt ei\_selectnode(x,y)} Select the node closest to (x,y).
Returns the coordinates of the selected node.

\item {\tt ei\_selectlabel(x,y)} Select the label closet to (x,y).
Returns the coordinates of the selected label.

\item {\tt ei\_selectarcsegment(x,y)} Select the arc segment closest to (x,y)

\item {\tt ei\_selectgroup(n)} Select the n$^{th}$ group of nodes, segments, arc
segments and block labels. This function will clear all previously selected
elements and leave the edit mode in 4 (group)

\item{\tt ei\_selectcircle(x,y,R,editmode)} selects objects within a circle of radius
R centered at (x,y).  If only x, y, and R paramters are given, the current
edit mode is used.  If the editmode parameter is used, 0 denotes nodes, 2
denotes block labels, 2 denotes segments, 3 denotes arcs, and 4 specifies
that all entity types are to be selected.

\item{\tt ei\_selectrectangle(x1,y1,x2,y2,editmode)} selects objects within a rectangle
defined by points (x1,y1) and (x2,y2). If no editmode parameter is supplied,
the current edit mode is used.  If the editmode parameter is used, 0 denotes
nodes, 2 denotes block labels, 2 denotes segments, 3 denotes arcs, and 4 
specifies that all entity types are to be selected.
\end{itemize}


\subsection{Object Labeling Commands}

\begin{itemize}
\item {\tt ei\_setnodeprop("propname",groupno, "inconductor")} Set the selected
nodes to have the nodal property \texttt{"propname"} and group
number \texttt{groupno}. The \texttt{"inconductor"} string
specifies which conductor the node belongs to. If the node doesn't
belong to a named conductor, this parameter can be set to
\texttt{"<None>"}.

\item {\tt ei\_setblockprop("blockname", automesh, meshsize, group)} Set the
selected block labels to have the properties:

Block property \texttt{"blockname"}.

\texttt{automesh}: 0 = mesher defers to mesh size constraint defined in
\texttt{meshsize}, 1 = mesher automatically chooses the mesh density.

\texttt{meshsize}: size constraint on the mesh in the block marked by this
label.

A member of group number \texttt{group}

\item {\tt ei\_setsegmentprop("propname", elementsize, automesh, hide, group,
"inconductor",)} Set the select segments to have:

Boundary property \texttt{"propname"}

Local element size along segment no greater than
\texttt{elementsize}

\texttt{automesh}: 0 = mesher defers to the element constraint defined by
\texttt{elementsize}, 1 = mesher automatically chooses mesh size along the
selected segments

\texttt{hide}: 0 = not hidden in post-processor, 1 == hidden in post
processor

A member of group number \texttt{group}

A member of the conductor specified by the string
\texttt{"inconductor".} If the segment is not part of a conductor,
this parameter can be specified as
\texttt{"<None>"}.

\item {\tt ei\_setarcsegmentprop(maxsegdeg, "propname", hide, group,
"inconductor")} Set the selected arc segments to:

Meshed with elements that span at most \texttt{maxsegdeg} degrees
per element

Boundary property \texttt{"propname"}

\texttt{hide}: 0 = not hidden in post-processor, 1 == hidden in post
processor

A member of group number \texttt{group}

A member of the conductor specified by the string
\texttt{"inconductor".} If the segment is not part of a conductor,
this parameter can be specified as
\texttt{"<None>"}.

\item{\tt ei\_setgroup(n)} Set the group associated of the selected items to n

\end{itemize}

\subsection{Problem Commands}

\begin{itemize}
\item {\tt ei\_probdef(units,type,precision,(depth),(minangle))} changes the problem
definition. The \texttt{units} parameter specifies the units used
for measuring length in the problem domain. Valid \texttt{"units"}
entries are
\texttt{"inches"}, \texttt{"millimeters"}, \texttt{"centimeters"},
\texttt{"mils"}, \texttt{"meters}, and \texttt{"micrometers"}. Set
\texttt{problemtype} to \texttt{"planar"} for a 2-D planar problem, or to
\texttt{"axi"} for an axisymmetric problem. The \texttt{precision} parameter
dictates the precision required by the solver. For example, entering
\texttt{1.E-8} requires the RMS of the residual to be less than 10$^{ - 8}$.
A fourth parameter, representing the depth of the problem in the
into-the-page direction for 2-D planar problems, can also be specified
for planar problems. A sixth parameter represents the minimum angle constraint sent to the mesh generator.

\item {\tt ei\_analyze(flag)} runs \texttt{belasolv} to solve the problem. The
\texttt{flag} parameter controls whether the Belasolve window is visible or
minimized. For a visible window, either specify no value for
\texttt{flag} or specify 0. For a minimized window, \texttt{flag}
should be set to 1.

\item {\tt ei\_loadsolution()} loads and displays the solution corresponding to the
current geometry.

\item {\tt ei\_setfocus("documentname")} Switches the
electrostatics input file upon which Lua commands are to act. If
more than one electrostatics input file is being edited at a time,
this command can be used to switch between files so that the
mutiple files can be operated upon programmatically via Lua. {\tt
documentname} should contain the name of the desired document as
it appears on the window's title bar.

\item {\tt ei\_saveas("filename")} saves the file with name
\texttt{"filename"}. Note if you use a path you must use two backslashes
{\em e.g.} \verb+c:\\temp\\myfemmfile.fee+

\end{itemize}

\subsection{Mesh Commands}

\begin{itemize}
\item \texttt{ei\_createmesh()} runs triangle to create a mesh. Note that this is not
a necessary precursor of performing an analysis, as
\texttt{ei\_analyze()} will make sure the mesh is up to date before
running an analysis. The number of elements in the mesh is pushed
back onto the lua stack.

\item \texttt{ei\_showmesh()} toggles the flag that shows or hides the mesh.

\item \texttt{ei\_purgemesh()} clears the mesh out of both the screen and memory.
\end{itemize}

\subsection{Editing Commands}
\begin{itemize}

\item \texttt{ei\_copyrotate(bx, by, angle, copies, (editaction) )}

\texttt{bx, by} -- base point for rotation

\texttt{angle} -- angle by which the selected objects are incrementally
shifted to make each copy. \texttt{angle} is measured in degrees.

\texttt{copies} -- number of copies to be produced from the selected
objects.

\texttt{editaction} 0 --nodes, 1 -- lines (segments), 2 --block labels, 3 --
arc segments, 4- group

\item \texttt{ei\_copytranslate(dx, dy, copies, (editaction))}

\texttt{dx,dy} -- distance by which the selected objects are incrementally
shifted.

\texttt{copies} -- number of copies to be produced from the selected
objects.

\texttt{editaction} 0 --nodes, 1 -- lines (segments), 2 --block labels, 3 --
arc segments, 4- group

\item{\tt mi\_createradius(x, y, r)} turns a corner located at {\tt (x,y)} into a curve of radius {\tt r}.

\item \texttt{ei\_moverotate(bx,by,shiftangle (editaction))}

\texttt{bx, by} -- base point for rotation

\texttt{shiftangle} -- angle in degrees by which the selected objects are
rotated.

\texttt{editaction} 0 --nodes, 1 -- lines (segments), 2 --block labels, 3 --
arc segments, 4- group

\item \texttt{ei\_movetranslate(dx,dy,(editaction))}

\texttt{dx,dy} -- distance by which the selected objects are shifted.

\texttt{editaction} 0 --nodes, 1 -- lines (segments), 2 --block labels, 3 --
arc segments, 4- group

\item \texttt{ei\_scale(bx,by,scalefactor,(editaction))}

\texttt{bx, by} -- base point for scaling

\texttt{scalefactor} -- a multiplier that determines how much the selected
objects are scaled

\texttt{editaction} 0 --nodes, 1 -- lines (segments), 2 --block labels, 3 --
arc segments, 4- group

\item \texttt{ei\_mirror(x1,y1,x2,y2,(editaction))} mirror the selected objects about
a line passing through the points \texttt{(x1,y1)} and
\texttt{(x2,y2)}. Valid \texttt{editaction} entries are 0 for
nodes, 1 for lines (segments), 2 for block labels, 3 for arc
segments, and 4 for groups.

\item \texttt{ei\_seteditmode(editmode)} Sets the current editmode to:

\texttt{"nodes"} -- nodes

\texttt{"segments"} - line segments

\texttt{"arcsegments"} - arc segments

\texttt{"blocks"} - block labels

\texttt{"group"} - selected group

This command will affect all subsequent uses of the other editing
commands, if they are used WITHOUT the \texttt{editaction}
parameter.
\end{itemize}

\subsection{Zoom Commands}

\begin{itemize}
\item \texttt{ei\_zoomnatural()} zooms to a ``natural'' view with sensible extents.

\item \texttt{ei\_zoomout()} zooms out by a factor of 50{\%}.

\item \texttt{ei\_zoomin()} zoom in by a factor of 200{\%}.

\item \texttt{ei\_zoom(x1,y1,x2,y2)} Set the display area to be from the bottom left
corner specified by \texttt{(x1,y1}) to the top right corner
specified by \texttt{(x2,y2)}.
\end{itemize}

\subsection{View Commands}
\begin{itemize}
\item \texttt{ei\_showgrid()} Show the grid points.

\item \texttt{ei\_hidegrid()} Hide the grid points points.

\item \texttt{ei\_gridsnap("flag")} Setting flag to ''on'' turns on snap to grid,
setting flag to "off"turns off snap to grid.

\item \texttt{ei\_setgrid(density,"type")} Change the grid spacing. The density
parameter specifies the space between grid points, and the type
parameter is set to \texttt{"cart"} for Cartesian coordinates or
\texttt{"polar"} for polar coordinates.

\item \texttt{ei\_refreshview()} Redraws the current view.

\item{\tt ei\_minimize()} minimizes the active magnetics input view.

\item{\tt ei\_maximize()} maximizes the active magnetics input view.

\item{\tt ei\_restore()} restores the active magnetics input view from a
 minimized or maximized state.

\item{\tt ei\_resize(width,height)} resizes the active magnetics input
 window client area to width $\times$ height.

\end{itemize}




\subsection{Object Properties}

\begin{itemize}
\item \texttt{ei\_getmaterial("materialname")} fetches the material specified by \texttt{materialname} 
from the materials library.

\item \texttt{ei\_addmaterial("materialname", ex, ey, qv)} adds a new material with
called \texttt{"materialname"} with the material properties:

\texttt{ex} Relative permittivity in the x- or r-direction.

\texttt{ey} Relative permittivity in the y- or z-direction.

\texttt{qv} Volume charge density in units of C/m$^{3}$

\item \texttt{ei\_addpointprop("pointpropname",Vp,qp)} adds a new point property of
name \texttt{"pointpropname"} with either a specified potential
\texttt{Vp }a point charge density \texttt{qp} in units of C/m.

\item \texttt{ei\_addboundprop("boundpropname", Vs, qs, c0, c1, BdryFormat)} adds a
new boundary property with name \texttt{"boundpropname"}

For a ``Fixed Voltage'' type boundary condition, set the
\texttt{Vs} parameter to the desired voltage and all other
parameters to zero.

To obtain a ``Mixed'' type boundary condition, set \texttt{C1} and
\texttt{C0} as required and \texttt{BdryFormat} to 1. Set all other
parameters to zero.

To obtain a prescribes surface charge density, set \texttt{qs} to
the desired charge density in C/m$^{2}$ and set \texttt{BdryFormat}
to 2.

For a ``Periodic'' boundary condition, set \texttt{BdryFormat} to 3
and set all other parameters to zero.

For an ``Anti-Perodic'' boundary condition, set \texttt{BdryFormat}
to 4 set all other parameters to zero.

\item \texttt{ei\_addconductorprop("conductorname", Vc, qc, conductortype)} adds a new
conductor property with name \texttt{"conductorname"} with either a
prescribed voltage or a prescribed total charge. Set the unused
property to zero. The \texttt{conductortype} parameter is 0 for
prescribed charge and 1 for prescribed voltage.

\item \texttt{ei\_deletematerial("materialname")} deletes the material named
\texttt{"materialname"}.

\item \texttt{ei\_deleteboundprop("boundpropname")} deletes the boundary property
named \texttt{"boundpropname"}.

\item \texttt{ei\_deleteconductor("conductorname")} deletes the conductor named
\texttt{conductorname}.

\item \texttt{ei\_deletepointprop("pointpropname")} deletes the point property named
\texttt{"pointpropname"}

\item \texttt{ei\_modifymaterial("BlockName",propnum,value)} This function allows for
modification of a material's properties without redefining the
entire material (e.g. so that current can be modified from run to
run). The material to be modified is specified by
\texttt{"BlockName"}. The next parameter is the number of the
property to be set. The last number is the value to be applied to
the specified property. The various properties that can be modified
are listed below:

\begin{tabular}{lll}
propnum & Symbol &  Description \\ \hline
 0 & \texttt{BlockName} & Name of the material \\
 1 & \texttt{ex} & x (or r) direction relative permittivity \\
 2 & \texttt{ey} & y (or z) direction relative permittivity \\
 3 & \texttt{qs} & Volume charge
\end{tabular}


\item \texttt{ei\_modifyboundprop("BdryName",propnum,value) }This function allows for
modification of a boundary property. The BC to be modified is specified by
\texttt{"BdryName"}. The next parameter is the number of the property to be
set. The last number is the value to be applied to the specified property.
The various properties that can be modified are listed below:

\begin{tabular}{lll}
 \texttt{propnum} & Symbol & Description \\ \hline
 0 & \texttt{BdryName} & Name of boundary property \\
 1 & \texttt{Vs} & Fixed Voltage \\
 2 & \texttt{qs} & Prescribed charge density \\
 3 & \texttt{c0} & Mixed BC parameter \\
 4 & \texttt{c1} & Mixed BC parameter \\
 5 & \texttt{BdryFormat} & Type of boundary condition:\\
   &   &
   \begin{tabular}{lll}
   0 & = & Prescribed V \\
   1 & = & Mixed \\
   2 & = & Surface charge density \\
   3 & = & Periodic \\
   4 & = & Antiperiodic
   \end{tabular}
\end{tabular}





\item \texttt{ei\_modifypointprop("PointName",propnum,value)} This function allows for
modification of a point property. The point property to be modified
is specified by \texttt{"PointName"}. The next parameter is the
number of the property to be set. The last number is the value to
be applied to the specified property. The various properties that
can be modified are listed below:



\begin{tabular}{lll}
\texttt{propnum} & Symbol & Description \\ \hline
 0 & \texttt{PointName} & Name of the point property \\
 1 & \texttt{Vp} & Prescribed nodal voltage \\
 2 & \texttt{qp} & Point charge density in C/m
\end{tabular}

\item \texttt{ei\_modifyconductorprop("ConductorName",propnum,value)} This function
allows for modification of a conductor property. The conductor
property to be modified is specified by \texttt{"ConductorName"}.
The next parameter is the number of the property to be set. The
last number is the value to be applied to the specified property.
The various properties that can be modified are listed below:


\begin{tabular}{lll}
\texttt{propnum} & Symbol & Description \\ \hline
  0 & \texttt{ConductorName} & Name of the conductor property \\
  1 & \texttt{Vc} &  Conductor voltage \\
  2 & \texttt{qc} &  Total conductor charge \\
  3 & \texttt{ConductorType} & 0 = Prescribed charge, 1 = Prescribed voltage
\end{tabular}

\end{itemize}

\subsection{Miscellaneous}

\begin{itemize}
\item \texttt{ei\_savebitmap("filename")} saves a bitmapped screenshot of the current
view to the file specified by \texttt{"filename"}, subject to the
\texttt{printf}-type formatting explained previously for the
\texttt{ei\_saveas} command.

\item \texttt{ei\_savemetafile("filename")} saves a metafile screenshot of the current
view to the file specified by \texttt{"filename"}, subject to the
\texttt{printf}-type formatting explained previously for the
\texttt{ei\_saveas} command.

\item \texttt{ei\_refreshview()} Redraws the current view.

\item \texttt{ei\_close()} closes the preprocessor window and
destroys the current document.

\item \texttt{ei\_shownames(flag)} This function allow the user to display or hide the
block label names on screen. To hide the block label names,
\texttt{flag} should be 0. To display the names, the parameter
should be set to 1.

\item{\tt ei\_readdxf("filename")} This function imports a dxf file specified by {\tt "filename"}.

\item{\tt ei\_savedxf("filename")} This function saves geometry informatoin in a dxf file specified by {\tt "filename"}.

\item{\tt ei\_defineouterspace(Zo,Ro,Ri)} defines
an axisymmetric external region to be used in conjuction with the
Kelvin Transformation method of modeling unbounded problems.  The
{\tt Zo} parameter is the z-location of the origin of the outer region,
the {\tt Ro} parameter is the radius of the outer region, and the {\tt
Ri} parameter is the radius of the inner region ({\em i.e.} the region of
interest). In the exterior region, the permeability varies as a function of
distance from the origin of the external region.  These parameters
are necessary to define the permeability variation in the external
region.

\item{\tt ei\_attachouterspace()} marks all
selected block labels as members of the external region used for
modeling unbounded axisymmetric problems via the Kelvin
Transformation.

\item{\tt ei\_detachouterspace()} undefines all selected block labels
as members of the external region used for modeling unbounded axisymmetric
problems via the Kelvin Transformation.

\item{\tt ei\_attachdefault()} marks the
selected block label as the default block label.  This block label
is applied to any region that has not been explicitly labeled.

\item{\tt ei\_detachdefault()} undefines the default
attribute for the selected block labels.

\item{\tt ei\_makeABC(n,R,x,y,bc)} creates a series of circular shells that emulate the
impedance of an unbounded domain (i.e. an Inprovised Asymptotic Boundary
Condition).  The {\tt n} parameter contains the number of shells to be used
(should be between 1 and 10), {\tt R} is the radius of the solution domain, and
{\tt (x,y)} denotes the center of the solution domain.  The {\tt bc} parameter should
be specified as 0 for a Dirichlet outer edge or 1 for a Neumann outer edge.
If the function is called without all the parameters, the function makes up
reasonable values for the missing parameters. 

\end{itemize}

\section{Electrostatics Post Processor Command Set}

There are a number of Lua scripting commands designed to operate in
the postprocessor. As with the preprocessor commands, these
commands can be used with either the underscore naming or with the
no-underscore naming convention.

\subsection{Data Extraction Commands}
\begin{itemize}

\item \texttt{eo\_lineintegral(type)} Calculate the line integral for the defined contour

\begin{tabular}{ll}
\texttt{type} & Integral \\ \hline
 0 & $E \cdot t$ \\
 1 & $D \cdot n$ \\
 2 & Contour length \\
 3 & Force from stress tensor \\
 4 & Torque from stress tensor
\end{tabular}

This integral returns either 1 or 2 values, depending on the
integral type, $e.g.:$

\texttt{Fx, Fy = eo\_lineintegral(3)}

\item \texttt{eo\_blockintegral(type)} Calculate a block integral for the selected
blocks

\begin{tabular}{ll}
\texttt{type} & Integral \\ \hline
 0 & Stored Energy \\
 1 & Block Cross-section \\
 2 & Block Volume \\
 3 & Average $D$ over the block \\
 4 & Average $E$ over the block \\
 5 & Weighted Stress Tensor Force \\
 6 & Weighted Stress Tensor Torque
\end{tabular}

Returns one or two floating point values as results, $e.g$.:

\texttt{Fx, Fy = eo\_blockintegral(4)}

\item \texttt{eo\_getpointvalues(X,Y)} Get the values associated with the point at x,y
The return values, in order, are:

\begin{tabular}{ll}
\texttt{Symbol} &  Definition \\ \hline
\texttt{V} & Voltage \\
\texttt{Dx} & x- or r- direction component of displacement \\
\texttt{Dy} & y- or z- direction component of displacement \\
\texttt{Ex} & x- or r- direction component of electric field intensity \\
\texttt{Ey} & y- or z- direction component of electric field intensity \\
\texttt{ex} & x- or r- direction component of permittivity \\
\texttt{ey} & y- or z- direction component of permittivity \\
\texttt{nrg} & electric field energy density \\
\end{tabular}

Example: To catch all values at (0.01,0) use

\texttt{V,Dx,Dy,Ex,Ey,ex,ey,nrg= eo\_getpointvalues(0.01,0) }

\item \texttt{eo\_makeplot(PlotType,NumPoints,Filename,FileFormat) }Allows Lua access
to the X-Y plot routines. If only PlotType or only PlotType and NumPoints
are specified, the command is interpreted as a request to plot the requested
plot type to the screen. If, in addition, the Filename parameter is
specified, the plot is instead written to disk to the specified file name as
an extended metafile. If the FileFormat parameter is also, the command is
instead interpreted as a command to write the data to disk to the specfied
file name, rather than display it to make a graphical plot. Valid entries
for PlotType are:

\begin{tabular}{ll}
\texttt{PlotType} &  Definition \\ \hline
 0 & \texttt{V (Voltage)} \\
 1 & \texttt{$\vert$D$\vert$ (Magnitude of flux density)} \\
 2 & \texttt{D . n (Normal flux density)} \\
 3 & \texttt{D . t (Tangential flux density)} \\
 4 & \texttt{$\vert$E$\vert$ (Magnitude of field intensity)} \\
 5 & \texttt{E . n (Normal field intensity)} \\
 6 & \texttt{E . t (Tangential field intensity)}
\end{tabular}

\vspace*{8pt}
Valid file formats are:

\begin{tabular}{ll}
\texttt{FileFormat} &  Definition  \\ \hline
 0 & \texttt{Multi-column text with legend } \\
 1 & \texttt{Multi-column text with no legend } \\
 2 & \texttt{Mathematica-style formatting}
\end{tabular}

For example, if one wanted to plot $V $ to the screen with 200 points evaluated
to make the graph, the command would be: \newline
\texttt{eo\_makeplot(0,200) } \newline
If this plot were to be written to disk as a metafile, the command
would be:\texttt{ } \newline
\texttt{eo\_makeplot(0,200,"c:temp.emf")} \newline
To write data instead of a plot to disk, the command would be of
the form:\texttt{ } \newline
\texttt{eo\_makeplot(0,200,"c:temp.txt",0)} \newline


\item \texttt{eo\_getprobleminfo() }Returns info on problem description. Returns three
values: the Problem type (0 for planar and 1 for axisymmetric); the depth
assumed for planar problems in units of meters; and the length unit used to draw the
geometry represented in units of meters.

\item \texttt{eo\_getconductorproperties("conductor")} Properties are returned for the
conductor property named "conductor". Two values are returned: The voltage
of the specified conductor, and the charge carried on the specified
conductor.
\end{itemize}

\subsection{Selection Commands}

\begin{itemize}
\item \texttt{eo\_seteditmode(mode) }Sets the mode of the postprocessor to point,
contour, or area mode. Valid entries for mode are\texttt{ "point",
"contour", }and\texttt{ "area". }

\item \texttt{eo\_selectblock(x,y) }Select the block that contains point\texttt{
(x,y).}

\item \texttt{eo\_groupselectblock(n) }Selects all of the blocks that are labeled by
block labels that are members of group n. If no number is specified
({\em i.e.} \texttt{eo\_groupselectblock()}), all blocks are selected.

\item \texttt{eo\_selectconductor("name")} Selects all nodes, segments, and arc
segments that are part of the conductor specified by the string
\texttt{("name")}. This command is used to select conductors for the
purposes of the ``weighted stress tensor'' force and torque
integrals, where the conductors are points or surfaces, rather than
regions ({\em i.e.} can't be selected with \texttt{eo\_selectblock}).

\item \texttt{eo\_addcontour(x,y) }Adds a contour point at\texttt{ (x,y). }If this is
the first point then it starts a contour, if there are existing
points the contour runs from the previous point to this point. The
\texttt{eo\_addcontour }command has the same functionality as a
right-button-click contour point addition when the program is
running in interactive mode.\texttt{ }

\item \texttt{eo\_bendcontour(angle,anglestep)} Replaces the straight line formed by
the last two points in the contour by an arc that spans angle
degrees. The arc is actually composed of many straight lines, each
of which is constrained to span no more than anglestep degrees. The
\texttt{angle} parameter can take on values from -180 to 180
degrees. The \texttt{anglestep} parameter must be greater than
zero. If there are less than two points defined in the contour,
this command is ignored.

\item \texttt{eo\_selectpoint(x,y)} Adds a contour point at the closest input point to
\texttt{(x,y).} If the selected point and a previous selected points lie at
the ends of an arcsegment, a contour is added that traces along the
arcsegment. The \texttt{selectpoint} command has the same
functionality as the left-button-click contour point selection when
the program is running in interactive mode.

\item \texttt{eo\_clearcontour()} Clear a prevously defined contour

\item \texttt{eo\_clearblock()} Clear block selection
\end{itemize}



\subsection{Zoom Commands}

\begin{itemize}
\item \texttt{eo\_zoomnatural()} Zoom to the natural boundaries of the geometry.

\item \texttt{eo\_zoomin()} Zoom in one level.

\item \texttt{eo\_zoomout()} Zoom out one level.

\item \texttt{eo\_zoom(x1,y1,x2,y2)} Zoom to the window defined by lower left corner
\texttt{(x1,y1)} and upper right corner\texttt{ (x2,y2).}
\end{itemize}



\subsection{View Commands}

\begin{itemize}
\item \texttt{eo\_showmesh()} Show the mesh.

\item \texttt{eo\_hidemesh()} Hide the mesh.

\item \texttt{eo\_showpoints()} Show the node points from the input geometry.

\item \texttt{eo\_hidepoints()} Hide the node points from the input geometry.

\item \texttt{eo\_smooth("flag")} This function controls whether or not smoothing is
applied to the $D$ and $E$ fields which are naturally piece-wise
constant over each element. Setting flag equal to \texttt{"on"}
turns on smoothing, and setting flag to \texttt{"off"} turns off
smoothing.

\item \texttt{eo\_showgrid()} Show the grid points.

\item \texttt{eo\_hidegrid()} Hide the grid points points.

\texttt{eo\_gridsnap("flag")} Setting flag to ''on'' turns on snap to grid,
setting flag to "off" turns off snap to grid.

\item \texttt{eo\_setgrid(density,"type")} Change the grid spacing. The density
parameter specifies the space between grid points, and the type
parameter is set to \texttt{"cart"} for Cartesian coordinates or
\texttt{"polar"} for polar coordinates.

\item \texttt{eo\_hidedensityplot()} hides the flux density plot.

\item \texttt{eo\_showdensityplot(legend,gscale,type,upper{\_}D,lower{\_}D)} Shows the
flux density plot with options:

\texttt{legend} Set to 0 to hide the plot legend or 1 to show the plot
legend.

\texttt{gscale} Set to 0 for a colour density plot or 1 for a grey scale
density plot.

\texttt{upper{\_}D} Sets the upper display limit for the density plot.

\texttt{lower{\_}D} Sets the lower display limit for the density plot.

\texttt{type} Sets the type of density plot. A value of 0 plots voltage, 1
plots the magnitude of $D$, and 2 plots the magnitude of $E$

\item \texttt{eo\_hidecontourplot()} Hides the contour plot.

\item \texttt{eo\_showcontourplot(numcontours,lower{\_}V,upper{\_}V)} shows the
$V$ contour plot with options:

\texttt{numcontours} Number of equipotential lines to be plotted.

\texttt{upper{\_}V} Upper limit for contours.

\texttt{lower{\_}V} Lower limit for contours.

If \texttt{eo\_numcontours} is -1 all parameters are ignored and
default values are used, \\ e.g. \texttt{show{\_}contour{\_}plot(-1)}

\item \texttt{eo\_showvectorplot(type,scalefactor)}
controls the display of vectors denoting the field strength and
direction. The parameters taken are the \texttt{type} of plot,
which should be set to 0 for no vector plot, 1 for flux density
$D$, and 2 for field intensity $E$. The \texttt{scalefactor}
determines the relative length of the vectors. If the scale is set
to 1, the length of the vectors are chosen so that the highest flux
density corresponds to a vector that is the same length as the
current grid size setting.

\item{\tt eo\_minimize()} minimizes the active magnetics input view.

\item{\tt eo\_maximize()} maximizes the active magnetics input view.

\item{\tt eo\_restore()} restores the active magnetics input view from a
 minimized or maximized state.

\item{\tt eo\_resize(width,height)} resizes the active magnetics input
 window client area to width $\times$ height.

\end{itemize}

\subsection{Miscellaneous}

\begin{itemize}

\item \texttt{eo\_close()} close the current postprocessor window.

\item{\tt eo\_refreshview()} Redraws the current view.

\item{\tt eo\_reload()} Reloads the solution from disk.

\item \texttt{eo\_savebitmap("filename")} saves a bitmapped screen shot of the current
view to the file specified by \texttt{"filename"}. Note that if you
use a path you must use two backslashes (e.g.
\texttt{"c:$\backslash \backslash $temp$\backslash \backslash
$myfile.bmp"}). If the file name contains a space (e.g. file
names like c:$\backslash $program files$\backslash $stuff) you must
enclose the file name in (extra) quotes by using a
\texttt{$\backslash $"} sequence. For example:

\texttt{eo\_savebitmap("$\backslash $"c:$\backslash \backslash
$temp$\backslash \backslash $screenshot.bmp$\backslash $"")}

\item \texttt{eo\_savemetafile("filename")} saves a metafile screenshot of the current
view to the file specified by \texttt{"filename"}, subject to the
printf-type formatting explained previously for the
\texttt{savebitmap} command.

\item \texttt{eo\_shownames(flag)} This function allow the user to display or hide the
block label names on screen. To hide the block label names,
\texttt{flag} should be 0. To display the names, the parameter
should be set to 1.

\item{\tt eo\_numnodes()} Returns the number of nodes in the in focus electrostatics output mesh.
\item{\tt eo\_numelements()} Returns the number of elements in the in focus electrostatics output mesh.
\item{\tt eo\_getnode(n)} Returns the (x,y) or (r,z) position of the nth mesh node.
\item{\tt eo\_getelement(n)} MOGetElement[n] returns the following proprerties for the nth element:
    \begin{enumerate}
        \item Index of first element node
        \item Index of second element node
        \item Index of third element node
        \item x (or r) coordinate of the element centroid
        \item y (or z) coordinate of the element centroid
        \item element area using the length unit defined for the problem
        \item group number associated with the element
    \end{enumerate}

\end{itemize}
