Changeset 7828 for trunk/anuga_core/documentation/user_manual
- Timestamp:
- Jun 14, 2010, 8:00:01 PM (14 years ago)
- Location:
- trunk/anuga_core/documentation/user_manual
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/documentation/user_manual/anuga_user_manual.tex
r7804 r7828 1 % Complete documentation on the extended LaTeX markup used for Python1 % Complete documentation on the extended LaTeX markup used for Python 2 2 % documentation is available in ''Documenting Python'', which is part 3 3 % of the standard documentation for Python. It may be found online … … 47 47 % the rest is at your discretion. 48 48 \authoraddress{Geoscience Australia \\ 49 Email: \email{ ole.nielsen@ga.gov.au}49 Email: \email{nariman.habili@ga.gov.au} 50 50 } 51 51 … … 71 71 % update_anuga_user_manual.py - if not a dummy 72 72 % will be used. 73 74 %\release{1.2} % release version; this is used to define the75 % % \version macro76 73 77 74 \makeindex % tell \index to actually write the .idx file … … 147 144 where the more adventurous reader might like to go. 148 145 149 This manual describes \anuga version 1.2. To check for later versions of this manual146 This manual describes \anuga version \version. To check for later versions of this manual 150 147 go to \url{https://datamining.anu.edu.au/anuga}. 151 148 … … 153 150 154 151 This manual covers only what is needed to operate the software after 155 installation and configuration. It does not include sinstructions152 installation and configuration. It does not include instructions 156 153 for installing the software or detailed API documentation, both of 157 154 which will be covered in separate publications and by documentation … … 632 629 contains stage and momentum information and can be used with the 633 630 \anuga viewer \code{anuga\_viewer} to generate a visual 634 display (see Section \ref{sec:an imate}). See Section \ref{sec:file formats}631 display (see Section \ref{sec:anuga_viewer}). See Section \ref{sec:file formats} 635 632 (page \pageref{sec:file formats}) for more on NetCDF and other file 636 633 formats. … … 657 654 658 655 The following figures are screenshots from the \anuga visualisation 659 tool \code{an imate}. Figure \ref{fig:runupstart} shows the domain656 tool \code{anuga_viewer}. Figure \ref{fig:runupstart} shows the domain 660 657 with water surface as specified by the initial condition, $t=0$. 661 658 Figure \ref{fig:runup2} shows later snapshots for $t=2.3$ and … … 663 660 on the previously dry bed. 664 661 665 \code{an imate} is described in more detail in Section \ref{sec:animate}.662 \code{anuga_viewer} is described in more detail in Section \ref{sec:anuga_viewer}. 666 663 667 664 \begin{figure}[htp] … … 689 686 \subsection{Overview} 690 687 691 The next example is about water flow in a channel with varying boundary conditions and688 The next example is about water-flow in a channel with varying boundary conditions and 692 689 more complex topographies. These examples build on the 693 690 concepts introduced through the \file{runup.py} in Section \ref{sec:simpleexample}. … … 735 732 Defining \code{m} and \code{n} in terms of the extent as in this example provides a convenient way of 736 733 controlling the resolution: By defining \code{dx} and \code{dy} to be the desired size of each 737 hypot henuse in the mesh we can write the mesh generation as follows:734 hypotenuse in the mesh we can write the mesh generation as follows: 738 735 739 736 \begin{verbatim} … … 760 757 761 758 The following figure is a screenshot from the \anuga visualisation 762 tool \code{an imate} of output from this example.759 tool \code{anuga_viewer} of output from this example. 763 760 764 761 \begin{figure}[htp] … … 823 820 \end{verbatim} 824 821 825 \subsection{Flow through more complex topogra hies}822 \subsection{Flow through more complex topographies} 826 823 827 824 Here is the code for the third version of the channel flow \file{channel3.py}: … … 1226 1223 1227 1224 Now that the scenario has been run, the user can view the output in a number of ways. 1228 As described earlier, the user may run \code{an imate} to view a three-dimensional representation1225 As described earlier, the user may run \code{anuga_viewer} to view a three-dimensional representation 1229 1226 of the simulation. 1230 1227 … … 1309 1306 Elford Reef location for each scenario (the elevation at this location is negative, 1310 1307 therefore stage is the more appropriate quantity to plot). Note the large negative stage value when the slide was 1311 introduced. This is due to the double gaussian form of the initial surface1308 introduced. This is due to the double Gaussian form of the initial surface 1312 1309 displacement of the slide. By contrast, the time series for depth is shown for the onshore location of the Cairns 1313 1310 Airport in Figure \ref{fig:airportboth}. … … 1346 1343 \end{itemize} 1347 1344 1348 The listings are intended merely to give the reader an idea of what 1349 each feature is, where to find it and how it can be used -- they do 1345 \section{Documentation}\index{Documentation} 1346 1347 The listings here are intended merely to give the reader an idea of what 1348 each feature is and how it can be used -- they do 1350 1349 not give full specifications; for these the reader 1351 may consult the code. The code for every function or class contains1350 may consult the programmer's guide. The code for every function or class contains 1352 1351 a documentation string, or 'docstring', that specifies the precise 1353 1352 syntax for its use. This appears immediately after the line 1354 1353 introducing the code, between two sets of triple quotes. 1355 1354 1356 Each listing also describes the location of the module in which 1357 the code for the feature being described can be found. All modules 1358 are in the folder \file{inundation} or one of its subfolders, and the 1355 Python has a handy tool that lets you easily navigate this documentation, 1356 called \code{pydoc}. In Linux, it runs as a server, which serves the 1357 documentation up to your web browser: 1358 1359 1. Open a terminal at your \code{anuga_source/anuga} folder 1360 2. Start the python documentation server with \code{pydoc -p 6767} 1361 3. Open a browser and type in \code{http://localhost:6767/} 1362 1363 Now you have a real-time programmers' guide for \anuga, and an easy way to find 1364 the functions you are interested in. Pydoctor and other Python doc generators 1365 look nicer and have graphs, etc, but pydoc works straight out of the box. 1366 1367 \section{Public vs Private Interface}\index{public vs private interface} 1368 1369 To simplify the process of writing scripts, \anuga has a public API which packages 1370 up all the commonly-used functionality of \anuga in the one place. To use it, simply 1371 import the anuga module like so: 1372 1373 \begin{verbatim} 1374 import anuga 1375 \end{verbatim} 1376 1377 You can now use the public API like so. Note the \code{anuga.} prefix: 1378 1379 \begin{verbatim} 1380 anuga.sww2dem('in.sww', 'out.asc') 1381 \end{verbatim} 1382 1383 If you wish to delve "under the hood" and modify the way \anuga runs at a more 1384 advanced level, you need to specify the full location of the module like so: 1385 1386 \begin{verbatim} 1387 from anuga.fit_interpolate.interpolate import Interpolation_interface 1388 \end{verbatim} 1389 1390 All modules are in the folder \file{inundation} or one of its subfolders, and the 1359 1391 location of each module is described relative to \file{inundation}. Rather 1360 1392 than using pathnames, whose syntax depends on the operating system, … … 1378 1410 1379 1411 Rather than using either of these forms, in this chapter we specify 1380 the location simply as \code{ pmesh.mesh_interface}, in keeping with1412 the location simply as \code{anuga.pmesh.mesh_interface}, in keeping with 1381 1413 the usage in the Python statement for importing the function, 1382 1414 namely: 1383 1415 1384 1416 \begin{verbatim} 1385 from pmesh.mesh_interface import create_mesh_from_regions 1386 \end{verbatim} 1387 1388 Each listing details the full set of parameters for the class or 1389 function; however, the description is generally limited to the most 1390 important parameters and the reader is again referred to the code 1391 for more details. 1417 from anuga.pmesh.mesh_interface import create_mesh_from_regions 1418 \end{verbatim} 1419 1392 1420 1393 1421 The following parameters are common to many functions and classes … … 1488 1516 1489 1517 \begin{funcdesc}{create_mesh_from_regions}{bounding_polygon, 1490 boundary_tags, 1491 maximum_triangle_area=None, 1492 filename=None, 1493 interior_regions=None, 1494 interior_holes=None, 1495 poly_geo_reference=None, 1496 mesh_geo_reference=None, 1497 minimum_triangle_angle=28.0, 1498 fail_if_polygons_outside=True, 1499 use_cache=False, 1500 verbose=True} 1518 boundary_tags, 1519 maximum_triangle_area=None, 1520 filename=None, 1521 interior_regions=None, 1522 interior_holes=None, 1523 hole_tags=None, 1524 poly_geo_reference=None, 1525 mesh_geo_reference=None, 1526 minimum_triangle_angle=28.0, 1527 fail_if_polygons_outside=True, 1528 breaklines=None, 1529 use_cache=False, 1530 verbose=True} 1501 1531 Module: \module{pmesh.mesh\_interface} 1502 1532 … … 1510 1540 interior polygon and its resolution. Additionally, the user specifies 1511 1541 a list of boundary tags, one for each edge of the bounding polygon. 1542 1543 \code{breaklines} lets you force a split along a boundary within the mesh. For 1544 example, a kerb or the edge of a dyke could be specified here. (new in 1.2) 1545 1546 \code{interior_holes} lets you specify polygons as empty holes in the mesh. 1547 This can be used to represent buildings, pylons and other immovable 1548 structures. These polygons do not need to be closed, but their points must be 1549 specified in a counter-clockwise order.(new in 1.2) 1512 1550 1513 1551 \textbf{WARNING}. Note that the dictionary structure used for the … … 1523 1561 1524 1562 \textbf{WARNING}. Do not have polygon lines cross or be on-top of each 1525 other. This can result in regions of unspecified resolutions. Do 1563 other. This can result in regions of unspecified resolutions, and \anuga 1564 will give you an error. Do 1526 1565 not have polygon close to each other. This can result in the area 1527 1566 between the polygons having small triangles. For more control … … 1559 1598 \code{maximum_triangle_area} is the maximal area per triangle 1560 1599 for the bounding polygon, excluding the interior regions. 1600 1601 \code{interior_holes} lets you specify polygons as empty holes in the mesh. 1602 This can be used to represent buildings, pylons and other immovable 1603 structures. These polygons do not need to be closed, but their points must be 1604 specified in a counter-clockwise order.(new in 1.2) 1561 1605 1562 1606 \code{mesh_filename} is the name of the file to contain the generated … … 2163 2207 2164 2208 # Add buildings from file 2165 building_polygons, building_heights = csv2building_polygons(building_file)2209 building_polygons, building_heights = anuga.load_csv_as_building_polygons(building_file) 2166 2210 2167 2211 B = [] … … 2224 2268 time_limit=None, 2225 2269 verbose=False, 2270 output_centroids=False, 2226 2271 use_cache=False, 2227 2272 boundary_polygon=None} … … 2249 2294 This must be the same polygon as used when calling \code{create_mesh_from_regions()}. 2250 2295 This argument can only be used when reading boundary data from an STS format file. 2296 2297 \code{output_centroids} set to true to sample at the centre of the triangle containing the point. 2298 This may be useful for debugging. (new in 1.2) 2251 2299 2252 2300 The model time stored within the file function can be accessed using … … 2701 2749 \end{itemize} 2702 2750 2703 The user can specify different culvert routines. Howe r\anuga currently provides only one, namely the2751 The user can specify different culvert routines. However, \anuga currently provides only one, namely the 2704 2752 \code{boyd_generalised_culvert_model} as used in the example below: 2705 2753 … … 3112 3160 time_min=None, 3113 3161 time_max=None, 3162 output_centroids=False, 3114 3163 time_thinning=1, 3115 3164 time_unit=None, … … 3135 3184 3136 3185 \code{filename} is the path to the SWW file. 3186 3187 \code{output_centroids} set to true to sample at the centre of the triangle containing the point. 3188 This may be useful for debugging. (new in 1.2) 3137 3189 3138 3190 \code{polyline} is the representation of the desired cross section -- it may contain … … 3235 3287 NC $\rightarrow$ SWW & Convert MOST boundary files to boundary \code{.sww}\\ 3236 3288 PTS + TSH $\rightarrow$ TSH with elevation & Least squares fit\\ 3237 TSH $\rightarrow$ SWW & Convert TSH to \code{.sww}-viewable using \code{an imate}\\3289 TSH $\rightarrow$ SWW & Convert TSH to \code{.sww}-viewable using \code{anuga_viewer}\\ 3238 3290 TSH + Boundary SWW $\rightarrow$ SWW & Simulation using \code{\anuga}\\ 3239 3291 Polygonal mesh outline $\rightarrow$ & TSH or MSH … … 3259 3311 \end{itemize} 3260 3312 3261 The contents of an SWW file may be viewed using the anuga viewer \code{an imate},3262 which creates an on-screen vis ialisation. See section \ref{sec:animate}3263 (page \pageref{sec:an imate}) in Appendix \ref{ch:supportingtools} for more on \code{animate}.3313 The contents of an SWW file may be viewed using the anuga viewer \code{anuga_viewer}, 3314 which creates an on-screen visualisation. See section \ref{sec:anuga_viewer} 3315 (page \pageref{sec:anuga_viewer}) in Appendix \ref{ch:supportingtools} for more on \code{anuga_viewer}. 3264 3316 3265 3317 Alternatively, there are tools, such as \code{ncdump}, that allow … … 3617 3669 3618 3670 In the computations presented in this paper we use an explicit Euler 3619 time 3671 timestepping method with variable timestepping adapted to the 3620 3672 observed CFL condition: 3621 3673 … … 3642 3694 To alleviate the problems associated with numerical instabilities due to 3643 3695 small water depths near a wet/dry boundary we employ a new flux limiter that 3644 ensures that unphysical fluxes are never encounte d.3696 ensures that unphysical fluxes are never encountered. 3645 3697 3646 3698 Let $u$ and $v$ be the velocity components in the $x$ and $y$ direction, … … 3690 3742 h_0 = H_0^2 3691 3743 \] 3692 provides a reasonable balance between accur racy and stability. In fact,3744 provides a reasonable balance between accuracy and stability. In fact, 3693 3745 setting $h=H_0$ will scale the predicted speed by a factor of $0.5$: 3694 3746 \[ … … 3876 3928 %% 3877 3929 % 3878 %Sub directories contain scrip s and derived files for each simulation.3930 %Sub directories contain scripts and derived files for each simulation. 3879 3931 %The directory ../source_data contains large source files such as 3880 3932 %DEMs provided externally as well as MOST tsunami simulations to be used … … 3882 3934 % 3883 3935 %Manual steps are: 3884 % Creation of DEMs from ar gcview (.asc + .prj)3936 % Creation of DEMs from arcview (.asc + .prj) 3885 3937 % Creation of mesh from pmesh (.tsh) 3886 3938 % Creation of tsunami simulations from MOST (.nc) … … 3967 4019 \pagebreak 3968 4020 \section{anuga\_viewer} 3969 \label{sec:an imate}4021 \label{sec:anuga_viewer} 3970 4022 3971 4023 The output generated by \anuga may be viewed by … … 3989 4041 %\code{anuga\_viewer} executable file (or a shortcut to it), or set up a 3990 4042 %file association to make files with the extension \code{.sww} open 3991 %with \code{an imate}. Alternatively, you can operate \code{animate}4043 %with \code{anuga_viewer}. Alternatively, you can operate \code{anuga_viewer} 3992 4044 %from the command line. 3993 4045 … … 3996 4048 3997 4049 %% \pagebreak 3998 %% \section{\anuga viewer -- an imate}3999 %% \label{sec:an imate}4050 %% \section{\anuga viewer -- anuga_viewer} 4051 %% \label{sec:anuga_viewer} 4000 4052 4001 4053 %% The output generated by \anuga may be viewed by 4002 %% means of the visualisation tool \code{an imate}, which takes an4054 %% means of the visualisation tool \code{anuga_viewer}, which takes an 4003 4055 %% SWW file generated by \anuga and creates a visual representation 4004 4056 %% of the data. Examples may be seen in Figures \ref{fig:runupstart} 4005 4057 %% and \ref{fig:runup2}. To view an SWW file with 4006 %% \code{an imate} in the Windows environment, you can simply drag the4058 %% \code{anuga_viewer} in the Windows environment, you can simply drag the 4007 4059 %% icon representing the file over an icon on the desktop for the 4008 %% \code{an imate} executable file (or a shortcut to it), or set up a4060 %% \code{anuga_viewer} executable file (or a shortcut to it), or set up a 4009 4061 %% file association to make files with the extension \code{.sww} open 4010 %% with \code{an imate}. Alternatively, you can operate \code{animate}4062 %% with \code{anuga_viewer}. Alternatively, you can operate \code{anuga_viewer} 4011 4063 %% from the command line. 4012 4064 … … 4034 4086 %% % \vfill 4035 4087 4036 %% The following describes how to operate \code{an imate} from the command line:4037 4038 %% Usage: \code{an imate[options] swwfile \ldots}\\ \nopagebreak4088 %% The following describes how to operate \code{anuga_viewer} from the command line: 4089 4090 %% Usage: \code{anuga_viewer [options] swwfile \ldots}\\ \nopagebreak 4039 4091 %% where: \\ \nopagebreak 4040 4092 %% \begin{tabular}{ll} … … 4974 5026 \indexedbold{stage} & &\\ 4975 5027 % \indexedbold{try this} 4976 \indexedbold{an imate} & visualisation tool used with \anuga & \pageref{sec:animate}\\5028 \indexedbold{anuga_viewer} & visualisation tool used with \anuga & \pageref{sec:anuga_viewer}\\ 4977 5029 \indexedbold{time boundary} & Returns values for the conserved quantities as a function of time. 4978 5030 The user must specify the domain to get access to the model time. -
trunk/anuga_core/documentation/user_manual/copyright.tex
r7809 r7828 19 19 \vspace*{0.5in} 20 20 21 Copyright \copyright 2004, 2005, 2006 Australian National University and Geoscience Australia. All rights reserved.21 Copyright \copyright 2004, 2005, 2006, 2010 Australian National University and Geoscience Australia. All rights reserved. 22 22 23 23 Permission to use, copy, modify, and distribute this software for any … … 134 134 \pagebreak 135 135 \item Pmw is a toolkit for building high-level compound widgets in 136 Python using the Tkinter module. Parts of Pmw have been encorpoated136 Python using the Tkinter module. Parts of Pmw have been incorpoated 137 137 into the graphical mesh generator. The license for Pmw reads 138 138
Note: See TracChangeset
for help on using the changeset viewer.