Changeset 4123


Ignore:
Timestamp:
Dec 28, 2006, 1:44:48 PM (17 years ago)
Author:
ole
Message:

Work on Linuxconf paper

Files:
3 edited

Legend:

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

    r4101 r4123  
    106106governing equation using a finite-volume method.
    107107
    108 \anuga also incorporates a mesh generator, called \code{pmesh}, that
     108\anuga also incorporates a mesh generator %, called \code{pmesh},
     109that
    109110allows the user to set up the geometry of the problem interactively as
    110111well as tools for interpolation and surface fitting, and a number of
     
    180181terrains in the model are represented by predefined forcing terms.
    181182
    182 A mesh generator, called pmesh, allows the user to set up the geometry
     183The built-in mesh generator %, called pmesh,
     184allows the user to set up the geometry
    183185of the problem interactively and to identify boundary segments and
    184186regions using symbolic tags.  These tags may then be used to set the
    185187actual boundary conditions and attributes for different regions
    186 (e.g. the Manning friction coefficient) for each simulation.
     188(e.g.\ the Manning friction coefficient) for each simulation.
    187189
    188190Most \anuga components are written in the object-oriented programming
  • anuga_work/publications/linuxconf_2006/database1.bib

    r4121 r4123  
    7272  pages =        {839--855},
    7373}
     74
     75
     76@ARTICLE{Nielsen2006,
     77  author = {Ole Nielsen, Jane Sexton, Duncan Gray and Nick Bartzis},
     78  year = 2006,
     79  title = {Modelling answers tsunami questions},
     80  journal = {AusGeo News},
     81  month = {September},
     82  year = {2006},
     83  number = 83,
     84  note = {\url{http://www.ga.gov.au/ausgeonews/ausgeonews200609/modelling.jsp}
     85  }
     86
     87
    7488@ARTICLE{Rob99l,
    7589  author = {C. Zoppou and S. Roberts},
  • anuga_work/publications/linuxconf_2006/paper_ole_nielsen.tex

    r4121 r4123  
    3232\and
    3333S.~G.~Roberts\thanks{Dept. of Maths, Australian National University,
    34 Canberra, \textsc{Australia}. \protect\url{mailto:stephen.roberts}}}
     34Canberra, \textsc{Australia}. \protect\url{mailto:stephen.roberts@anu.edu.au}}}
    3535
    3636\date{30 December 2006}
     
    7373for solving the conservative form of the Shallow Water Wave equation.
    7474In this paper we describe the model, the architecture and some applications.
    75 ANUGA has recently been released as Open Source available at
    76 \url{http://sourceforge.net/projects/anuga}. This strategy will enable
    77 free access to the software and allow the risk research community to
     75ANUGA has recently been released as Open Source. This strategy will enable
     76free access to the software and allow the scientific community to
    7877use, validate and contribute to the software in the future.
    7978
     
    108107\label{sec:intro}
    109108
    110 %Floods are the single greatest cause of death due to natural hazards
    111 %in Australia, causing almost 40{\%} of the fatalities recorded
    112 %between 1788 and 2003~\cite{Blong-2005}. Analysis of buildings
    113 %damaged between 1900 and 2003 suggests that 93.6{\%} of damage is
    114 %the result of meteorological hazards, of which almost 25{\%} is
    115 %directly attributable to flooding~\cite{Blong-2005}.
    116 
    117 Flooding of coastal communities may result from surges of near-shore
    118 waters caused by severe storms. The extent of inundation is
    119 critically linked to tidal conditions, bathymetry and topography; as
    120 recently exemplified in the United States by Hurricane Katrina.
    121 While the scale of the impact from such events is not common, the
     109The Indian Ocean tsunami on 26 December 2004 demonstrated the
     110potentially catastrophic consequences of natural hazards.  While the
     111scale of the impact from such events is not common, smaller-scale
     112tsunami regularly threaten coastal communities
     113around the world. Earthquakes which occur in the Java Trench near
     114Indonesia (e.g.~\cite{TsuMIS1995} or \cite{Baldwin-2006}) and along
     115the Puysegur Ridge to the south of New Zealand (e.g.~\cite{LebKC1998})
     116have potential to generate tsunami that may threaten Australia's
     117northwestern and southeastern coastlines. In addition, the
    122118preferential development of Australian coastal corridors means that
    123 storm-surge inundation of even a few hundred metres beyond the
    124 shoreline has increased potential to cause significant disruption
    125 and loss.
    126 
    127 Coastal communities also face the small but real risk of tsunami.
    128 Fortunately, catastrophic tsunami of the scale of the 26 December
    129 2004 event are exceedingly rare. However, smaller-scale tsunami are
    130 more common and regularly threaten coastal communities around the
    131 world. Earthquakes which occur in the Java Trench near Indonesia
    132 (e.g.~\cite{TsuMIS1995} or \cite{Baldwin-2006})
    133 and along the Puysegur Ridge to the south
    134 of New Zealand (e.g.~\cite{LebKC1998}) have potential to generate
    135 tsunami that may threaten Australia's northwestern and southeastern
    136 coastlines.
    137 
    138 Hydrodynamic modelling allows flooding, storm-surge and tsunami
    139 hazards to be better understood, their impacts to be anticipated
    140 and, with appropriate planning, their effects to be mitigated.
    141 Geoscience Australia in collaboration with the Mathematical Sciences
    142 Institute, Australian National University, is developing a software
    143 application called \AnuGA{} to model the hydrodynamics of floods,
    144 storm surges and tsunami. These hazards are modelled using the
    145 conservative shallow water equations which are described in
    146 section~\ref{sec:model}. In \AnuGA{} these equations are solved
    147 using a finite volume method as described in section~\ref{sec:fvm}.
    148 A more complete discussion of the method can be found in
    149 \cite{modsim2005} where the model and solution technique is
    150 validated on a standard tsunami benchmark data set.
    151 
    152 In this paper we will provide a description of the parallelisation
    153 of the code using a domain decomposition strategy and provide the
    154 preliminary timing results which verify the scalability of the
    155 parallel code.
    156 
     119inundation from hydrological disasters such as tsunami or storm-surge
     120of even a few hundred metres beyond the shoreline has increased
     121potential to cause significant disruption and loss. The extent of
     122inundation is critically linked to the event, tidal conditions,
     123bathymetry and topography and it not feasible to make impact
     124predictions using heuristics alone.
     125
     126Hydrodynamic modelling allows impacts from flooding, storm-surge and
     127tsunami to be better understood, their impacts to be anticipated and,
     128with appropriate planning, their effects to be mitigated.  Geoscience
     129Australia in collaboration with the Mathematical Sciences Institute,
     130Australian National University, is developing a software application
     131called \AnuGA{} to model the hydrodynamics of floods, storm surges and
     132tsunami. These hazards are modelled using the conservative shallow
     133water equations which are described in section~\ref{sec:model}. In
     134\AnuGA{} these equations are solved using a finite volume method as
     135described in section~\ref{sec:fvm}.  A more complete discussion of the
     136method can be found in \cite{modsim2005} where the model and solution
     137technique is validated on a standard tsunami benchmark data set.
     138Section~\ref{sec:software} describes the software implementation and
     139the API while section~\ref{sec:validation} presents testing and
     140validation results.
    157141
    158142
     
    302286\end{figure}
    303287
    304 
    305 
    306 
    307 
    308288In the computations presented in this paper we use an explicit Euler
    309289time stepping method with variable timestepping adapted to the
    310290observed CFL condition.
    311291
     292
    312293\section{Software Implementation}
    313294
    314 To set up a scenario the user specifies the geometry (derived from bathymetric and topographic data), the initial water level, boundary conditions (e.g. tide), outputs from other models (e.g. a deep water tsunami model), and forcing terms (e.g. frictional resistance, wind stress, atmospheric pressure gradients etc.).  The geometry could for example be a digital elevation model of an estuary and a boundary could be a collection of time series derived from tide gauges.
    315 
    316 To help with these tasks, a tool called pmesh has been developed which allows the user to set up the geometry of the problem interactively.  Pmesh produces a triangular mesh of the study area in which the user can specify the locations and types of boundary conditions that apply as well as identifying regions for either mesh refinement or for assignment of values at run time.  Figure \ref{fig:anuga mesh} shows an example of
    317 a geometry generated by pmesh.
    318 
    319 
     295\AnuGA{} is mostly written in the object-oriented programming
     296language \Python{} with computationally intensive parts implemented
     297as highly optimised shared objects written in C.
     298
     299\Python{} is known for its clarity, elegance, efficiency and
     300reliability. Complex software can be built in \Python{} without undue
     301distractions arising from idiosyncrasies of the underlying software
     302language syntax. In addition, \Python{}'s automatic memory management,
     303dynamic typing, object model and vast number of libraries means that
     304software can be produced quickly and can be readily adapted to
     305changing requirements throughout its lifetime.
     306
     307The fundamental object in \AnuGA{} is the \code{Domain} which
     308inherits functionality from a hierarchy of increasingly specialised
     309classes starting with a basic structural Mesh to classes implementing
     310the finite-volume scheme described in section \ref{sec:fvm}. Other classes
     311are \code{Quantity} which represents values of one variable across the mesh
     312along with their associated operations, \code{Geospatial_data} which
     313represents georeferenced elevation data and a collection of \code{Boundary}
     314classes which allows for a 'pluggable' way of driving the model.
     315The conserved quantities updated automatically by the numerical scheme
     316are \code{stage} (water level) $w$, \code{xmomentum} $uh$ and \code{ymomentum}
     317$vh$. The quanitites \code{elevation} $z$ and \code{friction} $\eta$ are
     318quantities that are not updated automaticall but can be changed explicitly
     319if the user wishes to. 
     320
     321To set up a scenario the user specifies the study area along with any internal
     322regions where increased mesh resolution is required. External edges may
     323be labelled using symbolic tags which are subsequently used to bind
     324boundary condition objects to tagged segments of the boundary. 
     325
     326Figure \ref{fig:anuga mesh} shows an example of a mesh generated by \AnuGA{}.
    320327
    321328\begin{figure}
     
    323330\includegraphics[width=5.0cm,keepaspectratio=true]{tsunami-fig-1}
    324331\caption{Triangular mesh used in our finite volume method. Conserved
    325 quantities $h$, $uh$ and $vh$ are associated with the centroid of
    326 each triangular cell.} \label{fig:anuga mesh}
     332quantities $h$, $uh$ and $vh$ are associated with each triangular cell.}
     333\label{fig:anuga mesh}
    327334\end{center}
    328335\end{figure}
    329336
    330  
    331 %Figure 1 Mesh generated by pmesh for a reservoir simulation.
    332 
    333 When the model is run, the mesh is converted into a domain object which represents the study area, the mesh, quantities, boundaries and forcing terms together with methods for time stepping, flux calculations, and all other numerical operations pertinent to the model.
    334 
    335 
    336 The (conserved) quantities updated by the numerical scheme are stage (water level) and horizontal momentum while bed elevation and friction are quantities that are not updated.  Setting initial values for quantities is done through the method
    337 domain.set_quantity(name, X, location, region)
    338 where name is the name of the quantity (e.g. 'stage', 'xmomentum', 'ymomentum', 'elevation' or 'friction').  The variable X represents the source data for populating the quantity and may take one of the following forms:
     337The mesh is then generated using \AnuGA{}'s built-in mesh generator and
     338converted into the \code{Domain} object which provides all methods used to
     339setup and run the flow simulation.
     340
     341Next step is to setup initial conditions for each Quantity object. For
     342the elevation $z$ this is typically obtained from bathymetric and
     343topographic data sets. Setting initial values for quantities is done
     344through the method \code{domain.set_quantity(name, X, location,
     345region)} where name is the name of the quantity (e.g.\ 'stage',
     346'xmomentum', 'ymomentum', 'elevation' or 'friction').  The variable X
     347represents the source data for populating the quantity and may take
     348one of the following forms:
    339349
    340350\begin{itemize}
    341 
    342 \item A constant value as in domain.set_quantity('stage', 1) which will set the initial water level to 1 m everywhere.
    343 \item Another quantity or a linear combination of quantities.  If q1 and q2 are two arbitrary quantities defined within the same domain, the expression set_quantity('stage', q1*(3*q2 + 5)) will set the stage quantity accordingly.  One common application of this would be to assign the stage as a constant depth above the bed elevation.
    344 \item An arbitrary function (or a callable object), f(x, y), where x and y are assumed to be vectors.  The quantity will take values for f at each location within the mesh.
    345 \item An arbitrary set of points and associated values (wrapped into a point_set object).  The points need not coincide with triangle vertices or centroids and a penalised least squares technique is employed to populate the quantity in a smooth and stable way.
     351\item A constant value as in domain.set_quantity('stage', 1) which
     352will set the initial water level to 1 m everywhere.
     353\item Another quantity or a linear combination of quantities.  If q1
     354and q2 are two arbitrary quantities defined within the same domain,
     355the expression set_quantity('stage', q1*(3*q2 + 5)) will set the stage
     356quantity accordingly.  One common application of this would be to
     357assign the stage as a constant depth above the bed elevation.
     358\item An arbitrary function (or a callable object), f(x, y), where x
     359and y are assumed to be vectors. The quantity will be assigned values by
     360evaluating f at each location within the mesh.
     361\item An arbitrary set of points and associated values (wrapped into a
     362Geospatial_data object). The points need not coincide with triangle
     363vertices or centroids and a penalised least squares technique is
     364employed to populate the quantity in a smooth and stable way.
    346365\item A filename containing points and attributes.
    347 \item A Numerical Python array (or a list of numbers) ordered according to the internal data structure.
     366\item A Numerical Python array (or a list of numbers) ordered
     367according to the internal data structure.
    348368\end{itemize}
    349369
    350370
    351 The parameter location determines whether the values should be assigned to triangle edge midpoints or vertices and region allows the operation to be restricted to a region specified by a symbolic tag or a set of indices.
    352 
    353 Since the least squares technique can be time consuming for large problems, set_quantity employs a caching technique which automatically decides whether to perform the computations or retrieve them from a cache.  This will typically speed up the build by several orders of magnitude after each computation has been performed once.
    354 
    355 Boundary conditions are bound to symbolic tags through the method domain.set_boundary which takes as input a lookup table (implemented as a Python dictionary) of the form {tag: boundary_object}.  The boundary objects are all assumed to be callable functions of vectors x and y.  Several predefined standard boundary objects are available and it is relatively straightforward to define problem-specific custom boundaries if needed.  The predefined boundary conditions include Dirichlet, Reflective, Transmissive, Temporal, and Spatio-Temporal boundaries.
    356 
    357 Forcing terms can be written according to a fixed protocol and added to the model using the idiom domain.forcing_terms.append(F) where F is assumed to be a user-defined callable object.
    358 
    359 When the simulation is running, the length of each time step is determined from the maximal speeds encountered and the sizes of triangles in order not to violate the CFL condition which specifies that no information should skip any triangles in one time step.  With large speeds and small triangles, time steps can become very small.  In order to access the state of the simulation at regular time intervals, AnuGA uses the method evolve:
    360 For t in domain.evolve(yieldstep, duration):
    361    <do whatever>
    362 
    363 The parameter duration specifies the time period over which evolve operates, and control is passed to the body of the for-loop at each fixed yieldstep.  The internal time stepping is thus decoupled from the overall time stepping so that outputs may be stored, displayed or interrogated.  The evolve method has been implemented using a Python generator.
     371The parameter location determines whether the values should be
     372assigned to triangle edge midpoints or vertices and region allows the
     373operation to be restricted to a region specified by a symbolic tag or
     374a set of indices.
     375
     376Since the least squares technique can be time consuming for large
     377problems, \code{set_quantity} employs a caching technique which automatically
     378decides whether to perform the computations or retrieve them from a
     379cache.  This will typically speed up the build by several orders of
     380magnitude after each computation has been performed once.
     381
     382Boundary conditions are bound to symbolic tags through the method
     383\code{domain.set_boundary} which takes as input a lookup table (implemented
     384as a Python dictionary) of the form \code{\{tag: boundary_object\}}. 
     385The boundary objects are all assumed to be callable functions of vectors x
     386and y.  Several predefined standard boundary objects are available and
     387it is relatively straightforward to define problem-specific custom
     388boundaries if needed.  The predefined boundary conditions include
     389Dirichlet, Reflective, Transmissive, Temporal, and Spatio-Temporal
     390boundaries.
     391
     392Forcing terms can be written according to a fixed protocol and added
     393to the model using the idiom \code{domain.forcing_terms.append(F)} where F is
     394assumed to be a user-defined callable object.
     395
     396When the simulation is running, the length of each time step is
     397determined from the maximal speeds encountered and the sizes of
     398triangles in order not to violate the CFL condition which specifies
     399that no information should skip any triangles in one time step.  With
     400large speeds and small triangles, time steps can become very small.
     401In order to access the state of the simulation at regular time
     402intervals, \AnuGA{} uses the method evolve:
     403
     404\begin{verbatim}
     405For t in domain.evolve(yieldstep, duration):
     406    <do whatever>
     407\end{verbatim}     
     408
     409The parameter \code{duration} specifies the time period over which
     410evolve operates, and control is passed to the body of the for-loop at
     411each fixed time step called \code{yieldstep}.  The internal workings
     412of the numerical scheme and its variable time stepping are thus
     413decoupled from the fixed time stepping of the evolve loop.  This means
     414that the user of the API may access the model at fixed timesteps to
     415e.g.\ store model outputs, interrogate quantities or change the model
     416itself at runtime. The evolve method has been implemented using a
     417Python generator hence the reference to 'yield' in the parameter.
    364418
    365419Figure \ref{fig:beach runup} shows a simulation of water flowing onto a
     
    375429\end{center}
    376430\end{figure}
    377 
    378  
    379 %Figure 2  Simulation of a levee breach.
    380 
    381 Most of the components of AnuGA are written in Python, an object-oriented programming language known for its clarity, elegance, efficiency and reliability.  It is often said that "Python lets you focus on the problem at hand".  This means that it is possible to develop complex pieces of software without undue distractions in dealing with idiosyncrasies of the software language syntax.  Consequently, software written in Python can be produced quickly and can be readily adapted to changing requirements throughout its lifetime.
    382 
    383 
    384 
    385 
    386 
    387 
    388431
    389432
     
    446489
    447490
    448 
    449 \section{Parallel Implementation}\label{sec:parallel}
    450 
    451 To parallelize our algorithm we use a simple domain decomposition
    452 strategy. We suppose we have a global mesh which defines the domain
    453 of our problem. We must first subdivide the global mesh into a set
    454 of non-overlapping submeshes. This partitioning is done using the
    455 \Metis{} partitioning library. We will demonstrate the efficiency of
    456 this library in the following subsections. Once this partitioning
    457 has been done, and the proper communication patterns set, we can
    458 start to evolve our solution. Each timestep consists of
    459 independently and then communicate the appropriate ``ghost'' cell
    460 information once each timestep.
    461 
    462 %\begin{figure}[hbtp]
    463 %  \centerline{ \includegraphics[scale = 0.6]{domain.eps}}
    464 %  \caption{The first step of the parallel algorithm is to divide
    465 %  the mesh over the processors.}
    466 %  \label{fig:subpart}
    467 %\end{figure}
    468 
    469 
    470 
    471 \begin{figure}[h!]
    472   \centerline{ \includegraphics[width=6.5cm]{mermesh.eps}}
    473   \caption{The global Merimbula mesh}
    474  \label{fig:mergrid}
    475 \end{figure}
    476 
    477 \begin{figure}[h!]
    478   \centerline{ \includegraphics[width=6.5cm]{mermesh4c.eps}
    479   \includegraphics[width=6.5cm]{mermesh4a.eps}}
    480 
    481   \centerline{ \includegraphics[width=6.5cm]{mermesh4d.eps}
    482   \includegraphics[width=6.5cm]{mermesh4b.eps}}
    483   \caption{The global Merimbula mesh partitioned into 4 submeshes using \Metis.}
    484  \label{fig:mergrid4}
    485 \end{figure}
    486 
    487 
    488 
    489 
    490 \begin{table}[h!]
    491 \caption{4-way and 8-way partition tests of Merimbula mesh showing
    492 the percentage distribution of cells between the
    493 submeshes.}\label{tbl:mer}
    494 \begin{center}
    495 \begin{tabular}{|c|c c c c|}
    496 \hline
    497 CPU & 0 & 1 & 2 & 3\\
    498 \hline
    499 Cells & 2757 & 2713 & 2761 & 2554\\
    500 \% & 25.6\% & 25.2\% & 25.6\% & 23.7\%\ \\
    501 \hline
    502 \end{tabular}
    503 
    504 \medskip
    505 
    506 \begin{tabular}{|c|c c c c c c c c|}
    507 \hline
    508 CPU & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7\\
    509 \hline
    510 Cells & 1229 & 1293 & 1352 & 1341 & 1349 & 1401 & 1413 & 1407\\
    511 \% & 11.4\% & 12.0\% & 12.5\% & 12.4\% & 12.5\% & 13.0\% & 13.1\% & 13.1\%\\
    512 \hline
    513 \end{tabular}
    514 \end{center}
    515 \end{table}
    516 
    517 
    518491\section{Conclusions}
    519 \label{sec:6} \AnuGA{} is a flexible and robust modelling system
     492\label{sec:6}
     493\AnuGA{} is a flexible and robust modelling system
    520494that simulates hydrodynamics by solving the shallow water wave
    521495equation in a triangular mesh. It can model the process of wetting
     
    525499
    526500\AnuGA{} can take as input bathymetric and topographic datasets and
    527 simulate the behaviour of riverine flooding, storm surge and
    528 tsunami. Initial validation using wave tank data supports AnuGA's
     501simulate the behaviour of riverine flooding, storm surge,
     502tsunami or even dam breaks.
     503Initial validation using wave tank data supports \AnuGA{}'s
    529504ability to model complex scenarios. Further validation will be
    530505pursued as additional datasets become available.
     
    534509Geoscience Australia's ongoing research effort to model and
    535510understand the potential impact from natural hazards in order to
    536 reduce their impact on Australian communities.
    537 
    538 
    539 %\paragraph{Acknowledgements:}
    540 %The authors are grateful to Belinda Barnes, National Centre for
    541 %Epidemiology and Population Health, Australian National University,
    542 %and Matt Hayne and Augusto Sanabria, Risk Research Group, Geoscience
    543 %Australia, for helpful reviews of a previous version of this paper.
    544 %Author Nielsen publish with the permission of the CEO, Geoscience
    545 %Australia.
    546 
    547 % Preferably provide your bibliography as a separate .bbl file.
    548 % Include URLs, DOIs, Math Review numbers or Zentralblatt numbers in your bibliography
    549 % so we help connect the web of science and ensure maximum visibility
    550 % for your article.
     511reduce their impact on Australian communities (see \cite{Nielsen2006}).
     512
     513The \AnuGA{} source code is available
     514at \url{http://sourceforge.net/projects/anuga}.
     515
    551516\bibliographystyle{plain}
    552517\bibliography{database1}
Note: See TracChangeset for help on using the changeset viewer.