Changeset 2542 for documentation
- Timestamp:
- Mar 13, 2006, 10:43:13 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
documentation/user_manual/anuga_user_manual.tex
r2536 r2542 171 171 The present example represents a simple scenario and does not 172 172 include any forcing terms, nor is the data taken from a file as it 173 would be in many typical cases. 173 would be in many typical cases. 174 174 175 175 The conserved quantities involved in the 176 176 problem are water depth, $x$-momentum and $y$-momentum. Other quantities 177 involved in the computation are the friction, stage (absolute height of water surface) 177 involved in the computation are the friction, stage (absolute height of water surface) 178 178 and elevation, the last two being related to 179 179 the depth through the equation 180 180 181 181 {\small \begin{verbatim} 182 \code{stage} = \code{elevation} + \code{depth} 182 stage = elevation + depth 183 183 \end{verbatim}} 184 184 … … 335 335 336 336 The stage (the height of the water surface) is related to the 337 elevation and the depth at any time by the equation \[\code{stage} = 338 \code{elevation} + \code{depth}\] 337 elevation and the depth at any time by the equation {\small 338 \begin{verbatim} 339 stage = elevation + depth 340 \end{verbatim}} 339 341 340 342 For this example, we simply assign a constant value to \code{stage}, … … 345 347 \end{verbatim}} 346 348 347 which specifies that the surface level is set to a height of $-0.4$, i.e. 0.4 units 349 which specifies that the surface level is set to a height of $-0.4$, i.e. 0.4 units 348 350 below the zero level. 349 351 … … 353 355 involving other quantities. Suppose, instead of setting a constant value 354 356 for the stage, we wished 355 to specify a constant value for the \emph{depth}. For such a case we 357 to specify a constant value for the \emph{depth}. For such a case we 356 358 need to specify that \code{stage} is 357 359 everywhere obtained by adding that value to the value already … … 363 365 \end{verbatim}} 364 366 365 That is, the value of \code{stage} is set to $\code{h} = 0.05$ plus the 367 That is, the value of \code{stage} is set to $\code{h} = 0.05$ plus the 366 368 value of \code{elevation} already defined. 367 369 368 The reader will probably appreciate that this capability to incorporate 370 The reader will probably appreciate that this capability to incorporate 369 371 expressions into statements using \code{set\_quantity} greatly expands 370 372 its power.) … … 403 405 404 406 \item[Dirichlet boundary]Specifies a fixed value at the 405 boundary and assigns initial values to the $x$-momentum and $y$-momentum. 407 boundary and assigns initial values to the $x$-momentum and $y$-momentum. 406 408 407 409 \item[Time boundary.]A Dirichlet boundary whose behaviour varies with time. … … 421 423 422 424 The reader may wish to experiment by varying the choice of boundary types 423 for one or more of the boundaries. In the case of \code{Bd} and \code{Bw}, 424 the three arguments in each case represent the 425 for one or more of the boundaries. In the case of \code{Bd} and \code{Bw}, 426 the three arguments in each case represent the 425 427 426 428 {\small \begin{verbatim} … … 476 478 477 479 478 \begin{figure}[hbt] 479 480 \centerline{ \includegraphics[width=75mm, height=75mm]{examples/bedslope _start.eps}}481 480 \begin{figure}[hbt] 481 482 \centerline{ \includegraphics[width=75mm, height=75mm]{examples/bedslopestart.eps}} 483 482 484 \caption{Bedslope example viewed with Swollen} 483 485 \label{fig:bedslopestart} 484 \end{figure} 485 486 487 \begin{figure}[hbt] 488 489 \centerline{ 490 \includegraphics[width=75mm, height=75mm]{examples/bedslope _during.eps}491 \includegraphics[width=75mm, height=75mm]{examples/bedslope _end.eps}492 } 493 486 \end{figure} 487 488 489 \begin{figure}[hbt] 490 491 \centerline{ 492 \includegraphics[width=75mm, height=75mm]{examples/bedslopeduring.eps} 493 \includegraphics[width=75mm, height=75mm]{examples/bedslopeend.eps} 494 } 495 494 496 \caption{Bedslope example viewed with Swollen} 495 497 \label{fig:bedslope2} 496 \end{figure} 498 \end{figure} 497 499 498 500 … … 511 513 scenario, rather than the artificial illustrative one used in 512 514 \code{bedslopephysical.py}. The domain of interest surrounds the Sydney region, 513 and predominantly covers Sydney Harbour. A hypothetical tsunami wave is 515 and predominantly covers Sydney Harbour. A hypothetical tsunami wave is 514 516 generated by a submarine mass failure situated on the edge of the 515 517 continental shelf. … … 567 569 area of a triangle used for triangulation---and mesh points are 568 570 created inside the polygon through a random process. Figure 569 \ref{fig:pentagon} shows a simple example of this, in which 571 \ref{fig:pentagon} shows a simple example of this, in which 570 572 the triangulation is carried out within a pentagon. 571 573 572 574 573 \begin{figure}[hbt] 574 575 576 575 \begin{figure}[hbt] 576 577 578 577 579 \caption{Mesh points are created inside the polygon} 578 \label{fig:pentagon} 579 \end{figure} 580 \label{fig:pentagon} 581 \end{figure} 580 582 581 583 Boundary tags are not restricted to \code{`left'}, \code{`right'}, … … 594 596 resolution. See Figure \ref{fig:interior meshes}. 595 597 596 \begin{figure}[hbt] 597 598 599 598 \begin{figure}[hbt] 599 600 601 600 602 \caption{Interior meshes with individual resolution} 601 \label{fig:interior meshes} 602 \end{figure} 603 \label{fig:interior meshes} 604 \end{figure} 603 605 604 606 In its general form, \code{pmesh} takes for its input a bounding … … 631 633 \code{meshname}. 632 634 633 The statements 635 The statements 634 636 635 637 {\small \begin{verbatim} … … 641 643 are used to read in the specific polygons \code{project.harbour\_polygon\_2} and 642 644 \code{botanybay\_polygon\_2} from \code{project.py} and assign a 643 common resolution of 5000 to each. The statement 645 common resolution of 5000 to each. The statement 644 646 645 647 {\small \begin{verbatim} 646 648 create_mesh_from_regions(project.diffpolygonall,% 647 boundary_tags= {'bottom': [0],% 649 boundary_tags= {'bottom': [0],% 648 650 'right1': [1],% 649 651 'right0': [2],% … … 654 656 'left3': [7]},% 655 657 maximum_triangle_area=100000,% 656 filename=meshname,% 658 filename=meshname,% 657 659 interior_regions=interior_regions) 658 660 \end{verbatim}} 659 661 660 662 is then used to create the mesh, taking the bounding polygon to be the polygon 661 \code{diffpolygonall} specified in \code{project.py}. The 662 argument \code{boundary\_tags} assigns a dictionary, whose keys are the 663 names of the boundary tags used for the bounding polygon---\code{`bottom'}, 664 `right0', `right1', `right2', `top', `left1', `left2' and `left3'--- 663 \code{diffpolygonall} specified in \code{project.py}. The 664 argument \code{boundary\_tags} assigns a dictionary, whose keys are the 665 names of the boundary tags used for the bounding polygon---\code{`bottom'}, 666 `right0', `right1', `right2', `top', `left1', `left2' and `left3'--- 665 667 and whose values identify the indices of the segments associated with each of these 666 668 tags. (The value associated with each boundary tag is a one-element list.) … … 695 697 taken from \code{project.py}. 696 698 697 {\small \begin{verbatim} 699 {\small \begin{verbatim} 698 700 domain.set_name(project.basename)% 699 701 domain.set_datadir(project.outputdir)% … … 718 720 \code{slump\_tsunami}. This is similar to how we set elevation in 719 721 \code{bedslopephysical.py} using a function---however, in this case the 720 function is both more complex and more interesting. 721 722 The function returns the water displacement for all \code{x} 723 and \code{y} in the domain. The water displacement is a ?? function that depends 722 function is both more complex and more interesting. 723 724 The function returns the water displacement for all \code{x} 725 and \code{y} in the domain. The water displacement is a ?? function that depends 724 726 on the characteristics of the slump (length, thickness, slope, etc), its 725 location (origin) and the depth at that location. 727 location (origin) and the depth at that location. 726 728 727 729 … … 739 741 The elevation is specified by reading data from a file: 740 742 741 {\small \begin{verbatim} %742 domain.set_quantity('elevation', %743 filename = project.combineddemname + '.pts', %744 use_cache = True, %745 verbose = True) %743 {\small \begin{verbatim} 744 domain.set_quantity('elevation', 745 filename = project.combineddemname + '.pts', 746 use_cache = True, 747 verbose = True) 746 748 \end{verbatim}} 747 749 … … 770 772 \subsection{Boundary Conditions} 771 773 772 Setting boundaries follows a similar pattern to the one used for 773 \code{bedslopephysical.py}, except that in this case we need to associate a 774 Setting boundaries follows a similar pattern to the one used for 775 \code{bedslopephysical.py}, except that in this case we need to associate a 774 776 boundary type with each of the 775 boundary tag names introduced when we established the mesh. In place of the four 776 boundary types introduced for \code{bedslopephysical.py}, we use the reflective 777 boundary tag names introduced when we established the mesh. In place of the four 778 boundary types introduced for \code{bedslopephysical.py}, we use the reflective 777 779 boundary for each of the 778 780 eight tagged segments: … … 792 794 {\small \begin{verbatim} 793 795 import time t0 = time.time() 794 796 795 797 for t in domain.evolve(yieldstep = 120, duration = 18000): 796 798 print domain.timestepping_statistics() 797 799 print domain.boundary_statistics(tags = 'bottom') 798 800 799 801 print 'That took %.2f seconds' %(time.time() 800 802 \end{verbatim}} … … 917 919 \section{Setting Quantities} 918 920 919 \begin{funcdesc}{set\_quantity}{name, numeric = None, quantity = None, function = None, 920 geospatial_data = None, filename = None, attribute_name = None, 921 \begin{funcdesc}{set\_quantity}{name, numeric = None, quantity = None, function = None, 922 geospatial_data = None, filename = None, attribute_name = None, 921 923 alpha = None, location = 'vertices', indices = None, verbose = False, 922 924 use_cache = False} … … 927 929 Compatible list, Numeric array (see below) or constant. If callable 928 930 it will treated as a function (see below) If instance of another 929 Quantity it will be treated as such. If geo _spatial object it will931 Quantity it will be treated as such. If geo\_spatial object it will 930 932 be treated as such 931 933 … … 1201 1203 1202 1204 \end{funcdesc} 1203 1204 1205 1206 1205 1207 \begin{funcdesc}{statistics}{???} 1206 1208 1207 1209 print domain.statistics() will provide basic structural statistics about e.g.\ mesh in the form of an area histogram 1208 \end{funcdesc} 1209 1210 1210 \end{funcdesc} 1211 1212 1211 1213 \begin{funcdesc}{get_quantity}{???} 1212 Module: \code{pyvolution.domain} 1214 Module: \code{pyvolution.domain} 1213 1215 Allow access to individual quantities and their methods 1214 1215 \end{funcdesc} 1216 1217 1216 1217 \end{funcdesc} 1218 1219 1218 1220 \begin{funcdesc}{get_values}{???} 1219 Module: \code{pyvolution.quantity} 1220 1221 Module: \code{pyvolution.quantity} 1222 1221 1223 Extract values for quantity as an array 1222 1223 \end{funcdesc} 1224 1225 1224 1225 \end{funcdesc} 1226 1227 1226 1228 \begin{funcdesc}{get_integral}{???} 1227 Module: \code{pyvolution.quantity} 1228 1229 Module: \code{pyvolution.quantity} 1230 1229 1231 Return computed integral over entire domain for this quantity 1230 1231 \end{funcdesc} 1232 1233 1234 \section{Other} 1235 1236 \begin{funcdesc}{domain.create_quantity_from_expression}{???} 1237 1238 Handy for creating derived quantities on-the-fly. 1232 1233 \end{funcdesc} 1234 1235 1236 \section{Other} 1237 1238 \begin{funcdesc}{domain.create_quantity_from_expression}{???} 1239 1240 Handy for creating derived quantities on-the-fly. 1239 1241 See \code{Analytical\_solution\_circular\_hydraulic\_jump.py} for an example of use. 1240 \end{funcdesc} 1242 \end{funcdesc} 1241 1243 1242 1244 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% … … 1333 1335 1334 1336 \begin{funcdesc}{sww2dem}{???} 1335 Module: \code{pyvolution.data\_manager} 1336 1337 1338 \end{funcdesc} 1339 1340 1337 Module: \code{pyvolution.data\_manager} 1338 1339 1340 \end{funcdesc} 1341 1342 1341 1343 \begin{funcdesc}{dem2pts}{???} 1342 Module: \code{pyvolution.data_manager} 1343 1344 1345 \end{funcdesc} 1344 Module: \code{pyvolution.data_manager} 1345 1346 1347 \end{funcdesc} 1346 1348 1347 1349 %\[ … … 1578 1580 \section{geo_spatial_data} 1579 1581 1580 This describes a class that represents arbitrary point data in UTM 1582 This describes a class that represents arbitrary point data in UTM 1581 1583 coordinates along with named attribute values. 1582 1584
Note: See TracChangeset
for help on using the changeset viewer.