Changeset 8083
- Timestamp:
- Nov 24, 2010, 4:55:55 PM (14 years ago)
- 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 3 3 \title{ANUGA Installation Guide} 4 4 5 %\author{Ole Nielsen, Duncan Gray, Jane Sexton}6 7 5 \usepackage{graphicx} 8 6 \usepackage{hyperref} 9 7 10 8 % Please at least include a long-lived email address; 11 9 % the rest is at your discretion. 12 10 \authoraddress{Geoscience Australia \\ 13 Email: \email{ nariman.habili@ga.gov.au}11 Email: \email{anuga@ga.gov.au} 14 12 } 15 13 … … 56 54 \label{sec:requirements} 57 55 58 To run ANUGA you will need a Windows PC (XP or Vista) or a Linux PC with at56 To run ANUGA you will need a Windows PC (XP, Vista or 7) or a Linux PC with at 59 57 least 512MB RAM. As ANUGA is a memory-intensive numerical system, more memory is better than less. 60 58 61 59 The 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 60 is OpenGL compatible. It has been tested with ATI, NVIDIA and Mobile Intel(R) GM45 Express chipsets. 61 62 The instructions below are written for the numpy version of ANUGA. ANUGA changed from 63 relying on the Numeric package to the numpy package early in July, 2009. If you have a Numeric ANUGA, 64 you should refer to the installation instructions for that version. The last Numeric version of 69 65 ANUGA had a build number of 7163. 70 66 … … 76 72 \section{Installation} 77 73 78 Below are the install procedures for Windows XP, Windows Vista (both32 bit) and Linux (32 and 64 bit).79 80 \subsection{Quick install - Windows XP (32 bit)}74 Below 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)} 81 77 \label{sec:winxp} 82 78 … … 90 86 run the test suite (optional) and then run a series of validation examples (optional). This may take some time. 91 87 Try 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}) 93 89 and view the resulting \code{.sww} files with the ANUGA viewer. 94 90 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 as97 %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 tools107 % \item g++ compiler108 % \item MinGW Make109 % \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, go144 % to the directory145 % \linebreak146 % \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 at165 % \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}168 91 169 92 … … 177 100 %details. 178 101 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 aspect184 of using ANUGA under Vista is welcomed.185 186 102 \subsection{Quick install - Linux} 187 103 \label{sec:linux} 188 104 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} 105 Please note that the following applies only to Ubuntu 10.04 and 10.10. We currently do not 106 support any other Linux distributions. 107 108 Open a terminal and enter: 109 \begin{verbatim} 110 sudo add-apt-repository ppa:anuga/ppa 111 sudo apt-get update 112 sudo apt-get install python-anuga 113 \end{verbatim} 114 115 For the Ubuntu version, you do not need to run test_all.py or compile_all.py. They have already been done for you. 116 291 117 292 118 \section{Optional but recommended software} … … 309 135 \section{Testing} 310 136 311 In the ANUGA root directory, run the test suite: 137 If you install ANUGA directly from the SVN repository (not the Windows one-click installer or using apt-get install for Ubuntu), 138 you should run the unit tests to verify that all the tests pass. In the ANUGA root directory, run the test suite: 312 139 \begin{verbatim} 313 140 python test_all.py … … 361 188 environment "System variables". However, in case you do not have 362 189 permission 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.190 for Windows XP is shown here. Setting the variable for Windows Vista and 7 should be similar. 364 191 365 192 \setlength\fboxsep{0pt} -
branches/anuga_1_2_1/anuga_core/documentation/user_manual/anuga_user_manual.tex
r7848 r8083 28 28 29 29 \usepackage{graphicx} 30 \usepackage{hyperref} 30 31 \usepackage[english]{babel} 31 32 \usepackage{datetime} … … 49 50 % the rest is at your discretion. 50 51 \authoraddress{Geoscience Australia \\ 51 Email: \email{ nariman.habili@ga.gov.au}52 Email: \email{anuga@ga.gov.au} 52 53 } 53 54 … … 140 141 inundation software system, describe what it can do and give step-by-step 141 142 instructions for setting up and running hydrodynamic simulations. 142 The stable release of \anuga and this manual are available on sourceforge at i143 The stable release of \anuga and this manual are available on sourceforge at 143 144 \url{http://sourceforge.net/projects/anuga}. A snapshot of work in progress is 144 145 available through the \anuga software repository at 145 \url{http s://datamining.anu.edu.au/svn/ga/anuga_core}146 \url{http://datamining.anu.edu.au/svn/anuga/trunk/anuga_core/source/anuga} 146 147 where the more adventurous reader might like to go. 147 148 148 149 This manual describes \anuga version \version. To check for later versions of this manual 149 go to \url{http s://datamining.anu.edu.au/anuga}.150 go to \url{http://datamining.anu.edu.au/anuga}. 150 151 151 152 \section{Scope} … … 158 159 159 160 The 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}. 161 162 162 163 \section{Audience} … … 165 166 its object oriented approach. 166 167 Python 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}. 171 169 172 170 Readers also need to have a general understanding of scientific modelling, … … 183 181 as riverine flooding, storm surges and tsunami is critical for 184 182 understanding their economic and social impact on our urban 185 communities. 183 communities. Geoscience Australia and the Australian National 186 184 University are developing a hydrodynamic inundation modelling tool 187 185 called \anuga to help simulate the impact of these hazards. … … 5092 5090 338:43--68, 1992. 5093 5091 5094 \bibitem {KurNP2001}5092 \bibitem[KurNP2001]{KurNP2001} 5095 5093 \newblock Semidiscrete central-upwind schemes for hyperbolic conservation laws 5096 5094 and hamilton-jacobi equations. -
branches/anuga_1_2_1/anuga_core/documentation/user_manual/anuga_whats_new.tex
r7867 r8083 1 1 \documentclass{manual} 2 2 \usepackage{hyperref} 3 3 4 4 \title{ANUGA What's New} 5 5 6 \author{ Ole Nielsen}6 \author{Nariman Habili} 7 7 8 8 % Please at least include a long-lived email address; 9 9 % the rest is at your discretion. 10 10 \authoraddress{Geoscience Australia \\ 11 Email: \email{ ole.nielsen@ga.gov.au}11 Email: \email{anuga@ga.gov.au} 12 12 } 13 13 … … 48 48 These lists are not comprehensive and we refer to the TRAC system for a complete audit trail of changes made to ANUGA. 49 49 \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: 53 52 \begin{itemize} 54 53 \item \url{https://datamining.anu.edu.au/anuga/changeset/4669} through to … … 59 58 The release names take the form 60 59 \begin{verbatim} 61 XX-YY_ZZ.EXT60 AA-BB.CC.DD.EXT 62 61 \end{verbatim} 63 62 where 64 63 \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. 66 65 \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. 69 69 \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. 70 70 \end{itemize} … … 79 79 here. Refer to the Subversion 80 80 log (https://datamining.anu.edu.au/anuga/timeline) and closed tickets 81 https://datamining.anu.edu.au/anuga/report/1 7) for all changes in ANUGA.81 https://datamining.anu.edu.au/anuga/report/10) for all changes in ANUGA. 82 82 83 83 \section{Bleeding Edge} … … 86 86 forcing terms. There is also activity in the area of viewers and installers. 87 87 88 \section{Release Name: anuga-1.2 beta, Date: June2010}88 \section{Release Name: anuga-1.2.0, Date: July 2010} 89 89 Breaks code compatibility with older ANUGA versions. Please see the ANUGA wiki for migration instructions. 90 90 Simplified API, with more logical module locations and names. … … 92 92 Support for user-specified breaklines. 93 93 Speed optimisations - fitting is around 25 percent faster. 94 Various bug fixes - see trac. 94 Various bug fixes - see trac. Note the new versioning system. 95 95 96 96 -
branches/anuga_1_2_1/anuga_core/documentation/user_manual/copyright.tex
r7828 r8083 4 4 % This is the ANUGA User Manual 5 5 % 6 % Version 1.2 Ju ne, 20106 % Version 1.2 July, 2010 7 7 % 8 8 % 9 9 % 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. 13 12 % 14 13 % COPYRIGHT PAGE … … 19 18 \vspace*{0.5in} 20 19 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 21 National University 2004-2010. 22 22 23 23 Permission to use, copy, modify, and distribute this software for any … … 29 29 software and in all copies of the supporting documentation for such 30 30 software. 31 This program is distributed in the hope that it will be useful, 31 32 32 This program is distributed in the hope that it will be useful,33 33 but WITHOUT ANY WARRANTY; without even the implied warranty of 34 34 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 72 72 \textbf{Credits}: 73 73 \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. 76 76 \index{ANUGA!credits|textit} 77 77 \end{itemize} … … 85 85 \textbf{Acknowledgments}: 86 86 \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, 88 89 Trevor Dhu, Linda Stals, Matt Hardy, Jack Kelly and Christopher 89 90 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. 91 92 \item The mesh generator engine was written by Jonathan Richard Shewchuk and made freely 92 93 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 41 41 from os.path import expanduser, split, join 42 42 from anuga.utilities.system_tools import get_revision_number, get_pathname_from_package 43 from anuga.config import major_revision43 from anuga.config import anuga_version 44 44 from sys import argv 45 45 … … 47 47 48 48 # Path for ANUGA 49 anugapath = get_pathname_from_package('anuga')49 #anugapath = get_pathname_from_package('anuga') 50 50 51 51 # Strip trailing source/anuga of path 52 basepath = split(split(anugapath)[0])[0]52 #basepath = split(split(anugapath)[0])[0] 53 53 54 54 # Add local path to user_manual 55 docpath = join(join(basepath, 'documentation'), 'user_manual')55 #docpath = join(join(basepath, 'documentation'), 'user_manual') 56 56 texfiles = ['anuga_user_manual', 57 57 'anuga_installation_guide', … … 59 59 'anuga_internal_tools'] 60 60 61 print 'Moving to', docpath62 chdir(docpath) # Move to location of LaTeX files61 #print 'Moving to', docpath 62 #chdir(docpath) # Move to location of LaTeX files 63 63 system('svn update') # Update from svn 64 64 … … 77 77 for line in fid.readlines(): 78 78 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) 84 80 85 81 lines.append(line) … … 115 111 116 112 # Clean-up 117 system('/bin/rm version.tex')113 #system('/bin/rm version.tex') 118 114 system('svn update') # Restore version file 119 115 … … 122 118 print 'User manual compiled' 123 119 124 print ' Major revision:', major_revision120 print 'Anuga version:', anuga_version 125 121 print 'Build:', get_revision_number() 126 122 system('date') -
branches/anuga_1_2_1/anuga_core/documentation/user_manual/version.tex
r7804 r8083 7 7 % release version; this is used to define the 8 8 % \version macro 9 \release{1.2 beta\_6051}9 \release{1.2.1} -
branches/anuga_1_2_1/anuga_core/source/anuga/LICENSE.txt
r7462 r8083 4 4 5 5 6 Copyright 2004 , 2005, 2006, 2007, 2008, 2009Australian National University and Geoscience Australia. All rights reserved.6 Copyright 2004-2010 Australian National University and Geoscience Australia. All rights reserved. 7 7 8 8 -
branches/anuga_1_2_1/anuga_core/source/anuga/README.txt
r5859 r8083 1 This is the root-Subversion directory for the ANUGA Inundation2 Software Development project conducted by3 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 13 1 This is the top directory for the inundation project source code 14 developed at the Risk Assessment Methods Projectat Geoscience15 Australia and Mathematical Sciences Institute at the Australian2 developed at the Risk and Impact Analysis Group at Geoscience 3 Australia and the Mathematical Sciences Institute at the Australian 16 4 National University. 17 5 18 6 19 Copyright 2004 , 2005, 200620 Ole Nielsen, Stephen Roberts, Duncan Gray, Jane Sexton 7 Copyright 2004-2010 8 Geoscience Australia, Australian National University 21 9 22 10 23 11 PREREQUISITES 24 12 25 python 2. 3 or later26 python-num eric27 python-dev (Interestingly, numeric seems to be installed as well)13 python 2.5 or 2.6 14 python-numpy 15 python-dev 28 16 python-scientific (or maybe only python-netcdf) 29 17 (Remember to put netcdf.dll somewhere so the PATH - e.g. in C:\bin) … … 42 30 In directory anuga: 43 31 44 python test_all.py32 python compile_all.py 45 33 46 34 … … 48 36 49 37 50 PATH=C:\Python2 4;C:\MinGW\bin;C:\Program Files\anuga_viewer38 PATH=C:\Python25;C:\MinGW\bin;C:\Program Files\anuga_viewer 51 39 52 40 It is assumed that the root directory for all anugu modules is on the pythonpath, e.g. 53 PYTHONPATH= V:\home\onielsen\anuga_core\source41 PYTHONPATH=C:\modelling\ 54 42 Alternatively this directory should be copied to the python site_packages directory 55 43 -
branches/anuga_1_2_1/anuga_core/source/anuga/__init__.py
r7874 r8083 43 43 from anuga.file.ungenerate import load_ungenerate 44 44 45 from anuga.geometry.polygon import read_polygon, plot_polygons, polygon_area 45 from anuga.geometry.polygon import read_polygon, plot_polygons, polygon_area, number_mesh_triangles 46 46 from anuga.geometry.polygon_function import Polygon_function 47 47 … … 53 53 from anuga.utilities.sww_merge import sww_merge 54 54 from anuga.utilities.file_utils import copy_code_files 55 from anuga.utilities.file_utils import start_screen_catcher 55 56 56 57 from anuga.geometry.polygon import read_polygon 57 58 from anuga.caching import cache 59 from anuga.coordinate_transforms.geo_reference import Geo_reference, write_NetCDF_georeference 58 60 59 61 #----------------------------- … … 314 316 315 317 316 317 318 318 #--------------------------- 319 # User access functions 320 #--------------------------- 321 from anuga.utilities.system_tools import get_user_name, get_host_name 322 from 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 370 370 y = num.reshape(y, (len(y), 1)) 371 371 vertex_coordinates = num.concatenate((x, y), axis=1) #m x 2 array 372 372 373 373 if boundary_polygon is not None: 374 374 # 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 223 223 quake_offset_time = None 224 224 225 is_opened = [False]*len(points_array) 225 226 for sww_file in sww_files: 226 227 sww_file = join(dir_name, sww_file+'.sww') … … 235 236 quake_offset_time = callable_sww.starttime 236 237 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) 256 260 ## 257 261 # @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 251 251 252 252 # Model time 253 self.time = 0.0254 253 self.finaltime = None 255 254 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 635 635 assert abs((area - ref)/area) < epsilon, msg 636 636 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 637 641 # Check that points are arranged in counter clock-wise order 638 642 v0 = [x1-x0, y1-y0] … … 884 888 return i 885 889 886 return 890 msg = 'Point %s not found within a triangle' %str(point) 891 raise Exception, msg 892 887 893 888 894 -
branches/anuga_1_2_1/anuga_core/source/anuga/abstract_2d_finite_volumes/test_gauge.py
r8069 r8083 460 460 os.remove(points_file) 461 461 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\ 491 point1, 5.0, 1.0\n\ 492 point2, 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") 464 538 465 539 #------------------------------------------------------------- -
branches/anuga_1_2_1/anuga_core/source/anuga/config.py
r7872 r8083 34 34 # Major revision number for use with create_distribution 35 35 # and update_anuga_user_guide 36 major_revision = '1.2'36 anuga_version = '1.2.1' 37 37 38 38 ################################################################################ … … 201 201 # Determine if we can read/write large NetCDF files 202 202 netcdf_mode_w = 'w' 203 netcdf_mode_wl = 'wl' 203 204 netcdf_mode_a = 'a' 205 netcdf_mode_al = 'al' 204 206 netcdf_mode_r = 'r' 205 207 -
branches/anuga_1_2_1/anuga_core/source/anuga/damage_modelling/inundation_damage.py
r7743 r8083 41 41 # Change these if the ouput from nexix changes 42 42 SHORE_DIST_LABEL = 'SHORE_DIST' 43 WALL_TYPE_LABEL = ' WALL_TYPE'44 STR_VALUE_LABEL = ' STR_VALUE'45 CONT_VALUE_LABEL = ' CONT_VALUE'43 WALL_TYPE_LABEL = 'NEXIS_WALL_TYPE' 44 STR_VALUE_LABEL = 'NEXIS_STRUCTURAL_VALUE' 45 CONT_VALUE_LABEL = 'NEXIS_CONTENTS_VALUE' 46 46 47 47 def inundation_damage(sww_base_name, exposure_files_in, -
branches/anuga_1_2_1/anuga_core/source/anuga/file/sww.py
r8069 r8083 952 952 953 953 domain.geo_reference = geo_reference 954 955 domain.starttime = float(starttime) + float(t)956 domain.time = 0.0957 954 958 955 for quantity in other_quantities: -
branches/anuga_1_2_1/anuga_core/source/anuga/pmesh/mesh.py
r7873 r8083 737 737 segments.append( [lo, hi] ) 738 738 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) 740 741 741 742 … … 757 758 return inner 758 759 759 def _tag_dict2list(self, tags, number_of_segs ):760 def _tag_dict2list(self, tags, number_of_segs, hole=False): 760 761 """ 761 762 Convert a tag dictionary from this sort of format; … … 771 772 # Due to this default this method is too connected to 772 773 # _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 774 780 if tags is not None: 775 781 for key in tags: -
branches/anuga_1_2_1/anuga_core/source/anuga/pmesh/test_mesh.py
r7873 r8083 1757 1757 self.failUnless(segs[2].tag=='bom', 1758 1758 'FAILED!') 1759 self.failUnless(segs[3].tag==' ',1759 self.failUnless(segs[3].tag=='interior', 1760 1760 'FAILED!') 1761 1761 verts = m.getUserVertices() … … 1775 1775 self.failUnless(point_x == new_point_x, ' failed') 1776 1776 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') 1777 1839 1778 1840 def test_add_circle(self): -
branches/anuga_1_2_1/anuga_core/source/anuga/test_all.py
r7865 r8083 14 14 import tempfile 15 15 import time 16 import anuga .utilities.system_tools as aust16 import anuga 17 17 from anuga.utilities.terminal_width import terminal_width 18 18 … … 207 207 # timestamp at the end 208 208 timestamp = time.asctime() 209 version = a ust.get_revision_number()209 version = anuga.config.anuga_version 210 210 print 211 211 print 'Finished at %s, version %s' % (timestamp, version) -
branches/anuga_1_2_1/anuga_core/source/anuga/utilities/compile.py
r7872 r8083 422 422 423 423 if ext == '.c': 424 for x in ['.dll', '.so']:425 try:426 os.remove(root + x)427 except:428 pass429 424 430 425 print separation_line -
branches/anuga_1_2_1/anuga_core/source/anuga/utilities/file_utils.py
r7841 r8083 343 343 if not filename2 is None: 344 344 copy_file_or_sequence(dir_name, filename2) 345 346 347 ## 348 # @brief A class to catch stdout and stderr and write to files. 349 class 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. 380 def 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.