Changeset 2277
- Timestamp:
- Jan 25, 2006, 12:20:23 PM (19 years ago)
- Location:
- documentation
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
documentation/AnuGA_user_manual.tex
r2274 r2277 1 %\newcommand{\code}[1]{{\small \tt #1}} %For use with one-line code snippets 2 1 3 \documentclass{report} 4 2 5 3 6 \title{AnuGA User Manual} … … 131 134 \verb+\\+\emph{s at the ends of lines!]} 132 135 133 \begin{verbatim}134 from pyvolution.mesh_factory import rectangular \\136 {\scriptsize \begin{verbatim} 137 from pyvolution.mesh_factory import rectangular 135 138 from pyvolution.shallow_water import Domain, Reflective_boundary, 136 139 Dirichlet_boundary, Time_boundary, Transmissive_boundary … … 139 142 points, vertices, boundary = rectangular(10,10) 140 143 141 #Create shallow water domain \\142 domain = Domain(points, vertices,boundary) \\144 #Create shallow water domain 145 domain = Domain(points, vertices,boundary) 143 146 domain.smooth = False domain.visualise = False 144 147 domain.store = True domain.filename = 'bedslope' … … 157 160 158 161 159 # Boundary conditions \\160 from math import sin, pi \\161 Br = Reflective_boundary(domain) \\162 Bt = Transmissive_boundary(domain) \\163 Bd = Dirichlet_boundary([0.2,0.,0.]) \\162 # Boundary conditions 163 from math import sin, pi 164 Br = Reflective_boundary(domain) 165 Bt = Transmissive_boundary(domain) 166 Bd = Dirichlet_boundary([0.2,0.,0.]) 164 167 165 168 Bw = Time_boundary(domain=domain, … … 167 170 168 171 169 domain.set_boundary({'left': Bd, 'right': Br, 'top': Br, 'bottom': 170 Br}) \\ 171 #domain.set_boundary({'left': Bw, 'right': Br, 'top': Br, 172 'bottom': Br}) 173 174 175 ###################### \\ 172 domain.set_boundary({'left': Bd, 'right': Br, 'top': Br, 'bottom': Br}) 173 174 175 ###################### 176 176 #Evolution 177 177 … … 182 182 183 183 184 \end{verbatim} 184 \end{verbatim}} 185 185 186 186 … … 190 190 scenario. This is carried out through the statement: 191 191 192 \begin{verbatim}192 {\small \begin{verbatim} 193 193 points, vertices, boundary = rectangular(10, 10) . 194 \end{verbatim} 194 \end{verbatim}} 195 195 196 196 The function \texttt{rectangular} is imported from a module … … 201 201 specific way. In general, the assignment 202 202 203 \begin{verbatim}203 {\small \begin{verbatim} 204 204 points, vertices, boundary = rectangular(m, n) 205 \end{verbatim} 205 \end{verbatim}} 206 206 207 207 returns: … … 230 230 \texttt{domain}, through the assignment: 231 231 232 \begin{verbatim}232 {\small \begin{verbatim} 233 233 domain = Domain(points, vertices, boundary) 234 \end{verbatim} 234 \end{verbatim}} 235 235 236 236 This uses a Python class \texttt{Domain}, imported from … … 242 242 of what these do]} 243 243 244 \begin{verbatim}244 {\scriptsize \begin{verbatim} 245 245 domain.smooth = False 246 246 domain.visualise = False … … 248 248 domain.filename = 'bedslope' 249 249 domain.default_order = 2 250 \end{verbatim} 250 \end{verbatim}} 251 251 252 252 … … 271 271 purposes: 272 272 273 \begin{verbatim}273 {\small \begin{verbatim} 274 274 \# Initial conditions 275 275 def f(x,y): 276 276 return -x/2 277 \end{verbatim} 277 \end{verbatim}} 278 278 279 279 This simply associates an elevation with each point $(x, y)$ of … … 285 285 \texttt{elevation} is assigned through the simple statement: 286 286 287 {\small \begin{verbatim} 287 288 \begin{verbatim} 288 289 domain.set_quantity('elevation', f) 289 \end{verbatim} 290 \end{verbatim}} 290 291 291 292 … … 296 297 assign them to a constant numerical value: 297 298 298 \begin{verbatim}299 {\small \begin{verbatim} 299 300 domain.set_quantity('friction', 0.1) 300 \end{verbatim} 301 \end{verbatim}} 301 302 302 303 This just specifies that the Manning friction coefficient is set … … 309 310 quantities: 310 311 311 \begin{verbatim}312 {\small \begin{verbatim} 312 313 h = 0.05 \# Constant depth 313 314 domain.set_quantity('stage', expression = 'elevation + %f' %h) 314 \end{verbatim} 315 \end{verbatim}} 315 316 316 317 Here the quantity \texttt{stage} is defined by taking the quantity … … 324 325 The boundary conditions are specified as follows: 325 326 326 \begin{verbatim}327 {\small \begin{verbatim} 327 328 Br = Reflective_boundary(domain) 328 329 … … 333 334 Bw = Time_boundary(domain=domain, 334 335 f=lambda t: [(0.1*sin(t*2*pi)), 0.0, 0.0]) 335 \end{verbatim} 336 \end{verbatim}} 336 337 337 338 The effect of these statements is to set up four alternative … … 359 360 form 360 361 361 \begin{verbatim} 362 domain.set_boundary({'left': Bd, 'right': Br, 'top': Br, 'bottom': 363 Br}) 364 \end{verbatim} 362 {\small \begin{verbatim} 363 domain.set_boundary({'left': Bd, 'right': Br, 'top': Br, 'bottom': Br}) 364 \end{verbatim}} 365 365 366 366 This statement stipulates that, in the current example, the left … … 372 372 373 373 The final statement \nopagebreak[3] 374 \begin{verbatim}374 {\small \begin{verbatim} 375 375 for t in domain.evolve(yieldstep = 0.1, finaltime = 4.0): 376 376 domain.write_time() 377 \end{verbatim} 377 \end{verbatim}} 378 378 379 379 is the key step that causes the configuration of the domain to
Note: See TracChangeset
for help on using the changeset viewer.