Changeset 2358
- Timestamp:
- Feb 8, 2006, 4:43:35 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
documentation/AnuGA_user_manual.tex
r2357 r2358 7 7 8 8 9 %\newcommand{\code}[1]{{\small \tt #1}} %For use with one-line code snippets 9 \newcommand{\indexedcode}[1]{\code{#1}\index{#1}} 10 \newcommand{\indexedbold}[1]{\textbf{#1}\index{#1}} 10 11 11 12 \documentclass{manual} … … 53 54 \noindent 54 55 \textbf{AnuGA}\index{AnuGA} is a hydrodynamic modelling tool that 55 allows users to model realistic flow problems in complex geometries. Examples include dam breaks or 56 the effects of natural hazards such as riverine flooding, storm surges and tsunami. 56 allows users to model realistic flow problems in complex 57 geometries. Examples include dam breaks or the effects of natural 58 hazards such as riverine flooding, storm surges and tsunami. 57 59 58 60 The user must specify a study area represented by a mesh of triangular … … 71 73 flows. 72 74 73 Anuga also incorporates a mesh generator, called \ texttt{pmesh}, that75 Anuga also incorporates a mesh generator, called \code{pmesh}, that 74 76 allows the user to set up the geometry of the problem interactively as 75 77 well as tools for interpolation and surface fitting, and a number of … … 131 133 \textbf{AnuGA} by working through a simple example. What follows 132 134 is a discussion of the structure and operation of the file 133 \ texttt{bedslope.py}, with just enough detail to allow the reader135 \code{bedslope.py}, with just enough detail to allow the reader 134 136 to appreciate what's involved in setting up a scenario like the 135 137 one it depicts. … … 166 168 \section{Outline of the Program} 167 169 168 In outline, \ texttt{bedslope.py} performs the following steps:170 In outline, \code{bedslope.py} performs the following steps: 169 171 170 172 \begin{enumerate} … … 189 191 \section{The Code} 190 192 191 %FIXME: we are using the \code function here. This should be used whereever possible 193 %FIXME: we are using the \code function here. 194 %This should be used whereever possible 192 195 For reference we include below the complete code listing for 193 196 \code{bedslope.py}. Subsequent paragraphs provide a `commentary' … … 254 257 \end{verbatim}} 255 258 256 The function \ texttt{rectangular} is imported from a module257 \ texttt{mesh\_factory} defined elsewhere. (\textbf{AnuGA} also259 The function \code{rectangular} is imported from a module 260 \code{mesh\_factory} defined elsewhere. (\textbf{AnuGA} also 258 261 contains several other schemes that can be used for setting up 259 262 meshes, but we shall not discuss these now.) The above assignment … … 269 272 \begin{itemize} 270 273 271 \item a list \ texttt{points} of length $N$, where $N = (m + 1)(n + 1)$,274 \item a list \code{points} of length $N$, where $N = (m + 1)(n + 1)$, 272 275 comprising the coordinates $(x, y)$ of each of the $N$ mesh 273 276 points, 274 277 275 \item a list \ texttt{vertices} of length $2mn$ (each entry specifies the three278 \item a list \code{vertices} of length $2mn$ (each entry specifies the three 276 279 vertices of one of the triangles used in the triangulation) , and 277 280 278 \item a dictionary \ texttt{boundary}, used to tag the triangle edges on281 \item a dictionary \code{boundary}, used to tag the triangle edges on 279 282 the boundaries. Each key corresponds to a triangle edge on one of 280 the four boundaries and its value is one of \ texttt{`left'},281 \ texttt{`right'}, \texttt{`top'} and \texttt{`bottom'}, indicating283 the four boundaries and its value is one of \code{`left'}, 284 \code{`right'}, \code{`top'} and \code{`bottom'}, indicating 282 285 which boundary the edge in question belongs to. 283 286 … … 288 291 289 292 These variables are then used to set up a data structure 290 \ texttt{domain}, through the assignment:293 \code{domain}, through the assignment: 291 294 292 295 {\small \begin{verbatim} … … 294 297 \end{verbatim}} 295 298 296 This uses a Python class \ texttt{Domain}, imported from297 \ texttt{shallow\_water}, which is an extension of a more generic298 class of the same name in the module \ texttt{domain}, and inherits299 This uses a Python class \code{Domain}, imported from 300 \code{shallow\_water}, which is an extension of a more generic 301 class of the same name in the module \code{domain}, and inherits 299 302 some methods from the generic class but has others specific to the 300 303 shallow-water scenarios in which it is used. Specific options for domain … … 309 312 310 313 The next task is to specify a number of quantities that we wish to set 311 for each mesh point. The class \ texttt{Domain} has a method312 \ texttt{set\_quantity}, used to specify these quantities. It is a314 for each mesh point. The class \code{Domain} has a method 315 \code{set\_quantity}, used to specify these quantities. It is a 313 316 particularly flexible method that allows the user to set quantities in 314 317 a variety of ways---using constants, functions, numeric arrays or 315 318 expressions involving other quantities, arbitrary data points with 316 319 associated values, all of which can be passed as arguments. All 317 quantities can be initialised using \ texttt{set\_quantity}. For318 conserved quantities (\ texttt{stage, xmomentum, ymomentum}) this is320 quantities can be initialised using \code{set\_quantity}. For 321 conserved quantities (\code{stage, xmomentum, ymomentum}) this is 319 322 called the \emph{initial condition}, for other quantities that aren't 320 323 updated by the equation, the same interface is used to assign their 321 324 values. The code in the present example demonstrates a number of forms 322 in which we can invoke \ texttt{set\_quantity}.325 in which we can invoke \code{set\_quantity}. 323 326 324 327 … … 341 344 \\ 342 345 Once the function $f$ is specified, the quantity 343 \ texttt{elevation} is assigned through the simple statement:346 \code{elevation} is assigned through the simple statement: 344 347 345 348 {\small \begin{verbatim} … … 352 355 353 356 The assignment of the friction quantity demonstrates another way 354 we can use \ texttt{set\_quantity} to set quantities---namely,357 we can use \code{set\_quantity} to set quantities---namely, 355 358 assign them to a constant numerical value: 356 359 … … 365 368 366 369 Assigning depth illustrates a more complex way to use 367 \ texttt{set\_quantity}, introducing an expression involving other370 \code{set\_quantity}, introducing an expression involving other 368 371 quantities: 369 372 … … 373 376 \end{verbatim}} 374 377 375 Here the quantity \ texttt{stage} is defined by taking the quantity378 Here the quantity \code{stage} is defined by taking the quantity 376 379 elevation already defined and adding a constant value $h = 0.05$ 377 380 to it everywhere. This expresses the fact that the water depth is … … 402 405 403 406 \begin{description} 404 \item[Reflective boundary] Returns same \ texttt{stage} as407 \item[Reflective boundary] Returns same \code{stage} as 405 408 as present in its neighbour volume but momentum vector reversed 180 degrees (reflected). 406 409 Specific to the shallow water equation as it works with the … … 437 440 is the key step that causes the configuration of the domain to 438 441 `evolve' in accordance with the model embodied in the code, over a 439 series of steps indicated by the values of \ texttt{yieldstep} and440 \ texttt{finaltime}, which can be altered as required.442 series of steps indicated by the values of \code{yieldstep} and 443 \code{finaltime}, which can be altered as required. 441 444 The yieldstep control the time interval between model output. Behind the scenes more timesteps are generally taken. 442 445 … … 449 452 %be used with swollen. Include screen shots.// 450 453 451 The output is a NetCDF file with the extension \ texttt{.sww}. It454 The output is a NetCDF file with the extension \code{.sww}. It 452 455 contains stage and momentum information and can be used with the 453 \ texttt{swollen} visualisation package to generate a visual display.456 \code{swollen} visualisation package to generate a visual display. 454 457 455 458 … … 471 474 \section{Example with real data} 472 475 473 The following discussion builds on the \code{bedslope.py} example and shows 474 how, using the same basic outline, we can incorporate many more complex features. 476 The following discussion builds on the \code{bedslope.py} example and 477 shows how, using the same basic outline, we can incorporate many more 478 complex features. 475 479 476 480 The chief difference is in the method used to create the mesh. Instead of imposing a mesh … … 478 482 mesh structures inside polygons. 479 483 480 In its simplest form, the mesh is created within a 481 single polygon whose vertices are at geographical locations specified by the user. 482 A triangular mesh is created using points inside the polygon selected 483 through a random process, the 484 user specifying the \emph{resolution}---that is, the maximal area of a triangle used for triangulation. 485 486 Figure XXX shows a simple example, in which the triangulation is carried out within a 487 pentagon. Instead of using the four tags \texttt{`left'}, \texttt{`right'}, \texttt{`bottom'} and 488 \texttt{`top'} to distinguish 489 boundary elements, the user can define tags appropriate to the configuration being modelled. 490 491 While this offers more flexibility than the rectangular grid, it doesn't provide a way to 492 adapt to geographic 493 or other features in the landscape, for which we may require to vary the resolution. We achieve 494 more flexibility by extending this method, allowing the user to specify a number of 495 interior polygons which are triangulated separately, possibly using different resolutions. 496 See Figure XXX. 484 In its simplest form, the mesh is created within a single polygon 485 whose vertices are at geographical locations specified by the user. A 486 triangular mesh is created using points inside the polygon selected 487 through a random process, the user specifying the 488 \emph{resolution}---that is, the maximal area of a triangle used for 489 triangulation. 490 491 Figure XXX shows a simple example, in which the triangulation is 492 carried out within a pentagon. Instead of using the four tags 493 \code{`left'}, \code{`right'}, \code{`bottom'} and 494 \code{`top'} to distinguish boundary elements, the user can define 495 tags appropriate to the configuration being modelled. 496 497 While this offers more flexibility than the rectangular grid, it 498 doesn't provide a way to adapt to geographic or other features in the 499 landscape, for which we may require to vary the resolution. We achieve 500 more flexibility by extending this method, allowing the user to 501 specify a number of interior polygons which are triangulated 502 separately, possibly using different resolutions. See Figure XXX. 503 504 505 \chapter{ANUGA Public Interface} 506 507 thoaedut 508 509 510 511 \begin{itemize} 512 513 \item \indexedcode{create_mesh_from_region}: Create mesh based on a bounding polygon and a number of internal polygons. Each polygon has a maximal area of triangles associated with it - the resolution. The bounding polygon also has symbolic \code{tags} associated with it. 514 Arguments are: 515 \item \indexedcode{pmesh_to_domain_instance}: Convert generated mesh file to domain object. Arguments are: Mesh file name and class specifying which domain class to instantiate. (Simpler) 516 517 518 \item \indexedcode{set_region} ``Low priority. Will be merged into set_quantity'' 519 \item \indexedcode{set_quantity} ``Pretty mature'' 520 \item \indexedcode{set_boundary} ``Pretty mature'' 521 522 523 \end{itemize} 524 525 526 Diagnostics 527 \begin{itemize} 528 \item \indexedcode{write_time} 529 \item \indexedcode{write_boundary_statistics} 530 531 532 \end{itemize} 533 534 535 \subsection{Boundary conditions} 536 537 ANUGA provides a large number of predefined boundary conditions to be used with 538 \code{set_boundary} 539 540 What do they do 541 How are they used 542 543 \begin{itemize} 544 \item \indexedcode{Reflective_boundary} 545 function, arguments 546 547 \item \indexedcode{Transmissive_boundary} 548 function, arguments, CAVEATS 549 550 \item \indexedcode{Dirichlet_boundary} 551 552 \item \indexedcode{Time_boundary} 553 554 \item \indexedcode{File_boundary} 555 556 \item \indexedcode{} 557 558 \item \indexedcode{} 559 560 561 \item \indexedcode{User defined boundary conditions.} 562 How to roll your own 563 564 565 566 \end{itemize} 567 568 569 570 \subsection{Initial conditions} 571 572 ANUGA provides a number of predefined initial conditions to be used with 573 \code{set_quantity}. 574 575 \begin{itemize} 576 577 578 \item \indexedcode{tsunami_slump} 579 function, arguments 580 581 \item \indexedcode{} 582 583 \end{itemize} 584 585 586 \subsection{Initial conditions} 587 588 ANUGA provides a number of predefined forcing functions to be used with ..... 589 590 \begin{itemize} 591 592 593 \item \indexedcode{} 594 function, arguments 595 596 \item \indexedcode{} 597 598 \end{itemize} 599 600 497 601 498 602 \appendix 603 604 \chapter{Supporting tools} 605 606 607 \section{caching} Could do now. 608 609 610 611 \section{swollen} Could do now. 612 613 614 \section{utilities/polygons} Could do now. 615 616 617 \section{coordinate_transforms} 618 619 \section{geo_spatial_data} 620 621 \section{pmesh GUI} 622 623 \section{alpha_shape} 624 625 626 627 628 499 629 \chapter{Glossary} 500 630 501 \begin{description} 502 503 \item[AnuGA] name of software (joint development between ANU and GA) 631 \begin{itemize} 632 \item \indexedbold{ANUGA} name of software (joint development between ANU and GA) 504 633 505 \item [Conserved quantity]506 507 \item [Default order]is this really needed?508 509 \item [Domain]510 511 \item [Dirichlet boundary]512 513 \item [Elevation]- refers to bathymetry and topography514 515 \item [bathymetry]offshore516 517 \item [topography]onshore518 519 \item [Evolution]integration of the shallow water wave equations over time520 521 \item [Forcing term]522 523 \item [IDLE]development environment shipped with Python524 525 \item [Manning friction coefficient]634 \item \indexedbold{Conserved quantity} 635 636 \item \indexedbold{Default order} is this really needed? 637 638 \item \indexedbold{Domain} 639 640 \item \indexedbold{Dirichlet boundary} 641 642 \item \indexedbold{Elevation} - refers to bathymetry and topography 643 644 \item \indexedbold{bathymetry} offshore 645 646 \item \indexedbold{topography} onshore 647 648 \item \indexedbold{Evolution} integration of the shallow water wave equations over time 649 650 \item \indexedbold{Forcing term} 651 652 \item \indexedbold{IDLE} development environment shipped with Python 653 654 \item \indexedbold{Manning friction coefficient} 526 655 527 \item [Mesh]triangulation of domain528 529 \item [Grid]evenly spaced530 531 \item [NetCDF]532 533 \item [pmesh]does this really need to be here? it's a class/module?534 535 \item [pyvolution]does this really need to be here? it's a class/module?536 537 \item [Quantity]conserved (state, x and y momentum)538 539 \item [Reflective boundary]540 541 \item [Smoothing]is this really needed?542 543 \item [Stage]544 545 \item [Swollen]visualisation tool546 547 \item [Time boundary]defined in the manual (flog from there)548 549 \item [Transmissive boundary]defined in the manual (flog from there)550 551 \item [xmomentum]conserved quantity (note, two-dimensional SWW equations say only x and y and NOT z)656 \item \indexedbold{Mesh} triangulation of domain 657 658 \item \indexedbold{Grid} evenly spaced 659 660 \item \indexedbold{NetCDF} 661 662 \item \indexedbold{pmesh} does this really need to be here? it's a class/module? 663 664 \item \indexedbold{pyvolution} does this really need to be here? it's a class/module? 665 666 \item \indexedbold{Quantity} conserved (state, x and y momentum) 667 668 \item \indexedbold{Reflective boundary} 669 670 \item \indexedbold{Smoothing} is this really needed? 671 672 \item \indexedbold{Stage} 673 674 \item \indexedbold{Swollen} visualisation tool 675 676 \item \indexedbold{Time boundary} defined in the manual (flog from there) 677 678 \item \indexedbold{Transmissive boundary} defined in the manual (flog from there) 679 680 \item \indexedbold{xmomentum} conserved quantity (note, two-dimensional SWW equations say only x and y and NOT z) 552 681 553 \item[ymomentum] conserved quantity 554 555 \item[resolution] refers to the maximal area of each triangular cell in the mesh 556 557 \item[easting] 558 559 \item[northing] 560 561 \item[latitude] 562 563 \item[longitude] 564 565 \item[edge] 566 567 \item[vertex] 682 \item \indexedbold{ymomentum} conserved quantity 683 684 \item \indexedbold{resolution} refers to the maximal area of each triangular cell in the mesh 685 686 \item \indexedbold{polygon} A sequence of points in the plane. (Arbitrary polygons can be created in this way ) 687 ANUGA represents polygons as either a list of 2-tuples, where the latter are either Python tuples or Python lists of length 2. The unit square, for example, would be represented by the polygon [ [0,0], [1,0], [1,1], [0,1] ]. Alternatively, polygons can be represented as $N \times 2$ Numeric arrays, where $N$ is the number of points. 688 689 NOTE: More can be read in the module utilities/polygon.py .... 690 691 \item \indexedbold{easting} 692 693 \item \indexedbold{northing} 694 695 \item \indexedbold{latitude} 696 697 \item \indexedbold{longitude} 698 699 \item \indexedbold{edge} 700 701 \item \indexedbold{vertex} 568 702 569 \item [finite volume]570 571 \item [flux]572 573 \item [Digital Elevation Model (DEM)]574 575 576 \end{ description}703 \item \indexedbold{finite volume} 704 705 \item \indexedbold{flux} 706 707 \item \indexedbold{Digital Elevation Model (DEM)} 708 709 710 \end{itemize} 577 711 578 712 The \code{\e appendix} markup need not be repeated for additional
Note: See TracChangeset
for help on using the changeset viewer.