Changeset 3111


Ignore:
Timestamp:
Jun 8, 2006, 10:59:32 AM (18 years ago)
Author:
howard
Message:

Added a description of symbolic tags to the example in 3.1, and incorporated other changes from feedback received.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • documentation/user_manual/anuga_user_manual.tex

    r3109 r3111  
    143143
    144144Readers are assumed to be familiar with the operating environment
    145 and have a general understanding of the problem background, as well
    146 as enough programming experience to adapt the code to different
    147 requirements, as described in this manual, and to understand the
    148 basic terminology of object-oriented programming.
     145and have a general understanding of the subject matter, as well as
     146enough programming experience to adapt the code to different
     147requirements and to understand the basic terminology of
     148object-oriented programming.
    149149
    150150\pagebreak
     
    173173
    174174To set up a particular scenario the user specifies the geometry
    175 (bathymetry and topography), the initial water level, boundary
    176 conditions such as tide, and any forcing terms that may drive the
    177 system such as wind stress or atmospheric pressure gradients.
    178 Gravity and frictional resistance from the different terrains in the model are
    179 represented by predefined forcing terms.
     175(bathymetry and topography), the initial water level (stage)
     176,
     177boundary conditions such as tide, and any forcing terms that may
     178drive the system such as wind stress or atmospheric pressure
     179gradients. Gravity and frictional resistance from the different
     180terrains in the model are represented by predefined forcing terms.
    180181
    181182A mesh generator, called pmesh, allows the user to set up the geometry
     
    303304\begin{itemize}
    304305
    305    \item a list \code{points} of length $N$, where $N = (m + 1)(n + 1)$,
    306 comprising the coordinates \code{(x, y)} of each of the $N$ mesh
    307 points,
    308 
    309    \item a list \code{vertices} of length $2mn$ (each entry specifies the three
    310 vertices of one of the triangles used in the triangulation) , and
    311 
    312    \item a dictionary \code{boundary}, used to tag the triangle edges on
    313 the boundaries. Each key corresponds to a triangle edge on one of
    314 the four boundaries and its value is one of \code{`left'},
    315 \code{`right'}, \code{`top'} and \code{`bottom'}, indicating
    316 which boundary the edge in question belongs to.
     306   \item a list \code{points} giving the coordinates of each mesh point,
     307
     308   \item a list \code{vertices} specifying the three vertices of each triangle, and
     309
     310   \item a dictionary \code{boundary} that stores the edges on
     311   the boundary and associates each with one of the symbolic tags \code{`left'}, \code{`right'},
     312   \code{`top'} or \code{`bottom'}.
    317313
    318314\end{itemize}
    319315
    320 An example of a general unstructured mesh and the
    321 associated data structures \code{points}, \code{vertices} and \code{boundary}
    322 is given in Section \ref{xxxx}.
    323 
    324 
    325 
     316An example of a general unstructured mesh and the associated data
     317structures \code{points}, \code{vertices} and \code{boundary} is
     318given in Section \ref{sec:meshexample}.
    326319
    327320
     
    338331
    339332This creates an instance of the \class{Domain} class, which
    340 represents the domain of the simulation. Specific options for domain
    341 are set at this point, including setting the basename for the output
    342 file and the directory to be used for data:
     333represents the domain of the simulation. Specific options are set at
     334this point, including the basename for the output file and the
     335directory to be used for data:
    343336
    344337{\small \begin{verbatim}
     
    366359\method{set\_quantity}, used to specify these quantities. It is a
    367360flexible method that allows the user to set quantities in a variety
    368 of ways---using constants, functions, numeric arrays or expressions
    369 involving other quantities, arbitrary data points with associated
     361of ways---using constants, functions, numeric arrays, expressions
     362involving other quantities, or arbitrary data points with associated
    370363values, all of which can be passed as arguments. All quantities can
    371364be initialised using \method{set\_quantity}. For a conserved
     
    392385the plane.  It specifies that the bed slopes linearly in the
    393386\code{x} direction, with slope $-\frac{1}{2}$,  and is constant in
    394 the \code{y} direction.  %[screen shot?]
     387the \code{y} direction.
    395388
    396389Once the function \function{f} is specified, the quantity
     
    412405\end{verbatim}}
    413406
    414 This just specifies that the Manning friction coefficient is set
    415 to 0.1 at every mesh point.
     407This specifies that the Manning friction coefficient is set to 0.1
     408at every mesh point.
    416409
    417410\subsubsection{Stage}
     
    436429i.e. 0.4 units (m) below the zero level.
    437430
     431%FIXME (Howard): Can we put this para somewhere else?
    438432Although it is not necessary for this example, it may be useful to
    439433digress here and mention a variant to this requirement, which allows
     
    501495
    502496Before describing how these boundary conditions are assigned, we
    503 recall that the variable \code{boundary} returned by
    504 \code{rectangular} not only stores the edges of the mesh that
    505 constitute the boundary but also assigns to each a symbolic `tag',
    506 which indicates whether that edge forms part of the `top' boundary,
    507 the `left' boundary, the `bottom' boundary or the `right' boundary.
    508 These tags provide the means to assign different boundary conditions
     497recall that the definition of a mesh uses a variable \code{boundary}
     498to store the edges of the mesh that lie on the boundary. (In the
     499code we are discussing, \code{boundary} was one of the three
     500variables returned by the function \code{rectangular}.)
     501
     502This variable \code{boundary} is a Python dictionary and it serves
     503not only to hold the edges that make up the boundary but also to
     504assign symbolic tags to these edges to distinguish different parts
     505of the boundary. In this example, the tags  used are \code{`left',
     506\code{`right'}, \code{`top'} and \code{`bottom'}, corresponding to
     507the left, right, top and bottom of the rectangle bounding the mesh,
     508and the function \code{rectangular} automatically assigns these tags
     509to the boundary edges when it generates the mesh. The tags are used
     510as keys for the dictionary, so that, for example,
     511\code{boundary[`left']} is a list of the mesh edges that lie along
     512the left part of the boundary.
     513
     514The tags provide the means to assign different boundary conditions
    509515to an edge depending on which part of the boundary it belongs to.
    510 (Later we shall describe examples in which the boundary is divided
    511 differently---we are not limited to the tags `left', `right', `top'
    512 and `bottom'.)
    513 
    514 With boundary objects assigned to variables as described above, we
    515 can apply one to each part of the boundary by means of a statement
    516 like
     516(Later we shall describe an example that uses different boundary
     517tags---we are not limited to using `left', `right', `top' and
     518`bottom'.)
     519
     520Using the boundary objects described above, we assign a boundary
     521condition to each part of the boundary by means of a statement like
    517522
    518523{\small \begin{verbatim}
     
    756761\end{verbatim}}
    757762
    758 is then used to create the mesh, taking the bounding polygon to be the polygon
    759 \code{diffpolygonall} specified in \file{project.py}. The
    760 argument \code{boundary\_tags} assigns a dictionary, whose keys are the
    761 names of the boundary tags used for the bounding polygon---\code{`bottom'},
    762 `right0', `right1', `right2', `top', `left1', `left2' and `left3'---
    763 and whose values identify the indices of the segments associated with each of these
    764 tags. (The value associated with each boundary tag is a one-element list.)
     763is then used to create the mesh, taking the bounding polygon to be
     764the polygon \code{diffpolygonall} specified in \file{project.py}.
     765The argument \code{boundary\_tags} assigns a dictionary, whose keys
     766are the names of the boundary tags used for the bounding
     767polygon---\code{`bottom'}, \code{`right0'}, \code{`right1'},
     768\code{`right2'}, \code{`top'}, \code{`left1'}, \code{`left2'} and
     769\code{`left3'}--- and whose values identify the indices of the
     770segments associated with each of these tags. (The value associated
     771with each boundary tag is a one-element list.)
    765772
    766773
     
    988995mesh and use it to describe how mesh data is stored.
    989996
    990 Figure \ref{fig:simplemesh} represents a very simple mesh comprising
    991 just 11 points and 10 triangles.
     997\label{sec:meshexample} Figure \ref{fig:simplemesh} represents a
     998very simple mesh comprising just 11 points and 10 triangles.
    992999
    9931000
     
    18801887        Use the same delimiter for the attribute names and the data.
    18811888
    1882         An XYA file can optionally end with lines of this type:
     1889        An XYA file can optionally end with a description of the georeference:
    18831890
    18841891            \code{\#geo reference}\\
     
    20982105 The output generated by \anuga may be viewed by
    20992106means of the visualisation tool \code{swollen}, which takes the
    2100 \code{sww} file output by \anuga and creates a visual representation
     2107\code{SWW} file output by \anuga and creates a visual representation
    21012108of the data. Examples may be seen in Figures \ref{fig:runupstart}
    2102 and \ref{fig:bedslope2}. To view an \code{sww} file with
     2109and \ref{fig:bedslope2}. To view an \code{SWW} file with
    21032110\code{swollen} in the Windows environment, you can simply drag the
    21042111icon representing the file over an icon on the desktop for the
    2105 \code{swollen} executable file (or a shortcut to it). Alternatively,
    2106 you can operate \code{swollen} from the command line, in both
    2107 Windows and Linux environments.
    2108 
    2109 On successful operation, you will see an interactive moving-picture display. You can use keys and the mouse
    2110 to slow down, speed up or stop the display, change the viewing position or carry out a number of other
    2111 simple operations.
     2112\code{swollen} executable file (or a shortcut to it), or set up a
     2113file association to make files with the extension \code{.sww} open
     2114with \code{swollen}. Alternatively, you can operate \code{swollen}
     2115from the command line, in both Windows and Linux environments.
     2116
     2117On successful operation, you will see an interactive moving-picture
     2118display. You can use keys and the mouse to slow down, speed up or
     2119stop the display, change the viewing position or carry out a number
     2120of other simple operations. Help is also displayed when you press
     2121the \code{h} key.
    21122122
    21132123The main keys operating the interactive screen are:\\
Note: See TracChangeset for help on using the changeset viewer.