Changeset 3923 for anuga_core/documentation
- Timestamp:
- Nov 7, 2006, 9:07:09 AM (18 years ago)
- Location:
- anuga_core/documentation/user_manual
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/documentation/user_manual/anuga_user_manual.tex
r3921 r3923 858 858 \label{sec:realdataexample} The following discussion builds on the 859 859 concepts introduced through the \file{runup.py} example and 860 introduces a second example, \file{run \_sydney.py}. This refers to860 introduces a second example, \file{runcairns.py}. This refers to 861 861 a real-life scenario, in which the domain of interest surrounds the 862 Sydney region, and predominantly covers Sydney Harbour. A862 Cairns region. A 863 863 hypothetical tsunami wave is generated by a submarine mass failure 864 864 situated on the edge of the continental shelf. … … 891 891 \subsection{The Code} 892 892 893 Here is the code for \file{run \_sydney\_smf.py}:894 895 \verbatiminput{ examples/runsydney.py}893 Here is the code for \file{runcairns.py}: 894 895 \verbatiminput{../../demos/runcarins.py} 896 896 897 897 In discussing the details of this example, we follow the outline … … 923 923 \end{figure} 924 924 925 Boundary tags are not restricted to \code{`left'}, \code{` right'},926 \code{` bottom'} and \code{`top'}, as in the case of925 Boundary tags are not restricted to \code{`left'}, \code{`bottom'}, 926 \code{`right'} and \code{`top'}, as in the case of 927 927 \file{runup.py}. Instead the user specifies a list of 928 928 tags appropriate to the configuration being modelled. … … 960 960 \file{project.py}: 961 961 962 \verbatiminput{ examples/project.py}962 \verbatiminput{../../demos/project.py} 963 963 964 964 The resulting mesh is output to a \emph{mesh file}\index{mesh … … 974 974 975 975 {\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]] 982 985 \end{verbatim}} 983 986 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 987 are 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 993 defined resolution to each. Figure \ref{fig:cairnspolys} 994 illustrates 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 1004 The statement 987 1005 988 1006 {\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) 1007 remainder_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) 1002 1016 \end{verbatim}} 1003 1017 1004 1018 is then used to create the mesh, taking the bounding polygon to be 1005 the polygon \code{d iffpolygonall} specified in \file{project.py}.1019 the polygon \code{demopoly} specified in \file{project.py}. 1006 1020 The argument \code{boundary\_tags} assigns a dictionary, whose keys 1007 1021 are 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 1022 polygon---\code{`top'}, \code{`ocean\_east'}, \code{`bottom'}, and 1023 \code{lonshore'}--- and whose values identify the indices of the 1011 1024 segments associated with each of these tags. (The value associated 1012 1025 with each boundary tag is a one-element list.) … … 1053 1066 1054 1067 \subsection{Initial Conditions} 1055 Quantities for \file{run sydney.py} are set1068 Quantities for \file{runcairns.py} are set 1056 1069 using similar methods to those in \file{runup.py}. However, 1057 1070 in this case, many of the values are read from the auxiliary file … … 1091 1104 {\small \begin{verbatim} 1092 1105 domain.set_quantity('elevation', 1093 filename = project. combineddemname + '.pts',1106 filename = project.dem_name + '.pts', 1094 1107 use_cache = True, 1095 1108 verbose = True) 1096 1109 \end{verbatim}} 1097 1110 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}. 1119 1131 1120 1132 \subsection{Boundary Conditions}\index{boundary conditions} … … 1130 1142 {\small \begin{verbatim} 1131 1143 Bd = 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} ) 1144 domain.set_boundary( {'ocean_east': Bd, 'bottom': Bd, 'onshore': Bd, 1145 'top': Bd} ) 1141 1146 \end{verbatim}} 1142 1147 … … 1145 1150 With the basics established, the running of the `evolve' step is 1146 1151 very similar to the corresponding step in \file{runup.py}. Here, 1147 the simulation is run for five hours (1 8000 seconds) with1152 the simulation is run for five hours (10000 seconds) with 1148 1153 the output stored every two minutes (120 seconds). 1149 1154 … … 1151 1156 import time t0 = time.time() 1152 1157 1153 for t in domain.evolve(yieldstep = 120, duration = 1 8000):1158 for t in domain.evolve(yieldstep = 120, duration = 10000): 1154 1159 print domain.timestepping_statistics() 1155 1160 print domain.boundary_statistics(tags = 'bottom') -
anuga_core/documentation/user_manual/update_anuga_user_manual.py
r3921 r3923 54 54 # Compile with LaTeX, makeindex etc 55 55 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) 60 61 61 62 # 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) 64 65 65 66 # Create html pages
Note: See TracChangeset
for help on using the changeset viewer.