Changeset 8083


Ignore:
Timestamp:
Nov 24, 2010, 4:55:55 PM (8 years ago)
Author:
habili
Message:

Bug fixes, including correct use of starttime and duration.

Location:
branches/anuga_1_2_1/anuga_core
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • branches/anuga_1_2_1/anuga_core/documentation/user_manual/anuga_installation_guide.tex

    r7527 r8083  
    33\title{ANUGA Installation Guide}
    44
    5 %\author{Ole Nielsen, Duncan Gray, Jane Sexton}
    6 
    75\usepackage{graphicx}
    8 
     6\usepackage{hyperref}
    97
    108% Please at least include a long-lived email address;
    119% the rest is at your discretion.
    1210\authoraddress{Geoscience Australia \\
    13   Email: \email{nariman.habili@ga.gov.au}
     11  Email: \email{anuga@ga.gov.au}
    1412}
    1513
     
    5654\label{sec:requirements}
    5755
    58 To run ANUGA you will need a Windows PC (XP or Vista) or a Linux PC with at
     56To run ANUGA you will need a Windows PC (XP, Vista or 7) or a Linux PC with at
    5957least 512MB RAM.  As ANUGA is a memory-intensive numerical system, more memory is better than less.
    6058
    6159The viewer (Windows only) requires a graphics adapter that
    62 is OpenGL compatible. It has been tested with ATI FireGL X1 cards
    63 and the NVIDIA family. It may not work with other cards such as those from the
    64 Intel(R) 82915G Express chipset family.
    65 
    66 The instructions below are written for the numpy version of ANUGA.  ANUGA changed from
    67 relying on the Numeric package to the numpy package early in July, 2009.  If you have a Numeric ANUGA,
    68 you should refer to the installation instructions for that version.  The last Numeric version of
     60is OpenGL compatible. It has been tested with ATI, NVIDIA and Mobile Intel(R) GM45 Express chipsets.
     61
     62The instructions below are written for the numpy version of ANUGA. ANUGA changed from
     63relying on the Numeric package to the numpy package early in July, 2009. If you have a Numeric ANUGA,
     64you should refer to the installation instructions for that version. The last Numeric version of
    6965ANUGA had a build number of 7163.
    7066
     
    7672\section{Installation}
    7773
    78 Below are the install procedures for Windows XP, Windows Vista (both 32 bit) and Linux (32 and 64 bit).
    79 
    80 \subsection{Quick install - Windows XP (32 bit)}
     74Below are the install procedures for Windows XP, Windows Vista, Windows 7 (all 32 bit) and Linux (32 and 64 bit).
     75
     76\subsection{Quick install - Windows XP, Vista and 7 (32 bit)}
    8177\label{sec:winxp}
    8278
     
    9086run the test suite (optional) and then run a series of validation examples (optional). This may take some time.
    9187Try the demonstrations provided in the ANUGA directory \code{anuga\_demos} (discussed in the ANUGA user manual at
    92 \url{http://datamining.anu.edu.au/\%7Eole/anuga/user\%5Fmanual/anuga\%5Fuser\%5Fmanual.pdf})
     88\url{https://datamining.anu.edu.au/anuga/attachment/wiki/WikiStart/anuga_user_manual-1.2.0.pdf})
    9389and view the resulting \code{.sww} files with the ANUGA viewer.
    9490
    95 %This procedure assumes that you do not have python installed on the target machine.
    96 %If you do have a python installed already then skip the installation of python as
    97 %long as you have version 2.5 or later installed.
    98 %
    99 %\begin{itemize} 
    100 %  \item Install the support software, in order.
    101 %    \begin{enumerate}
    102 %      \item Execute \code{python-2.5.4.msi} to install python.
    103 %
    104 %      \item Install MinGW from \code{MinGW-5.1.4.exe}.  Install components:
    105 %        \begin{enumerate}
    106 %          \item MinGW base tools
    107 %          \item g++ compiler
    108 %          \item MinGW Make
    109 %        \end{enumerate}
    110 %        Note that you will need an internet connection for the above install.
    111 %
    112 %      \item Execute \code{numpy-1.3.0-win32-superpack-python2.5.exe} to install numpy.
    113 %
    114 %      \item Execute \code{netCDF_binary_4.0.exe} to install NetCDF.
    115 %
    116 %      \item Execute \code{ScientificPython-2.9.0.win32-py2.5.exe} to install Scientific Python.
    117 
    118 %      \item Execute \code{matplotlib-0.98.5.2.win32-py2.5.exe} to install matplotlib.
    119 %    \end{enumerate}
    120 
    121 %  \item Add the following to the end of the PATH environment variable:
    122 %    \begin{verbatim};C:\Python25;C:\MingW\bin;C:\netcdf4\bin\end{verbatim}
    123 %    For details on how to do this under Windows please refer to Appendix \ref{sec:setwindowspath}.
    124 %\end{itemize} 
    125 %
    126 %\subsubsection{ANUGA Installation}
    127 %\label{sec:ANUGA}
    128 %
    129 %\begin{itemize} 
    130 %  \item Unpack the ANUGA source code (\code{anuga-1.0_xxxx.tgz})\footnote{Internet Explorer has the habit of renaming the .tgz files to .gz -
    131 %                                                                          the remedy is to rename them back or use another browser such as Firefox.}
    132 %    in the python site-packages directory \code{C:$\backslash$Python25$\backslash$Lib$\backslash$site-packages}.
    133 %    This is often done in Windows by double clicking on the \code{.tgz} file and then 'browse to' the destination directory.
    134 %
    135 %  \item In the ANUGA root directory (\code{C:$\backslash$Python25$\backslash$Lib$\backslash$site-packages$\backslash$anuga}),
    136 %    run the compilation script (either from the commandline or by running it in IDLE):
    137 %    \begin{verbatim}python compile_all.py\end{verbatim}
    138 %
    139 %  \item In the ANUGA root directory (\code{C:$\backslash$Python25$\backslash$Lib$\backslash$site-packages$\backslash$anuga}),
    140 %    run the test suite (either from the commandline or by running it in IDLE):
    141 %    \begin{verbatim}python test_all.py\end{verbatim} ANUGA has been succesfully installed if the tests pass.
    142 %
    143 %  \item To verify that ANUGA succesfully reproduces a series of validation examples, go
    144 %    to the directory
    145 %    \linebreak
    146 %    \code{anuga_validation$\backslash$automated_validation_tests} under the ANUGA root directory where you can run:
    147 %    \begin{verbatim}python validate_all.py\end{verbatim}
    148 %    This may take some time.
    149 %
    150 %  \item To install the ANUGA viewer:
    151 %    \begin{enumerate}
    152 %      \item Unpack the distribution (\code{anuga_viewer_1.0.tgz}) into:
    153 %        \begin{verbatim}C:\Program Files\end{verbatim}
    154 %
    155 %      \item Double click on the test file:
    156 %        \begin{verbatim}C:\Program Files\anuga_viewer\cylinders.sww\end{verbatim}
    157 %
    158 %      \item Associate \code{.sww} files with the executable:
    159 %      \begin{verbatim}C:\Program Files\anuga_viewer\animate.exe\end{verbatim}       
    160 %      For details on how to do this under Windows please refer to Appendix \ref{sec:assocanimatesww}.
    161 %    \end{enumerate}
    162 %
    163 %    Try the demonstrations provided in the ANUGA directory \code{anuga\_demos}
    164 %    (discussed in the ANUGA user manual at
    165 %    \url{http://datamining.anu.edu.au/\%7Eole/anuga/user\%5Fmanual/anuga\%5Fuser\%5Fmanual.pdf})
    166 %    and view the resulting \code{.sww} files with the ANUGA viewer.
    167 %\end{itemize}   
    16891
    16992
     
    177100%details.
    178101
    179 \subsection{Quick install - Windows Vista}
    180 \label{sec:winvista}
    181 
    182 The installation of the support software and the ANUGA software should be the same as for Windows XP above.
    183 The installation and use of ANUGA under Windows Vista has not been heavily tested.  Feedback on any aspect
    184 of using ANUGA under Vista is welcomed.
    185 
    186102\subsection{Quick install - Linux}
    187103\label{sec:linux}
    188104
    189 The procedure to install onto a Linux platform is targetted at a Debian-like Linux, such as Ubuntu.
    190 If you use another Linux the overall procedure should be followed, although the details will vary.
    191 
    192 The steps below assume that you do not have python installed on the target machine.
    193 If you do have a python installed already then skip the installation of python as
    194 long as you have version 2.5 or later.
    195 
    196 Note that even if you already have python installed you should still check if things like
    197 \code{python-dev} and \code{python-profiler} need to be installed.
    198 
    199 \subsubsection{Support Software - Linux 32 bit}
    200 \label{sec:linux32bit}
    201 
    202 Install support software (in order):
    203 \begin{enumerate} 
    204   \item Install the python development environment, either through Synaptic or by:
    205     \begin{verbatim}sudo apt-get install python python-dev python-profiler\end{verbatim}
    206     If you already have python 2.5 or later installed, don't include \code{python} above.
    207 
    208   \item Install g++, either through Synaptic or by:
    209     \begin{verbatim}sudo apt-get install g++\end{verbatim}
    210 
    211   \item Install the numpy package, either through Synaptic or by:
    212     \begin{verbatim}sudo apt-get install python-numpy\end{verbatim}
    213 
    214   \item Install the NetCDF package from the .tar.gz file:
    215     \begin{verbatim}tar xzf netcdf.tar.gz
    216 cd netcdf-4.0.1
    217 ./configure
    218 make check
    219 sudo make install
    220 cd\end{verbatim}
    221 
    222   \item Install the ScientificPython package from the .tar.gz file:
    223     \begin{verbatim}tar xzf ScientificPython-2.9.0.tar.gz
    224 cd ScientificPython-2.9.0
    225 python setup.py build --numpy
    226 sudo python setup.py install
    227 cd\end{verbatim}
    228 
    229   \item Install matplotlib, either through Synaptic or by:
    230     \begin{verbatim}sudo apt-get install python-matplotlib\end{verbatim}
    231 \end{enumerate}   
    232 
    233 \subsubsection{Support Software - Linux 64 bit}
    234 \label{sec:linux64bit}
    235 
    236 Install support software (in order):
    237 \begin{enumerate} 
    238   \item Install the python development environment, either through Synaptic or by:
    239     \begin{verbatim}sudo apt-get install python python-dev python-profiler\end{verbatim}
    240     If you already have python 2.5 or later installed, don't include \code{python} above.
    241 
    242   \item Install g++, either through Synaptic or by:
    243     \begin{verbatim}sudo apt-get install g++\end{verbatim}
    244 
    245   \item Define a CFLAGS value:
    246     \begin{verbatim}export CFLAGS=-fPIC\end{verbatim}
    247 
    248   \item Install the numpy package, either through Synaptic or by:
    249     \begin{verbatim}sudo apt-get install python-numpy\end{verbatim}
    250 
    251   \item Install the NetCDF package from the .tar.gz file:
    252     \begin{verbatim}tar xzf netcdf.tar.gz
    253 cd netcdf-4.0.1
    254 ./configure
    255 make check
    256 sudo make install
    257 cd\end{verbatim}
    258 
    259   \item Install the ScientificPython package from the .tar.gz file:
    260     \begin{verbatim}tar xzf ScientificPython-2.9.0.tar.gz
    261 cd ScientificPython-2.9.0
    262 python setup.py build --numpy
    263 sudo python setup.py install
    264 cd\end{verbatim}
    265 
    266   \item Install matplotlib, either through Synaptic or by:
    267     \begin{verbatim}sudo apt-get install python-matplotlib\end{verbatim}
    268 \end{enumerate}   
    269 
    270 \subsubsection{ANUGA Installation - 32 or 64 bit}
    271 \label{sec:ANUGA32-64bit}
    272 
    273 \begin{enumerate} 
    274   \item Get the ANUGA source from \url{http://sourceforge.net/projects/anuga} (\code{anuga-1.0_5789.tgz} say),
    275     and expand it into the python site-packages directory \code{/usr/lib/python2.5/site-packages}.
    276     In the unpacked ANUGA directory \code{/usr/lib/python2.5/site-packages/anuga} run the command:
    277     \begin{verbatim}sudo python compile_all.py\end{verbatim}
    278 
    279   \item In the ANUGA root directory (\code{/usr/lib/python2.5/site-packages/anuga})
    280     run the test suite:
    281     \begin{verbatim}python test_all.py\end{verbatim} ANUGA has been succesfully installed if the tests pass.
    282 
    283   \item To verify that ANUGA succesfully reproduces a series of validation examples, go
    284     to the directory
    285     \linebreak
    286     \code{/usr/lib/python2.5/site-packages/anuga_validation/automated_validation_tests}
    287     where you can run validation tests to ensure the correct running of ANUGA:
    288     \begin{verbatim}python validate_all.py\end{verbatim}
    289     This may take some time.
    290 \end{enumerate}
     105Please note that the following applies only to Ubuntu 10.04 and 10.10. We currently do not
     106support any other Linux distributions.
     107
     108Open a terminal and enter:
     109\begin{verbatim}
     110sudo add-apt-repository ppa:anuga/ppa
     111sudo apt-get update
     112sudo apt-get install python-anuga
     113\end{verbatim}
     114
     115For the Ubuntu version, you do not need to run test_all.py or compile_all.py. They have already been done for you.
     116
    291117
    292118\section{Optional but recommended software}
     
    309135\section{Testing}
    310136
    311 In the ANUGA root directory, run the test suite:
     137If you install ANUGA directly from the SVN repository (not the Windows one-click installer or using apt-get install for Ubuntu),
     138you should run the unit tests to verify that all the tests pass. In the ANUGA root directory, run the test suite:
    312139\begin{verbatim}
    313140python test_all.py
     
    361188environment "System variables". However, in case you do not have
    362189permission to modify the system variable, then the method of setting the PATH environment "User variable"
    363 for Windows XP is shown here. Setting the variable for Windows Vista should be similar.
     190for Windows XP is shown here. Setting the variable for Windows Vista and 7 should be similar.
    364191
    365192\setlength\fboxsep{0pt}
  • branches/anuga_1_2_1/anuga_core/documentation/user_manual/anuga_user_manual.tex

    r7848 r8083  
    2828
    2929\usepackage{graphicx}
     30\usepackage{hyperref}
    3031\usepackage[english]{babel}
    3132\usepackage{datetime}
     
    4950% the rest is at your discretion.
    5051\authoraddress{Geoscience Australia \\
    51   Email: \email{nariman.habili@ga.gov.au}
     52  Email: \email{anuga@ga.gov.au}
    5253}
    5354
     
    140141inundation software system, describe what it can do and give step-by-step
    141142instructions for setting up and running hydrodynamic simulations.
    142 The stable release of \anuga and this manual are available on sourceforge ati
     143The stable release of \anuga and this manual are available on sourceforge at
    143144\url{http://sourceforge.net/projects/anuga}. A snapshot of work in progress is
    144145available through the \anuga software repository at
    145 \url{https://datamining.anu.edu.au/svn/ga/anuga_core}
     146\url{http://datamining.anu.edu.au/svn/anuga/trunk/anuga_core/source/anuga}
    146147where the more adventurous reader might like to go.
    147148
    148149This manual describes \anuga version \version. To check for later versions of this manual
    149 go to \url{https://datamining.anu.edu.au/anuga}.
     150go to \url{http://datamining.anu.edu.au/anuga}.
    150151
    151152\section{Scope}
     
    158159
    159160The latest installation instructions may be found at:
    160 \url{http://datamining.anu.edu.au/\~{}ole/anuga/user_manual/anuga_installation_guide.pdf}.
     161\url{http://datamining.anu.edu.au/anuga/attachment/wiki/WikiStart/anuga_installation_guide-1.2.0.pdf}.
    161162
    162163\section{Audience}
     
    165166its object oriented approach.
    166167Python tutorials include
    167 \url{http://docs.python.org/tut},
    168 \url{http://www.sthurlow.com/python}, and
    169 %\url{http://datamining.anu.edu.au/\%7e ole/work/teaching/ctac2006/exercise1.pdf}.
    170 \url{http://datamining.anu.edu.au/\~{}ole/work/teaching/ctac2006/exercise1.pdf}.
     168\url{http://docs.python.org/tut} and \url{http://www.sthurlow.com/python}.
    171169
    172170Readers also need to have a general understanding of scientific modelling,
     
    183181as riverine flooding, storm surges and tsunami is critical for
    184182understanding their economic and social impact on our urban
    185 communities.  Geoscience Australia and the Australian National
     183communities. Geoscience Australia and the Australian National
    186184University are developing a hydrodynamic inundation modelling tool
    187185called \anuga to help simulate the impact of these hazards.
     
    50925090  338:43--68, 1992.
    50935091
    5094 \bibitem{KurNP2001}
     5092\bibitem[KurNP2001]{KurNP2001}
    50955093\newblock Semidiscrete central-upwind schemes for hyperbolic conservation laws
    50965094  and hamilton-jacobi equations.
  • branches/anuga_1_2_1/anuga_core/documentation/user_manual/anuga_whats_new.tex

    r7867 r8083  
    11\documentclass{manual}
    2 
     2\usepackage{hyperref}
    33
    44\title{ANUGA What's New}
    55
    6 \author{Ole Nielsen}
     6\author{Nariman Habili}
    77
    88% Please at least include a long-lived email address;
    99% the rest is at your discretion.
    1010\authoraddress{Geoscience Australia \\
    11   Email: \email{ole.nielsen@ga.gov.au}
     11  Email: \email{anuga@ga.gov.au}
    1212}
    1313
     
    4848These lists are not comprehensive and we refer to the TRAC system for a complete audit trail of changes made to ANUGA.
    4949\begin{itemize}
    50     \item Timeline of all changes to the code base: \url{https://datamining.anu.edu.au/anuga/timeline}
    51     \item List of completed tasks ordered by last modification time\footnote{Last time a closed ticket was modified will normally correspond to the time it was resolved. However, it is possible that it could be modified after being closed. Refer to the ticket change history if in doubt.}: \url{https://datamining.anu.edu.au/anuga/report/17}
    52     \item Changesets between two releases: To see all changes between version 4669 and 4733, for example, visit:
     50    \item Timeline of all changes to the code base: https://datamining.anu.edu.au/anuga/timeline
     51    \item Changesets between two releases: To see all changes between subversion versions 4669 and 4733, for example, visit:
    5352    \begin{itemize}
    5453      \item \url{https://datamining.anu.edu.au/anuga/changeset/4669} through to
     
    5958The release names take the form
    6059\begin{verbatim}
    61   XX-YY_ZZ.EXT
     60  AA-BB.CC.DD.EXT
    6261\end{verbatim}
    6362where
    6463\begin{itemize}
    65   \item \code{XX} is the name of the anuga component, e.g.
     64  \item \code{AA} is the name of the anuga component, e.g.
    6665  \code{anuga}, \code{anuga\_viewer}, \code{anuga\_installation\_guide} or \code{anuga\_user\_manual}
    67   \item \code{YY} is the name of the major revision, e.g. 1.0beta, which is unlikely to change very often unless the code has undergone a major change.
    68   \item \code{ZZ} is the Subversion revision number of this release. Every change to ANUGA causes the revision number to increment so this number uniquely identifies the version of ANUA. This is also known as the changeset number.
     66  \item \code{BB} is the major revision number. The major revision number is unlikely to change very often unless the code has undergone a major change.
     67  \item \code{CC} is the minor revision number. This number will increase when the code undergoes major bug fixes, changes to the interface, optimisation and the addition of minor features.
     68  \item \code{DD} is the minor revision number. This number will increase when the code undergoes minor bug fixes.
    6969  \item \code{EXT} is the file name extension \code{tgz}\footnote{Internet explorer has the habit of renaming the .tgz files to .gz - the remedy is to rename them back or use another browser such as Firefox.} used for source code or \code{pdf} used for documentation.
    7070\end{itemize}
     
    7979here. Refer to the Subversion
    8080log (https://datamining.anu.edu.au/anuga/timeline) and closed tickets
    81 https://datamining.anu.edu.au/anuga/report/17) for all changes in ANUGA.
     81https://datamining.anu.edu.au/anuga/report/10) for all changes in ANUGA.
    8282
    8383\section{Bleeding Edge}
     
    8686forcing terms. There is also activity in the area of viewers and installers.
    8787
    88 \section{Release Name: anuga-1.2beta, Date: June 2010}
     88\section{Release Name: anuga-1.2.0, Date: July 2010}
    8989Breaks code compatibility with older ANUGA versions. Please see the ANUGA wiki for migration instructions.
    9090Simplified API, with more logical module locations and names.
     
    9292Support for user-specified breaklines.
    9393Speed optimisations - fitting is around 25 percent faster.
    94 Various bug fixes - see trac.
     94Various bug fixes - see trac. Note the new versioning system.
    9595
    9696
  • branches/anuga_1_2_1/anuga_core/documentation/user_manual/copyright.tex

    r7828 r8083  
    44%  This is the ANUGA User Manual
    55%
    6 %  Version 1.2    June, 2010
     6%  Version 1.2    July, 2010
    77%
    88%
    99%
    10 %  Copyright 2004, 2005, 2010
    11 %  Stephen Roberts, Australian National University
    12 %  Ole Nielsen, Duncan Gray, Jane Sexton, Nick Bartzis, Geoscience Australia
     10%  Copyright Commonwealth of Australia (Geoscience Australia) and the Australian
     11%  National University 2004-2010.
    1312%
    1413%  COPYRIGHT PAGE
     
    1918\vspace*{0.5in}
    2019
    21 Copyright \copyright 2004, 2005, 2006, 2010 Australian National University and Geoscience Australia. All rights reserved.
     20\copyright Commonwealth of Australia (Geoscience Australia) and the Australian
     21National University 2004-2010.
    2222
    2323Permission to use, copy, modify, and distribute this software for any
     
    2929software and in all copies of the supporting documentation for such
    3030software.
     31This program is distributed in the hope that it will be useful,
    3132
    32 This program is distributed in the hope that it will be useful,
    3333but WITHOUT ANY WARRANTY; without even the implied warranty of
    3434MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     
    7272\textbf{Credits}:
    7373\begin{itemize}
    74 \item \anuga was developed and is maintained by Stephen Roberts,
    75   Ole Nielsen, Duncan Gray and Jane Sexton.
     74\item \anuga was developed by Stephen Roberts, Ole Nielsen, Duncan Gray and Jane Sexton. It is currently being developed and
     75 maintained by Nariman Habili and Stephen Roberts.
    7676\index{ANUGA!credits|textit} 
    7777\end{itemize}
     
    8585\textbf{Acknowledgments}:
    8686\begin{itemize}
    87 \item John Jakeman, Rudy van Drie, Ted Rigby, Petar Milevski, Joaquim Luis, Nils Goseberg, William Power,
     87\item Ole Nielsen, James Hudson, John Jakeman, Rudy van Drie, Ted Rigby,
     88      Petar Milevski, Joaquim Luis, Nils Goseberg, William Power,
    8889      Trevor Dhu, Linda Stals, Matt Hardy, Jack Kelly and Christopher
    8990      Zoppou who contributed to this project at various times.
    90 \item A stand alone visualiser (anuga\_viewer) based on Open-scene-graph was developed by Darran Edmundson.
     91\item A stand alone visualiser (anuga\_viewer) based on Open-scene-graph was developed by Darran Edmundson and James Hudson.
    9192\item The mesh generator engine was written by Jonathan Richard Shewchuk and made freely
    9293      available under the following license.  See source code \code{triangle.c} for more
  • branches/anuga_1_2_1/anuga_core/documentation/user_manual/update_anuga_user_manual.py

    r7189 r8083  
    4141from os.path import expanduser, split, join
    4242from anuga.utilities.system_tools import get_revision_number, get_pathname_from_package
    43 from anuga.config import major_revision
     43from anuga.config import anuga_version
    4444from sys import argv
    4545
     
    4747
    4848# Path for ANUGA
    49 anugapath = get_pathname_from_package('anuga')
     49#anugapath = get_pathname_from_package('anuga')
    5050
    5151# Strip trailing source/anuga of path
    52 basepath = split(split(anugapath)[0])[0]
     52#basepath = split(split(anugapath)[0])[0]
    5353
    5454# Add local path to user_manual
    55 docpath = join(join(basepath, 'documentation'), 'user_manual')
     55#docpath = join(join(basepath, 'documentation'), 'user_manual')
    5656texfiles = ['anuga_user_manual',
    5757            'anuga_installation_guide',
     
    5959            'anuga_internal_tools']
    6060
    61 print 'Moving to', docpath
    62 chdir(docpath) # Move to location of LaTeX files
     61#print 'Moving to', docpath
     62#chdir(docpath) # Move to location of LaTeX files
    6363system('svn update') # Update from svn
    6464
     
    7777for line in fid.readlines():
    7878    if line.startswith('\\release'):
    79         try:
    80             line = '\\release{%s\\_%d}\n' %(major_revision,
    81                                             get_revision_number())
    82         except:
    83             line = '\\release{%s}\n' %(major_revision)
     79        line = '\\release{%s}\n' %(anuga_version)
    8480           
    8581    lines.append(line)
     
    115111
    116112# Clean-up
    117 system('/bin/rm version.tex')
     113#system('/bin/rm version.tex')
    118114system('svn update') # Restore version file
    119115
     
    122118print 'User manual compiled'
    123119
    124 print 'Major revision:', major_revision
     120print 'Anuga version:', anuga_version
    125121print 'Build:', get_revision_number()
    126122system('date')
  • branches/anuga_1_2_1/anuga_core/documentation/user_manual/version.tex

    r7804 r8083  
    77% release version; this is used to define the
    88% \version macro
    9 \release{1.2beta\_6051}
     9\release{1.2.1}
  • branches/anuga_1_2_1/anuga_core/source/anuga/LICENSE.txt

    r7462 r8083  
    44
    55
    6 Copyright 2004, 2005, 2006, 2007, 2008, 2009 Australian National University and Geoscience Australia. All rights reserved.
     6Copyright 2004-2010 Australian National University and Geoscience Australia. All rights reserved.
    77
    88
  • branches/anuga_1_2_1/anuga_core/source/anuga/README.txt

    r5859 r8083  
    1 This is the root-Subversion directory for the ANUGA Inundation
    2 Software Development project conducted by
    3 
    4 Stephen Roberts (ANU)
    5 Ole Nielsen (GA)
    6 Duncan Gray (GA)
    7 Jane Sexton (GA)
    8 Nick Bartzis (GA)
    9 Jack Kelly (ANU)
    10 John Jakeman (ANU)
    11 
    12 
    131This is the top directory for the inundation project source code
    14 developed at the Risk Assessment Methods Project at Geoscience
    15 Australia and Mathematical Sciences Institute at the Australian
     2developed at the Risk and Impact Analysis Group at Geoscience
     3Australia and the Mathematical Sciences Institute at the Australian
    164National University.
    175
    186
    19 Copyright 2004, 2005, 2006 
    20 Ole Nielsen, Stephen Roberts, Duncan Gray, Jane Sexton
     7Copyright 2004-2010 
     8Geoscience Australia, Australian National University
    219
    2210
    2311PREREQUISITES
    2412
    25 python 2.3 or later
    26 python-numeric
    27 python-dev (Interestingly, numeric seems to be installed as well)
     13python 2.5 or 2.6
     14python-numpy
     15python-dev
    2816python-scientific (or maybe only python-netcdf)
    2917 (Remember to put netcdf.dll somewhere so the PATH - e.g. in C:\bin)
     
    4230In directory anuga:
    4331
    44   python test_all.py
     32  python compile_all.py
    4533 
    4634
     
    4836
    4937
    50 PATH=C:\Python24;C:\MinGW\bin;C:\Program Files\anuga_viewer
     38PATH=C:\Python25;C:\MinGW\bin;C:\Program Files\anuga_viewer
    5139
    5240It is assumed that the root directory for all anugu modules is on the pythonpath, e.g.
    53 PYTHONPATH=V:\home\onielsen\anuga_core\source
     41PYTHONPATH=C:\modelling\
    5442Alternatively this directory should be copied to the python site_packages directory
    5543 
  • branches/anuga_1_2_1/anuga_core/source/anuga/__init__.py

    r7874 r8083  
    4343from anuga.file.ungenerate import load_ungenerate
    4444
    45 from anuga.geometry.polygon import read_polygon, plot_polygons, polygon_area
     45from anuga.geometry.polygon import read_polygon, plot_polygons, polygon_area, number_mesh_triangles
    4646from anuga.geometry.polygon_function import Polygon_function
    4747
     
    5353from anuga.utilities.sww_merge import sww_merge
    5454from anuga.utilities.file_utils import copy_code_files
     55from anuga.utilities.file_utils import start_screen_catcher
    5556
    5657from anuga.geometry.polygon import read_polygon
    5758from anuga.caching import cache
     59from anuga.coordinate_transforms.geo_reference import Geo_reference, write_NetCDF_georeference
    5860
    5961#-----------------------------
     
    314316       
    315317
    316 
    317 
    318 
     318#---------------------------
     319# User access functions
     320#---------------------------
     321from anuga.utilities.system_tools import get_user_name, get_host_name
     322from anuga.utilities.system_tools import get_revision_number
     323
  • branches/anuga_1_2_1/anuga_core/source/anuga/abstract_2d_finite_volumes/file_function.py

    r7810 r8083  
    370370        y = num.reshape(y, (len(y), 1))
    371371        vertex_coordinates = num.concatenate((x, y), axis=1) #m x 2 array
    372 
     372       
    373373        if boundary_polygon is not None:
    374374            # Remove sts points that do not lie on boundary
  • branches/anuga_1_2_1/anuga_core/source/anuga/abstract_2d_finite_volumes/gauge.py

    r7780 r8083  
    223223    quake_offset_time = None
    224224
     225    is_opened = [False]*len(points_array)
    225226    for sww_file in sww_files:
    226227        sww_file = join(dir_name, sww_file+'.sww')
     
    235236            quake_offset_time = callable_sww.starttime
    236237
    237     for point_i, point in enumerate(points_array):
    238         is_opened = False   
    239         for time in callable_sww.get_time():
    240             #add domain starttime to relative time.
    241             quake_time = time + quake_offset_time
    242             point_quantities = callable_sww(time, point_i) # __call__ is overridden
    243 
    244             if point_quantities[0] != NAN:
    245                 if is_opened == False:
    246                     points_writer = writer(file(dir_name + sep + gauge_file
    247                                                         + point_name[point_i] + '.csv', "wb"))
    248                     points_writer.writerow(heading)
    249                     is_opened = True
    250                 points_list = [quake_time, quake_time/3600.] +  _quantities2csv(quantities, point_quantities, callable_sww.centroids, point_i)
    251                 points_writer.writerow(points_list)
    252             else:
    253                 if verbose:
    254                     msg = 'gauge' + point_name[point_i] + 'falls off the mesh in file ' + sww_file + '.'
    255                     log.warning(msg)
     238        for point_i, point in enumerate(points_array):
     239            for time in callable_sww.get_time():
     240                # add domain starttime to relative time.
     241                quake_time = time + quake_offset_time
     242                point_quantities = callable_sww(time, point_i) # __call__ is overridden
     243
     244                if point_quantities[0] != NAN:
     245                    if is_opened[point_i] == False:
     246                        points_writer = writer(file(dir_name + sep + gauge_file
     247                                                    + point_name[point_i] + '.csv', "wb"))
     248                        points_writer.writerow(heading)
     249                        is_opened[point_i] = True
     250                    else:
     251                        points_writer = writer(file(dir_name + sep + gauge_file
     252                                                    + point_name[point_i] + '.csv', "ab"))
     253
     254                    points_list = [quake_time, quake_time/3600.] +  _quantities2csv(quantities, point_quantities, callable_sww.centroids, point_i)
     255                    points_writer.writerow(points_list)
     256                else:
     257                    if verbose:
     258                        msg = 'gauge' + point_name[point_i] + 'falls off the mesh in file ' + sww_file + '.'
     259                        log.warning(msg)
    256260##
    257261# @brief Read a .sww file and plot the time series.
  • branches/anuga_1_2_1/anuga_core/source/anuga/abstract_2d_finite_volumes/generic_domain.py

    r8069 r8083  
    251251
    252252        # Model time
    253         self.time = 0.0
    254253        self.finaltime = None
    255254        self.recorded_min_timestep = self.recorded_max_timestep = 0.0
  • branches/anuga_1_2_1/anuga_core/source/anuga/abstract_2d_finite_volumes/neighbour_mesh.py

    r7711 r8083  
    635635            assert abs((area - ref)/area) < epsilon, msg
    636636
     637            msg = 'Triangle (%f,%f), (%f,%f), (%f, %f)' % (x0,y0,x1,y1,x2,y2)
     638            msg += ' is degenerate:  area == %f' % self.areas[i]
     639            assert area > 0.0, msg
     640
    637641            # Check that points are arranged in counter clock-wise order
    638642            v0 = [x1-x0, y1-y0]
     
    884888                return i
    885889
    886         return
     890        msg = 'Point %s not found within a triangle' %str(point)
     891        raise Exception, msg
     892
    887893
    888894
  • branches/anuga_1_2_1/anuga_core/source/anuga/abstract_2d_finite_volumes/test_gauge.py

    r8069 r8083  
    460460        os.remove(points_file)
    461461        os.remove(point1_filename)
    462        
    463        
     462
     463    def test_sww2csv_multiple_files(self):
     464        """
     465        This is testing the sww2csv_gauges function, by creating a multiple
     466        sww file and then exporting the gauges and checking the results.
     467        """
     468        timestep=2.0
     469        domain = self.domain
     470        domain.set_starttime(0.)
     471        # Create two sww files with timestep at end. These are to be
     472        # stored consecutively in the gauge csv files
     473        basename='datatest'
     474        domain.set_name(basename)
     475        self._create_sww(stage=10.,timestep=timestep)
     476
     477        domain.set_name(basename+str(time.time()))
     478        domain.set_time(domain.get_time()+timestep)
     479        self._create_sww(stage=20.,timestep=timestep)
     480
     481        points_file = tempfile.mktemp(".csv")
     482        file_id = open(points_file,"w")
     483
     484        # test the function at these points
     485        points = [[5.0,1.],[0.5,2.]]
     486
     487        # create a csv file containing our gauge points
     488        points_file = tempfile.mktemp(".csv")
     489        file_id = open(points_file,"w")
     490        file_id.write("name,easting,northing \n\
     491point1, 5.0, 1.0\n\
     492point2, 0.5, 2.0\n")
     493        file_id.close()
     494
     495        sww2csv_gauges(basename+".sww",
     496                       points_file,
     497                       quantities=['stage', 'elevation'],
     498                       use_cache=False,
     499                       verbose=False)
     500
     501        point1_answers_array = [[0.0,1.0,-5.0], [2.0,10.0,-5.0],[4.0,10.0,-5.0],
     502                                [6.0,20.0,-5.0]]
     503        point1_filename = 'gauge_point1.csv'
     504        point1_handle = file(point1_filename)
     505        point1_reader = reader(point1_handle)
     506        point1_reader.next()
     507
     508        line=[]
     509        for i,row in enumerate(point1_reader):
     510            # note the 'hole' (element 1) below - skip the new 'hours' field
     511            line.append([float(row[0]),float(row[2]),float(row[3])])
     512            #print 'line',line[i],'point1',point1_answers_array[i]
     513            assert num.allclose(line[i], point1_answers_array[i])
     514
     515        point2_answers_array = [[0.0,1.0,-0.5], [2.0,10.0,-0.5],[4.0,10.0,-0.5],
     516                                [6.0,20.0,-0.5]]
     517        point2_filename = 'gauge_point2.csv'
     518        point2_handle = file(point2_filename)
     519        point2_reader = reader(point2_handle)
     520        point2_reader.next()
     521                       
     522        line=[]
     523        for i,row in enumerate(point2_reader):
     524            # note the 'hole' (element 1) below - skip the new 'hours' field
     525            line.append([float(row[0]),float(row[2]),float(row[3])])
     526            #print 'line',line[i],'point2',point2_answers_array[i]
     527            assert num.allclose(line[i], point2_answers_array[i])
     528                         
     529        # clean up
     530        point1_handle.close()
     531        point2_handle.close()
     532        os.remove(points_file)
     533        os.remove(point1_filename)
     534        os.remove(point2_filename)       
     535
     536        #remove second swwfile not removed by tearDown
     537        os.remove(basename+".sww")
    464538
    465539#-------------------------------------------------------------
  • branches/anuga_1_2_1/anuga_core/source/anuga/config.py

    r7872 r8083  
    3434# Major revision number for use with create_distribution
    3535# and update_anuga_user_guide
    36 major_revision = '1.2'
     36anuga_version = '1.2.1'
    3737
    3838################################################################################
     
    201201# Determine if we can read/write large NetCDF files
    202202netcdf_mode_w = 'w'
     203netcdf_mode_wl = 'wl'
    203204netcdf_mode_a = 'a'
     205netcdf_mode_al = 'al'
    204206netcdf_mode_r = 'r'
    205207
  • branches/anuga_1_2_1/anuga_core/source/anuga/damage_modelling/inundation_damage.py

    r7743 r8083  
    4141# Change these if the ouput from nexix changes
    4242SHORE_DIST_LABEL = 'SHORE_DIST'
    43 WALL_TYPE_LABEL = 'WALL_TYPE'
    44 STR_VALUE_LABEL = 'STR_VALUE'
    45 CONT_VALUE_LABEL = 'CONT_VALUE'
     43WALL_TYPE_LABEL = 'NEXIS_WALL_TYPE'
     44STR_VALUE_LABEL = 'NEXIS_STRUCTURAL_VALUE'
     45CONT_VALUE_LABEL = 'NEXIS_CONTENTS_VALUE'
    4646
    4747def inundation_damage(sww_base_name, exposure_files_in,
  • branches/anuga_1_2_1/anuga_core/source/anuga/file/sww.py

    r8069 r8083  
    952952
    953953    domain.geo_reference = geo_reference
    954 
    955     domain.starttime = float(starttime) + float(t)
    956     domain.time = 0.0
    957954
    958955    for quantity in other_quantities:
  • branches/anuga_1_2_1/anuga_core/source/anuga/pmesh/mesh.py

    r7873 r8083  
    737737            segments.append( [lo, hi] )
    738738        region_dict['segments'] = segments
    739         region_dict['segment_tags'] = self._tag_dict2list(segment_tags, N)
     739        region_dict['segment_tags'] = self._tag_dict2list(segment_tags, N,
     740                                                          hole=hole)
    740741       
    741742   
     
    757758        return inner
    758759
    759     def _tag_dict2list(self, tags, number_of_segs):
     760    def _tag_dict2list(self, tags, number_of_segs, hole=False):
    760761        """
    761762        Convert a tag dictionary from this sort of format;
     
    771772        # Due to this default this method is too connected to
    772773        # _add_area_from_polygon
    773         segment_tags = ['']*number_of_segs
     774
     775        if hole:
     776            default_tag ='interior'
     777        else:
     778            default_tag =''
     779        segment_tags = [default_tag]*number_of_segs
    774780        if tags is not None:
    775781            for key in tags:
  • branches/anuga_1_2_1/anuga_core/source/anuga/pmesh/test_mesh.py

    r7873 r8083  
    17571757        self.failUnless(segs[2].tag=='bom',
    17581758                        'FAILED!')
    1759         self.failUnless(segs[3].tag=='',
     1759        self.failUnless(segs[3].tag=='interior',
    17601760                        'FAILED!')
    17611761        verts = m.getUserVertices()
     
    17751775            self.failUnless(point_x == new_point_x, ' failed')
    17761776            self.failUnless(point_y == new_point_y, ' failed')
     1777
     1778
     1779
     1780
     1781    def test_add_hole_from_polygon_none_tag(self):
     1782        x=-500
     1783        y=-1000
     1784        m=Mesh(geo_reference=Geo_reference(56,x,y))
     1785
     1786        # These are the absolute values
     1787        polygon_absolute = [[0,0],[1,0],[1,1],[0,1]]
     1788       
     1789        x_p = -10
     1790        y_p = -40
     1791        geo_ref_poly = Geo_reference(56, x_p, y_p)
     1792        polygon = geo_ref_poly.change_points_geo_ref(polygon_absolute)
     1793       
     1794        poly_point = m.add_hole_from_polygon(polygon,
     1795                                               None,
     1796                                               geo_reference=geo_ref_poly)
     1797        # poly_point values are relative to the mesh geo-ref
     1798        # make them absolute
     1799        #print "poly_point.x+x",poly_point.x+x
     1800        #print "poly_point.y+y",poly_point.y+y
     1801        #print "polygon_absolute", polygon_absolute
     1802        self.failUnless(is_inside_polygon([poly_point.x+x,poly_point.y+y],
     1803                                       polygon_absolute, closed = False),
     1804                        'FAILED!')
     1805               
     1806        self.failUnless(len(m.holes)==1,
     1807                        'FAILED!')
     1808        segs = m.getUserSegments()
     1809        self.failUnless(len(segs)==4,
     1810                        'FAILED!')
     1811        self.failUnless(len(m.userVertices)==4,
     1812                        'FAILED!')
     1813       
     1814        self.failUnless(segs[0].tag=='interior',
     1815                        'FAILED!') 
     1816        self.failUnless(segs[1].tag=='interior',
     1817                        'FAILED!')
     1818         
     1819        self.failUnless(segs[2].tag=='interior',
     1820                        'FAILED!')
     1821        self.failUnless(segs[3].tag=='interior',
     1822                        'FAILED!')
     1823        verts = m.getUserVertices()
     1824        #print "User verts",verts
     1825        #print 'polygon',polygon
     1826        #vert values are relative
     1827        for point,new_point in map(None,polygon,verts):
     1828            point_x = point[0] + geo_ref_poly.get_xllcorner()
     1829            new_point_x = new_point.x + m.geo_reference.get_xllcorner()
     1830            point_y = point[1] + geo_ref_poly.get_yllcorner()
     1831            #print "new_point.y",new_point.y
     1832            #print "m.geo_ref.get_yllcorner()",m.geo_reference.get_yllcorner()
     1833            new_point_y = new_point.y + m.geo_reference.get_yllcorner()
     1834            #print "point_y",point_y
     1835            #print "new_point_y",new_point_y
     1836           
     1837            self.failUnless(point_x == new_point_x, ' failed')
     1838            self.failUnless(point_y == new_point_y, ' failed')           
    17771839
    17781840    def test_add_circle(self):
  • branches/anuga_1_2_1/anuga_core/source/anuga/test_all.py

    r7865 r8083  
    1414import tempfile
    1515import time
    16 import anuga.utilities.system_tools as aust
     16import anuga
    1717from anuga.utilities.terminal_width import terminal_width
    1818
     
    207207    # timestamp at the end
    208208    timestamp = time.asctime()
    209     version = aust.get_revision_number()
     209    version = anuga.config.anuga_version
    210210    print
    211211    print 'Finished at %s, version %s' % (timestamp, version)
  • branches/anuga_1_2_1/anuga_core/source/anuga/utilities/compile.py

    r7872 r8083  
    422422
    423423      if ext == '.c':
    424           for x in ['.dll', '.so']:
    425               try:
    426                   os.remove(root + x)
    427               except:
    428                   pass
    429424
    430425          print separation_line
  • branches/anuga_1_2_1/anuga_core/source/anuga/utilities/file_utils.py

    r7841 r8083  
    343343    if not filename2 is None:
    344344        copy_file_or_sequence(dir_name, filename2)
     345
     346
     347##
     348# @brief A class to catch stdout and stderr and write to files.
     349class Screen_Catcher:
     350    """this simply catches the screen output and stores it to file defined by
     351    start_screen_catcher (above)
     352    """
     353
     354    ##
     355    # @brief Initialize this instance of Screen_Catcher.
     356    # @param filename The path to the file to write to.
     357    def __init__(self, filename):
     358        self.filename = filename
     359        if os.path.exists(self.filename)is True:
     360            log.critical('Old existing file "%s" has been deleted'
     361                         % self.filename)
     362            remove(self.filename)
     363
     364    ##
     365    # @brief Write output to the file.
     366    # @param stuff The string to write.
     367    def write(self, stuff):
     368        fid = open(self.filename, 'a')
     369        fid.write(stuff)
     370        fid.close()
     371
     372       
     373##
     374# @brief Store screen output and errors to a file.
     375# @param dir_name Path to directory for output files (default '.').
     376# @param myid
     377# @param numprocs
     378# @param extra_info
     379# @param verbose True if this function is to be verbose.
     380def start_screen_catcher(dir_name=None, myid='', numprocs='', extra_info='',
     381                         verbose=True):
     382    """
     383    Used to store screen output and errors to file, if run on multiple
     384    processes each processor will have its own output and error file.
     385
     386    extra_info - is used as a string that can identify outputs with another
     387    string eg. '_other'
     388
     389    FIXME: Would be good if you could suppress all the screen output and
     390    only save it to file... however it seems a bit tricky as this capture
     391    techique response to sys.stdout and by this time it is already printed out.
     392    """
     393
     394    import sys
     395
     396    if dir_name == None:
     397        dir_name = getcwd()
     398
     399    if os.access(dir_name, os.W_OK) == 0:
     400        if verbose: log.critical('Making directory %s' % dir_name)
     401        mkdir (dir_name,0777)
     402
     403    if myid != '':
     404        myid = '_' + str(myid)
     405    if numprocs != '':
     406        numprocs = '_' + str(numprocs)
     407    if extra_info != '':
     408        extra_info = '_' + str(extra_info)
     409
     410    screen_output_name = os.path.join(dir_name, "screen_output%s%s%s.txt" %
     411                                        (myid, numprocs, extra_info))
     412    screen_error_name = os.path.join(dir_name, "screen_error%s%s%s.txt" %
     413                                       (myid, numprocs, extra_info))
     414
     415    if verbose: log.critical('Starting ScreenCatcher, all output will be '
     416                             'stored in %s' % screen_output_name)
     417
     418    # used to catch screen output to file
     419    sys.stdout = Screen_Catcher(screen_output_name)
     420    sys.stderr = Screen_Catcher(screen_error_name)
Note: See TracChangeset for help on using the changeset viewer.