Changeset 3923


Ignore:
Timestamp:
Nov 7, 2006, 9:07:09 AM (16 years ago)
Author:
sexton
Message:
 
Location:
anuga_core/documentation/user_manual
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/documentation/user_manual/anuga_user_manual.tex

    r3921 r3923  
    858858\label{sec:realdataexample} The following discussion builds on the
    859859concepts introduced through the \file{runup.py} example and
    860 introduces a second example, \file{run\_sydney.py}.  This refers to
     860introduces a second example, \file{runcairns.py}.  This refers to
    861861a real-life scenario, in which the domain of interest surrounds the
    862 Sydney region, and predominantly covers Sydney Harbour. A
     862Cairns region. A
    863863hypothetical tsunami wave is generated by a submarine mass failure
    864864situated on the edge of the continental shelf.
     
    891891\subsection{The Code}
    892892
    893 Here is the code for \file{run\_sydney\_smf.py}:
    894 
    895 \verbatiminput{examples/runsydney.py}
     893Here is the code for \file{runcairns.py}:
     894
     895\verbatiminput{../../demos/runcarins.py}
    896896
    897897In discussing the details of this example, we follow the outline
     
    923923\end{figure}
    924924
    925 Boundary tags are not restricted to \code{`left'}, \code{`right'},
    926 \code{`bottom'} and \code{`top'}, as in the case of
     925Boundary tags are not restricted to \code{`left'}, \code{`bottom'},
     926\code{`right'} and \code{`top'}, as in the case of
    927927\file{runup.py}. Instead the user specifies a list of
    928928tags appropriate to the configuration being modelled.
     
    960960\file{project.py}:
    961961
    962 \verbatiminput{examples/project.py}
     962\verbatiminput{../../demos/project.py}
    963963
    964964The resulting mesh is output to a \emph{mesh file}\index{mesh
     
    974974
    975975{\small \begin{verbatim}
    976     interior_res = 5000
    977     interior_regions = [[project.northern_polygon, interior_res],
    978                         [project.harbour_polygon, interior_res],
    979                         [project.southern_polygon, interior_res],
    980                         [project.manly_polygon, interior_res],
    981                         [project.top_polygon, interior_res]]
     976    islands_res = 100000
     977    cairns_res = 100000
     978    shallow_res = 500000
     979    interior_regions = [[project.poly_cairns, cairns_res],
     980                        [project.poly_island0, islands_res],
     981                        [project.poly_island1, islands_res],
     982                        [project.poly_island2, islands_res],
     983                        [project.poly_island3, islands_res],
     984                        [project.poly_shallow, shallow_res]]
    982985\end{verbatim}}
    983986
    984 are used to read in the specific polygons \code{project.harbour\_polygon\_2} and
    985 \code{botanybay\_polygon\_2} from \file{project.py} and assign a
    986 common resolution of to each. The statement
     987are used to read in the specific polygons \code{project.cairns},
     988\code{project.poly_island0},
     989\code{project.poly_island1},
     990\code{project.poly_island2},
     991\code{project.poly_island3} and
     992\code{project.poly_shallow} from \file{project.py} and assign a
     993defined resolution to each. Figure \ref{fig:cairnspolys}
     994illustrates the polygons used for the Cairns scenario.
     995
     996\begin{figure}[hbt]
     997
     998  \centerline{\includegraphics[width=75mm, height=75mm]
     999      {../../demos/cairns_model.jpg}}
     1000  \caption{Interior and bounding polygons for the \code{runcairns.py} example.}
     1001  \label{fig:cairnspolys}
     1002\end{figure}
     1003
     1004The statement
    9871005
    9881006{\small \begin{verbatim}
    989 create_mesh_from_regions(project.demopoly,
    990                          boundary_tags= {'oceannorth': [0],
    991                                          'onshorenorth1': [1],
    992                                          'onshorenorthwest1': [2],
    993                                          'onshorenorthwest2': [3],
    994                                          'onshorenorth2': [4],
    995                                          'onshorewest': [5],
    996                                          'onshoresouth': [6],
    997                                          'oceansouth': [7],
    998                                          'oceaneast': [8]},
    999                          maximum_triangle_area=100000,
    1000                          filename=meshname,           
    1001                          interior_regions=interior_regions)   
     1007remainder_res = 10000000 
     1008_ = cache(create_mesh_from_regions,
     1009          project.polyAll,
     1010           {'boundary_tags': {'top': [0], 'ocean_east': [1],
     1011                              'bottom': [2], 'onshore': [3]},
     1012           'maximum_triangle_area': remainder_res,
     1013           'filename': meshname,
     1014           'interior_regions': interior_regions},
     1015          verbose = True, evaluate=False)
    10021016\end{verbatim}}
    10031017
    10041018is then used to create the mesh, taking the bounding polygon to be
    1005 the polygon \code{diffpolygonall} specified in \file{project.py}.
     1019the polygon \code{demopoly} specified in \file{project.py}.
    10061020The argument \code{boundary\_tags} assigns a dictionary, whose keys
    10071021are the names of the boundary tags used for the bounding
    1008 polygon---\code{`bottom'}, \code{`right0'}, \code{`right1'},
    1009 \code{`right2'}, \code{`top'}, \code{`left1'}, \code{`left2'} and
    1010 \code{`left3'}--- and whose values identify the indices of the
     1022polygon---\code{`top'}, \code{`ocean\_east'}, \code{`bottom'}, and
     1023\code{lonshore'}--- and whose values identify the indices of the
    10111024segments associated with each of these tags. (The value associated
    10121025with each boundary tag is a one-element list.)
     
    10531066
    10541067\subsection{Initial Conditions}
    1055 Quantities for \file{runsydney.py} are set
     1068Quantities for \file{runcairns.py} are set
    10561069using similar methods to those in \file{runup.py}. However,
    10571070in this case, many of the values are read from the auxiliary file
     
    10911104{\small \begin{verbatim}
    10921105    domain.set_quantity('elevation',
    1093                         filename = project.combineddemname + '.pts',
     1106                        filename = project.dem_name + '.pts',
    10941107                        use_cache = True,
    10951108                        verbose = True)
    10961109\end{verbatim}}
    10971110
    1098 However, before this step can be executed, some preliminary steps
    1099 are needed to prepare the file from which the data is taken. Two
    1100 source files are used for this data---their names are specified in
    1101 the file \file{project.py}, in the variables \code{coarsedemname}
    1102 and \code{finedemname}. They contain `coarse' and `fine' data,
    1103 respectively---that is, data sampled at widely spaced points over a
    1104 large region and data sampled at closely spaced points over a
    1105 smaller subregion. The data in these files is combined through the
    1106 statement
    1107 
    1108 {\small \begin{verbatim}
    1109 combine_rectangular_points_files(project.finedemname + '.pts',
    1110                                  project.coarsedemname + '.pts',
    1111                                  project.combineddemname + '.pts')
    1112 \end{verbatim}}
    1113 
    1114 The effect of this is simply to combine the datasets by eliminating
    1115 any coarse data associated with points inside the smaller region
    1116 common to both datasets. The name to be assigned to the resulting
    1117 dataset is also derived from the name stored in the variable
    1118 \code{combinedname} in the file \file{project.py}.
     1111%However, before this step can be executed, some preliminary steps
     1112%are needed to prepare the file from which the data is taken. Two
     1113%source files are used for this data---their names are specified in
     1114%the file \file{project.py}, in the variables \code{coarsedemname}
     1115%and \code{finedemname}. They contain `coarse' and `fine' data,
     1116%respectively---that is, data sampled at widely spaced points over a
     1117%large region and data sampled at closely spaced points over a
     1118%smaller subregion. The data in these files is combined through the
     1119%statement
     1120
     1121%{\small \begin{verbatim}
     1122%combine_rectangular_points_files(project.finedemname + '.pts',
     1123%                                 project.coarsedemname + '.pts',
     1124%                                 project.combineddemname + '.pts')
     1125%\end{verbatim}}
     1126%The effect of this is simply to combine the datasets by eliminating
     1127%any coarse data associated with points inside the smaller region
     1128%common to both datasets. The name to be assigned to the resulting
     1129%dataset is also derived from the name stored in the variable
     1130%\code{combinedname} in the file \file{project.py}.
    11191131
    11201132\subsection{Boundary Conditions}\index{boundary conditions}
     
    11301142{\small \begin{verbatim}
    11311143Bd = Dirichlet_boundary([0.0,0.0,0.0])
    1132 domain.set_boundary( {'oceannorth': Bd,
    1133                       'onshorenorth1': Bd,
    1134                       'onshorenorthwest1': Bd,
    1135                       'onshorenorthwest2': Bd,
    1136                       'onshorenorth2': Bd,
    1137                       'onshorewest': Bd,
    1138                       'onshoresouth': Bd,
    1139                       'oceansouth': Bd,
    1140                       'oceaneast': Bd} )
     1144domain.set_boundary( {'ocean_east': Bd, 'bottom': Bd, 'onshore': Bd,
     1145                          'top': Bd} )
    11411146\end{verbatim}}
    11421147
     
    11451150With the basics established, the running of the `evolve' step is
    11461151very similar to the corresponding step in \file{runup.py}. Here,
    1147 the simulation is run for five hours (18000 seconds) with
     1152the simulation is run for five hours (10000 seconds) with
    11481153the output stored every two minutes (120 seconds).
    11491154
     
    11511156    import time t0 = time.time()
    11521157
    1153     for t in domain.evolve(yieldstep = 120, duration = 18000):
     1158    for t in domain.evolve(yieldstep = 120, duration = 10000):
    11541159        print domain.timestepping_statistics()
    11551160        print domain.boundary_statistics(tags = 'bottom')
  • anuga_core/documentation/user_manual/update_anuga_user_manual.py

    r3921 r3923  
    5454    # Compile with LaTeX, makeindex etc
    5555    for i in range(3):
    56         system('latex --interaction=nonstopmode %s.tex' %texfile)
    57         system('makeindex %s.idx' %texfile)
    58         system('makeindex mod%s.idx' %texfile)
    59         system('bibtex %s' %texfile)   
     56        #os.system('latex --interaction=nonstopmode %s.tex' %texfile)
     57        os.system('pdflatex --interaction=nonstopmode %s.tex' %texfile)
     58        os.system('makeindex %s.idx' %texfile)
     59        os.system('makeindex mod%s.idx' %texfile)
     60        os.system('bibtex %s' %texfile)   
    6061
    6162    # Create pdf file
    62     system('dvips %s -o %s.ps' %((texfile,)*2))   
    63     system('ps2pdf %s.ps' %texfile)   
     63    #os.system('dvips %s -o %s.ps' %((texfile,)*2))   
     64    #os.system('ps2pdf %s.ps' %texfile)   
    6465     
    6566    # Create html pages
Note: See TracChangeset for help on using the changeset viewer.