| 1 | ============ |
|---|
| 2 | Installation |
|---|
| 3 | ============ |
|---|
| 4 | |
|---|
| 5 | .. contents:: |
|---|
| 6 | :local: |
|---|
| 7 | :depth: 2 |
|---|
| 8 | |
|---|
| 9 | .. raw:: latex |
|---|
| 10 | |
|---|
| 11 | \minitoc[e] |
|---|
| 12 | |
|---|
| 13 | The |FiPy| finite volume PDE solver relies on several third-party packages. |
|---|
| 14 | It is *best to obtain and install those first*, before attempting to install |
|---|
| 15 | |FiPy|. |
|---|
| 16 | |
|---|
| 17 | |outsideLinks| |
|---|
| 18 | |
|---|
| 19 | .. note:: |
|---|
| 20 | |
|---|
| 21 | Most of the installation steps will involve a variant on the command:: |
|---|
| 22 | |
|---|
| 23 | $ python setup.py ... |
|---|
| 24 | |
|---|
| 25 | In addition to the specific commands given here, further information |
|---|
| 26 | about each ``setup.py`` script is available by typing:: |
|---|
| 27 | |
|---|
| 28 | $ python setup.py --help |
|---|
| 29 | |
|---|
| 30 | For each package, please follow any instructions given in its `README` or |
|---|
| 31 | `INSTALLATION` files. |
|---|
| 32 | |
|---|
| 33 | ---------- |
|---|
| 34 | Privileges |
|---|
| 35 | ---------- |
|---|
| 36 | |
|---|
| 37 | If you do not have administrative privileges on your computer, or if for |
|---|
| 38 | any reason you don't want to tamper with your existing Python_ |
|---|
| 39 | installation, most packages (including |FiPy|) will allow you to install to |
|---|
| 40 | an alternate location. Instead of installing these packages with |
|---|
| 41 | ``python setup.py install``, |
|---|
| 42 | you would use |
|---|
| 43 | ``python setup.py install --home=<dir>``, |
|---|
| 44 | where ``<dir>`` is the desired installation directory (usually "``~``" to |
|---|
| 45 | indicate your home directory). You will then need to append |
|---|
| 46 | ``<dir>/lib/python`` to your ``PYTHONPATH`` environment variable. See the |
|---|
| 47 | `Alternate Installation`_ section of the Python_ document "`Installing |
|---|
| 48 | Python Modules`_" |citeInstallingPythonModules| for more information, such |
|---|
| 49 | as circumstances in which you should use ``--prefix`` instead of |
|---|
| 50 | ``--home``. |
|---|
| 51 | |
|---|
| 52 | .. _Alternate Installation: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://docs.python.org/inst/alt-install-windows.html |
|---|
| 53 | |
|---|
| 54 | .. _Installing Python Modules: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://docs.python.org/inst/ |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | ------------- |
|---|
| 58 | Prerequisites |
|---|
| 59 | ------------- |
|---|
| 60 | |
|---|
| 61 | Operating System |
|---|
| 62 | ================ |
|---|
| 63 | |
|---|
| 64 | |FiPy| has been developed and tested on the following operating |
|---|
| 65 | systems, `Mac OS X`_ 10.3 "Panther" & 10.4 "Tiger", `Debian Linux`_ |
|---|
| 66 | 3.1 "Sarge", `Windows XP`_ and `Windows 2000`_. We welcome reports of |
|---|
| 67 | compatibility with other systems, along with any steps necessary to |
|---|
| 68 | install. |
|---|
| 69 | |
|---|
| 70 | .. note:: |
|---|
| 71 | |
|---|
| 72 | Simple instructions for `Mac OS X`_ users are in |MACOSX-INSTALLATION-txt|. |
|---|
| 73 | Simple instructions for Windows_ users are in |WINDOWS-INSTALLATION-txt|. |
|---|
| 74 | |
|---|
| 75 | The only elements of |FiPy| that are likely to be platform-dependent |
|---|
| 76 | are the viewers, but at least one viewer should work on each platform. |
|---|
| 77 | All other aspects should function on any platform that has a recent |
|---|
| 78 | Python_ installation. |
|---|
| 79 | |
|---|
| 80 | Many of the packages listed below have prebuilt installers for different |
|---|
| 81 | platforms (particularly for Windows). These installers can save considerable |
|---|
| 82 | time and effort compared to configuring and building from source, although |
|---|
| 83 | they frequently comprise somewhat older versions of the respective code. |
|---|
| 84 | Whether building from source or using a prebuilt installer, please read and |
|---|
| 85 | follow explicitly any instructions given in the respective packages' |
|---|
| 86 | ``README`` and ``INSTALLATION`` files. |
|---|
| 87 | |
|---|
| 88 | .. _Mac OS X: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.apple.com/macosx/ |
|---|
| 89 | .. _Debian Linux: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.debian.org/ |
|---|
| 90 | .. _Windows: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.microsoft.com/windows/ |
|---|
| 91 | .. _Windows XP: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.microsoft.com/windowsxp/ |
|---|
| 92 | .. _Windows 2000: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.microsoft.com/windows2000/ |
|---|
| 93 | |
|---|
| 94 | .. |latexWINDOWSINSTALL| raw:: latex |
|---|
| 95 | |
|---|
| 96 | Section~\ref{sec:WindowsInstallation} ``\titleref{sec:WindowsInstallation}'' |
|---|
| 97 | |
|---|
| 98 | .. |htmlWINDOWSINSTALL| raw:: html |
|---|
| 99 | |
|---|
| 100 | the <a href="windows-installation.html">Windows Installation Guide</a> |
|---|
| 101 | |
|---|
| 102 | .. |WINDOWS-INSTALLATION-txt| replace:: |htmlWINDOWSINSTALL| |latexWINDOWSINSTALL| |
|---|
| 103 | |
|---|
| 104 | .. |latexMACOSXINSTALL| raw:: latex |
|---|
| 105 | |
|---|
| 106 | Section~\ref{sec:MacOSXInstallation} ``\titleref{sec:MacOSXInstallation}'' |
|---|
| 107 | |
|---|
| 108 | .. |htmlMACOSXINSTALL| raw:: html |
|---|
| 109 | |
|---|
| 110 | the <a href="macosx-installation.html">Mac OS X Installation Guide</a> |
|---|
| 111 | |
|---|
| 112 | |
|---|
| 113 | .. |MACOSX-INSTALLATION-txt| replace:: |htmlMACOSXINSTALL| |latexMACOSXINSTALL| |
|---|
| 114 | |
|---|
| 115 | Required Packages |
|---|
| 116 | ================= |
|---|
| 117 | |
|---|
| 118 | .. warning:: |
|---|
| 119 | |
|---|
| 120 | |FiPy| will not run if the following items are not installed. |
|---|
| 121 | |
|---|
| 122 | Python |
|---|
| 123 | ------ |
|---|
| 124 | |
|---|
| 125 | .. raw:: latex |
|---|
| 126 | |
|---|
| 127 | \IndexSoftware{Python} |
|---|
| 128 | |
|---|
| 129 | http://www.python.org/ |
|---|
| 130 | |
|---|
| 131 | |FiPy| is written in the Python_ language and requires a Python_ |
|---|
| 132 | installation to run. Python_ comes pre-installed on many operating |
|---|
| 133 | systems, which you can check by opening a terminal and typing |
|---|
| 134 | ``python``, *e.g.*:: |
|---|
| 135 | |
|---|
| 136 | $ python |
|---|
| 137 | Python 2.3 (#1, Sep 13 2003, 00:49:11) |
|---|
| 138 | ... |
|---|
| 139 | Type "help", "copyright", "credits" or "license" for more information. |
|---|
| 140 | >>> |
|---|
| 141 | |
|---|
| 142 | If necessary, you can download_ and install it for your platform |
|---|
| 143 | |citePythonDownload|. |
|---|
| 144 | |
|---|
| 145 | .. note:: |
|---|
| 146 | |
|---|
| 147 | |FiPy| requires at least version 2.3 of Python_ and has not yet |
|---|
| 148 | been tested with version 2.5. |
|---|
| 149 | |
|---|
| 150 | .. _Python: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.python.org/ |
|---|
| 151 | .. _download: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.python.org/download/ |
|---|
| 152 | .. |citePythonDownload| raw:: latex |
|---|
| 153 | |
|---|
| 154 | \cite{PythonDownload} |
|---|
| 155 | |
|---|
| 156 | NumPy |
|---|
| 157 | ----- |
|---|
| 158 | |
|---|
| 159 | .. raw:: latex |
|---|
| 160 | |
|---|
| 161 | \IndexSoftware{NumPy} |
|---|
| 162 | |
|---|
| 163 | http://sourceforge.net/projects/numpy/ |
|---|
| 164 | |
|---|
| 165 | Obtain and install the NumPy_ package. |FiPy| requires at least |
|---|
| 166 | version 1.0 of NumPy_. |
|---|
| 167 | |
|---|
| 168 | .. attention:: |
|---|
| 169 | |
|---|
| 170 | |FiPy| no longer uses the older Numeric_ or numarray_ packages. |
|---|
| 171 | |
|---|
| 172 | .. raw:: latex |
|---|
| 173 | |
|---|
| 174 | \IndexSoftware{numarray} |
|---|
| 175 | \IndexSoftware{Numeric} |
|---|
| 176 | |
|---|
| 177 | .. _Numeric: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=1351 |
|---|
| 178 | .. _numarray: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.stsci.edu/resources/software_hardware/numarray |
|---|
| 179 | .. _NumPy: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.scipy.org/NumPy |
|---|
| 180 | |
|---|
| 181 | PySparse |
|---|
| 182 | -------- |
|---|
| 183 | |
|---|
| 184 | .. raw:: latex |
|---|
| 185 | |
|---|
| 186 | \IndexSoftware{PySparse} |
|---|
| 187 | |
|---|
| 188 | http://pysparse.sourceforge.net |
|---|
| 189 | |
|---|
| 190 | |FiPy| requires `Roman Geus`_' PySparse_ package. |
|---|
| 191 | |
|---|
| 192 | You can `download the PySparse archive`_ or check it out via |
|---|
| 193 | anonymous CVS download:: |
|---|
| 194 | |
|---|
| 195 | $ cvs -d:pserver:anonymous@pysparse.cvs.sourceforge.net:/cvsroot/pysparse login |
|---|
| 196 | |
|---|
| 197 | and press enter at the password prompt, then:: |
|---|
| 198 | |
|---|
| 199 | $ cvs -z3 -d:pserver:anonymous@pysparse.cvs.sourceforge.net:/cvsroot/pysparse \ |
|---|
| 200 | > checkout pysparse |
|---|
| 201 | |
|---|
| 202 | From within the ``pysparse`` base directory, follow its included |
|---|
| 203 | instructions for building PySparse_ for your platform. `PySparse Windows |
|---|
| 204 | installers`_ are available. |
|---|
| 205 | |
|---|
| 206 | .. note:: |
|---|
| 207 | |
|---|
| 208 | Windows users who choose to build from source should pay particular |
|---|
| 209 | attention to the instructions in the INSTALL file in the base PySparse_ |
|---|
| 210 | directory. |
|---|
| 211 | |
|---|
| 212 | .. warning:: |
|---|
| 213 | |
|---|
| 214 | If pysparse is installed in a local directory a further path may |
|---|
| 215 | have to be added to the PYTHONPATH environment variable. For |
|---|
| 216 | example, if |
|---|
| 217 | |
|---|
| 218 | $ python setup.py install --home=/some/directory/some/where |
|---|
| 219 | |
|---|
| 220 | then both /some/directory/some/where and |
|---|
| 221 | /some/directory/some/where/lib/python are required to be added to |
|---|
| 222 | the PYTHONPATH. e.g. |
|---|
| 223 | |
|---|
| 224 | $ set PYTHONPATH=/some/directory/some/where:/some/directory/some/where/lib/python |
|---|
| 225 | |
|---|
| 226 | .. warning:: |
|---|
| 227 | |
|---|
| 228 | |FiPy| requires version 1.0 or higher of PySparse_. |
|---|
| 229 | |
|---|
| 230 | .. _Roman Geus: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://people.web.psi.ch/geus/ |
|---|
| 231 | .. _PySparse: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://pysparse.sourceforge.net |
|---|
| 232 | .. _download the PySparse archive: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://sourceforge.net/project/showfiles.php?group_id=101403 |
|---|
| 233 | .. _PySparse Windows installers: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://sourceforge.net/project/showfiles.php?group_id=101403 |
|---|
| 234 | |
|---|
| 235 | Viewers |
|---|
| 236 | ======= |
|---|
| 237 | |
|---|
| 238 | |FiPy| will work perfectly well without them, but at least one of the |
|---|
| 239 | following packages will be required to view the results of |FiPy| |
|---|
| 240 | calculations. |FiPy| will select the first viewer that is available |
|---|
| 241 | from the list below. If more than one is installed, specify a viewer |
|---|
| 242 | by setting the ``FIPY_VIEWER`` environment variable to either |
|---|
| 243 | "``gist``", "``gnuplot``" or "``matplotlib``". |
|---|
| 244 | |
|---|
| 245 | Matplotlib |
|---|
| 246 | ---------- |
|---|
| 247 | |
|---|
| 248 | .. raw:: latex |
|---|
| 249 | |
|---|
| 250 | \IndexSoftware{Matplotlib} |
|---|
| 251 | |
|---|
| 252 | http://matplotlib.sourceforge.net |
|---|
| 253 | |
|---|
| 254 | Matplotlib_ is a Python_ package that displays publication quality |
|---|
| 255 | results. It displays both 1D X-Y type plots and 2D contour plots for |
|---|
| 256 | structured data. It does not display unstructured 2D data or 3D data. |
|---|
| 257 | It works on all common platforms and produces publication quality hard |
|---|
| 258 | copies. Version 0.72.1 or higher is required. `Matplotlib installers |
|---|
| 259 | for specific platforms`_ are available |citeMatplotlibDownload|. |
|---|
| 260 | |
|---|
| 261 | .. note:: |
|---|
| 262 | |
|---|
| 263 | Matplotlib_ is noticeably slower than Pygist_ or Gnuplot.py_, but |
|---|
| 264 | has superior image rendering and plotting functionality. |
|---|
| 265 | |
|---|
| 266 | .. _Matplotlib: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://matplotlib.sourceforge.net |
|---|
| 267 | .. _Matplotlib installers for specific platforms: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474 |
|---|
| 268 | .. |citeMatplotlibDownload| raw:: latex |
|---|
| 269 | |
|---|
| 270 | \cite{MatplotlibDownload} |
|---|
| 271 | |
|---|
| 272 | Gnuplot-py |
|---|
| 273 | ---------- |
|---|
| 274 | |
|---|
| 275 | http://gnuplot-py.sourceforge.net |
|---|
| 276 | |
|---|
| 277 | Gnuplot.py_ is a Python_ package that interfaces to gnuplot_, the |
|---|
| 278 | popular open-source plotting program. It displays both 1D X-Y type |
|---|
| 279 | plots and 2D contour plots for structured data but not for |
|---|
| 280 | unstructured data or 3D data. It works on all common platforms and |
|---|
| 281 | produces hard copies, however, it sometimes breaks on Windows. As a |
|---|
| 282 | general remark, the viewing quality using either Pygist_ or |
|---|
| 283 | Matplotlib_ is preferable. |
|---|
| 284 | |
|---|
| 285 | .. _Gnuplot: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://gnuplot.sorceforge.net/ |
|---|
| 286 | .. _Gnuplot.py: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://gnuplot-py.sourceforge.net |
|---|
| 287 | |
|---|
| 288 | Pygist |
|---|
| 289 | ------ |
|---|
| 290 | |
|---|
| 291 | .. raw:: latex |
|---|
| 292 | |
|---|
| 293 | \IndexSoftware{Pygist} |
|---|
| 294 | \IndexSoftware{gist} |
|---|
| 295 | |
|---|
| 296 | http://hifweb.lbl.gov/public/software/gist/ |
|---|
| 297 | |
|---|
| 298 | The Pygist_ package can be used to display simulation results. It |
|---|
| 299 | displays both 1D X-Y type plots and 2D contour plots for both |
|---|
| 300 | structured and unstructured data. It does not display 3D |
|---|
| 301 | data. Although stated as working on Windows, it does not seem to do a |
|---|
| 302 | good job of rendering on this platform. Pygist_ works fine on other |
|---|
| 303 | common platforms. Pygist_ no longer seems to be under development, but |
|---|
| 304 | is still recommended as a fast light weight alternative to |
|---|
| 305 | Matplotlib_. |
|---|
| 306 | |
|---|
| 307 | .. attention:: |
|---|
| 308 | |
|---|
| 309 | Pygist requires the old Numeric module to be installed. |
|---|
| 310 | |
|---|
| 311 | .. warning:: |
|---|
| 312 | |
|---|
| 313 | The facility to produce hard copies in Pygist_ does not work very well and |
|---|
| 314 | may crash the |FiPy| run. "``.eps``" and "``.cgm``" export seem to work. |
|---|
| 315 | |
|---|
| 316 | .. note:: |
|---|
| 317 | |
|---|
| 318 | If you experience difficulty building the native Pygist_ viewer on |
|---|
| 319 | `Mac OS X`_, you may wish to build the package with the ``--x11`` |
|---|
| 320 | option described in its documentation. |
|---|
| 321 | |
|---|
| 322 | .. note:: |
|---|
| 323 | |
|---|
| 324 | Pygist_ can have problems finding color pallets, such as "``heat.gp``" and |
|---|
| 325 | "``work.gs``", when installed locally. You may need to set the |
|---|
| 326 | ``GISTPATH`` environment variable to point to the directory containing |
|---|
| 327 | these files (you may find it as "``g/``" within the directory you |
|---|
| 328 | specified for ``--home``). |
|---|
| 329 | |
|---|
| 330 | .. _Pygist: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://hifweb.lbl.gov/public/software/gist/ |
|---|
| 331 | |
|---|
| 332 | MayaVi |
|---|
| 333 | ------ |
|---|
| 334 | |
|---|
| 335 | .. raw:: latex |
|---|
| 336 | |
|---|
| 337 | \IndexSoftware{MayaVi} |
|---|
| 338 | |
|---|
| 339 | http://mayavi.sourceforge.net |
|---|
| 340 | |
|---|
| 341 | The `MayaVi 1`_ Data Visualizer is a free, easy to use scientific data |
|---|
| 342 | visualizer. It displays 1D, 2D and 3D data. It is the only |FiPy| |
|---|
| 343 | viewer available for 3D data. Other viewers are probably better for 1D |
|---|
| 344 | or 2D viewing. |
|---|
| 345 | |
|---|
| 346 | .. warning:: |
|---|
| 347 | |
|---|
| 348 | |FiPy| can only use `MayaVi 1`_ to display 3D meshes consisting entirely |
|---|
| 349 | of tetrahedrons or wedge elements. The ordering of vertices for other |
|---|
| 350 | mesh types may not work. |
|---|
| 351 | |
|---|
| 352 | .. note:: |
|---|
| 353 | |
|---|
| 354 | Is is also necessary to install the PyVTK_ package to use the |
|---|
| 355 | |FiPy| MayaVi_ viewers. |
|---|
| 356 | |
|---|
| 357 | .. note:: |
|---|
| 358 | |
|---|
| 359 | `MayaVi 1`_ is outdated and we hope to have compatilibiltiy with |
|---|
| 360 | `MayaVi 2`_ as soon as possible. |
|---|
| 361 | |
|---|
| 362 | .. _MayaVi 1: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://mayavi.sourceforge.net |
|---|
| 363 | .. _MayaVi 2: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://code.enthought.com/projects/mayavi |
|---|
| 364 | .. _PyVTK: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://cens.ioc.ee/projects/pyvtk/ |
|---|
| 365 | |
|---|
| 366 | Optional Packages |
|---|
| 367 | ==================== |
|---|
| 368 | |
|---|
| 369 | .. note:: |
|---|
| 370 | |
|---|
| 371 | The following packages are not required to run |FiPy|, but they can be helpful. |
|---|
| 372 | |
|---|
| 373 | SciPy |
|---|
| 374 | ----- |
|---|
| 375 | |
|---|
| 376 | .. raw:: latex |
|---|
| 377 | |
|---|
| 378 | \IndexSoftware{SciPy} |
|---|
| 379 | |
|---|
| 380 | http://www.scipy.org/ |
|---|
| 381 | |
|---|
| 382 | Significantly improved performance has been achieved with the |
|---|
| 383 | judicious use of C language inlining, via the weave_ module of the |
|---|
| 384 | SciPy_ package. `SciPy download instructions`_ |
|---|
| 385 | |citeSciPyDownload| are available. We recommend version 0.5.2 or greater. |
|---|
| 386 | |
|---|
| 387 | .. note:: |
|---|
| 388 | |
|---|
| 389 | A handful of test cases use functions from the SciPy_ library and will |
|---|
| 390 | throw errors if it is missing. |
|---|
| 391 | |
|---|
| 392 | .. _weave: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.scipy.org/documentation/weave/ |
|---|
| 393 | .. _SciPy: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.scipy.org/ |
|---|
| 394 | .. _SciPy download instructions: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.scipy.org/Download |
|---|
| 395 | .. |citeSciPyDownload| raw:: latex |
|---|
| 396 | |
|---|
| 397 | \cite{SciPyDownload} |
|---|
| 398 | |
|---|
| 399 | gmsh |
|---|
| 400 | ---- |
|---|
| 401 | |
|---|
| 402 | .. raw:: latex |
|---|
| 403 | |
|---|
| 404 | \IndexSoftware{gmsh} |
|---|
| 405 | |
|---|
| 406 | http://www.geuz.org/gmsh/ |
|---|
| 407 | |
|---|
| 408 | It is possible to create irregular meshes with this package. |
|---|
| 409 | |
|---|
| 410 | .. note:: |
|---|
| 411 | |
|---|
| 412 | The `Mac OS X`_ distribution of gmsh provides a nice graphical tool, but |
|---|
| 413 | is structured a bit differently than on other platforms. To access the |
|---|
| 414 | underlying shell tool, create a shell alias called ``gmsh`` that |
|---|
| 415 | corresponds to ``<Gmsh path>/Gmsh.app/Contents/MacOS/Gmsh``. |
|---|
| 416 | |
|---|
| 417 | Trilinos |
|---|
| 418 | -------- |
|---|
| 419 | |
|---|
| 420 | .. raw:: latex |
|---|
| 421 | |
|---|
| 422 | \IndexSoftware{Trilinos} |
|---|
| 423 | |
|---|
| 424 | http://trilinos.sandia.gov |
|---|
| 425 | |
|---|
| 426 | Trilinos_ provides solvers and preconditioners, and can be used instead of |
|---|
| 427 | PySparse_. Trilinos_ preconditioning allows for iterative solutions to some |
|---|
| 428 | difficult problems that PySparse_ cannot solve. |FiPy| can only work with |
|---|
| 429 | Trilinos_ version 7.0.9 or higher. |
|---|
| 430 | |
|---|
| 431 | .. attention:: |
|---|
| 432 | |
|---|
| 433 | Trilinos_ is a large software suite with its own set of prerequisites, and |
|---|
| 434 | can be difficult to set up. It is not necessary for most problems, and is |
|---|
| 435 | NOT recommended in a basic install of |FiPy|. |
|---|
| 436 | |
|---|
| 437 | |
|---|
| 438 | For use with |FiPy|, Trilinos_ must be configured with the following packages |
|---|
| 439 | enabled: Epetra, EpetraExt, AztecOO, PyTrilinos, ML, Ifpack, Amesos. It may |
|---|
| 440 | also be necessary to enable Galeri for Trilinos_ to compile properly. |
|---|
| 441 | |
|---|
| 442 | .. attention:: |
|---|
| 443 | |
|---|
| 444 | As of Trilinos_ 7.0.9, Trilinos_ can be set up by creating a build |
|---|
| 445 | directory in the base directory of the Trilinos_ source tree:: |
|---|
| 446 | |
|---|
| 447 | cd trilinos-7.0.9/ ; mkdir BUILD_DIR ; cd BUILD_DIR |
|---|
| 448 | |
|---|
| 449 | and then running:: |
|---|
| 450 | |
|---|
| 451 | ../configure --enable-epetra --enable-epetraext --enable-aztecoo \ |
|---|
| 452 | --enable-pytrilinos --enable-ml --enable-ifpack --enable-amesos \ |
|---|
| 453 | --enable-galeri |
|---|
| 454 | |
|---|
| 455 | before running ``make`` and ``make install``. |
|---|
| 456 | |
|---|
| 457 | Depending on your platform, other options may be helpful or necessary; |
|---|
| 458 | see ``../configure --help``, the Trilinos_ user guide available from |
|---|
| 459 | http://trilinos.sandia.gov/documentation.html, or |
|---|
| 460 | http://trilinos.sandia.gov/packages/pytrilinos/faq.html for more in-depth |
|---|
| 461 | documentation. |
|---|
| 462 | |
|---|
| 463 | .. note:: |
|---|
| 464 | |
|---|
| 465 | Trilinos_ documentation suggests, on 32-bit PC platforms with the GCC |
|---|
| 466 | compilers, configuring with ``CXXFLAGS="-O3" CFLAGS="-O3" FFLAGS="-O5 |
|---|
| 467 | -funroll-all-loops -malign-double"`` for best performance. This gives |
|---|
| 468 | significant benefits. Use of aggressive optimization settings on other |
|---|
| 469 | platforms is also recommended. |
|---|
| 470 | |
|---|
| 471 | .. note:: |
|---|
| 472 | |
|---|
| 473 | If Trilinos_ is installed in a nonstandard location, the path to the |
|---|
| 474 | PyTrilinos site-packages directory should be added to the ``PYTHONPATH`` |
|---|
| 475 | environment variable; this should be of the form |
|---|
| 476 | ``$INSTALL_DIR/lib/$PYTHON_VERSION/site-packages/``. Also, the path to |
|---|
| 477 | the Trilinos_ lib directory should be added to the ``LD_LIBRARY_PATH`` (on |
|---|
| 478 | Linux) or ``DYLD_LIBRARY_PATH`` (on Mac OS X) environment variable; this |
|---|
| 479 | should be of the form ``$INSTALL_DIR/lib``. |
|---|
| 480 | |
|---|
| 481 | |
|---|
| 482 | Trilinos_ solvers can be replace PySparse_ solvers. If both PySparse_ and |
|---|
| 483 | Trilinos_ are present, which one is used can be controlled by setting the |
|---|
| 484 | ``FIPY_SOLVERS`` environment variable to ``Trilinos`` or ``Pysparse``, or by |
|---|
| 485 | passing a ``--Trilinos`` or ``--Pysparse`` flag to the |FiPy| script, |
|---|
| 486 | overriding the environment. In the absence of these indicators, |FiPy| will |
|---|
| 487 | default to using PySparse_ if it is present. |
|---|
| 488 | |
|---|
| 489 | .. warning:: |
|---|
| 490 | |
|---|
| 491 | Trilinos_ solvers frequently give intermediate output that |FiPy| cannot |
|---|
| 492 | suppress. The most commonly encountered messages are: |
|---|
| 493 | |
|---|
| 494 | "``Gen_Prolongator warning : Max eigen <= 0.0``", which is not |
|---|
| 495 | significant to |FiPy|; |
|---|
| 496 | |
|---|
| 497 | "``Aztec status AZ_loss: loss of precision``", which indicates that there |
|---|
| 498 | was some difficulty in solving the problem to the requested tolerance due |
|---|
| 499 | to precision limitations, but usually does not prevent the solver from |
|---|
| 500 | finding an adequate solution; |
|---|
| 501 | |
|---|
| 502 | "``Aztec status AZ_ill_cond: GMRES hessenberg ill-conditioned``", which |
|---|
| 503 | indicates that GMRES is having trouble with the problem, and may indicate |
|---|
| 504 | that trying a different solver or preconditioner may give more accurate |
|---|
| 505 | results if GMRES fails; |
|---|
| 506 | |
|---|
| 507 | "``Aztec status AZ_breakdown: numerical breakdown``", which usually |
|---|
| 508 | indicates serious problems solving the equation which forced the solver |
|---|
| 509 | to stop before reaching an adequate solution. Different solvers, |
|---|
| 510 | different preconditioners, or a less restrictive tolerance may help. |
|---|
| 511 | |
|---|
| 512 | Trilinos_ allows using a variety of preconditioners. An example of passing a |
|---|
| 513 | Trilinos_ preconditioner to a solver can be seen in |
|---|
| 514 | ``examples/diffusion/nthOrder/input4thOrder-line.py``. |
|---|
| 515 | |
|---|
| 516 | .. _Trilinos: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://trilinos.sandia.gov |
|---|
| 517 | |
|---|
| 518 | ---------------- |
|---|
| 519 | Obtaining |FiPy| |
|---|
| 520 | ---------------- |
|---|
| 521 | |
|---|
| 522 | |FiPy| is freely available for download via Subversion_ or as a `compressed |
|---|
| 523 | archive`_ |citeFiPyDownload|. To obtain |FiPy| via anonymous Subversion, |
|---|
| 524 | issue the following command:: |
|---|
| 525 | |
|---|
| 526 | $ svn checkout http://matforge.org/svn/fipy/tags/CURRENT |
|---|
| 527 | |
|---|
| 528 | This will download a fairly stable version of |FiPy| (somewhere |
|---|
| 529 | between version |VERSION| and HEAD). If you prefer, you can download |
|---|
| 530 | |FiPy| version |VERSION| (recommended) with:: |
|---|
| 531 | |
|---|
| 532 | $ svn checkout http://matforge.org/svn/fipy/tags/STABLE |
|---|
| 533 | |
|---|
| 534 | Further information about Subversion_ can be found in |
|---|
| 535 | |documentation:SVN.txt| and in the `online Subversion Red Bean book`_ |
|---|
| 536 | |citeSubversionRedBean|. |
|---|
| 537 | |
|---|
| 538 | .. warning:: |
|---|
| 539 | |
|---|
| 540 | Keep in mind that if you choose to download the `compressed |
|---|
| 541 | archive`_ you will then need to preserve your changes when upgrades |
|---|
| 542 | to |FiPy| become available (upgrades via Subversion_ will handle |
|---|
| 543 | this issue automatically). |
|---|
| 544 | |
|---|
| 545 | .. _compressed archive: http://www.ctcms.nist.gov/fipy/download/ |
|---|
| 546 | .. |citeFiPyDownload| raw:: latex |
|---|
| 547 | |
|---|
| 548 | \cite{FiPyDownload} |
|---|
| 549 | |
|---|
| 550 | Manual |
|---|
| 551 | ====== |
|---|
| 552 | |
|---|
| 553 | You can `download the latest manual`_ |citeFiPyGuide|. Alternatively, |
|---|
| 554 | it may be possible to build a fresh copy by issuing the following |
|---|
| 555 | command in the base directory:: |
|---|
| 556 | |
|---|
| 557 | $ python setup.py build_docs --latex --manual |
|---|
| 558 | |
|---|
| 559 | .. note:: |
|---|
| 560 | |
|---|
| 561 | This mechanism is intended primarily for the developers. A |
|---|
| 562 | command-line pdfTeX installation and several |LaTeX| packages are |
|---|
| 563 | required; particularly ``memoir.cls``. You will also need to add |
|---|
| 564 | ``~/path/to/fipy/utils`` to your ``PYTHONPATH`` environment |
|---|
| 565 | variable. |
|---|
| 566 | |
|---|
| 567 | .. _download the latest manual: http://www.ctcms.nist.gov/fipy/download/ |
|---|
| 568 | |
|---|
| 569 | .. |citeFiPyGuide| raw:: latex |
|---|
| 570 | |
|---|
| 571 | \cite{FiPyGuide} |
|---|
| 572 | |
|---|
| 573 | -------------- |
|---|
| 574 | Testing |FiPy| |
|---|
| 575 | -------------- |
|---|
| 576 | |
|---|
| 577 | From the base directory, you can verify that |FiPy| works properly by |
|---|
| 578 | executing:: |
|---|
| 579 | |
|---|
| 580 | $ python setup.py test |
|---|
| 581 | |
|---|
| 582 | Depending on the packages you chose to install in `Optional Packages`_, |
|---|
| 583 | be sure to set the appropriate environment variables. You can expect a few |
|---|
| 584 | errors if you did not install all of the recommended packages. |
|---|
| 585 | |
|---|
| 586 | If you chose to install the `weave`_ package, you should rerun the |
|---|
| 587 | tests with:: |
|---|
| 588 | |
|---|
| 589 | $ python setup.py test --inline |
|---|
| 590 | |
|---|
| 591 | A few tests will fail the first time as a result of the messages |
|---|
| 592 | output in the course of caching the compiled inline code, but a repeat |
|---|
| 593 | test should have no failures (although see "``repairing catalog by |
|---|
| 594 | removing key``" in |the FAQ|). |
|---|
| 595 | |
|---|
| 596 | .. note:: |
|---|
| 597 | |
|---|
| 598 | In order for Python_ to find the |FiPy| modules, you will need to ensure |
|---|
| 599 | that the base directory is added to your ``PYTHONPATH`` environment |
|---|
| 600 | variable, *e.g.*:: |
|---|
| 601 | |
|---|
| 602 | $ setenv PYTHONPATH .:${PYTHONPATH} |
|---|
| 603 | |
|---|
| 604 | or:: |
|---|
| 605 | |
|---|
| 606 | $ export PYTHONPATH=.:${PYTHONPATH} |
|---|
| 607 | |
|---|
| 608 | ----------------- |
|---|
| 609 | Installing |FiPy| |
|---|
| 610 | ----------------- |
|---|
| 611 | |
|---|
| 612 | It is not necessary to formally install |FiPy|, but if you wish to do so |
|---|
| 613 | and you are confident that all of the requisite packages have been |
|---|
| 614 | installed properly and |FiPy| passes its tests, you can install it by |
|---|
| 615 | typing:: |
|---|
| 616 | |
|---|
| 617 | $ python setup.py install |
|---|
| 618 | |
|---|
| 619 | at the command line. Alternatively, you may choose not to formally install |
|---|
| 620 | |FiPy| and to simply work within the base directory instead. |
|---|
| 621 | |
|---|
| 622 | If you choose to install, Python_ will find your |FiPy| modules |
|---|
| 623 | automatically. If you choose not to install, then you will need to ensure |
|---|
| 624 | that the |FiPy| distribution directory is appended to your ``PYTHONPATH`` |
|---|
| 625 | environment variable (either "``.``" if you are working within the |FiPy| |
|---|
| 626 | directory, or "``~/path/to/fipy``" if you are working in your own directory). |
|---|
| 627 | |
|---|
| 628 | ------------ |
|---|
| 629 | Using |FiPy| |
|---|
| 630 | ------------ |
|---|
| 631 | |
|---|
| 632 | To see examples of problems that |FiPy| is capable of solving, you can |
|---|
| 633 | run any of the scripts in |examples/|. You can type, *e.g.*:: |
|---|
| 634 | |
|---|
| 635 | $ python examples/diffusion/steadyState/mesh1D/input.py |
|---|
| 636 | |
|---|
| 637 | at the command line, which should produce a graphical display of the |
|---|
| 638 | solution. |
|---|
| 639 | |
|---|
| 640 | With judicious use of the weave_ package, we have been able to obtain |
|---|
| 641 | significantly improved performance for some problems, while keeping the code as clear as |
|---|
| 642 | possible. You can invoke this faster code by passing the ``--inline`` |
|---|
| 643 | option at the command line, *i.e.*:: |
|---|
| 644 | |
|---|
| 645 | $ python examples/diffusion/steadyState/mesh1D/input.py --inline |
|---|
| 646 | |
|---|
| 647 | Some modest speed efficiency gains can be made with the use of the |
|---|
| 648 | ``--cache`` flag. This flag instructs |FiPy| to trade memory for |
|---|
| 649 | speed. This flag can be invoked with, *e.g.*:: |
|---|
| 650 | |
|---|
| 651 | $ python examples/diffusion/steadyState/mesh1D/input.py --inline --cache |
|---|
| 652 | |
|---|
| 653 | In order to customize the examples, or to develop your own scripts, some |
|---|
| 654 | knowledge of Python syntax is required. We recommend you familiarize |
|---|
| 655 | yourself with the excellent `Python tutorial`_ |citePythonTutorial| |
|---|
| 656 | or with `Dive Into Python`_ |citeDiveIntoPython|. |
|---|
| 657 | |
|---|
| 658 | .. _Python tutorial: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://docs.python.org/tut/tut.html |
|---|
| 659 | .. _Dive Into Python: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://diveintopython.org |
|---|
| 660 | .. _Subversion: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://matforge.org/fipy/browser |
|---|
| 661 | .. _online Subversion Red Bean book: http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://svnbook.red-bean.com |
|---|
| 662 | |
|---|
| 663 | .. include:: utils/include.txt |
|---|
| 664 | |
|---|
| 665 | .. include:: documentation/VERSION.txt |
|---|
| 666 | |
|---|
| 667 | .. |FiPy| replace:: |htmlFiPy| |latexFiPy| |
|---|
| 668 | .. |TeX| replace:: |latexTeX| |htmlTeX| |
|---|
| 669 | .. |LaTeX| replace:: |latexLaTeX| |htmlLaTeX| |
|---|
| 670 | .. |examples/| replace:: |htmlExamples/| |latexExamples/| |
|---|
| 671 | .. |documentation:SVN.txt| replace:: |latexSVN.txt| |htmlSVN.txt| |
|---|
| 672 | |
|---|
| 673 | .. |citeSubversionRedBean| raw:: latex |
|---|
| 674 | |
|---|
| 675 | \cite{SubversionRedBean} |
|---|
| 676 | |
|---|
| 677 | .. |citeInstallingPythonModules| raw:: latex |
|---|
| 678 | |
|---|
| 679 | \cite{InstallingPythonModules} |
|---|
| 680 | |
|---|
| 681 | .. |citePythonTutorial| raw:: latex |
|---|
| 682 | |
|---|
| 683 | \cite{PythonTutorial} |
|---|
| 684 | |
|---|
| 685 | .. |citeDiveIntoPython| raw:: latex |
|---|
| 686 | |
|---|
| 687 | \cite{DiveIntoPython} |
|---|
| 688 | |
|---|
| 689 | .. |the FAQ| replace:: |htmlFAQ| |latexFAQ| |
|---|
| 690 | |
|---|
| 691 | .. |outsideLinks| raw:: html |
|---|
| 692 | |
|---|
| 693 | <div class="note"> |
|---|
| 694 | <p class="admonition-title">Note</p> |
|---|
| 695 | By selecting the links on this page, you will be leaving NIST webspace. |
|---|
| 696 | We have provided these links to other web sites because they may have |
|---|
| 697 | information that would be of interest to you. No inferences should be |
|---|
| 698 | drawn on account of other sites being referenced, or not, from this |
|---|
| 699 | page. There may be other web sites that are more appropriate for your |
|---|
| 700 | purpose. NIST does not necessarily endorse the views expressed, or |
|---|
| 701 | concur with the facts presented on these sites. Further, NIST does not |
|---|
| 702 | endorse any commercial products that may be mentioned on these sites. |
|---|
| 703 | Please address comments about this page to <a class="reference" |
|---|
| 704 | href="mailto:fipy@nist.gov">fipy@nist.gov</a>. |
|---|
| 705 | </div> |
|---|