Changeset 3121
- Timestamp:
- Jun 8, 2006, 4:49:08 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
documentation/user_manual/anuga_user_manual.tex
r3119 r3121 281 281 %\verbatiminput{examples/bedslope.py} 282 282 283 \subsection{Establishing the Mesh} 283 \subsection{Establishing the Mesh}\index{mesh, establishing} 284 284 285 285 The first task is to set up the triangular mesh to be used for the … … 454 454 details. 455 455 456 \subsection{Boundary Conditions} 456 \subsection{Boundary Conditions}\index{boundary conditions} 457 457 458 458 The boundary conditions are specified as follows: … … 524 524 boundary. An edge with endpoints \code{points[i]} and 525 525 \code{points[j]} is represented by the 2-tuple \code{(i, j)}. The 526 keys for the dictionary are the 2-tuples \code{ [i, j]} corresponding526 keys for the dictionary are the 2-tuples \code{(i, j)} corresponding 527 527 to boundary edges in the mesh, and the values are the tags are used 528 to label them. In the present example, the value \code{boundary[ i,529 j ]} assigned to \code{[i, j]} is one of the four tags \code{`left'},530 \code{` right'}, \code{`top'} or \code{`bottom'}, depending on531 whether the boundary edge represented by \code{(i, j)} occurs at the 532 left, right, top or bottom of the rectangle bounding the mesh. The 533 function \code{rectangular} automatically assigns these tags to the 534 boundary edges when it generates the mesh.528 to label them. In the present example, the value \code{boundary[(i, 529 j)]} assigned to \code{(i, j)]} is one of the four tags 530 \code{`left'}, \code{`right'}, \code{`top'} or \code{`bottom'}, 531 depending on whether the boundary edge represented by \code{(i, j)} 532 occurs at the left, right, top or bottom of the rectangle bounding 533 the mesh. The function \code{rectangular} automatically assigns 534 these tags to the boundary edges when it generates the mesh. 535 535 \end{itemize} 536 536 … … 539 539 (In Section \ref{sec:realdataexample} we describe an example that 540 540 uses different boundary tags---in general, the possible tags are not 541 limited to `left', `right', `top' and `bottom', but can be s elected541 limited to `left', `right', `top' and `bottom', but can be specified 542 542 by the user.) 543 543 … … 565 565 566 566 567 \subsection{Evolution} 567 \subsection{Evolution}\index{evolution} 568 568 569 569 The final statement \nopagebreak[3] … … 690 690 given above, discussing each major step of the code in turn. 691 691 692 \subsection{Establishing the Mesh} 692 \subsection{Establishing the Mesh}\index{mesh, establishing} 693 693 694 694 One obvious way that the present example differs from … … 906 906 \code{combinedname} in the file \file{project.py}. 907 907 908 \subsection{Boundary Conditions} 908 \subsection{Boundary Conditions}\index{boundary conditions} 909 909 910 910 Setting boundaries follows a similar pattern to the one used for … … 1125 1125 Additionally, the user specifies a list of boundary tags, one for 1126 1126 each edge of the bounding polygon. 1127 1128 \textbf{WARNING}. Note that the dictionary structure used for the 1129 parameter \code{boundary\_tags} is different from that used for the 1130 variable \code{boundary} that occurs in the specification of a mesh. 1131 In the case of \code{boundary}, the tags are the \emph{values} of 1132 the dictionary, whereas in the case of \code{boundary_tags}, the 1133 tags are the \emph{keys} and the \emph{value} corresponding to a 1134 particular tag is a list of numbers identifying boundary edges 1135 labelled with that tag. Because of this, it is theoretically 1136 possible to assign the same edge to more than one tag. However, an 1137 attempt to do this will cause an error. 1127 1138 \end{funcdesc} 1128 1139 … … 1159 1170 \begin{methoddesc} {add\_region\_from\_polygon}{self, polygon, tags=None, 1160 1171 max_triangle_area=None, geo_reference=None} 1161 Module: \module{pmesh.mesh} Class: \class{Mesh}1172 Module: \module{pmesh.mesh}, Class: \class{Mesh} 1162 1173 1163 1174 This method is used to add a region to a \class{Mesh} instance. The … … 1171 1182 \begin{methoddesc} {add\_hole\_from\_polygon}{self, polygon, tags=None, 1172 1183 geo_reference=None} 1173 Module: \module{pmesh.mesh} Class: \class{Mesh}1184 Module: \module{pmesh.mesh}, Class: \class{Mesh} 1174 1185 1175 1186 % Translate following into layman's language … … 1185 1196 minimum_triangle_angle=28.0, 1186 1197 verbose=False} 1187 Module: \module{pmesh.mesh} Class: \class{Mesh}1198 Module: \module{pmesh.mesh}, Class: \class{Mesh} 1188 1199 1189 1200 % Translate following into layman's language … … 1195 1206 1196 1207 \begin{methoddesc} {export\_mesh_file}{self,ofile} 1197 Module: \module{pmesh.mesh} Class: \class{Mesh}1208 Module: \module{pmesh.mesh}, Class: \class{Mesh} 1198 1209 1199 1210 % Translate following into layman's language … … 1206 1217 1207 1218 \begin{methoddesc} {import_ungenerate_file}{self,ofile, tag=None} 1208 Module: \module{pmesh.mesh} Class: \class{Mesh}1219 Module: \module{pmesh.mesh}, Class: \class{Mesh} 1209 1220 1210 1221 % Translate following into layman's language … … 1286 1297 Module: \module{pyvolution.domain} 1287 1298 1288 Specifies the directory used for data, assigning it to the pathname \code{name}. The default value, before1299 Specifies the directory used for SWW files, assigning it to the pathname \code{name}. The default value, before 1289 1300 \code{set\_datadir} has been run, is the value \code{default\_datadir} 1290 1301 specified in \code{config.py}. … … 1465 1476 Module: \module{pyvolution.least\_squares} 1466 1477 1467 Given a time series, either as a sequence of numbers or defined at 1468 the vertices of a triangular mesh (such as those stored in SWW 1469 files), \code{Interpolation\_function} is used to create a callable 1470 object that interpolates a value for an arbitrary time \code{t} 1471 within the model limits and possibly a point \code{(x, y)} within a 1472 mesh region. 1478 Given a time series (i.e. a series of values associated with 1479 different times), whose values are either just numbers or a set of 1480 numbers defined at the vertices of a triangular mesh (such as those 1481 stored in SWW files), \code{Interpolation\_function} is used to 1482 create a callable object that interpolates a value for an arbitrary 1483 time \code{t} within the model limits and possibly a point \code{(x, 1484 y)} within a mesh region. 1473 1485 1474 1486 The actual time series at which data is available is specified by … … 1501 1513 1502 1514 %%%%%% 1503 \section{Boundary Conditions} 1515 \section{Boundary Conditions}\index{boundary conditions} 1504 1516 1505 1517 \anuga provides a large number of predefined boundary conditions, … … 1626 1638 1627 1639 1628 \section{Evolution} 1640 \section{Evolution}\index{evolution} 1629 1641 1630 1642 \begin{methoddesc}{evolve}{yieldstep = None, finaltime = None, duration = None, skip_initial_step = False} … … 1667 1679 Module: \module{pyvolution.domain} 1668 1680 1669 1681 Returns a string of the following type for each 1682 timestep: 1683 1684 \code{Time = 0.9000, delta t in [0.00598964, 0.01177388], steps=12 1685 (12)} 1686 1687 Here the numbers in \code{steps=12 (12)} indicate the number of steps taken and 1688 the number of first-order steps, respectively. 1670 1689 \end{funcdesc} 1671 1690 … … 1674 1693 Module: \module{pyvolution.domain} 1675 1694 1695 Returns a string of the following type when \code{quantities = 'stage'} and \code{tags = ['top', 'bottom']}: 1696 1697 {\small \begin{verbatim} 1698 Boundary values at time 0.5000: 1699 top: 1700 stage in [ -0.25821218, -0.02499998] 1701 bottom: 1702 stage in [ -0.27098821, -0.02499974] 1703 \end{verbatim}} 1676 1704 1677 1705 \end{funcdesc} … … 1708 1736 See \file{Analytical\_solution\_circular\_hydraulic\_jump.py} for an example of use. 1709 1737 \end{funcdesc} 1710 1711 1712 \begin{classdesc}{Geospatial\_data}{data_points = None,1713 attributes = None,1714 geo_reference = None,1715 default_attribute_name = None,1716 file_name = None}1717 Module: \module{geospatial\_data.geo\_spatial\_data}1718 Creates a georeferenced geospatial data object from either arrays or1719 a file (pts or xya).1720 1721 Objects of this class can be used with \method{set\_quantity}.1722 1723 FIXME (Ole): Describe methods such as get\_attributes() etc1724 \end{classdesc}1725 1738 1726 1739 … … 1799 1812 \begin{tabular}{ll} 1800 1813 ASC, PRJ & Digital elevation models (gridded)\\ 1801 TSH & Triangular meshes (e.g. created from \code{pmesh})\\1802 1814 NC & Model outputs for use as boundary conditions (e.g. from MOST) 1803 1815 \end{tabular} … … 1818 1830 1819 1831 TSH + Boundary SWW $\rightarrow$ SWW & Simulation using 1820 \code{pyvolution} 1832 \code{pyvolution}\\ 1833 1834 Polygonal mesh outline $\rightarrow$ & TSH or MSH 1821 1835 \end{tabular} 1822 1836 … … 1873 1887 1874 1888 A mesh file is a file that has a specific format suited to 1875 specifying mesh data for \anuga. A mesh file can have one of two 1876 formats: it can be either a TSH file, which is an ASCII file, or an 1877 MSH file, which is a NetCDF file. A mesh file can be generated from 1878 the function \function{create\_mesh\_from\_regions} (see Section 1879 \ref{sec:meshgeneration}) and used to initialise a domain.1880 1881 A mesh file describesthe outline of the mesh---the vertices and1889 triangular meshes and their outlines. A mesh file can have one of 1890 two formats: it can be either a TSH file, which is an ASCII file, or 1891 an MSH file, which is a NetCDF file. A mesh file can be generated 1892 from the function \function{create\_mesh\_from\_regions} (see 1893 Section \ref{sec:meshgeneration}) and used to initialise a domain. 1894 1895 A mesh file can define the outline of the mesh---the vertices and 1882 1896 line segments that enclose the region in which the mesh is 1883 1897 created---and the triangular mesh itself, which is specified by … … 1887 1901 1888 1902 In addition, a mesh file may contain `holes' and/or `regions'. A 1889 hole or region is defined by specifying a point and a number of1890 segments that enclose that point. A hole represents an area where no 1891 mesh is to be created, while a region is a labelled area used for 1892 defining properties of a mesh, such as friction values.1903 hole represents an area where no mesh is to be created, while a 1904 region is a labelled area used for defining properties of a mesh, 1905 such as friction values. A hole or region is specified by a point 1906 and bounded by a number of segments that enclose that point. 1893 1907 1894 1908 A mesh file can also contain a georeference, which describes an … … 2482 2496 expand_pinch=False, 2483 2497 boundary_points_fraction=0.2} 2484 Module: \code{alpha\_shape} Class: \class{Alpha\_Shape}2498 Module: \code{alpha\_shape}, Class: \class{Alpha\_Shape} 2485 2499 2486 2500 This function sets flags that govern the operation of the algorithm … … 2499 2513 2500 2514 \begin{methoddesc}{get\_boundary}{} 2501 Module: \code{alpha\_shape} Class: \class{Alpha\_Shape}2515 Module: \code{alpha\_shape}, Class: \class{Alpha\_Shape} 2502 2516 2503 2517 Returns a list of tuples representing the boundary of the alpha … … 2508 2522 2509 2523 \begin{methoddesc}{write\_boundary}{file_name} 2510 Module: \code{alpha\_shape} Class: \class{Alpha\_Shape}2524 Module: \code{alpha\_shape}, Class: \class{Alpha\_Shape} 2511 2525 2512 2526 Writes the list of 2-tuples returned by \code{get\_boundary} to the … … 2536 2550 if \code{n} = \code{None}). If denominator evaluates to zero or if 2537 2551 \code{y} 2538 is omitted , absolute error is returned.\\2552 is omitted or if \code{relative = False}, absolute error is returned.\\ 2539 2553 2540 2554 \code{norm(x)} & 2-norm of \code{x}.\\ … … 2543 2557 \code{y} is \code{None} returns autocorrelation of \code{x}.\\ 2544 2558 2545 \code{ensure\_numeric(A, typecode = None)} & Ensure that sequence is2546 a Numeric array. If \code{A} is already a Numeric array it will be 2547 returned unaltered. Otherwise, an attempt is made to convert it to a 2548 Numeric array. (Needed because \code{array(A)} can2559 \code{ensure\_numeric(A, typecode = None)} & Returns a Numeric array 2560 for any sequence \code{A}. If \code{A} is already a Numeric array it 2561 will be returned unaltered. Otherwise, an attempt is made to convert 2562 it to a Numeric array. (Needed because \code{array(A)} can 2549 2563 cause memory overflow.)\\ 2550 2564
Note: See TracChangeset
for help on using the changeset viewer.