Changeset 3099
- Timestamp:
- Jun 6, 2006, 1:27:24 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
documentation/user_manual/anuga_user_manual.tex
r3092 r3099 550 550 551 551 \begin{itemize} 552 \item \textbf{Reflective boundary} Returns same \code{stage} as552 \item \textbf{Reflective boundary}\label{def:reflective boundary} Returns same \code{stage} as 553 553 as present in its neighbour volume but momentum vector 554 554 reversed 180 degrees (reflected). … … 556 556 momentum quantities assumed to be the second and third conserved 557 557 quantities. A reflective boundary condition models a solid wall. 558 \item \textbf{Transmissive boundary} Returns same conserved quantities as558 \item \textbf{Transmissive boundary}\label{def:transmissive boundary} Returns same conserved quantities as 559 559 those present in its neighbour volume. This is one way of modelling 560 560 outflow from a domain, but it should be used with caution if flow is … … 562 562 may cause occasional spurious effects. If this occurs, 563 563 consider using e.g. a Dirichlet boundary condition. 564 \item \textbf{[Dirichlet boundary} Specifies a fixed value at the564 \item \textbf{[Dirichlet boundary}\label{def:dirichlet boundary} Specifies a fixed value at the 565 565 boundary and assigns initial values to the $x$-momentum and $y$-momentum. 566 \item \textbf {Time boundary} Like a Dirichlet boundary but with behaviour566 \item \textbf{Time boundary}\label{def:time boundary} Like a Dirichlet boundary but with behaviour 567 567 varying with time. 568 568 \end{itemize} … … 791 791 In practice, the details of the polygons used are read from a 792 792 separate file \file{project.py}. The resulting mesh is output to a 793 \emph{meshfile}\index{meshfile} . This term is used to describe a794 file of a specific format used to store the data specifying a mesh. 795 (There are in fact two possible formats for such a file: it can 796 either be a binary file, with extension \code{.msh}, or an ASCII 797 file, with extension \code{.tsh}. In the present case, the binary 798 file format \code{.msh} is used. See Section \ref{sec:file formats} 799 (page \pageref{sec:file formats}) for more on file formats.) 800 \code{pmesh} assigns a name to the file by appending the extension 801 \code{.msh} to the name specified in the input file793 \emph{meshfile}\index{meshfile}\label{def:meshfile}. This term is 794 used to describe a file of a specific format used to store the data 795 specifying a mesh. (There are in fact two possible formats for such 796 a file: it can either be a binary file, with extension \code{.msh}, 797 or an ASCII file, with extension \code{.tsh}. In the present case, 798 the binary file format \code{.msh} is used. See Section 799 \ref{sec:file formats} (page \pageref{sec:file formats}) for more on 800 file formats.) \code{pmesh} assigns a name to the file by appending 801 the extension \code{.msh} to the name specified in the input file 802 802 \file{project.py}. This name is stored in the variable 803 803 \code{meshname}. … … 1031 1031 1032 1032 Rather than using either of these forms, in this chapter we specify 1033 the location simply as \code{pmesh.mesh _interface}, in keeping with1033 the location simply as \code{pmesh.mesh\_interface}, in keeping with 1034 1034 the usage in the Python statement for importing the function, 1035 1035 namely: … … 1085 1085 1086 1086 This function allows a user to initiate the automatic creation of a 1087 mesh inside a specified polygon (input \code{bounding_polygon}). 1087 mesh inside a specified polygon (input \code{bounding_polygon}). 1088 1088 Among the parameters that can be 1089 1089 set are the \emph{resolution} (maximal area for any triangle in the … … 1098 1098 1099 1099 1100 \begin{funcdesc} {add _region}{}1101 1102 \end{funcdesc} 1103 1104 \begin{funcdesc} {add _hole}{}1105 1106 \end{funcdesc} 1107 1108 1109 \begin{funcdesc} {add _region_from_polygon}{self, polygon, tags=None,1100 \begin{funcdesc} {add\_region}{} 1101 1102 \end{funcdesc} 1103 1104 \begin{funcdesc} {add\_hole}{} 1105 1106 \end{funcdesc} 1107 1108 1109 \begin{funcdesc} {add\_region\_from\_polygon}{self, polygon, tags=None, 1110 1110 max_triangle_area=None, geo_reference=None} 1111 1111 Module: \module{pmesh.mesh} Class: \class{Mesh} … … 1120 1120 \end{funcdesc} 1121 1121 1122 \begin{funcdesc} {add _hole_from_polygon}{self, polygon, tags=None,1122 \begin{funcdesc} {add\_hole\_from\_polygon}{self, polygon, tags=None, 1123 1123 geo_reference=None} 1124 1124 Module: \module{pmesh.mesh.Mesh} … … 1133 1133 \end{funcdesc} 1134 1134 1135 \begin{funcdesc} {generate _mesh}{self,1135 \begin{funcdesc} {generate\_mesh}{self, 1136 1136 maximum_triangle_area=None, 1137 1137 minimum_triangle_angle=28.0, … … 1146 1146 1147 1147 1148 \begin{funcdesc} {export _mesh_file}{self,ofile}1148 \begin{funcdesc} {export\_mesh_file}{self,ofile} 1149 1149 Module: \module{pmesh.mesh.Mesh} 1150 1150 … … 1218 1218 Module: \module{pyvolution.domain} 1219 1219 1220 Returns the name assigned to the domain by \code{set _name}. If no name has been1220 Returns the name assigned to the domain by \code{set\_name}. If no name has been 1221 1221 assigned, returns \code{`domain'}. 1222 1222 \end{funcdesc} … … 1226 1226 1227 1227 Specifies the directory used for data, assigning it to the pathname \code{name}. The default value, before 1228 \code{set\_datadir} has been run, is the value \code{default _datadir}1228 \code{set\_datadir} has been run, is the value \code{default\_datadir} 1229 1229 specified in \code{config.py}. 1230 1230 … … 1245 1245 \end{funcdesc} 1246 1246 1247 \begin{funcdesc} {get _datadir}{}1247 \begin{funcdesc} {get\_datadir}{} 1248 1248 Module: \module{pyvolution.domain} 1249 1249 1250 Returns the data directory set by \code{set _datadir} or,1251 if \code{set _datadir} has not1252 been run, returns the value \code{default _datadir} specified in1250 Returns the data directory set by \code{set\_datadir} or, 1251 if \code{set\_datadir} has not 1252 been run, returns the value \code{default\_datadir} specified in 1253 1253 \code{config.py}. 1254 1254 \end{funcdesc} 1255 1255 1256 \begin{funcdesc} {set _time}{time=0.0}1256 \begin{funcdesc} {set\_time}{time=0.0} 1257 1257 Module: \module{pyvolution.domain} 1258 1258 … … 1261 1261 \end{funcdesc} 1262 1262 1263 \begin{funcdesc} {set _default_order}{n}1263 \begin{funcdesc} {set\_default\_order}{n} 1264 1264 Sets the default (spatial) order to the value specified by 1265 1265 \code{n}, which must be either 1 or 2. (Assigning any other value … … 1295 1295 use_cache = False} 1296 1296 Module: \module{pyvolution.domain} 1297 (see also \module{pyvolution.quantity.set _values})1297 (see also \module{pyvolution.quantity.set\_values}) 1298 1298 1299 1299 This function is used to assign values to individual quantities for a … … 1309 1309 \item a function (e.g.\ see the samples introduced in Chapter 2) 1310 1310 \item an expression composed of other quantities and numbers, arrays, lists (for 1311 example, a linear combination of quantities, such as 1311 example, a linear combination of quantities, such as 1312 1312 \code{domain.set\_quantity('stage','elevation'+x))} 1313 \item the name of a file from which the data can be read. In this case, the optional argument attribute _name will select which attribute to use from the file. If left out, set_quantity will pick one. This is useful in cases where there is only one attribute.1314 \item a geospatial dataset (See ?????). Optional argument attribute _name applies here as with files.1313 \item the name of a file from which the data can be read. In this case, the optional argument attribute\_name will select which attribute to use from the file. If left out, set\_quantity will pick one. This is useful in cases where there is only one attribute. 1314 \item a geospatial dataset (See ?????). Optional argument attribute\_name applies here as with files. 1315 1315 \end{itemize} 1316 1316 … … 1331 1331 Other optional arguments are 1332 1332 \begin{itemize} 1333 \item \code{indices} which is a list of ids of triangles to which set _quantity should apply its assignment of values.1333 \item \code{indices} which is a list of ids of triangles to which set\_quantity should apply its assignment of values. 1334 1334 \item \code{location} determines which part of the triangles to assign to. Options are 'vertices' (default), 'edges', and 'centroids'. 1335 1335 \end{itemize} … … 1346 1346 %%% 1347 1347 \anuga provides a number of predefined initial conditions to be used 1348 with \code{set _quantity}.1348 with \code{set\_quantity}. 1349 1349 1350 1350 \begin{funcdesc}{slump_tsunami}{length, depth, slope, width=None, thickness=None, … … 1367 1367 1368 1368 %%% 1369 \begin{funcdesc}{file _function}{filename,1369 \begin{funcdesc}{file\_function}{filename, 1370 1370 domain = None, 1371 1371 quantities = None, … … 1380 1380 a callable object. \code{filename} could be a \code{sww} file. 1381 1381 Returns interpolated values based on the input 1382 file using the underlying \code{interpolation _function}.1382 file using the underlying \code{interpolation\_function}. 1383 1383 1384 1384 \code{quantities} is either the name of a single quantity to be … … 1386 1386 function will return a tuple of values---one for each quantity. 1387 1387 1388 \code{interpolation _points} is a list of absolute UTM coordinates1388 \code{interpolation\_points} is a list of absolute UTM coordinates 1389 1389 for points at which values are sought. 1390 1390 1391 1391 The model time stored within the file function can be accessed using 1392 the method \code{f.get _time()}1392 the method \code{f.get\_time()} 1393 1393 \end{funcdesc} 1394 1394 … … 1416 1416 an array---or dictionary of arrays (used in conjunction with the 1417 1417 optional argument \code{quantity\_names}) --- called 1418 \code{quantities}. The optional arguments \code{vertex _coordinates}1418 \code{quantities}. The optional arguments \code{vertex\_coordinates} 1419 1419 and \code{triangles} represent the spatial mesh associated with the 1420 1420 quantity arrays. If omitted the function created by … … 1463 1463 \end{funcdesc} 1464 1464 1465 \begin{funcdesc} {get _boundary_tags}{}1465 \begin{funcdesc} {get\_boundary\_tags}{} 1466 1466 Module: \module{pyvolution.mesh} 1467 1467 … … 1472 1472 \subsection{Predefined boundary conditions} 1473 1473 1474 \begin{classdesc}{Reflective _boundary}{Boundary}1474 \begin{classdesc}{Reflective\_boundary}{Boundary} 1475 1475 Module: \module{pyvolution.shallow\_water} 1476 1476 … … 1483 1483 1484 1484 %%% 1485 \begin{classdesc}{Transmissive _boundary}{domain = None}1485 \begin{classdesc}{Transmissive\_boundary}{domain = None} 1486 1486 Module: \module{pyvolution.generic\_boundary\_conditions} 1487 1487 … … 1493 1493 1494 1494 %%% 1495 \begin{classdesc}{Dirichlet _boundary}{conserved_quantities=None}1495 \begin{classdesc}{Dirichlet\_boundary}{conserved_quantities=None} 1496 1496 Module: \module{pyvolution.generic\_boundary\_conditions} 1497 1497 1498 1498 A Dirichlet boundary returns constant values for each of conserved 1499 quantities. In the example of \code{Dirichlet\_boundary([0.2, 0.0, 0.0])}, 1500 the \code{stage} value at the boundary is 0.2 and the \code{xmomentum} and 1499 quantities. In the example of \code{Dirichlet\_boundary([0.2, 0.0, 0.0])}, 1500 the \code{stage} value at the boundary is 0.2 and the \code{xmomentum} and 1501 1501 \code{ymomentum} at the boundary are set to 0.0. The list must contain 1502 1502 a value for each conserved quantity. … … 1504 1504 1505 1505 %%% 1506 \begin{classdesc}{Time _boundary}{domain = None, f = None}1506 \begin{classdesc}{Time\_boundary}{domain = None, f = None} 1507 1507 Module: \module{pyvolution.generic\_boundary\_conditions} 1508 1508 … … 1513 1513 1514 1514 %%% 1515 \begin{classdesc}{File _boundary}{Boundary}1515 \begin{classdesc}{File\_boundary}{Boundary} 1516 1516 Module: \module{pyvolution.generic\_boundary\_conditions} 1517 1517 1518 1518 This method may be used if the user wishes to apply a SWW file or 1519 a time series file to a boundary segment or segments. 1519 a time series file to a boundary segment or segments. 1520 1520 The boundary values are obtained from a file and interpolated to the 1521 1521 appropriate segments for each conserved quantity. … … 1579 1579 \subsection{Diagnostics} 1580 1580 1581 \begin{funcdesc}{timestepping _statistics}{}1581 \begin{funcdesc}{timestepping\_statistics}{} 1582 1582 Module: \module{pyvolution.domain} 1583 1583 … … 1593 1593 1594 1594 1595 \begin{funcdesc}{get _quantity}{name, location='vertices', indices = None}1595 \begin{funcdesc}{get\_quantity}{name, location='vertices', indices = None} 1596 1596 Module: \module{pyvolution.domain} 1597 1597 Allow access to individual quantities and their methods … … 1600 1600 1601 1601 1602 \begin{funcdesc}{get _values}{location='vertices', indices = None}1602 \begin{funcdesc}{get\_values}{location='vertices', indices = None} 1603 1603 Module: \module{pyvolution.quantity} 1604 1604 … … 1608 1608 1609 1609 1610 \begin{funcdesc}{get _integral}{}1610 \begin{funcdesc}{get\_integral}{} 1611 1611 Module: \module{pyvolution.quantity} 1612 1612 … … 1618 1618 \section{Other} 1619 1619 1620 \begin{funcdesc}{domain.create _quantity_from_expression}{???}1620 \begin{funcdesc}{domain.create\_quantity\_from\_expression}{???} 1621 1621 1622 1622 Handy for creating derived quantities on-the-fly. … … 1625 1625 1626 1626 1627 \begin{classdesc}{Geospatial _data}{data_points = None,1627 \begin{classdesc}{Geospatial\_data}{data_points = None, 1628 1628 attributes = None, 1629 1629 geo_reference = None, 1630 1630 default_attribute_name = None, 1631 1631 file_name = None} 1632 Module: \module{geospatial _data.geo_spatial_data}1632 Module: \module{geospatial\_data.geo\_spatial\_data} 1633 1633 Creates a georeferenced geospatial data object from either arrays or 1634 1634 a file (pts or xya). … … 1636 1636 Objects of this class can be used with \method{set\_quantity}. 1637 1637 1638 FIXME (Ole): Describe methods such as get _attributes() etc1638 FIXME (Ole): Describe methods such as get\_attributes() etc 1639 1639 \end{classdesc} 1640 1640 … … 1778 1778 1779 1779 The SWW format is used not only for output but also serves as input 1780 for functions such as \function{file _boundary} and1781 \function{file _function}, described in Chapter \ref{ch:interface}.1780 for functions such as \function{file\_boundary} and 1781 \function{file\_function}, described in Chapter \ref{ch:interface}. 1782 1782 1783 1783 A TMS file is used to store time series data that is independent of … … 1791 1791 be either a TSH file, which is an ASCII file, or an MSH file, which 1792 1792 is a NetCDF file. A meshfile can be generated from the function 1793 \function{create _mesh_from_regions} (see Section1793 \function{create\_mesh\_from\_regions} (see Section 1794 1794 \ref{sec:meshgeneration}) and used to initialise a domain. 1795 1795 … … 1815 1815 attributes associated with a set of points. 1816 1816 1817 The format for an XYA file is: 1817 The format for an XYA file is:\\ 1818 1818 %\begin{verbatim} 1819 1819 … … 1858 1858 1859 1859 \begin{tabular}{l l} 1860 \code{ncols} & \code{753} 1861 \code{nrows} & \code{766} 1862 \code{xllcorner} & \code{314036.58727982} 1863 \code{yllcorner} & \code{6224951.2960092}1864 \code{cellsize} & \code{100}1860 \code{ncols} & \code{753}\\ 1861 \code{nrows} & \code{766}\\ 1862 \code{xllcorner} & \code{314036.58727982}\\ 1863 \code{yllcorner} & \code{6224951.2960092}\\ 1864 \code{cellsize} & \code{100}\\ 1865 1865 \code{NODATA_value} & \code{-9999} 1866 1866 \end{tabular} … … 1903 1903 1904 1904 Takes data from an SWW file \code{basename_in} and converts it to DEM format (ASC or 1905 ERS) of a desired grid size \code{cellsize} in metres. 1906 The easting and northing values are used if the user wished to clip the output 1905 ERS) of a desired grid size \code{cellsize} in metres. 1906 The easting and northing values are used if the user wished to clip the output 1907 1907 file to a specified rectangular area. The \code{reduction} input refers to a function 1908 1908 to reduce the quantities over all time step of the SWW file, example, maximum. … … 2019 2019 2020 2020 If the function definition changes after a result has been cached, this will be 2021 detected by examining the functions \code{bytecode (co _code, co_consts,2022 func _defaults, co_argcount)} and the function will be recomputed.2023 2024 Options are set by means of the function \code{set _option(key, value)},2021 detected by examining the functions \code{bytecode (co\_code, co\_consts, 2022 func\_defaults, co\_argcount)} and the function will be recomputed. 2023 2024 Options are set by means of the function \code{set\_option(key, value)}, 2025 2025 where \code{key} is a key associated with a 2026 2026 Python dictionary \code{options}. This dictionary stores settings such as the name of … … 2034 2034 2035 2035 2036 \textbf{USAGE:} 2036 \textbf{USAGE:} \nopagebreak 2037 2037 2038 2038 {\small \begin{verbatim} … … 2070 2070 up/down arrows & increase/decrease speed\\ 2071 2071 2072 left/right arrows & direction in time \emph{(when running)}\\ & step through simulation \emph{(when stopped)}\\ 2072 left/right arrows & direction in time \emph{(when running)}\\ 2073 & step through simulation \emph{(when stopped)}\\ 2073 2074 2074 2075 left mouse button & rotate\\ … … 2088 2089 Options:\\ \nopagebreak 2089 2090 \begin{tabular}{ll} 2090 \code{--display <type>} & \code{MONITOR | POWERWALL | REALITY _CENTER |}\\2091 & \code{HEAD _MOUNTED_DISPLAY}\\2091 \code{--display <type>} & \code{MONITOR | POWERWALL | REALITY\_CENTER |}\\ 2092 & \code{HEAD\_MOUNTED\_DISPLAY}\\ 2092 2093 \code{--rgba} & Request a RGBA colour buffer visual\\ 2093 2094 \code{--stencil} & Request a stencil buffer visual\\ 2094 2095 \code{--stereo} & Use default stereo mode which is \code{ANAGLYPHIC} if not \\ 2095 2096 & overridden by environmental variable\\ 2096 \code{--stereo <mode>} & \code{ANAGLYPHIC | QUAD _BUFFER | HORIZONTAL_SPLIT |}\\2097 & \code{VERTICAL _SPLIT | LEFT_EYE | RIGHT_EYE |}\\2097 \code{--stereo <mode>} & \code{ANAGLYPHIC | QUAD\_BUFFER | HORIZONTAL\_SPLIT |}\\ 2098 & \code{VERTICAL\_SPLIT | LEFT\_EYE | RIGHT\_EYE |}\\ 2098 2099 & \code{ON | OFF} \\ 2099 2100 \code{-alphamax <float 0-1>} & Maximum transparency clamp value\\ 2100 2101 \code{-alphamin <float 0-1>} & Transparency value at \code{hmin}\\ 2102 \end{tabular} 2103 2104 \begin{tabular}{ll} 2101 2105 \code{-cullangle <float angle 0-90>} & Cull triangles steeper than this value\\ 2102 2106 \code{-help} & Display this information\\ 2103 2107 \code{-hmax <float>} & Height above which transparency is set to 2104 2108 \code{alphamax}\\ 2109 \end{tabular} 2110 2111 \begin{tabular}{ll} 2112 2105 2113 \code{-hmin <float>} & Height below which transparency is set to 2106 2114 zero\\ 2115 \end{tabular} 2116 2117 \begin{tabular}{ll} 2107 2118 \code{-lightpos <float>,<float>,<float>} & $x,y,z$ of bedslope directional light ($z$ is 2108 2119 up, default is overhead)\\ 2120 \end{tabular} 2121 2122 \begin{tabular}{ll} 2109 2123 \code{-loop} & Repeated (looped) playback of \code{.swm} files\\ 2124 2125 \end{tabular} 2126 2127 \begin{tabular}{ll} 2110 2128 \code{-movie <dirname>} & Save numbered images to named directory and 2111 2129 quit\\ 2130 2112 2131 \code{-nosky} & Omit background sky\\ 2132 2133 2113 2134 \code{-scale <float>} & Vertical scale factor\\ 2114 2135 \code{-texture <file>} & Image to use for bedslope topography\\ … … 2123 2144 \refmodindex{utilities.polygon} 2124 2145 2125 \begin{classdesc}{Polygon _function}{regions, default = 0.0, geo_reference = None}2146 \begin{classdesc}{Polygon\_function}{regions, default = 0.0, geo_reference = None} 2126 2147 Module: \code{utilities.polygon} 2127 2148 … … 2141 2162 \end{classdesc} 2142 2163 2143 \begin{funcdesc}{read _polygon}{filename}2164 \begin{funcdesc}{read\_polygon}{filename} 2144 2165 Module: \code{utilities.polygon} 2145 2166 … … 2149 2170 \end{funcdesc} 2150 2171 2151 \begin{funcdesc}{populate _polygon}{polygon, number_of_points, seed = None, exclude = None}2172 \begin{funcdesc}{populate\_polygon}{polygon, number_of_points, seed = None, exclude = None} 2152 2173 Module: \code{utilities.polygon} 2153 2174 … … 2156 2177 \end{funcdesc} 2157 2178 2158 \begin{funcdesc}{point _in_polygon}{polygon, delta=1e-8}2179 \begin{funcdesc}{point\_in\_polygon}{polygon, delta=1e-8} 2159 2180 Module: \code{utilities.polygon} 2160 2181 … … 2164 2185 \end{funcdesc} 2165 2186 2166 \begin{funcdesc}{inside _polygon}{points, polygon, closed = True, verbose = False}2187 \begin{funcdesc}{inside\_polygon}{points, polygon, closed = True, verbose = False} 2167 2188 Module: \code{utilities.polygon} 2168 2189 … … 2175 2196 \end{funcdesc} 2176 2197 2177 \begin{funcdesc}{outside _polygon}{points, polygon, closed = True, verbose = False}2198 \begin{funcdesc}{outside\_polygon}{points, polygon, closed = True, verbose = False} 2178 2199 Module: \code{utilities.polygon} 2179 2200 2180 Exactly like \code{inside _polygon}, but with the words `inside' and `outside' interchanged.2201 Exactly like \code{inside\_polygon}, but with the words `inside' and `outside' interchanged. 2181 2202 \end{funcdesc} 2182 2203 2183 \begin{funcdesc}{is _inside_polygon}{point, polygon, closed=True, verbose=False}2204 \begin{funcdesc}{is\_inside\_polygon}{point, polygon, closed=True, verbose=False} 2184 2205 Module: \code{utilities.polygon} 2185 2206 … … 2189 2210 \end{funcdesc} 2190 2211 2191 \begin{funcdesc}{is _outside_polygon}{point, polygon, closed=True, verbose=False}2212 \begin{funcdesc}{is\_outside\_polygon}{point, polygon, closed=True, verbose=False} 2192 2213 Module: \code{utilities.polygon} 2193 2214 2194 Exactly like \code{is _outside_polygon}, but with the words `inside' and `outside' interchanged.2215 Exactly like \code{is\_outside\_polygon}, but with the words `inside' and `outside' interchanged. 2195 2216 \end{funcdesc} 2196 2217 2197 \begin{funcdesc}{point _on_line}{x, y, x0, y0, x1, y1}2218 \begin{funcdesc}{point\_on\_line}{x, y, x0, y0, x1, y1} 2198 2219 Module: \code{utilities.polygon} 2199 2220 … … 2203 2224 \end{funcdesc} 2204 2225 2205 \begin{funcdesc}{separate _points_by_polygon}{points, polygon, closed = True, verbose = False}2206 \indexedcode{separate _points_by_polygon}2226 \begin{funcdesc}{separate\_points\_by\_polygon}{points, polygon, closed = True, verbose = False} 2227 \indexedcode{separate\_points\_by\_polygon} 2207 2228 Module: \code{utilities.polygon} 2208 2229 2209 2230 \end{funcdesc} 2210 2231 2211 \begin{funcdesc}{polygon _area}{polygon}2232 \begin{funcdesc}{polygon\_area}{polygon} 2212 2233 Module: \code{utilities.polygon} 2213 2234 … … 2215 2236 \end{funcdesc} 2216 2237 2217 \begin{funcdesc}{plot _polygons}{polygons, figname, verbose = False}2238 \begin{funcdesc}{plot\_polygons}{polygons, figname, verbose = False} 2218 2239 Module: \code{utilities.polygon} 2219 2240 2220 Plots each polygon contained in input polygon list, e.g. 2241 Plots each polygon contained in input polygon list, e.g. 2221 2242 \code{polygons = [poly1, poly2, poly3]} where \code{poly1 = [[x11,y11],[x12,y12],[x13,y13]]} 2222 2243 etc. Each polygon is closed for plotting purposes and subsequent plot saved to \code{figname}. … … 2225 2246 \end{funcdesc} 2226 2247 2227 \section{coordinate _transforms}2228 2229 \section{geospatial _data}2248 \section{coordinate\_transforms} 2249 2250 \section{geospatial\_data} 2230 2251 2231 2252 This describes a class that represents arbitrary point data in UTM … … 2238 2259 2239 2260 2240 \begin{classdesc}{Geospatial _data}2261 \begin{classdesc}{Geospatial\_data} 2241 2262 {data_points = None, 2242 2263 attributes = None, … … 2244 2265 default_attribute_name = None, 2245 2266 file_name = None} 2246 Module: \code{geospatial _data}2267 Module: \code{geospatial\_data} 2247 2268 2248 2269 This class is used to store a set of data points and associated … … 2251 2272 2252 2273 The data points are specified either by reading them from a NetCDF 2253 or XYA file, identified through the parameter \code{file _name}, or2274 or XYA file, identified through the parameter \code{file\_name}, or 2254 2275 by providing their \code{x}- and \code{y}-coordinates in metres, 2255 2276 either as a sequence of 2-tuples of floats or as an $M \times 2$ 2256 2277 Numeric array of floats, where $M$ is the number of points. 2257 2278 Coordinates are interpreted relative to the origin specified by the 2258 object \code{geo _reference}, which contains data indicating the UTM2259 zone, easting and northing. If \code{geo _reference} is not2279 object \code{geo\_reference}, which contains data indicating the UTM 2280 zone, easting and northing. If \code{geo\_reference} is not 2260 2281 specified, a default is used. 2261 2282 … … 2264 2285 keys are the attribute names and whose values are lists or arrays of 2265 2286 length $M$. One of the attributes may be specified as the default 2266 attribute, by assigning its name to \code{default _attribute_name}.2287 attribute, by assigning its name to \code{default\_attribute\_name}. 2267 2288 If no value is specified, the default attribute is taken to be the 2268 2289 first one. … … 2270 2291 2271 2292 2272 \begin{funcdesc}{import _points_file}{delimiter = None, verbose = False}2273 2274 \end{funcdesc} 2275 2276 2277 \begin{funcdesc}{export _points_file}{ofile, absolute=False}2278 2279 \end{funcdesc} 2280 2281 2282 \begin{funcdesc}{get _data_points}{absolute = True}2283 2284 \end{funcdesc} 2285 2286 2287 \begin{funcdesc}{set _attributes}{attributes}2288 2289 \end{funcdesc} 2290 2291 2292 \begin{funcdesc}{get _attributes}{attribute_name = None}2293 2294 \end{funcdesc} 2295 2296 2297 \begin{funcdesc}{get _all_attributes}{}2298 2299 \end{funcdesc} 2300 2301 2302 \begin{funcdesc}{set _default_attribute_name}{default_attribute_name}2303 2304 \end{funcdesc} 2305 2306 2307 \begin{funcdesc}{set _geo_reference}{geo_reference}2308 2309 \end{funcdesc} 2310 2311 2312 \begin{funcdesc}{ __add__}2293 \begin{funcdesc}{import\_points\_file}{delimiter = None, verbose = False} 2294 2295 \end{funcdesc} 2296 2297 2298 \begin{funcdesc}{export\_points\_file}{ofile, absolute=False} 2299 2300 \end{funcdesc} 2301 2302 2303 \begin{funcdesc}{get\_data\_points}{absolute = True} 2304 2305 \end{funcdesc} 2306 2307 2308 \begin{funcdesc}{set\_attributes}{attributes} 2309 2310 \end{funcdesc} 2311 2312 2313 \begin{funcdesc}{get\_attributes}{attribute_name = None} 2314 2315 \end{funcdesc} 2316 2317 2318 \begin{funcdesc}{get\_all\_attributes}{} 2319 2320 \end{funcdesc} 2321 2322 2323 \begin{funcdesc}{set\_default\_attribute\_name}{default_attribute_name} 2324 2325 \end{funcdesc} 2326 2327 2328 \begin{funcdesc}{set\_geo\_reference}{geo_reference} 2329 2330 \end{funcdesc} 2331 2332 2333 \begin{funcdesc}{add}{} 2313 2334 2314 2335 \end{funcdesc} … … 2317 2338 \section{pmesh GUI} 2318 2339 2319 \section{alpha _shape}2340 \section{alpha\_shape} 2320 2341 An \emph{alpha shape} is a shape created from a set of points in the 2321 2342 plane, according to an algorithm. This shape is intended to capture … … 2335 2356 associated with instances of this class. 2336 2357 2337 \begin{classdesc}{Alpha _Shape}{points, alpha = None}2338 Module: \code{alpha _shape}2358 \begin{classdesc}{Alpha\_Shape}{points, alpha = None} 2359 Module: \code{alpha\_shape} 2339 2360 2340 2361 To instantiate this class the user supplies the points from which 2341 2362 the alpha shape is to be created (in the form of a list of 2-tuples 2342 2363 \code{[[x1, y1],[x2, y2]}\ldots\code{]}, assigned to the parameter 2343 \code{points}) and, optionally, a value for the parameter $\alpha$. 2344 The alpha shape is then computed and details of the required 2345 boundary may be retrieved as attributes of the class instance. 2364 \code{points}) and, optionally, a value for the parameter 2365 \code{alpha}. The alpha shape is then computed and details of the 2366 required boundary may be retrieved as attributes of the class 2367 instance. 2346 2368 \end{classdesc} 2347 2369 2348 2370 2349 \begin{funcdesc}{alpha _shape_via_files}{point_file, boundary_file, alpha= None}2350 Module: \code{alpha _shape}2371 \begin{funcdesc}{alpha\_shape\_via\_files}{point_file, boundary_file, alpha= None} 2372 Module: \code{alpha\_shape} 2351 2373 2352 2374 This function reads points from the specified file 2353 \code{point _file}, computes the associated alpha shape (either using2354 the specified value for \code{alpha} or, if no value is specified, 2355 automatically setting it to a value judged to be optimal} and 2356 outputs the boundary to a file named \code{boundary_file}. This2375 \code{point\_file}, computes the associated alpha shape (either 2376 using the specified value for \code{alpha} or, if no value is 2377 specified, automatically setting it to a value judged to be optimal) 2378 and outputs the boundary to a file named \code{boundary\_file}. This 2357 2379 output file lists the coordinates \code{x, y} of each point in the 2358 2380 boundary, using one line per point. … … 2360 2382 2361 2383 2362 \begin{funcdesc}{set _boundary_type}{self,raw_boundary=True,2384 \begin{funcdesc}{set\_boundary\_type}{self,raw_boundary=True, 2363 2385 remove_holes=False, 2364 2386 smooth_indents=False, 2365 2387 expand_pinch=False, 2366 2388 boundary_points_fraction=0.2} 2367 Module: \code{alpha _shape}2389 Module: \code{alpha\_shape} 2368 2390 2369 2391 This function sets flags that govern the operation of the algorithm 2370 that computes the boundary, 2371 raw_boundary Return raw boundary i.e. the regular edges of the 2372 alpha shape. 2373 remove_holes filter to remove small holes 2374 (small is defined by boundary_points_fraction ) 2375 smooth_indents remove sharp triangular indents in boundary 2376 expand_pinch test for pinch-off and correct 2377 i.e. a boundary vertex with more than two edges. 2378 \end{funcdesc} 2379 2380 \section{utilities/numerical_tools} 2381 2382 \begin{tabular}{|l l|} \hline 2392 that computes the boundary, as follows: 2393 2394 Set \code{raw\_boundary = True} to return raw boundary, i.e. the regular edges of the 2395 alpha shape.\\ 2396 Set \code{remove\_holes = True} to remove small holes 2397 (`small' is defined by 2398 \code{boundary\_points\_fraction})\\ 2399 Set \code{smooth\_indents = True} to remove sharp triangular indents in 2400 boundary\\ 2401 Set \code{expand\_pinch = True} to test for pinch-off and 2402 correct, i.e. to prevent a boundary vertex having more than two edges. 2403 \end{funcdesc} 2404 2405 \section{Numerical Tools} 2406 2407 The following table describes some useful numerical functions that 2408 may be found in the module \module{utilities.numerical\_tools}: 2409 2410 \begin{tabular}{|p{8cm} p{8cm}|} \hline 2383 2411 \code{angle(v1, v2=None)} & Angle between two-dimensional vectors 2384 \code{v1} and \code{v2}, in range $0$ to $2\pi$. If \code{v2} is2385 omitted it is taken as the unit vector in the $x$-direction.\\2386 2387 \code{normal _vector(v)} & Normal vector to \code{v}\\2388 2389 \code{mean(x)} & Mean value of a vector \\2412 \code{v1} and \code{v2}, or between \code{v1} and the $x$-axis if 2413 \code{v2} is \code{None}. Value is in range $0$ to $2\pi$. \\ 2414 2415 \code{normal\_vector(v)} & Normal vector to \code{v}.\\ 2416 2417 \code{mean(x)} & Mean value of a vector \code{x}.\\ 2390 2418 2391 2419 \code{cov(x, y=None)} & Covariance of vectors \code{x} and \code{y}. 2392 If y is None, returns \code{cov(x, x)}\\2420 If \code{y} is \code{None}, returns \code{cov(x, x)}.\\ 2393 2421 2394 2422 \code{err(x, y=0, n=2, relative=True)} & Relative error of 2395 2423 $\parallel$\code{x}$-$\code{y}$\parallel$ to 2396 2424 $\parallel$\code{y}$\parallel$ (2-norm if \code{n} = 2 or Max norm 2397 if \code{n} = None). If denominator evaluates to zero or if \code{y} 2425 if \code{n} = \code{None}). If denominator evaluates to zero or if 2426 \code{y} 2398 2427 is omitted, absolute error is returned.\\ 2399 2428 2400 \code{norm(x)} & 2-norm of \code{x} \\2429 \code{norm(x)} & 2-norm of \code{x}.\\ 2401 2430 2402 2431 \code{corr(x, y=None)} & Correlation of \code{x} and \code{y}. If 2403 2432 \code{y} is \code{None} returns autocorrelation of \code{x}.\\ 2404 2433 2405 \code{ensure _numeric(A, typecode = None)} & Ensure that sequence is2434 \code{ensure\_numeric(A, typecode = None)} & Ensure that sequence is 2406 2435 a Numeric array. If \code{A} is already a Numeric array it will be 2407 2436 returned unaltered. Otherwise, an attempt is made to convert it to a 2408 Numeric array. This function is necessary as\code{array(A)} can2409 cause memory overflow. \\2437 Numeric array. (Needed because \code{array(A)} can 2438 cause memory overflow.)\\ 2410 2439 2411 2440 \code{histogram(a, bins, relative=False)} & Standard histogram. If … … 2413 2442 the total and thus represent frequencies rather than counts.\\ 2414 2443 2415 \code{create _bins(data, number_of_bins = None)} & Safely create bins2416 for use with histogram. If data contains only one point or is 2417 constant, one bin will be created. If \code{number_of_bins} is 2418 omitted, 10 bins will be created.\\ \hline2444 \code{create\_bins(data, number\_of\_bins = None)} & Safely create 2445 bins for use with histogram. If \code{data} contains only one point 2446 or is constant, one bin will be created. If \code{number\_of\_bins} 2447 is omitted, 10 bins will be created.\\ \hline 2419 2448 2420 2449 \end{tabular} 2421 2422 2423 \begin{itemize}2424 \item \indexedcode{ensure_numeric}2425 \item \indexedcode{mean}2426 \item2427 \end{itemize}2428 2450 2429 2451 … … 2481 2503 2482 2504 \subsubsection{Can I start the simulation at an arbitrary time?} 2483 Yes, using \code{domain.set_time()} you can specify an arbitrary starting time. 2484 This is for example useful in conjunction with a file_boundary, which may start hours before anything hits the model boundary. By assigning a later time for the model to start, computational resources aren't wasted. 2505 Yes, using \code{domain.set\_time()} you can specify an arbitrary 2506 starting time. This is for example useful in conjunction with a 2507 file\_boundary, which may start hours before anything hits the model 2508 boundary. By assigning a later time for the model to start, 2509 computational resources aren't wasted. 2485 2510 2486 2511 \subsubsection{Can I change values for any quantity during the simulation?} 2487 Yes, using \code{domain.set_quantity()} inside the domain.evolve loop you 2488 can change values of any quantity. This is for example useful if you wish to 2489 let the system settle for a while before assigning an initial condition. Another example would be changing the values for elevation to model e.g. erosion. 2512 Yes, using \code{domain.set\_quantity()} inside the domain.evolve 2513 loop you can change values of any quantity. This is for example 2514 useful if you wish to let the system settle for a while before 2515 assigning an initial condition. Another example would be changing 2516 the values for elevation to model e.g. erosion. 2490 2517 2491 2518 \subsubsection{Can I change boundary conditions during the simulation?} … … 2499 2526 2500 2527 \subsubsection{How do I use a DEM in my simulation?} 2501 You use \code{dem2pts} to convert your DEM to the required .pts format. This .pts file is then called 2528 You use \code{dem2pts} to convert your DEM to the required .pts format. This .pts file is then called 2502 2529 when setting the elevation data to the mesh in \code{domain.set_quantity} 2503 2530 2504 2531 \subsubsection{What sort of DEM resolution should I use?} 2505 Try and work with the \emph{best} you have available. Onshore DEMs are typically available in 25m, 100m and 250m grids. Note, offshore data is often sparse, 2506 or non-existant. 2532 Try and work with the \emph{best} you have available. Onshore DEMs 2533 are typically available in 25m, 100m and 250m grids. Note, offshore 2534 data is often sparse, or non-existent. 2507 2535 2508 2536 \subsubsection{What sort of mesh resolution should I use?} … … 2528 2556 2529 2557 \subsubsection{How do I know which boundary tags are available?} 2530 The method \code{domain.get_boundary_tags()} will return a list of 2531 available tags for use with \code{domain.set_boundary_condition()}. 2558 The method \code{domain.get\_boundary\_tags()} will return a list of 2559 available tags for use with 2560 \code{domain.set\_boundary\_condition()}. 2532 2561 2533 2562 … … 2537 2566 \chapter{Glossary} 2538 2567 2539 \begin{tabular}{|l p{10cm}| c|} \hline 2568 \begin{tabular}{|lp{10cm}|c|} \hline 2569 %\begin{tabular}{|llll|} \hline 2540 2570 \emph{Term} & \emph{Definition} & \emph{Page}\\ \hline 2541 2571 … … 2543 2573 GA) & \pageref{def:anuga}\\ 2544 2574 2545 \indexedbold{domain} & The domain of a function is the set of all input values to the2546 function.&\\2547 2548 \indexedbold{Dirichlet boundary} & A Dirichlet boundary condition imposed on a differential equation2549 which specifies the values the solution is to take on the boundary of the2550 domain.&\\2551 2552 \indexedbold{elevation} & refers to bathymetry and topography&\\2553 2554 2575 \indexedbold{bathymetry} & offshore elevation &\\ 2555 2576 2556 \indexedbold{topography} & onshore elevation &\\ 2577 \indexedbold{conserved quantity} & conserved (stage, x and y 2578 momentum) & \\ 2579 2580 % \indexedbold{domain} & The domain of a function is the set of all input values to the 2581 % function.&\\ 2582 2583 \indexedbold{Digital Elevation Model (DEM)} & DEMs are digital files consisting of points of elevations, 2584 sampled systematically at equally spaced intervals.& \\ 2585 2586 \indexedbold{Dirichlet boundary} & A boundary condition imposed on a differential equation 2587 that specifies the values the solution is to take on the boundary of the 2588 domain. & \pageref{def:dirichlet boundary}\\ 2589 2590 \indexedbold{edge} & A triangular cell within the computational mesh can be depicted 2591 as a set of vertices joined by lines (the edges). & \\ 2592 2593 \indexedbold{elevation} & refers to bathymetry and topography &\\ 2557 2594 2558 2595 \indexedbold{evolution} & integration of the shallow water wave equations 2559 2596 over time &\\ 2560 2597 2598 \indexedbold{finite volume method} & The method evaluates the terms in the shallow water 2599 wave equation as fluxes at the surfaces of each finite volume. Because the 2600 flux entering a given volume is identical to that leaving the adjacent volume, 2601 these methods are conservative. Another advantage of the finite volume method is 2602 that it is easily formulated to allow for unstructured meshes. The method is used 2603 in many computational fluid dynamics packages. & \\ 2604 2561 2605 \indexedbold{forcing term} & &\\ 2562 2563 \indexedbold{IDLE} & Development environment shipped with2564 Python &\\2565 2566 \indexedbold{Manning friction coefficient} & &\\2567 2568 \indexedbold{mesh} & Triangulation of domain &\\2569 2570 \indexedbold{meshfile} & [generic word for either .tsh or2571 .msh file] & \\2572 2573 \indexedbold{points file} & [generic word for either .pts or2574 .xya file] & \\2575 2576 \indexedbold{grid} & evenly spaced mesh & \\2577 2578 \indexedbold{NetCDF} & &\\2579 2580 \indexedbold{conserved quantity} & conserved (stage, x and y2581 momentum) & \\2582 2583 \indexedbold{reflective boundary} & &\\2584 2585 \indexedbold{stage} & &\\2586 2587 % \indexedbold{try this}2588 2589 \indexedbold{swollen} & visualisation tool &\\2590 2591 \indexedbold{time boundary} & defined in the manual (flog from2592 there)&\\2593 2594 \indexedbold{transmissive boundary} & defined in the manual (flog from2595 there)&\\2596 2597 \indexedbold{xmomentum} & conserved quantity (note, two-dimensional SWW equations say only x and y and NOT2598 z) &\\2599 2600 \indexedbold{ymomentum} & conserved quantity & \\2601 2602 2603 2604 \indexedbold{resolution} & The maximal area of a triangular cell in a2605 mesh & \\2606 2607 \indexedbold{polygon} & A sequence of points in the plane. (Arbitrary polygons can be created2608 in this way.)2609 \anuga represents a polygon in one of two ways. One way is to represent it as a2610 list whose members are either Python tuples2611 or Python lists of length 2. The unit square, for example, would be represented by the2612 list2613 [ [0,0], [1,0], [1,1], [0,1] ]. The alternative is to represent it as an2614 $N \times 2$ Numeric array, where $N$ is the number of points.2615 2616 NOTE: More can be read in the module utilities/polygon.py .... &2617 \\ \hline2618 2619 \end{tabular}2620 2621 \begin{tabular}{|l p{10cm}|c|} \hline2622 2623 \emph{Term} & \emph{Definition} & \emph{Page}\\ \hline2624 \indexedbold{easting} & A rectangular (x,y) coordinate measurement of distance east from a north-south reference line,2625 usually a meridian used as the axis of origin within a map zone or2626 projection. Easting is a UTM (Universal Transverse Mercator)2627 Coordinate. & \\2628 2629 \indexedbold{northing} & A rectangular (x,y) coordinate measurement of distance north from a north-south reference line,2630 usually a meridian used as the axis of origin within a map zone or2631 projection. Northing is a UTM (Universal Transverse Mercator)2632 Coordinate. & \\2633 2634 2635 \indexedbold{latitude} & The angular distance on a mericlear north and south of the equator, expressed in degrees and2636 minutes. & \\2637 2638 \indexedbold{longitude} & The angular distance east or west, between the meridian of a particular place on Earth and that of the2639 Prime Meridian (located in Greenwich, England) expressed in degrees2640 or time.& \\2641 2642 \indexedbold{edge} & A triangular cell within the computational mesh can be depicted as a set of vertices joined by lines (the2643 edges). & \\2644 2645 \indexedbold{vertex} & A point at which edges meet. & \\2646 2647 \indexedbold{finite volume} & The method evaluates the terms in the shallow water wave equation as fluxes at the surfaces of each2648 finite volume. Because the flux entering a given volume is identical2649 to that leaving the adjacent volume, these methods are conservative.2650 Another advantage of the finite volume method is that it is easily2651 formulated to allow for unstructured meshes. The method is used in2652 many computational fluid dynamics packages. & \\2653 2654 2606 2655 2607 \indexedbold{flux} & the amount of flow through the volume per unit 2656 2608 time & \\ 2657 2609 2658 \indexedbold{Digital Elevation Model (DEM)} & DEMs are digital files consisting of points of elevations, 2659 sampled systematically at equally spaced intervals.& \\ \hline 2660 2661 2662 \end{tabular} 2610 \indexedbold{grid} & Evenly spaced mesh & \\ 2611 2612 \indexedbold{latitude} & The angular distance on a mericlear north and south of the 2613 equator, expressed in degrees and minutes. & \\ 2614 2615 \indexedbold{longitude} & The angular distance east or west, between the meridian 2616 of a particular place on Earth and that of the Prime Meridian (located in Greenwich, 2617 England) expressed in degrees or time.& \\ 2618 2619 \indexedbold{Manning friction coefficient} & &\\ 2620 2621 \indexedbold{mesh} & Triangulation of domain &\\ 2622 2623 \indexedbold{meshfile} & A TSH or MSH file & \pageref{def:meshfile}\\ 2624 2625 \indexedbold{NetCDF} & &\\ 2626 2627 \indexedbold{northing} & A rectangular (x,y) coordinate measurement of distance 2628 north from a north-south reference line, usually a meridian used as the axis of 2629 origin within a map zone or projection. Northing is a UTM (Universal Transverse 2630 Mercator) coordinate. & \\ 2631 2632 \indexedbold{points file} & A PTS or XYA file & \\ \hline 2633 2634 \end{tabular} 2635 2636 \begin{tabular}{|lp{10cm}|c|} \hline 2637 2638 \indexedbold{polygon} & A sequence of points in the plane. \anuga represents a polygon 2639 either as a list consisting of Python tuples or lists of length 2 or as an $N \times 2$ 2640 Numeric array, where $N$ is the number of points. 2641 2642 The unit square, for example, would be represented either as 2643 \code{[ [0,0], [1,0], [1,1], [0,1] ]} or as \code{array( [0,0], [1,0], [1,1], 2644 [0,1] )}. 2645 2646 NOTE: For details refer to the module \module{utilities/polygon.py}. & 2647 \\ \indexedbold{resolution} & The maximal area of a triangular cell in a 2648 mesh & \\ 2649 2650 2651 \indexedbold{reflective boundary} & Models a solid wall. Returns same conserved 2652 quantities as those present in the neighbouring volume but reflected. Specific to the 2653 shallow water equation as it works with the momentum quantities assumed to be the 2654 second and third conserved quantities. & \pageref{def:reflective boundary}\\ 2655 2656 \indexedbold{stage} & &\\ 2657 2658 % \indexedbold{try this} 2659 2660 \indexedbold{swollen} & visualisation tool used with \anuga & \pageref{sec:swollen}\\ 2661 2662 \indexedbold{time boundary} & Returns values for the conserved 2663 quantities as a function of time. The user must specify 2664 the domain to get access to the model time. & \pageref{def:time boundary}\\ 2665 2666 \indexedbold{topography} & onshore elevation &\\ 2667 2668 \indexedbold{transmissive boundary} & & \pageref{def:transmissive boundary}\\ 2669 2670 \indexedbold{vertex} & A point at which edges meet. & \\ 2671 2672 \indexedbold{xmomentum} & conserved quantity (note, two-dimensional SWW equations say 2673 only \code{x} and \code{y} and NOT \code{z}) &\\ 2674 2675 \indexedbold{ymomentum} & conserved quantity & \\ \hline 2676 2677 \end{tabular} 2678 2663 2679 2664 2680 %The \code{\e appendix} markup need not be repeated for additional
Note: See TracChangeset
for help on using the changeset viewer.