pax_global_header 0000666 0000000 0000000 00000000064 14773653671 0014535 g ustar 00root root 0000000 0000000 52 comment=4d1f09c8ee1b5da28a5853b39077beb8d40061be
danieljprice-splash-4d1f09c/ 0000775 0000000 0000000 00000000000 14773653671 0016072 5 ustar 00root root 0000000 0000000 danieljprice-splash-4d1f09c/.github/ 0000775 0000000 0000000 00000000000 14773653671 0017432 5 ustar 00root root 0000000 0000000 danieljprice-splash-4d1f09c/.github/workflows/ 0000775 0000000 0000000 00000000000 14773653671 0021467 5 ustar 00root root 0000000 0000000 danieljprice-splash-4d1f09c/.github/workflows/build.yml 0000664 0000000 0000000 00000002763 14773653671 0023321 0 ustar 00root root 0000000 0000000 # This is a basic workflow to help you get started with Actions
name: build
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Install gfortran and cairo on Linux
run: sudo apt-get install gfortran libcairo2-dev
- name: Check gfortran version
run: gfortran --version
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: get a copy of giza
run: git clone https://github.com/danieljprice/giza
- name: compile splash
run: make SYSTEM=gfortran withgiza
- name: clean
run: make clean
- name: compile libexact
run: make SYSTEM=gfortran libexact
- name: compile libread
run: make SYSTEM=gfortran libread
- name: clean
run: make clean
- name: compile splash in single precision
run: make SYSTEM=gfortran DOUBLEPRECISION=no withgiza
- name: clean
run: make clean
- name: compile splash with debug flags
run: make SYSTEM=gfortran DEBUG=yes withgiza
danieljprice-splash-4d1f09c/.github/workflows/release.yml 0000664 0000000 0000000 00000006633 14773653671 0023642 0 ustar 00root root 0000000 0000000 name: release
# a general github action to generate a release whenever a version tag is pushed
# generates and uploads a tarball of the source code
# in a way that plays nicely with git submodules
# could be easily adapted to produce binaries for each OS
# Daniel Price, Aug 2020
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
release:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Get version
id: get_version
env:
vernum: ${{ github.ref }}
repo: ${{ github.repository }}
run: |
echo "version=${vernum/refs\/tags\//}" >> $GITHUB_ENV
echo "repo=$(basename ${repo})" >> $GITHUB_ENV
echo "tarfile=$(basename ${repo})-${vernum/refs\/tags\//}.tar.gz" >> $GITHUB_ENV
# - name: build tarball mac
# if: matrix.os == 'macos-latest'
# env:
# tarfile: ${{ steps.get_version.outputs.tarfile }}
# repo: ${{ steps.get_version.outputs.repo }}
# run: |
# tar cfz /tmp/$tarfile --exclude ".git*" -s "/./${repo}/" .
- name: build tarball
if: matrix.os == 'ubuntu-latest'
env:
tarfile: ${{ env.tarfile }}
repo: ${{ env.repo }}
run: |
echo "tarfile=${{ env.tarfile }}, repo=${{ env.repo }}"
tar cfz /tmp/${{ env.tarfile }} --exclude ".git*" \
--transform "s,.,${{ env.repo }}," .
- name: check tarball and get SHA
env:
tarfile: ${{ env.tarfile }}
id: shasum
run: |
mv /tmp/${{ env.tarfile }} .
tar tfz ${{ env.tarfile }}
echo "sha=$(shasum -a 256 ${{ env.tarfile }} | awk '{printf $1}')" >> $GITHUB_ENV
- name: Extract Release Notes
run: |
./scripts/get_release_notes.pl > release-notes.md
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.version }}
release_name: ${{ env.version }}
body_path: release-notes.md
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.tarfile }}
asset_name: ${{ env.tarfile }}
asset_content_type: application/gzip
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Bump Brew
env:
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.BREW_TOKEN_SPLASH }}
version: ${{ env.version }}
brewtap: danieljprice/all
formula: ${{ env.repo }}
run: |
git config --global user.email "daniel.price@monash.edu"
git config --global user.name "Daniel Price"
brew install pipgrip
brew tap $brewtap
brew bump-formula-pr -f --version=${version/v/} --no-browse --no-audit \
--sha256=${{ env.sha }} \
--url="https://github.com/${{ github.repository }}/releases/download/${{ env.version }}/${{ env.tarfile }}" \
$brewtap/$formula
danieljprice-splash-4d1f09c/.gitignore 0000664 0000000 0000000 00000000447 14773653671 0020067 0 ustar 00root root 0000000 0000000 *.mod
*.o
*.so
?splash
docs/splash.aux
docs/splash.log
docs/splash.toc
docs/splash.out
docs/splash.blg
docs/splash.haux
docs/*.bib
docs/html/*.png
docs/html/*.html
docs/html/splash.css
cairo-*
pixman-*
bin
ref
*otherendian.f90
Portfile*
.DS_Store
releasenotes*
ChangeLog
giza*
tests
__pycache__
danieljprice-splash-4d1f09c/.readthedocs.yml 0000664 0000000 0000000 00000001212 14773653671 0021154 0 ustar 00root root 0000000 0000000 # .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Set the version of Python and other tools
build:
os: ubuntu-22.04
tools:
python: "3.12"
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
# Build documentation with MkDocs
#mkdocs:
# configuration: mkdocs.yml
# Optionally build your docs in additional formats such as PDF
#formats:
# - pdf
# Optionally set the version of Python and requirements required to build your docs
python:
install:
- requirements: docs/requirements.txt
danieljprice-splash-4d1f09c/INSTALL 0000664 0000000 0000000 00000000544 14773653671 0017126 0 ustar 00root root 0000000 0000000 Basic compilation, with all dependencies present:
make SYSTEM=gfortran
Compilation with giza in subdirectory of splash:
cd splash
git clone https://github.com/danieljprice/giza
make SYSTEM=gfortran withgiza
More detailed installation instructions can be found in the userguide:
https://splash-viz.readthedocs.io/en/latest/getting-started.html#install
danieljprice-splash-4d1f09c/LICENCE 0000664 0000000 0000000 00000035445 14773653671 0017072 0 ustar 00root root 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
danieljprice-splash-4d1f09c/Makefile 0000664 0000000 0000000 00000001070 14773653671 0017530 0 ustar 00root root 0000000 0000000 #----------------------------------------------------------------
# Parent Makefile for SPLASH
# This file is just a wrapper for the sub-make in the build
# directory. Refer to build/Makefile for more details.
#
# (c) 2007-2013 Daniel Price
#
#----------------------------------------------------------------
.PHONY: splash install docs tests src bin
splash:
@cd build; ${MAKE} ${MAKECMDGOALS}
%::
@cd build; ${MAKE} ${MAKECMDGOALS}
install:
@cd build; ${MAKE} ${MAKECMDGOALS}
docs:
@cd build; ${MAKE} ${MAKECMDGOALS}
clean:
@cd build; ${MAKE} clean
danieljprice-splash-4d1f09c/README.md 0000664 0000000 0000000 00000005476 14773653671 0017365 0 ustar 00root root 0000000 0000000 SPLASH - an interactive visualisation tool for SPH data
=======================================================
About
-----
SPLASH is a free and open source visualisation tool for Smoothed Particle Hydrodynamics (SPH) simulations in one, two and three dimensions, developed mainly for astrophysics. It uses a command-line menu but data can be manipulated interactively in the plotting window.
Data is read *directly* from the code dump format giving rapid access to results and the visualisation is advanced forwards and backwards through timesteps by single keystrokes.
SPLASH uses the SPH smoothing kernel to render plots of density and other physical quantities, giving a smooth representation of the data. The goal is to produce beautiful plots and visualisations from SPH codes, instead of simple particle plots.
SPLASH can also be used as a standalone plotting tool for any kind of tabulated or image data from ascii, csv or .fits files.
Status
------

[](https://splash-viz.readthedocs.io/en/latest/?badge=latest)
Example
-------
Links
-----
- Project homepage: http://users.monash.edu.au/~dprice/splash
- Code repository: https://github.com/danieljprice/splash
- Documentation: https://splash-viz.readthedocs.io
- Code paper: https://adsabs.harvard.edu/abs/2007PASA...24..159P
Install
-------
For installation instructions see the [userguide](https://splash-viz.readthedocs.io/en/latest/getting-started.html).
Usage
------------
```
splash mydata.txt
```
Command line mode (to screen):
```
splash -r density dump_0*
```
Command line mode (to file):
```
splash -r density -dev myplot.pdf dump_0*
```
See the [userguide](https://splash-viz.readthedocs.io) for more.
Contributing
------------
We welcome contributions, including (but not limited to):
1. Code, via [pull request](https://github.com/danieljprice/splash/pulls). Please read developer section of user guide for guidelines.
2. Documentation, also by [pull request](https://github.com/danieljprice/splash/pulls). Docs can be edited in the docs/ directory of the main code.
3. Suggestions for features or bug reports, via the [issue tracker](https://github.com/danieljprice/splash/issues/new). Please file bugs via github rather than by email.
4. Discussion via the [mailing lists](http://users.monash.edu.au/~dprice/splash/mailinglists.html)
Citation
--------
Please cite [Price (2007)](https://adsabs.harvard.edu/abs/2007PASA...24..159P)
when using SPLASH.
License
-------
See [LICENCE](LICENCE) file for usage and distribution conditions
Copyright (c) 2004-2023 Daniel Price and contributors
danieljprice-splash-4d1f09c/bin/ 0000775 0000000 0000000 00000000000 14773653671 0016642 5 ustar 00root root 0000000 0000000 danieljprice-splash-4d1f09c/bin/.keep 0000664 0000000 0000000 00000000000 14773653671 0017555 0 ustar 00root root 0000000 0000000 danieljprice-splash-4d1f09c/build/ 0000775 0000000 0000000 00000000000 14773653671 0017171 5 ustar 00root root 0000000 0000000 danieljprice-splash-4d1f09c/build/.depends 0000664 0000000 0000000 00000016430 14773653671 0020620 0 ustar 00root root 0000000 0000000 globaldata.o multiplot.mod settings_data.mod labels.mod filenames.mod particle_data.mod params.mod: globaldata.f90
asciiutils.o asciiutils.mod: asciiutils.f90
setpage.o pagesetup.mod: setpage.f90
transform.o transforms.mod: transform.f90
prompting.o prompting.mod: prompting.f90
geometry.o geometry.mod: geometry.f90
plotutils.o plotutils.mod: plotutils.f90
colourbar.o colourbar.mod: pagesetup.mod colourbar.f90
colours.o colours.mod: colours.f90
colourparts.o colourparts.mod: colourparts.f90
shapes.o shapes.mod: transforms.mod prompting.mod params.mod shapes.f90
units.o settings_units.mod: settings_data.mod labels.mod prompting.mod params.mod units.f90
write_pixmap.o write_pixmap.mod: colours.mod filenames.mod write_pixmap.f90
write_sphdata.o write_sphdata.mod: params.mod settings_units.mod labels.mod write_sphdata.f90
analysis.o analysis.mod: prompting.mod params.mod filenames.mod asciiutils.mod labels.mod analysis.f90
discplot.o disc.mod: transforms.mod discplot.f90
exact_fromfile.o exactfromfile.mod: exact_fromfile.f90
exact_mhdshock.o mhdshock.mod: exact_mhdshock.f90
exact_polytrope.o polytrope.mod: exact_polytrope.f90
exact_rhoh.o rhoh.mod: exact_rhoh.f90
exact_sedov.o sedov.mod: exact_sedov.f90
exact_shock.o shock.mod: exact_shock.f90
exact_shock_sr.o shock_sr.mod: exact_shock_sr.f90
exact_wave.o wave.mod: exact_wave.f90
exact_toystar1D.o toystar1d.mod: exact_toystar1D.f90
exact_toystar2D.o toystar2d.mod: exact_toystar2D.f90
exact_densityprofiles.o densityprofiles.mod: exact_densityprofiles.f90
exact_torus.o torus.mod: exact_torus.f90
exact_ringspread.o ringspread.mod: exact_ringspread.f90
exact.o exact.mod: transforms.mod ringspread.mod densityprofiles.mod wave.mod toystar2d.mod toystar1d.mod torus.mod shock_sr.mod shock.mod sedov.mod rhoh.mod polytrope.mod mhdshock.mod exactfromfile.mod labels.mod filenames.mod prompting.mod settings_data.mod exact.f90
limits.o limits.mod: asciiutils.mod settings_data.mod particle_data.mod geometry.mod labels.mod params.mod limits.f90
allocate.o mem_allocation.mod: particle_data.mod allocate.f90
titles.o titles.mod: filenames.mod asciiutils.mod titles.f90
system_f2003.o system_commands.mod: system_f2003.f90
system_utils.o system_utils.mod: system_commands.mod system_utils.f90
options_render.o settings_render.mod: params.mod prompting.mod colours.mod labels.mod colourbar.mod options_render.f90
options_particleplots.o settings_part.mod: multiplot.mod geometry.mod prompting.mod particle_data.mod settings_render.mod limits.mod labels.mod exact.mod settings_data.mod params.mod options_particleplots.f90
calc_quantities.o calcquantities.mod: settings_units.mod mem_allocation.mod settings_part.mod settings_data.mod particle_data.mod labels.mod calc_quantities.f90
get_data.o getdata.mod: system_utils.mod asciiutils.mod settings_units.mod calcquantities.mod geometry.mod labels.mod prompting.mod particle_data.mod settings_part.mod settings_data.mod limits.mod filenames.mod exact.mod get_data.f90
convert.o convert.mod: prompting.mod getdata.mod analysis.mod write_sphdata.mod filenames.mod settings_data.mod particle_data.mod convert.f90
options_data.o options_data.mod: settings_units.mod labels.mod limits.mod calcquantities.mod getdata.mod prompting.mod filenames.mod params.mod settings_data.mod options_data.f90
options_limits.o settings_limits.mod: transforms.mod labels.mod limits.mod prompting.mod calcquantities.mod settings_data.mod filenames.mod multiplot.mod options_limits.f90
options_page.o settings_page.mod: filenames.mod prompting.mod params.mod shapes.mod settings_limits.mod options_page.f90
options_powerspec.o settings_powerspec.mod: prompting.mod labels.mod limits.mod settings_data.mod options_powerspec.f90
options_vecplot.o settings_vecplot.mod: limits.mod labels.mod settings_data.mod prompting.mod options_vecplot.f90
options_xsecrotate.o settings_xsecrot.mod: transforms.mod multiplot.mod calcquantities.mod settings_data.mod prompting.mod limits.mod labels.mod filenames.mod options_xsecrotate.f90
pdfs.o pdfs.mod: asciiutils.mod filenames.mod plotutils.mod transforms.mod prompting.mod pdfs.f90
rotate.o rotation.mod: rotate.f90
interpolate1D.o interpolations1d.mod: interpolate1D.f90
interpolate2D.o interpolations2d.mod: interpolate2D.f90
interpolate3D.o interpolations3d.mod: interpolate3D.f90
interpolate3D_xsec.o xsections3d.mod: interpolate3D_xsec.f90
interpolate3D_projection.o projections3d.mod: interpolate3D_projection.f90
interpolate3D_opacity.o interpolate3d_opacity.mod: colours.mod projections3d.mod interpolate3D_opacity.f90
interpolate_vec.o interpolate_vec.mod: interpolate_vec.f90
interactive.o interactive_routines.mod: colours.mod settings_part.mod labels.mod calcquantities.mod filenames.mod transforms.mod settings_limits.mod settings_data.mod limits.mod settings_vecplot.mod settings_page.mod multiplot.mod shapes.mod settings_xsecrot.mod colourbar.mod interactive.f90
fieldlines.o fieldlines.mod: fieldlines.f90
legends.o legends.mod: legends.f90
particleplot.o particleplots.mod: geometry.mod interpolations2d.mod settings_part.mod settings_data.mod labels.mod params.mod particleplot.f90
powerspectrums.o powerspectrums.mod: interpolations3d.mod powerspectrums.f90
render.o render.mod: settings_vecplot.mod legends.mod plotutils.mod colourbar.mod render.f90
plotstep.o timestep_plotting.mod: asciiutils.mod rotation.mod fieldlines.mod interpolate_vec.mod geometry.mod shapes.mod legends.mod colourbar.mod write_pixmap.mod exactfromfile.mod disc.mod pagesetup.mod render.mod xsections3d.mod interpolate3d_opacity.mod interpolations3d.mod interpolations2d.mod interpolations1d.mod powerspectrums.mod particleplots.mod interactive_routines.mod transforms.mod colourparts.mod settings_units.mod settings_vecplot.mod settings_limits.mod toystar2d.mod toystar1d.mod exact.mod filenames.mod pdfs.mod projections3d.mod particle_data.mod settings_powerspec.mod settings_xsecrot.mod settings_render.mod settings_part.mod settings_page.mod settings_data.mod titles.mod prompting.mod multiplot.mod limits.mod labels.mod colours.mod params.mod plotstep.f90
timestepping.o timestepping.mod: params.mod settings_part.mod getdata.mod timestep_plotting.mod settings_page.mod settings_data.mod particle_data.mod filenames.mod timestepping.f90
defaults.o defaults.mod: shapes.mod titles.mod settings_units.mod settings_powerspec.mod settings_xsecrot.mod settings_vecplot.mod settings_render.mod settings_part.mod options_data.mod settings_limits.mod multiplot.mod exact.mod settings_page.mod settings_data.mod particle_data.mod limits.mod labels.mod filenames.mod defaults.f90
menu.o mainmenu.mod: settings_units.mod params.mod timestepping.mod getdata.mod geometry.mod defaults.mod transforms.mod prompting.mod multiplot.mod settings_xsecrot.mod settings_vecplot.mod settings_render.mod settings_page.mod settings_part.mod settings_limits.mod settings_data.mod options_data.mod limits.mod labels.mod filenames.mod menu.f90
splash.o: settings_page.mod timestepping.mod analysis.mod write_sphdata.mod convert.mod write_pixmap.mod asciiutils.mod system_utils.mod system_commands.mod settings_xsecrot.mod settings_data.mod projections3d.mod mem_allocation.mod mainmenu.mod limits.mod defaults.mod getdata.mod filenames.mod splash.f90
read_data_sphNG.o sphngread.mod: settings_units.mod geometry.mod calcquantities.mod labels.mod system_utils.mod mem_allocation.mod settings_data.mod particle_data.mod params.mod read_data_sphNG.f90
danieljprice-splash-4d1f09c/build/Makefile 0000664 0000000 0000000 00000073007 14773653671 0020640 0 ustar 00root root 0000000 0000000 ##-------------------------------------------------------------------##
## Makefile for compiling SPLASH and linking with ##
## required libraries ##
## ##
## Written by Daniel Price ##
## University of Exeter, UK, 2004-2008 ##
## Monash University, Australia, 2008- ##
## ##
## requires GNU make (on some systems this is 'gmake' instead ##
## of 'make') ##
## ##
## see the INSTALL file for detailed installation instructions ##
##-------------------------------------------------------------------##
.KEEP_STATE:
KNOWN_SYSTEM=no
SRCDIR=../src
BINDIR=../bin
TESTDIR=../tests
VPATH=$(SRCDIR) $(SRCDIR)/H5Part ../utils
SHELL=/bin/bash
#
# some default settings for unix systems
#
FC=
FFLAGS=
#
# change the line below if SPLASH does not find the X11 libraries
# (some settings of the SYSTEM variable for specific machines overwrite this)
#
# X11_LIBS= -L/usr/X11R6/lib64 -lX11
X11_DIR= /usr/X11/
X11_LIBS= -L$(X11_DIR)/lib -lX11
X11_CFLAGS= -I$(X11_DIR)/include
CAIRO_LIBS= -L$(X11_DIR)/lib -lcairo
CAIRO_CFLAGS= -I$(X11_DIR)/include
#--------------------------------------------------------------
# here we choose the backend plotting library for splash
# (giza is the default backend for splash v2.x, but can
# still be compiled with PGPLOT, just with disabled features)
#--------------------------------------------------------------
ifneq ($(BACKEND), pgplot)
#-- C A I R O --
GIZA_DIR= $(PREFIX)
PLOTLIB= giza-fortran.F90 plotlib_giza.f90
PGPLOTLIBS = -L$(GIZA_DIR)/lib -lgiza $(CAIRO_LIBS)
CFLAGS= -fPIC -Wall -Wextra -O3 -g
CC = gcc
else
#-- P G P L O T --
PLOTLIB= plotlib_pgplot.f90
#
# change the line below depending on where/how you have installed PGPLOT
# (some settings of the SYSTEM variable for specific machines overwrite this)
#
PGPLOTLIBS = -L$(PGPLOT_DIR) -lpgplot -lpng
endif
#--------------------------------------------------------------
#
# If you need the HDF5 libraries, edit the lines below
# possibly adding a -L/libpath/ and a -I/includepath/
#
ifndef HDF5ROOT
ifdef HDF5_ROOT
HDF5ROOT=$(HDF5_ROOT)
endif
ifdef HDF5_DIR
HDF5ROOT=$(HDF5_DIR)
endif
endif
HDF5LIBS = -L$(HDF5ROOT)/lib -lhdf5
HDF5INCLUDE = -I$(HDF5ROOT)/include
H5PART_LIBS = -L$(H5PART_DIR)/lib -lH5Part
H5PART_INCLUDE = -I$(H5PART_DIR)/include
ifdef FITS_DIR
FITSLIBS = -L$(FITS_DIR)/lib -lcfitsio
else
FITSLIBS = -lcfitsio
endif
FITSINCLUDE = -I$(FITS_DIR)/include
#
# this file contains system-dependent routines like getarg, iargc etc.
#
SYSTEMFILE= system_f2003.f90
#
# this can be used to static link the pgplot libraries if all else fails
#
STATICLIBS=
#
# set the parallel flag to 'yes' to compile with openMP directives
#
#PARALLEL=no
ifndef OPENMP
OPENMP=yes
endif
#
# compile in double precision by default (v3.0 onwards this is now default)
#
ifndef DOUBLEPRECISION
DOUBLEPRECISION=yes
endif
#
# the openMP flags should be set in the lines defining your system type
# (ie. leave line below blank)
OMPFLAGS=
#
# the endian flag can be used to compile the code to read BIG or LITTLE endian data
# some compilers also allow this to be done at runtime (e.g. g95, ifort) by setting
# an environment variable appropriately (e.g. G95_ENDIAN or F_UFMTENDIAN)
#
#ENDIAN=
#ENDIAN='BIG'
#ENDIAN='LITTLE'
#
# default destination for installed binaries
#
DESTDIR=
PREFIX=/usr/local/
#
# default C compiler
#
ifndef CC
CC = gcc
endif
ifndef CXX
CXX = g++
endif
# default C++ library linking
# (different between Mac/Linux)
UNAME=$(shell uname)
ifeq ($(UNAME), Darwin)
CXXLIBS= -lc++
else
CXXLIBS= -lstdc++
endif
#--------------------------------------------------------------
# the following are general settings for particular compilers
#
# set the environment variable 'SYSTEM' to one of those
# listed to use the appropriate settings
#
# in bash the equivalent is
# export SYSTEM='gfortran'
#
#--------------------------------------------------------------
ifeq ($(SYSTEM), gfortran)
# gfortran compiler (part of gcc 4.x.x)
FC= gfortran
FFLAGS= -O3 -fPIC
DBLFLAGS= -fdefault-real-8 -fdefault-double-8
SYSTEMFILE= system_f2003.f90
DEBUGFLAG= -Wall -Wextra -pedantic -g -frange-check -fcheck=all -fbacktrace \
-finit-real=NaN #-ffpe-trap=invalid,zero,overflow
OMPFLAGS= -fopenmp
ENDIANFLAGBIG= -fconvert=big-endian
ENDIANFLAGLITTLE= -fconvert=little-endian
KNOWN_SYSTEM=yes
endif
ifeq ($(SYSTEM),sunf95)
# sun f95 compiler on linux
FC= sunf95
FFLAGS= -fast -ftrap=%none
OMPFLAGS= -openmp
DBLFLAGS= -xtypemap=real:64,double:64
DEBUGFLAG= -g -C -w4 -errtags -erroff=COMMENT_1582,COMMENT_1744 -ftrap=%all
SYSTEMFILE= system_f2003.f90
ENDIANFLAGBIG= -xfilebyteorder=big16:%all
ENDIANFLAGLITTLE= -xfilebyteorder=little16:%all
KNOWN_SYSTEM=yes
endif
ifeq ($(SYSTEM),ifort)
# this is for the intel fortran compiler (version 10)
FC= ifort
FFLAGS= -O3 -nbs
OMPFLAGS= -qopenmp
DBLFLAGS= -r8
DEBUGFLAG= -C -g
SYSTEMFILE= system_f2003.f90
ENDIANFLAGBIG= -convert big_endian
ENDIANFLAGLITTLE= -convert little_endian
# or use setenv F_UFMTENDIAN=big or little at runtime
KNOWN_SYSTEM=yes
CC=icc
CFLAGS=-Wall -O3 -fPIC
endif
ifeq ($(SYSTEM),ifx)
# this is for the intel fortran compiler (version 10)
FC= ifx
FFLAGS= -O3 -nbs
OMPFLAGS= -qopenmp
DBLFLAGS= -r8
DEBUGFLAG= -C -g
SYSTEMFILE= system_f2003.f90
ENDIANFLAGBIG= -convert big_endian
ENDIANFLAGLITTLE= -convert little_endian
# or use setenv F_UFMTENDIAN=big or little at runtime
KNOWN_SYSTEM=yes
CC=icc
CFLAGS=-Wall -O3 -fPIC
endif
ifeq ($(SYSTEM),pgf90)
# this is for the Portland Group Fortran 90 compiler (tested with version 7.2-5)
FC= pgf90
FFLAGS= -fast -mcmodel=medium -Mbackslash -Ktrap=none
DBLFLAGS= -r8
DEBUGFLAG= -C -g -gopt -Mbounds -Mchkfpstk -Mchkptr -Mchkstk -Mcoff \
-Mdwarf1 -Mdwarf2 -Melf -Mpgicoff -traceback
OMPFLAGS= -mp
SYSTEMFILE= system_f2003.f90
ENDIANFLAGBIG= -Mbyteswapio # only works on a little-endian machine
ENDIANFLAGLITTLE=
KNOWN_SYSTEM=yes
endif
ifeq ($(SYSTEM),pathf95)
# this is for the Pathscale f95 compiler
FC= pathf95
FFLAGS= -Ofast -mcmodel=medium
DBLFLAGS= -r8
DEBUGFLAG= -C -g
OMPFLAGS= -openmp
SYSTEMFILE= system_f2003.f90
ENDIANFLAGBIG= -convert big_endian
ENDIANFLAGLITTLE= -convert little_endian
KNOWN_SYSTEM=yes
endif
#--------------------------------------------------------------
#
# the following presets are user or machine-specific
#
#--------------------------------------------------------------
ifeq ($(SYSTEM),cody)
FC= gfortran
FFLAGS= -O3 -Wall
SYSTEMFILE= system_f2003.f90
DBLFLAGS= -fdefault-real-8 -fdefault-double-8
DEBUGFLAG= -g -frange-check
OMPFLAGS= -fopenmp
ENDIANFLAGBIG= -fconvert=big-endian
ENDIANFLAGLITTLE= -fconvert=little-endian
SNFLAGS= -L$(HOME)/tree16/Objfiles/g5 -lsw
CFLAGS = -g -O2 -Wall -I$(HOME)/tree16/include -fbounds-check
CC = gcc
KNOWN_SYSTEM=yes
endif
#
# these are the flags used for linking
#
LDFLAGS= $(X11_LIBS) $(PGPLOTLIBS)
#
# this is an option to change the endian-ness at compile time
# (provided the appropriate flags are specified for the compiler)
#
ifeq ($(ENDIAN), BIG)
FFLAGS += ${ENDIANFLAGBIG}
endif
ifeq ($(ENDIAN), LITTLE)
FFLAGS += ${ENDIANFLAGLITTLE}
endif
# compile in parallel
ifeq ($(PARALLEL),yes)
FFLAGS += $(OMPFLAGS)
else
ifeq ($(OPENMP),yes)
FFLAGS += $(OMPFLAGS)
endif
endif
# compile in double precision
ifeq ($(DOUBLEPRECISION), yes)
FFLAGS += ${DBLFLAGS}
FPPFLAGS+=-DDP
endif
# add debugging flags at compile time
ifeq ($(DEBUG),yes)
FFLAGS += $(DEBUGFLAG)
endif
#
# MPI... no splash doesn't use it
# but sometimes you need to compile
# with the mpi compiler (e.g. to link
# correctly to MPI-HDF5 libraries)
# This just changes the compiler name
# whilst keeping the flags the same
# if MPI is set to "yes"
#
ifeq ($(MPI),yes)
FC= mpif90 -DPARALLEL_IO
CC=mpicc -DPARALLEL_IO
endif
#
# If PGPLOT was compiled with a different compiler to the one used here,
# need to link to the libraries for that compiler. We attempt to do this
# automatically below by looking in the PGPLOT makefile.
#
# If the relevant library is not found, may also need -L/dir/ for the directory
# where the corresponding library is located (e.g. -L/usr/local/gfortran/lib -lgfortran)
#
# (information about what is done here is printed via the checkpgplot target, below)
#
ifeq ($(BACKEND),pgplot)
ifdef PGPLOT_DIR
PGPLOT_COMP=${shell if [ -e $$PGPLOT_DIR/makefile ]; then grep 'FCOMPL=' $$PGPLOT_DIR/makefile | cut -d= -f2; else echo unknown; fi}
ifneq (X$(FC), X) # make sure it is not just accidentally blank
ifneq ($(PGPLOT_COMP), $(FC))
# g77-compiled PGPLOT
ifeq ($(PGPLOT_COMP), g77)
PGPLOTLIBS+=-lg2c
endif
# gfortran-compiled PGPLOT
ifeq ($(PGPLOT_COMP), gfortran)
PGPLOTLIBS+=-lgfortran
endif
# g95-compiled PGPLOT
ifeq ($(PGPLOT_COMP), g95)
PGPLOTLIBS+=-lg95
endif
endif
endif
endif
endif
ifeq ($(FC),gfortran)
GFORTRAN_VERSION=${shell $(FC) -dumpversion | head -1 | awk '{print $$NF}'}
GFORTRAN_VMAJOR:=${shell echo "$(GFORTRAN_VERSION)" | cut -f1 -d.}
GFORTRAN_VMINOR:=${shell echo "$(GFORTRAN_VERSION)" | cut -f2 -d.}
GFORTRAN_GE_4_4:=$(shell [ $(GFORTRAN_VMAJOR) -gt 4 -o \( $(GFORTRAN_VMAJOR) -eq 4 -a $(GFORTRAN_VMINOR) -ge 4 \) ] && echo true)
else
GFORTRAN_GE_4_4:=true
endif
# define the implicit rule to make a .o file from a .f90/.f95 file
# (some Make versions don't know this)
%.o : %.f90
$(FC) $(FFLAGS) -c $< -o $@
%.o : %.F90
$(FC) $(FPPFLAGS) $(FFLAGS) -c $< -o $@
%.o : %.f95
$(FC) $(FFLAGS) -c $< -o $@
%.o : %.c
$(CC) -c $(CFLAGS) $(INCLUDES) $< -o $@
# modules must be compiled in the correct order to check interfaces
# really should include all dependencies but I am lazy
READFILES= read_data_ascii.f90 read_data_sphNG.f90 read_data_ndspmhd.f90 \
read_data_gadget.f90 read_data_VINE.f90 read_data_sro.f90 \
read_data_dragon.f90 read_data_seren.f90 read_data_tipsy.f90 \
read_data_mhutch.f90 read_data_UCLA.f90 read_data_aly.f90 \
read_data_bauswein.f90 read_data_egaburov.f90 read_data_starsmasher.f90 \
read_data_gadget_jsb.f90 read_data_foulkes.f90 read_data_jjm.f90 \
read_data_jjm_multiphase.f90 read_data_mbate.f90 read_data_oilonwater.f90 \
read_data_rsph.f90 read_data_urban.f90 read_data_spyros.f90 \
read_data_vanaverbeke.f90 read_data_vtk.f90
READFILES_HDF5= hdf5_helper_utils.c read_data_gadget_hdf5_utils.c read_data_gadget_hdf5.f90 \
read_data_amuse_hdf5_utils.c read_data_amuse_hdf5.f90 \
read_data_cactus_hdf5_utils.c read_data_cactus_hdf5_futils.f90 read_data_cactus_hdf5.f90 \
read_data_flash_hdf5_utils.c read_data_flash_hdf5.f90
#read_data_falcON_hdf5_utils.cc read_data_falcON_hdf5_utils.f90 read_data_falcON_hdf5.f90 \
READFILES_FITS= write_fits.f90 read_data_fits.f90
READFILES_PBOB= read_data_pbob_utils.c read_data_pbob.f90 read_pbob.c read_particle.c
READFILES_H5PART= H5PartF.c H5PartAttribF.c H5Part.f90 H5PartAttrib.f90
RUN_CHECKS=
LDFLAGSLIB=
# link with hdf5 libraries
ifeq ($(HDF5),yes)
READFILES+=$(READFILES_HDF5)
CFLAGS+=$(HDF5INCLUDE)
LDFLAGS+=$(HDF5LIBS)
LDFLAGSLIB+=$(HDF5LIBS)
FPPFLAGS+=-DHDF5
RUN_CHECKS+=checkhdf5
endif
ifeq ($(FITS),yes)
READFILES+= $(READFILES_FITS)
LDFLAGS+=$(FITSLIBS)
LDFLAGSLIB+=$(FITSLIBS)
FPPFLAGS+=-DFITS
RUN_CHECKS+=checkfits
else
READFILES+=no_fits.f90
endif
ifdef PBOB_DIR
READFILES+=$(READFILES_PBOB)
VPATH+=$(PBOB_DIR)
RUN_CHECKS+=checkpbob
endif
ifdef H5PART_DIR
READFILES+=$(READFILES_H5PART)
VPATH+=$(H5PART_LIBS) $(HDF5LIBS)
RUN_CHECKS+=checkh5part
endif
SOURCES= $(PLOTLIB) globaldata.f90 physcon.f90 utils_vectors.f90 \
asciiutils.f90 byteswap.f90 \
labels.f90 partutils.f90 transform.f90 setpage.f90 sort.f90 \
prompting.f90 promptlist.f90 map_columns.f90 geometry.f90 kernels.f90 \
plotutils.f90 blackbody.f90 colourbar.f90 \
colours.f90 colourparts.f90 timing.f90 pagecolours.f90 \
interpolation.f90 interpolate1D.f90 interpolate2D.f90 \
rotate.f90 interpolate3D_projection.f90 interpolate3D_geom.f90 interpolate3D_xsec.f90 \
interpolate3D_proj_geom.f90 \
interpolate3D_opacity.f90 interpolate_vec.f90 interpolate3D.f90 \
units.f90 limits.f90 geomutils.f90 dataread_utils.f90 \
write_data_gadget.f90 write_data_phantom.f90 write_pfm.f90 write_pixmap.f90 \
write_griddata.f90 write_sphdata.f90 read_kepler.f90 \
$(SYSTEMFILE) system_utils.f90 \
cubicsolve.f90 discplot.f90 fparser.f90 parsetext.f90 \
exact_fromfile.f90 exact_Cshock.f90 exact_mhdshock.f90 \
exact_polytrope.f90 exact_rhoh.f90 exact_rochelobe.f90 \
exact_sedov.f90 exact_shock.f90 exact_shock_sr.f90 exact_wave.f90 \
exact_toystar1D.f90 exact_toystar2D.f90 exact_function.f90 exact_planetdisc.f90\
exact_densityprofiles.f90 exact_dustywaves.f90 exact_torus.f90 exact_bondi.f90 \
exact_ringspread.f90 exact_gresho.f90 exact.f90 shapes.f90 \
allocate.f90 titles.f90 calc_quantities.f90 contours.f90 \
legends.f90 options_render.f90 options_particleplots.f90 options_xsecrotate.f90 \
options_limits.f90 options_page.f90 imageutils.f90 \
lightcurve_utils.f90 $(READFILES) lightcurve.f90 extinction.f90 \
read_data.F90 \
adjust_data.f90 set_options_from_dataread.f90 get_data.f90 \
options_data.f90 options_powerspec.f90 \
options_vecplot.f90 pdfs.f90 \
particleplot.f90 interactive.f90 \
convert_grid.f90 \
analysis.f90 convert.f90 fieldlines.f90 \
powerspectrums.f90 render.f90 \
plotstep.f90 timestepping.f90 \
defaults.f90 initialise.f90 menu.f90 \
splash.f90
OBJECTS1= $(SOURCES:.f90=.o) $(STATICLIBS)
OBJECTS2= $(OBJECTS1:.F90=.o)
OBJECTS3= $(OBJECTS2:.c=.o)
OBJECTS= $(OBJECTS3:.cc=.o)
#
# Now compile with the appropriate data read file
# (move yours to the top so that you can simply type "make")
#
all: checksystem $(RUN_CHECKS) $(OBJECTS) read_data.o
$(FC) $(FFLAGS) -o $(BINDIR)/splash $(OBJECTS) $(LDFLAGS)
@echo; echo ' SPLASH v3 successfully compiled! ';
@echo; echo ' "sudo make install" to copy the binary to $(DESTDIR)$(PREFIX)/bin';
@echo; echo ' If you do not have admin privileges, add the following to your .bashrc or equialent:';
@echo; echo ' export SPLASH_DIR=$$HOME/splash';
@echo ' export PATH=$$PATH:$$SPLASH_DIR/bin';
@echo; echo ' For backwards compatibility with v2.x, add the following to your .bashrc or equivalent:';
@echo; echo " alias asplash='splash ' # alias for ascii splash";
@echo " alias ssplash='splash -f phantom'";
@echo " alias gsplash='splash -f gadget' ";
@echo " alias vsplash='splash -f vine' ";
@echo " alias nsplash='splash -f ndspmhd' ";
@echo " alias rsplash='splash -f srosph' ";
@echo " alias dsplash='splash -f dragon' ";
@echo " alias srsplash='splash -f seren' ";
@echo " alias tsplash='splash -f tipsy' ";
@echo " alias msplash='splash -f mhutch' "; echo;
#---falcON HDF5 read ---
falcon: falcON
falcON: falcON_hdf5
falcON_hdf5: checksystem checkhdf5 $(OBJECTS) read_data_falcON_hdf5_utils.o read_data_falcON_hdf5.o
$(FC) $(FFLAGS) -o $(BINDIR)/fsplash $(OBJECTS) read_data_falcON_hdf5_utils.o read_data_falcON_hdf5.o $(LDFLAGS) $(CXXLIBS) $(HDF5LIBS) -lhdf5_cpp
read_data_falcON_hdf5_utils.o: read_data_falcON_hdf5_utils.cc
$(CXX) $(CXXFLAGS) -std=c++11 $(HDF5INCLUDE) -c $< -o $@
#---SILO read ---
silo: checksystem checksilo $(OBJECTS) read_data_silo_utils.o read_data_silo.o
$(FC) $(FFLAGS) -o $(BINDIR)/silosplash $(OBJECTS) read_data_silo_utils.o read_data_silo.o $(LDFLAGS) $(HDF5LIBS) -lsiloh5
read_data_silo_utils.o: read_data_silo_utils.c
$(CC) $(CFLAGS) $(HDF5INCLUDE) -c $< -o $@
#
# sources for the grid2pdf command-line utility
#
SRCGRID2PDF= $(SYSTEMFILE) globaldata.f90 prompting.f90 transform.f90 \
asciiutils.f90 write_griddata.f90 pdfs.f90 grid2pdf.f90
OBJGRID2PDF= ${SRCGRID2PDF:.f90=.o}
grid2pdf: checksystem $(OBJGRID2PDF)
$(FC) $(FFLAGS) -o $(BINDIR)/$@ $(OBJGRID2PDF)
#
#
#
liball: lib libexact libread
#
# libsplash: library version of splash interpolation routines
#
SRCLIB= sort.f90 asciiutils.f90 kernels.f90 timing.f90 geometry.f90 \
interpolation.f90 interpolate1D.f90 interpolate2D.f90 interpolate3D.f90 \
interpolate3D_geom.f90 interpolate3D_projection.f90 \
interpolate3D_proj_geom.f90 interpolate3D_opacity.f90 interpolate3D_xsec.f90 \
libsplash.f90 libutils.f90
OBJLIB1=${SRCLIB:.f90=.o}
OBJLIB=${OBJLIB1} libread.o
.PHONY: libsplash
libsplash: lib
lib: $(OBJLIB)
$(FC) -shared -fPIC $(FFLAGS) $(FPPFLAGS) $(DBLFLAGS) $(OBJLIB) -o libsplash.so
#
# libexact: exact solution library
#
SRCLIBEXACT= plotlib_mock.f90 libutils.f90 geometry.f90 exact_shock.f90 \
exact_shock_sr.f90 exact_sedov.f90 \
exact_polytrope.f90 exact_toystar1D.f90 exact_toystar2D.f90 exact_gresho.f90 \
exact_mhdshock.f90 exact_rhoh.f90 exact_densityprofiles.f90 exact_torus.f90 \
exact_ringspread.f90 cubicsolve.f90 exact_dustywaves.f90 exact_rochelobe.f90 \
exact_Cshock.f90 exact_planetdisc.f90 exact_bondi.f90 \
libexact.f90
OBJLIBEXACT=${SRCLIBEXACT:.f90=.o}
OBJLIBEXACTALL=${OBJLIBEXACT:.F90=.o}
.PHONY: libexact
libexact: checksystem $(OBJLIBEXACTALL)
$(FC) -shared -fPIC $(FFLAGS) $(FPPFLAGS) $(DBLFLAGS) $(OBJLIBEXACTALL) -o libexact.so
#
# libread: data read library
#
SRCLIBREAD= globaldata.f90 physcon.f90 asciiutils.f90 libutils.f90 labels.f90 allocate.f90 byteswap.f90 $(SYSTEMFILE)\
system_utils.f90 geometry.f90 prompting.f90 fparser.f90 units.f90 timing.f90\
sort.f90 geomutils.f90 partutils.f90 calc_quantities.f90 dataread_utils.f90 \
utils_vectors.f90 lightcurve_utils.f90 read_kepler.f90 $(READFILES) read_data.F90 \
adjust_data.f90 limits.f90 get_data.f90 initialise.f90 read.f90 libread.f90
OBJLIBREAD=${SRCLIBREAD:.f90=.o}
OBJLIBREAD1=${OBJLIBREAD:.F90=.o}
OBJLIBREADALL=${OBJLIBREAD1:.c=.o}
.PHONY: libread
libread: checksystem $(OBJLIBREADALL)
$(FC) -shared -fPIC $(FFLAGS) $(FPPFLAGS) $(DBLFLAGS) $(OBJLIBREADALL) -o libread.so $(LDFLAGSLIB)
#
# splash image manipulation utilities
#
SOURCESIMLIB= asciiutils.f90 $(SYSTEMFILE) system_utils.f90 timing.f90 kernels.f90 \
interpolation.f90 interpolate2D.f90 interpolate3D.f90 \
imageutils.f90 write_fits.f90 denoise.f90
OBJECTSIMLIB = $(SOURCESIMLIB:.f90=.o)
.PHONY: denoise
splash-image: denoise
splash-denoise: denoise
denoise: checksystem checkfits $(OBJECTSIMLIB)
$(FC) $(FFLAGS) -o $(BINDIR)/$@ $(OBJECTSIMLIB) $(FITSLIBS)
@echo; echo ' Denoise utility successfully compiled! ';
@echo; echo ' Use "make install" to copy the binaries to $(DESTDIR)$(PREFIX)/bin'; echo;
#
# splash moments
#
SOURCESM= asciiutils.f90 $(SYSTEMFILE) system_utils.f90 timing.f90 kernels.f90 \
interpolate1D.f90 write_fits.f90 moments.f90 sph_moments.f90
OBJECTSM = $(SOURCESM:.f90=.o)
.PHONY: sphmoments
sphmoments: checksystem checkfits $(OBJECTSM)
$(FC) $(FFLAGS) -o $(BINDIR)/$@ $(OBJECTSM) $(FITSLIBS)
@echo; echo ' sphmoments utility successfully compiled! ';
@echo; echo ' Use "make install" to copy the binaries to $(DESTDIR)$(PREFIX)/bin'; echo;
checksystem:
ifeq ($(KNOWN_SYSTEM), yes)
@echo ""
@echo "Compiling splash for $(SYSTEM) system..........."
@echo ""
ifeq ($(ENDIAN), BIG)
@echo "Flags set for conversion to BIG endian"
endif
ifeq ($(ENDIAN), LITTLE)
@echo "Flags set for conversion to LITTLE endian"
endif
ifeq ($(PARALLEL), yes)
@echo "Compiling the PARALLEL code"
else
ifeq ($(OPENMP), yes)
@echo "Compiling the PARALLEL code"
else
@echo "Compiling the SERIAL code"
endif
endif
ifeq ($(FC),gfortran)
ifeq ($(GFORTRAN_GE_4_4),true)
@echo "compiling with gfortran v$(GFORTRAN_VERSION) (OK)"
else
${error gfortran v$(GFORTRAN_VERSION) is too old to compile this version of splash: please upgrade your gfortran}
endif
endif
else
@echo ""
@echo " Makefile for splash by Daniel Price "
@echo " -- see INSTALL file for detailed instructions"
@echo ""
@echo " make: ERROR: value of SYSTEM=$(SYSTEM) not recognised..."
@echo " => set the environment variable SYSTEM to one listed "
@echo " in build/Makefile and try again"
@echo ""
@${MAKE} compilers
@$(MAKE) err;
endif
compilers:
@echo "I suggest one of the following, based on detected Fortran compilers..."; echo;
@if type -p ifx > /dev/null; then echo "make SYSTEM=ifx"; fi;
@if type -p ifort > /dev/null; then echo "make SYSTEM=ifort"; fi;
@if type -p pathf90 > /dev/null; then echo "make SYSTEM=pathf90"; fi;
@if type -p pgf90 > /dev/null; then echo "make SYSTEM=pgf90"; fi;
@if type -p xlf90_r > /dev/null; then echo "make SYSTEM=ukaff1a [uses xlf90_r]"; fi;
@if type -p gfortran > /dev/null; then echo "make SYSTEM=gfortran"; fi;
@if type -p g95 > /dev/null; then echo "make SYSTEM=g95"; fi;
@echo "(end of possible selections)"; echo;
checkpgplot:
ifeq (X${PGPLOT_DIR}, X)
@echo; echo "ERROR: PGPLOT_DIR should be set before compiling splash"; echo; ${MAKE} err;
else
@if [ -d $$PGPLOT_DIR ]; then echo; echo "PGPLOT_DIR=$$PGPLOT_DIR"; echo; else echo; echo "ERROR: Directory given by PGPLOT_DIR=$$PGPLOT_DIR does not exist"; echo; ${MAKE} err; fi;
endif
ifneq ($(PGPLOT_COMP),$(FC))
@echo; echo "*** WARNING: PGPLOT appears to have been compiled with a different Fortran"; echo " compiler (${PGPLOT_COMP}) to the one you are using to compile SPLASH (${FC}),"; echo " so may need to link to the relevant compiler libraries ***";
# g77-compiled PGPLOT
@if [ "${PGPLOT_COMP}" = "g77" ]; then echo " [Adding -lg2c to the link flags for g77-compiled PGPLOT]"; fi;
# gfortran-compiled PGPLOT
@if [ "${PGPLOT_COMP}" = "gfortran" ]; then echo " [Adding -lgfortran to the link flags for gfortran-compiled PGPLOT]"; fi;
# g95-compiled PGPLOT
@if [ "${PGPLOT_COMP}" = "g95" ]; then echo " [Adding -lg95 to the link flags for g95-compiled PGPLOT]"; fi;
@echo
# else
# @echo "PGPLOT was compiled with ${PGPLOT_COMP}";
endif
checkgiza:
@if [ ! -e $(GIZA_DIR)/include/giza-fortran.F90 ]; then \
if [ -d ../giza/ ]; then \
echo "*********************************************************"; \
echo "* *"; \
echo "* ERROR: Cannot find system install of giza *"; \
echo "* Type \"make withgiza\" to build local copy of giza *"; \
echo "* *"; \
echo "*********************************************************"; \
else \
echo "*********************************************************"; \
echo "* *"; \
echo "* ERROR: giza is not installed. Please install it. *"; \
echo "* *"; \
echo "* e.g: *"; \
echo "* git clone https://github.com/danieljprice/giza.git *"; \
echo "* make withgiza *"; \
echo "* *"; \
echo "*********************************************************"; \
fi; \
fi;
checkh5part: checkhdf5
ifeq (X${H5PART_DIR}, X)
@echo; echo "ERROR: H5PART_DIR should be set before compiling splash with h5part read/write"; echo; ${MAKE} err;
else
@if [ -d $$H5PART_DIR ]; then echo; echo "H5PART_DIR=$$H5PART_DIR"; echo; else echo; echo "ERROR: Directory given by H5PART_DIR=$$H5PART_DIR does not exist"; echo; ${MAKE} err; fi;
endif
checkhdf5:
ifeq (X${HDF5ROOT}, X)
@echo; echo "ERROR: HDF5ROOT should be set before compiling splash with HDF5 utilities"; echo; ${MAKE} err;
else
@if [ -d $$HDF5ROOT ]; then echo; echo "HDF5ROOT=$$HDF5ROOT"; echo; else echo; echo "ERROR: Directory given by HDF5ROOT=$$HDF5ROOT does not exist"; echo; ${MAKE} err; fi;
endif
checksilo: checkhdf5
ifeq (X${SILO_DIR}, X)
@echo; echo "ERROR: SILO_DIR should be set before compiling splash with SILO reader"; echo; ${MAKE} err;
else
@if [ -d $$SILO_DIR ]; then echo; echo "SILO_DIR=$$SILO_DIR"; echo; else echo; echo "ERROR: Directory given by SILO_DIR=$$SILO_DIR does not exist"; echo; ${MAKE} err; fi;
endif
checkfits:
ifeq (X${FITS_DIR}, X)
@echo; echo "*** WARNING: May need FITS_DIR=/usr/local to find cfitsio library **"; echo;
else
@if [ -d $$FITS_DIR ]; then echo; echo "FITS_DIR=$$FITS_DIR"; echo; else echo; echo "ERROR: Directory given by FITS_DIR=$$FITS_DIR does not exist"; echo; ${MAKE} err; fi;
endif
checkpbob:
ifeq (X${PBOB_DIR}, X)
@echo; echo "ERROR: PBOB_DIR should be set before compiling splash with PBOB reader"; echo; ${MAKE} err;
else
@if [ -d $$PBOB_DIR ]; then echo; echo "PBOB_DIR=$$PBOB_DIR"; echo; else echo; echo "ERROR: Directory given by PBOB_DIR=$$PBOB_DIR does not exist"; echo; ${MAKE} err; fi;
endif
#
# install option, copies any binaries compiled to /usr/local/bin/
# run `make' first, then `make install'. Could in principle
# have install compile it as well, but environment variables
# will not be defined if "make" is run using sudo, so better
# to do the two separately
#
install: destdircheck installcheck
@cd $(BINDIR); for x in *splash*; do if [ -e $$x ]; then echo "copying $$x -> $(DESTDIR)$(PREFIX)/bin/$$x"; cp $$x $(DESTDIR)$(PREFIX)/bin/; fi; done;
@cd $(BINDIR); x=denoise; if test -e $$x; then echo "copying $$x -> $(DESTDIR)$(PREFIX)/bin/$$x"; cp $$x $(DESTDIR)$(PREFIX)/bin/; fi;
@cd $(BINDIR); x=sphmoments; if test -e $$x; then echo "copying $$x -> $(DESTDIR)$(PREFIX)/bin/$$x"; cp $$x $(DESTDIR)$(PREFIX)/bin/; fi;
@echo; echo 'installation complete';
installcheck:
@if [ -e $(BINDIR)/splash ] || [ -e $(BINDIR)/denoise ] || [ -e $(BINDIR)/sphmoments ]; then echo; \
echo 'compiled binaries install to $(DESTDIR)$(PREFIX)/bin'; \
echo '(use "sudo make install" if Permission denied)'; \
echo; else echo;\
echo 'run "make" first, followed by "make install"'; echo;\
$(MAKE) err; fi
destdircheck: installcheck
@if test -d $(DESTDIR)$(PREFIX)/bin; then echo $(DESTDIR)$(PREFIX)/bin exists and is a directory; else \
echo; echo "*** ERROR in make install ***"; echo "$(DESTDIR)$(PREFIX)/bin is not a valid directory"; echo;\
$(MAKE) err; fi;
installclean: destdircheck
@for x in $(DESTDIR)$(PREFIX)/bin/?splash; do rm $$x; done;
distclean: installclean
cleanall: clean installclean
err:
$(error aborting);
## other stuff
plotlib_pgplot.o: checkpgplot
plotlib_giza.o : giza-fortran.o
giza-fortran.o : giza-fortran.F90
$(FC) $(FFLAGS) -I$(GIZA_DIR)/include/ -c $(GIZA_DIR)/include/giza-fortran.F90 -o $@
.PHONY: giza gizabuild libgiza
giza-fortran.F90 : checkgiza
#
# LOCAL build of giza
#
withgiza: ../giza/lib/libgiza.a
$(MAKE) $(MAKECMDFLAGS) GIZA_DIR="../giza"
../giza/lib/libgiza.a:
@echo "Compiling local copy of giza..."
cd ../giza; ./configure --prefix="$(PWD)/../giza" CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="" CAIRO_LIBS="$(CAIRO_LIBS)" CAIRO_CFLAGS="$(CAIRO_CFLAGS)" X11_LIBS="$(X11_LIBS)" X11_CFLAGS="$(X11_CFLAGS)"
cd ../giza; $(MAKE) $(MAKECMDFLAGS) install CC="$(CC)" CFLAGS="$(CFLAGS)"
docs: doc
doc:
cd ../docs; make html latexpdf
htmldocs: htmldoc
htmldoc: doc cleanhtmldocs
cd ../docs; \
make html
cleanhtmldocs:
cd ../docs; make clean
tar:
tar cf splash.tar Makefile $(SOURCES) read_data*.f90
targz:
tar cf splash.tar Makefile $(SOURCES) read_data*.f90
gzip splash.tar
## unit tests of various modules as I write them
.PHONY: tests
test: test1 test2 test3 test_slicer test_prompt test-parse
test1: interpolate3D_projection.o interpolate3D_xsec.o test_interpolate3D.o
$(FC) $(FFLAGS) $(LDFLAGS) -o $(BINDIR)/test_interpolation3D $(TESTDIR)/test_interpolate3D.o interpolate3D_projection.o interpolate3D_xsec.o
test2: transform.o $(TESTDIR)//test_transform.o
$(FC) $(FFLAGS) $(LDFLAGS) -o $(BINDIR)/test_transform $(TESTDIR)/test_transform.o transform.o
test3: fieldlines.o $(TESTDIR)//test_fieldlines.o
$(FC) $(FFLAGS) $(LDFLAGS) -o $(BINDIR)/test_fieldlines $(TESTDIR)/test_fieldlines.o fieldlines.o
test_slicer: interpolate3D_projection.o interpolate3D_xsec.o test_slicer3D.o
$(FC) $(FFLAGS) $(LDFLAGS) -o $(BINDIR)/test_slicer3D $(TESTDIR)/test_slicer3D.o interpolate3D_projection.o interpolate3D_xsec.o
test_prompt: prompting.o test_prompting.o
$(FC) $(FFLAGS) $(LDFLAGS) -o $(BINDIR)/test_prompt prompting.o test_prompting.o
test-parse: $(PLOTLIB) asciiutils.o fparser.o parsetext.o $(TESTDIR)/test-parsetext.o
$(FC) $(FFLAGS) -o $(BINDIR)/test-parse giza-fortran.o plotlib_giza.o fparser.o asciiutils.o parsetext.o $(TESTDIR)/test-parsetext.o $(LDFLAGS)
#
#--code dependencies: MAY BE INCOMPLETE - I generate this automatically every so often
#
include .depends
cleanread:
rm -f read_data*.o splash.o $(BINDIR)/?splash $(BINDIR)/splash* libsplash.so libexact.so
clean:
rm -f *.o *.mod $(BINDIR)/?splash $(BINDIR)/splash* libsplash.so libexact.so $(BINDIR)/denoise
cleangiza:
${MAKE} -C ../giza clean uninstall
danieljprice-splash-4d1f09c/docs/ 0000775 0000000 0000000 00000000000 14773653671 0017022 5 ustar 00root root 0000000 0000000 danieljprice-splash-4d1f09c/docs/Makefile 0000664 0000000 0000000 00000001172 14773653671 0020463 0 ustar 00root root 0000000 0000000 # Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
danieljprice-splash-4d1f09c/docs/_static/ 0000775 0000000 0000000 00000000000 14773653671 0020450 5 ustar 00root root 0000000 0000000 danieljprice-splash-4d1f09c/docs/_static/css/ 0000775 0000000 0000000 00000000000 14773653671 0021240 5 ustar 00root root 0000000 0000000 danieljprice-splash-4d1f09c/docs/_static/css/custom.css 0000664 0000000 0000000 00000000076 14773653671 0023267 0 ustar 00root root 0000000 0000000 .math {
text-align: center;
}
.eqno {
float: right;
}
danieljprice-splash-4d1f09c/docs/advanced.rst 0000664 0000000 0000000 00000102432 14773653671 0021323 0 ustar 00root root 0000000 0000000
Advanced plotting examples
==========================
Rendered plot of star formation data
------------------------------------
This is an example using data provided by Paul Clark. The data is from
an SPH simulation of star formation in sphNG format. We read the dump
file as follows:
::
dprice/dustfrag> splash omuk162
after which we get output along the lines of:
::
...
reading single dumpfile
>>>>>>>>>>>>>>>>>>>>>>>>>> omuk162 <<<<<<<<<<<<<<<<<<<<<<<<<<
double precision dump
File ID: FHydroRTMHD1
npart = 11744854
...
and arrive at the main menu:
::
You may choose from a delectable sample of plots
-------------------------------------------------------
1) x 7) v\dx
2) y 8) v\dy
3) z 9) v\dz
4) particle mass 10) u
5) h 11) grad h
6) density
-------------------------------------------------------
12) multiplot [ 4 ] m) set multiplot
-------------------------------------------------------
d(ata) p(age) o(pts) l(imits) le(g)end h(elp)
r(ender) v(ector) x(sec/rotate) s,S(ave) q(uit)
-------------------------------------------------------
Please enter your selection now (y axis or option):
here we want to plot a rendered plot of column density (density is in
column 6), so we type ``2`` for column 2 (y) as the y axis, ``1`` for column
1 (x) as the x-axis and at the render prompt ``6``, for density, ie:
::
Please enter your selection now (y axis or option):2
(x axis) (default=1):
(render) (0=none) ([0:11], default=0):6
(vector plot) (0=none, 7=v) ([0:7], default=0):0
Graphics device/type (? to see list, default /xw): /xw
producing the plot shown in :numref:`fig:starpart1` – somewhat black!
.. figure:: figs/starpart1.png
:alt: star formation tutorial part 1a
:name: fig:starpart1
:width: 50.0%
First stage in the star formation figure tutorial: a simple render plot of density
The main thing to note is the limits on the colour bar (extending from :math:`0`
to :math:`10^{7}` on a linear scale) which is the main source of all the
blackness. Moving the cursor over the colour bar and pressing ``l`` for
log produces :numref:`fig:starpart1b` — a vast
improvement!
.. figure:: figs/starpart2.png
:alt: star formation tutorial part 1b
:name: fig:starpart1b
:width: 50.0%
With a log axis after having placed cursor over colour bar and pressed ``l``
For this visualisation we will eventually want the data in physical
units rather than code units. For the sphNG read these units are already
specified in the read_data routine, so all we have to do is turn
physical units on. Pressing ``q`` from interactive mode (that is, with the
cursor in the plot window) returns us to the main menu.
Physical units are turned on from the :ref:`sec:menu-d`, as follows:
::
Please enter your selection now (y axis or option):d
----------------- data read options -------------------
0) exit
1) read new data /re-read data
2) change number of timesteps used ( 1 )
3) plot selected steps only ( OFF )
4) buffering of data on/off ( OFF )
5) turn calculate extra quantities on/off ( OFF )
6) use physical units ( OFF )
7) change physical unit settings
enter option ([0:7], default=0):6
current settings for conversion to physical units are:
x [cm] = x x 1.000E+17
y [cm] = y x 1.000E+17
z [cm] = z x 1.000E+17
particle mass [g] = particle mass x 1.991E+33
h [cm] = h x 1.000E+17
density [g/cm\u3\d] = density x 1.991E-18
v\dx [cm/s] = v\dx x 3.645E+04
v\dy [cm/s] = v\dy x 3.645E+04
v\dz [cm/s] = v\dz x 3.645E+04
u [erg/g] = u x 1.328E+09
grad h = grad h x 1.000E+00
time = time x 1.69E+00
Use physical units? (default=yes):
returning us to the main menu with labels changed as follows:
::
You may choose from a delectable sample of plots
-------------------------------------------------------
1) x [cm] 7) v\dx [cm/s]
2) y [cm] 8) v\dy [cm/s]
3) z [cm] 9) v\dz [cm/s]
4) particle mass [g] 10) u [erg/g]
5) h [cm] 11) grad h
6) log density [g/cm\u3
-------------------------------------------------------
12) multiplot [ 4 ] m) set multiplot
-------------------------------------------------------
d(ata) p(age) o(pts) l(imits) le(g)end h(elp)
r(ender) v(ector) x(sec/rotate) s,S(ave) q(uit)
-------------------------------------------------------
Please enter your selection now (y axis or option):
at this stage we will save the current settings to file by pressing ``s``
from the main menu.
::
Please enter your selection now (y axis or option):s
default options saved to file splash.defaults
Actually we would prefer the column labels in AU, but we will come to
that later. Replotting the same plot (that is 2, 1, 6, 0, /xw from the
main menu) plots the same plot we had before, but with the axes in
physical units. Zooming in (using the mouse) on the region of interest
and adapting the colour bar limits by moving the mouse over the colour
bar and pressing ``a`` produces the plot shown in :numref:`fig:starpart2`.
.. figure:: figs/starpart3.png
:alt: star formation tutorial part 2a
:name: fig:starpart2
:width: 50.0%
Second stage in the star formation figure tutorial: having applied physical units, zooming in and pressing ``a`` on the colour bar
For this kind of plot, the Bate colour scheme looks better – pressing
``m`` with the mouse in the plot window changes the colour scheme,
producing the plot shown in :numref:`fig:starpart2b`.
.. figure:: figs/starpart4.png
:alt: star formation tutorial part 2b
:name: fig:starpart2b
:width: 50.0%
having changed the colour scheme
Pressing ``s`` in interactive mode (that is, with the mouse in the plot window) saves the
current zoom and colour bar settings (but not to disk until you also
press ``S`` from the main menu). Pressing ``q`` from interactive mode
returns to the main menu.
Next we want to turn on the plotting of sink particles (all particle
types other than gas are turned off by default). This is done in the
:ref:`sec:menu-o` as follows:
::
Please enter your selection now (y axis or option):o
------------- particle plot options -------------------
0) exit
1) turn on/off particles by type ( ON, OFF, OFF, OFF )
2) change graph markers for each type ( 1, 4, 17, 1 )
3) set colour for each particle type ( -1, -1, -1, -1 )
4) plot line joining particles ( OFF )
5) plot smoothing circles ( 0 )
6) use fast particle plotting ( ON )
7) change coordinate systems ( 1 )
8) plot exact solution ( 0 )
9) exact solution plot options
enter option ([0:9], default=0):1
Plot gas particles? (default=yes):
Plot ghost particles? (default=no):
Plot sink particles? (default=no):y
>> Plot sink particles on top of rendered plots? (default=no):y
Plot unknown/dead particles? (default=no):
Repeating our previous plot (i.e., 2, 1, 6, 0, /xw) produces the plot
shown in :numref:`fig:starpart3`.
.. figure:: figs/starpart5.png
:alt: star formation tutorial part 3a
:name: fig:starpart3
:width: 50.0%
Third stage in the star formation figure tutorial: having turned sink particle plotting on
.. figure:: figs/starpart6.png
:alt: star formation tutorial part 3b
:name: fig:starpart3b
:width: 50.0%
replacing the axes with a scale
The axes in [cm] are kind of ugly, so we could either change this to a
sensible unit or plot a scale instead. We will do the latter. The axes
can be turned off in the :ref:`sec:menu-p`, as follows:
::
Please enter your selection now (y axis or option):p
---------------- page setup options -------------------
...
2) axes options ( 0)
...
enter option ([0:8], default=0):2
-4 : draw box and major tick marks only;
-3 : draw box and tick marks (major and minor) only;
-2 : draw no box, axes or labels;
-1 : draw box only;
0 : draw box and label it with coordinates;
1 : same as AXIS=0, but also draw the coordinate axes (X=0, Y=0);
2 : same as AXIS=1, but also draw grid lines at major increments of the coordinates;
10 : draw box and label X-axis logarithmically;
20 : draw box and label Y-axis logarithmically;
30 : draw box and label both axes logarithmically.
enter axis option ([-4:30], default=0):-2
axis = -2
The option to plot a scale of a particular length is also to be found in
the :ref:`sec:menu-g`. We will choose to plot a scale of length 0.1 pc.
::
Please enter your selection now (y axis or option):g
---------------- legend and title options -------------------
To set the plot titles, create a file called
'splash.titles' in the working directory, with one title per line
0) exit
1) time legend on/off/settings ( ON 0.87 1.87 0.00 "t=")
2) titles on/off/settings ( ON 0.20 -0.92 0.00)
3) legend for multiple steps per page on/off ( OFF )
4) plot scale on co-ordinate plots ( OFF )
5) legend only on nth panel/first row/column ( 0 )
Enter option ([0:5], default=0):4
Plot scale on co-ordinate plots? (default=no):y
Enter length of scale in the current x,y,z units (default=1.000):3.0856e15
Enter text to appear below scale (e.g. '10 AU') (default=1 unit): 0.1 pc
Enter horizontal position as fraction of viewport ([0.000:1.000], default=0.5000):
Enter vertical position in character heights above bottom (default=1.000):
Note that because the x axis units were already in cm, we simply entered
the value for 0.1pc in these units. Before plotting again, we should
save what we have done so far to disk: Pressing ``S`` from the main menu
saves both the current plot settings *and* the plot limits to disk:
::
Please enter your selection now (y axis or option):S
default options saved to file splash.defaults
saving plot limits to file splash.limits
Plotting our figure again (``2``-``1``-``6``-``0``-``/xw``) produces the plot shown in :numref:`fig:starpart3`
Nearly there...! To add the finishing touches we want to increase the
number of pixels substantially. This is done in the :ref:`sec:menu-r`, option
1, for which we can use the shortcut ``r1``:
::
Please enter your selection now (y axis or option):r1
----------------- rendering options -------------------
enter number of pixels along x axis ([1:10000], default=200):1000
then, to plot the figure to file instead of the screen, we simply choose
a different device at the prompt:
::
Please enter your selection now (y axis or option):2
(x axis) (default=1):
(render) (0=none) ([0:11], default=6):
(vector plot) (0=none, 7=v) ([0:7], default=0):
Graphics device/type (? to see list, default /xw): starpartfinal.gif/gif
producing our final finished :numref:`fig:starfinal`.
.. figure:: figs/starpartfinal.png
:alt: Finished star formation plot
:name: fig:starfinal
:width: 50.0%
Finished star formation plot
Pressing ``S`` from the main menu saves all of the settings and plot
limits to disk, so invoking splash again will produce the same plot. To
produce the same plot on a sequence of dumps, simply put more than one
file on the command line and plot to a non-interactive device (see
:ref:`sec:movies`). Use the postscript devices /ps or /cps (for
colour) to make figures suitable for inclusion in a paper.
Other things you may want to do with this plot include:
- Turn the time legend off. See :ref:`sec:legendoff`.
- Change the colour of sink particles. See
:ref:`sec:partcolours`.
- Change the foreground/background colour of the page. See
:ref:`sec:pagecolours`.
Multi-panelled figure
---------------------
The following is an example plot taken from [PB07]_.
Here I will plot a sequence of plots tiled on the same page, so that
columns correspond to dumps taken from different runs at the same time
and rows correspond to an evolutionary sequence from a given run. The
plot uses sphNG data which contains sink particles, so I also want these
to appear on the plots and be plotted in white. Basically I want the
plots to be plotted such that as much of the plot is taken up by data
and very little by axes and the like but still conveying all of the
necessary information.
We proceed as follows: Firstly, each different run (corresponding in
this case to a series of runs with different magnetic field strength)
are in different subdirectories with names like ``mbossbod_f10.0/``,
``mbossbod_f5.0/``, etc. which all contain a sequence of dump files with
names like ``mbos001``, ``mbos002`` etc. To begin the plot, I start by
creating a new, empty subdirectory so that the ``splash.defaults`` and
``splash.limits`` files created by pressing ``S`` from the main menu will
be in this directory such that running splash from that directory always
produces this plot. So:
::
dprice% mkdir plot1
dprice% cd plot1
then having decided which dump files from each run to use, I create a
text file listing these filenames (with the full relative pathname) in
the order in which I will plot them. For example, calling this file
(arbitrarily) ``filelistplot``, the contents should be something like
the following:
::
dprice% more filelistplot
../mbossbod_f20.0/mbos259
../mbossbod_f20.0/mbos263
../mbossbod_f20.0/mbos268
../mbossbod_f20.0/mbos275
../mbossbod_f20.0/mbos294
../mbossbod_f10.0/mbos259
../mbossbod_f10.0/mbos263
../mbossbod_f10.0/mbos268
../mbossbod_f10.0/mbos275
../mbossbod_f10.0/mbos294
../mbossbod_f7.5/mbos259
../mbossbod_f7.5/mbos263
../mbossbod_f7.5/mbos268
...
Then invoke splash with these filenames on the
command line:
::
splash `cat filelistplot`
after which the first dump file should be read, indicated by output
along the lines of:
::
reading single dumpfile
>>>>>>>>>>>>>>>>>>>>>>>>>> ../mbossbod_f20.0/mbos259 <<<<<<<<<<<<<<<<<<<<<<<<<<
double precision dump
File ID: SHydroRTMHD1
npart = 491567
...
An alternative method is to rename the ``filelistplot`` file
``splash.filenames``, from which the filenames will be read if there are
none specified on the command line (this feature was implemented as a
workaround for a limit to the number of command line arguments on the
some compilers).
The first stage is to get a plot of a single panel looking good. So,
from the main menu, we will plot a simple rendering of density and
adjust the plot limits until we are happy:
::
You may choose from a delectable sample of plots
-------------------------------------------------------
1) x 6) density
2) y 7) B\dx
3) z 8) B\dy
4) particle mass 9) B\dz
5) h
-------------------------------------------------------
10) multiplot [ 4 ] m) set multiplot
-------------------------------------------------------
d(ata) p(age) o(pts) l(imits) le(g)end h(elp)
r(ender) v(ector) x(sec/rotate) s,S(ave) q(uit)
-------------------------------------------------------
Please enter your selection now (y axis or option):2
(x axis) (default=1):
(render) (0=none) ([0:9], default=0):6
(vector plot) (0=none, 7=B) ([0:7], default=0):
Graphics device/type (? to see list, default /xw): /xw
which should produce the plot shown in :numref:`fig:multipart1`. Not much can be seen at
first – just a few white dots. This is mainly a result of the density
axis (i.e., the colour bar) not being logged.
.. figure:: figs/multipart1.png
:alt: multi-panelled figure tutorial part 1
:name: fig:multipart1
:width: 50.0%
First stage in the multi-panelled figure tutorial: a simple render plot of density
Moving the cursor over the
colour bar and pressing ``l`` results in the plot shown in :numref:`fig:multipart1b`
.. figure:: figs/multipart2.png
:alt: multi-panelled figure tutorial part 1b
:name: fig:multipart1b
:width: 50.0%
and with a log axis after having placed cursor over colour bar and pressed ``l``
Before we proceed any further, we will first change the axes to be in
physical units rather than code units. Pressing ``q`` in the plot window
to exit interactive mode and return to the main menu, and from the :ref:`sec:menu-d`,
turn the ``use physical units`` option on:
::
Please enter your selection now (y axis or option):d
----------------- data read options -------------------
0) exit
1) read new data /re-read data
2) change number of timesteps used ( 1 )
3) plot selected steps only ( OFF )
4) buffering of data on/off ( OFF )
5) turn calculate extra quantities on/off ( OFF )
6) use physical units ( OFF )
7) change physical unit settings
enter option ([0:7], default=0):6
current settings for conversion to physical units are:
x [cm] = x x 1.000E+16
y [cm] = y x 1.000E+16
z [cm] = z x 1.000E+16
particle mass [g] = particle mass x 1.991E+33
h [cm] = h x 1.000E+16
density [g/cm\u3\d] = density x 1.991E-15
B\dx [G] = B\dx x 1.000E+00
B\dy [G] = B\dy x 1.000E+00
B\dz [G] = B\dz x 1.000E+00
time = time x 1.13E-01
Use physical units? (default=yes):yes
The default transformations to physical units are in this case set in
the data read. However it would be nicer in this case to set the x and y
axis units to AU (Astronomical Units), rather than cm.
From the :ref:`sec:menu-d` we proceed as follows:
::
enter option ([0:7], default=0):7
enter column to change units (-2=reset all,-1=quit,0=time) ([-2:9], default=-1):1
enter x [cm] units (new=old*units) (default=0.1000E+17):668.3893
enter label amendment (default=[cm]): [AU]
Apply these units to all coordinates and h? (default=yes):
Enter unit for 'z' in 3D column integrated plots (default=0.1000E+17):
Enter label for z integration unit (e.g. [cm]) (default=[cm]):
enter column to change units (-2=reset all,-1=quit,0=time) ([-2:9], default=-1):
save units to file? (default=yes):
saving plot limits to file splash.units
where in the above I set the multiplicative factor such that the x axis
will be in AU and correspondingly changed the units label to ``[AU]``
(note the preceding space). I was also prompted to change the unit for
’z integration’ – this is the length unit added when integrating a
quantity through z. Leaving this in cm means that, even though the
coordinate axes are in AU, the density (in g/cm\ :math:`^{3}`) is
integrated through z in cm, giving column density in g/cm\ :math:`^{2}`
(as opposed to g /cm:math:`^{3}` AU).
To save what we have done so far, press ``s`` from the main menu to save
the current settings to the ``splash.defaults`` file:
::
Please enter your selection now (y axis or option):s
default options saved to file splash.defaults
Having turned physical units on, we replot the same plot (i.e.,
answering ``2``, ``1``, ``6``, ``0``, ``/xw`` to the prompts, as previously). First of all
we find simply a white screen. This is a result of the colour bar axis
now being wrong. Moving the mouse over the colour bar and pressing ``a``
(to adapt) results in the plot shown in :numref:`fig:multipart3`. The plot looks
basically identical to the previous plot, except that the axes are now
in physical units (x and y are in AU and column density is in
g/cm\ :math:`^{2}`).
.. figure:: figs/multipart3.png
:alt: multi-panelled figure tutorial part 2
:name: fig:multipart3
:width: 50.0%
Second stage in the multi-panelled figure tutorial: having changed the axes into physical units
Next, we zoom in to the central region of interest using the mouse –
selecting a region and clicking to zoom in. Pressing ``o`` centres the
plot on the origin and as we zoom in it we also press ``a`` over the
colour bar to readjust the colour bar limits to the max/min on the
zoomed-in plot. Finishing with the adjustments (and pressing ``s`` in the
plot window to save the current settings) results in the plot shown in
:numref:`fig:multipart3b`.
.. figure:: figs/multipart4.png
:alt: multi-panelled figure tutorial part 2b
:name: fig:multipart3b
:width: 50.0%
zooming in and adjusting the colour bar
Surface rendering
-----------------
Here I will give an example of how to use the 3D surface rendering
feature starting with a dump file kindly supplied by Giuseppe Lodato
from an SPH simulation of a warped accretion disc. First we read the
file:
::
dprice$ splash warp001
after which we reach the main menu:
::
You may choose from a delectable sample of plots
-------------------------------------------------------
1) x 6) density
2) y 7) v\dx
3) z 8) v\dy
4) particle mass 9) v\dz
5) h
-------------------------------------------------------
10) multiplot [ 4 ] m) set multiplot
-------------------------------------------------------
d(ata) p(age) o(pts) l(imits) le(g)end h(elp)
r(ender) v(ector) x(sec/rotate) s,S(ave) q(uit)
-------------------------------------------------------
Please enter your selection now (y axis or option):
Firstly we want to plot just a simple render plot of density. Thus we
choose:
::
Please enter your selection now (y axis or option):2
(x axis) (default=1):
(render) (0=none) ([0:9], default=0):6
(vector plot) (0=none, 7=v) ([0:7], default=0):
Graphics device/type (? to see list, default /xwin): /xw
producing the plot shown in :numref:`fig:surfpart1` (I have used ``/png``
instead of ``/xw`` to produce the figures for the userguide).
.. figure:: figs/surfpart1.png
:alt: surface rendering tutorial part 1
:name: fig:surfpart1
:width: 50.0%
First stage in the surface rendering tutorial: a simple render plot of density
Moving the cursor over the colour bar and pressing ``l`` to log the colour bar axis
produces :numref:`fig:surfpart1b`.
.. figure:: figs/surfpart2.png
:alt: surface rendering tutorial part 1b
:name: fig:surfpart1b
:width: 50.0%
with a log axis after having placed cursor over colour bar and pressed ``l``
The next step is to adjust the viewing angle. Pressing ``h`` in the plot
window brings up the list of keystrokes which can be used to change the
angle. Here we want to add a rotation about the :math:`x-` axis, so we
press ``{`` three times to change the x angle by -90 degrees and then
press ``[`` once to increment the angle by a further -15 degrees. The
splash output in the terminal reads, amongst other things:
::
rotating particles about z by 0.00
rotating particles about y by 0.00
rotating particles about x by 255.00
Then we obtain :numref:`fig:surfpart2`.
.. figure:: figs/surfpart3.png
:alt: surface rendering tutorial part 2
:name: fig:surfpart2
:width: 50.0%
Second stage in the surface rendering tutorial: after adjusting the rotation angle
Next, we need to turn the 3D surface rendering on. This cannot be done
in interactive mode so we need to exit – pressing ``s`` first to save what
we have done so far, then ``q`` to quit interactive mode. Then, back at
the splash main menu, we type x4 for the :ref:`sec:menu-x`,
option 4 which is “3D surface rendering on/off†with prompts appearing
as follows:
::
Please enter your selection now (y axis or option):x4
---------- cross section / 3D plotting options --------
Use 3D opacity rendering? (default=yes):y
Now we replot the original plot with the new settings as follows:
::
Please enter your selection now (y axis or option):2
(x axis) (default=1):
(render) (0=none) ([0:9], default=6):
(vector plot) (0=none, 7=v) ([0:7], default=0):
enter z coordinate of observer (default=53.58):
enter distance between observer and projection screen ([0.000:], default=5.358):
using current h and pmass limits to calculate kappa (cross section/unit mass)
min h = 0.1197254 min particle mass = 3.812551E-11
[ kappa = pi*h_min**2/(particle_mass*n_smoothing_lengths) ]
enter approximate surface depth (number of smoothing lengths): ([0.000:], default=2.000):
kappa (particle cross section per unit mass) = 1.2369025E+9
Graphics device/type (? to see list, default /xwin):
Note that several new prompts appear – for the moment I have just used
the default answers by pressing return. The first result is rather
frightening : just a black image with a black colour bar! This is
because the limits we set for column density are several orders of
magnitude away from the limits on density. Moving the cursor over the
colour bar and pressing ``a`` to adapt the limits produces the plot shown
in :numref:`fig:surfpart2b`.
.. figure:: figs/surfpart4.png
:alt: surface rendering tutorial part 2b
:name: fig:surfpart2b
:width: 50.0%
With 3D surface rendering turned on (which also turns on 3D perspective) and having adjusted the colour bar limits
Note that the plot suddenly appears much smaller – this is a consequence
of the 3D perspective settings. Moving the cursor into the plot window
and pressing ``a`` adapts the plot limits. After also clicking on the
colour bar and adjusting the colour bar limits, we arrive at the plot
shown in :numref:`fig:surfpart3`.
.. figure:: figs/surfpart5.png
:alt: surface rendering tutorial part 3
:name: fig:surfpart3
:width: 50.0%
Third stage in the surface rendering tutorial: after adjusting the xy and colour bar limits interactively
Now that we are nearly there, to add the finishing touches we need to i)
increase the number of pixels in the image and ii) turn the axes off,
since they are no longer meaningful with 3D perspective set. The number
of pixels can be increased by returning to the splash main menu
(pressing ``s`` in interactive mode before doing so to save what we have
done so far), then typing ``r1`` for :ref:`sec:menu-r`, option 1:
::
Please enter your selection now (y axis or option):r1
----------------- rendering options -------------------
enter number of pixels along x axis ([1:10000], default=200):1000
Next, we turn the axes off using the :ref:`sec:menu-p`:
::
Please enter your selection now (y axis or option):p2
---------------- page setup options -------------------
-4 : draw box and major tick marks only;
-3 : draw box and tick marks (major and minor) only;
-2 : draw no box, axes or labels;
-1 : draw box only;
0 : draw box and label it with coordinates;
1 : same as AXIS=0, but also draw the coordinate axes (X=0, Y=0);
2 : same as AXIS=1, but also draw grid lines at major increments of the coordinates;
10 : draw box and label X-axis logarithmically;
20 : draw box and label Y-axis logarithmically;
30 : draw box and label both axes logarithmically.
enter axis option ([-4:30], default=0):-2
axis = -2
Plotting the same plot again now results in the plot shown in :numref:`fig:surfpart3b`.
.. figure:: figs/surfpart6.png
:alt: surface rendering tutorial part 3b
:name: fig:surfpart3b
:width: 50.0%
and increasing the number of pixels and having turned the axes off
Finally we will also set the background colour to black, adjust the
opacity and move the time legend. Notice that in :numref:`fig:surfpart3b` the surface looks
blotchy. This is an indication that the surface is too shallow (that is
we are only seeing particles on the very top). Thus we will adjust the
opacity for a slightly deeper plot. We proceed as follows: Exiting
interactive mode (pressing ``s`` then ``q`` in the plot window), we first
set the foreground and background colours in the :ref:`sec:menu-p`:
::
Please enter your selection now (y axis or option):p8
---------------- page setup options -------------------
Enter background colour (by name, e.g. "black") (default=):black
Enter foreground colour (by name, e.g. "white") (default=):white
Do you want to plot axes and overlaid text in background colour (default is foreground) ? (default=no):
Now, replotting the same plot again, but this time adjusting the opacity
at the prompt:
::
enter approximate surface depth (number of smoothing lengths): ([0.000:], default=2.000):200.0
Finally, moving the time legend by positioning the cursor and pressing
’G’ and zooming out slightly by pressing ``-`` once, we arrive at our
finished figure (or movie frame) shown in :numref:`fig:surfpartfinal`. Pressing ``s`` in
interactive mode saves the settings, then pressing ``q`` returns to the
splash main menu. To :ref:`sec:menu-s` to disk, press ``S`` from the main
menu to save both the ``splash.defaults`` file and the ``splash.limits``
file.
.. figure:: figs/surfpartfinal.png
:alt: Finished surface-rendered plot
:name: fig:surfpartfinal
:width: 50.0%
Finished surface-rendered plot
To create a sequence of images with these settings, then simply invoke
splash again with multiple files:
::
splash warp???
then plotting the same plot as previously to a non-interactive device
will cycle through all dump files producing a sequence of plots with
names like ``splash_0000.png``, ``splash_0001.png`` etc. These can be
easily converted into an animation.
.. _sec:evsplash:
Using splash to plot energy vs time plots
------------------------------------------
splash can be used for all kinds of data. For example I often use it to plot the
contents of the .ev file my SPH code dumps monitoring quantities like
energy and angular momentum at every timestep. A shortcut way of setting
options appropriate to reading such files (e.g. plotting lines instead
of dots, plotting all files on the same page) is implemented by adding
the “-ev†option to the command line: e.g.
::
splash -ev file1.ev file2.ev file3.ev
also, using the -ev option on the command line means that any
modification to the preset options /limits are saved to files called
``evsplash.defaults`` and ``evsplash.limits`` instead of the usual
``splash.defaults`` and ``splash.limits``. This means the defaults for
this type of plot are saved separately to those for “normal†plots of
SPH data.
For other command line options, see :ref:`sec:commandline`.
.. _sec:surfdens:
Plotting azimuthally-averaged disc surface density and Toomre Q parameter
-------------------------------------------------------------------------
For analysis of accretion disc simulations, it is useful to make
azimuthally averaged plots of the disc properties such as the surface
density and, for self-gravitating discs, the Toomre Q parameter. Extra
columns appear to plot both of these quantities when the simulation is
3D and the coordinate system is changed to cylindrical or spherical
co-ordinates (in the :ref:`sec:menu-o` – see
:ref:`sec:geom`). For the Toomre Q parameter to appear it is
also necessary to have read the thermal energy from the dump file. For
example, having read a dump file, change the coordinate system to
cylindricals:
::
Please enter your selection now (y axis or option):o7
------------- particle plot options -------------------
0) reset (= 1)
1) cartesian x,y,z
2) cylindrical r,phi,z
3) spherical r,phi,theta
4) toroidal r,theta,phi
Enter coordinate system to plot in: ([0:4], default=1):2
then extra columns appear in the menu:
::
You may choose from a delectable sample of plots
-------------------------------------------------------
1) r 13) u
2) phi 14) grad h
3) z 15) grad soft
... ...
11) v\dphi 23) Surface density
12) v\dz 24) Toomre Q parameter
-------------------------------------------------------
Then (in this example), select column 23 to plot surface density,
::
Please enter your selection now (y axis or option):23
setting x axis to r for surface density plot
...and the plot will appear - an example surface density plot is shown
in :numref:`fig:surfdens`.
.. figure:: figs/surfdens.pdf
:alt: Azimuthally averaged surface density
:name: fig:surfdens
:width: 50.0%
Plot of azimuthally averaged surface density in a 3D accretion disk
simulation
Azimuthally averaged quantities are calculated by binning the particles
into a fixed number of annuli in radius. The mean surface density is
calculated using
.. math:: \Sigma(r_{ann}) = \frac{M_{ann}}{\pi [(r_{ann} + 0.5\Delta r)^{2} - (r_{ann} - 0.5\Delta r)^{2}]},
that is, the total mass in the annulus (sum of the particle masses)
divided by its area, where :math:`r_{ann}` is the radius (cylindrical or
spherical) of the annulus. The Toomre Q parameter, defined as
.. math:: Q_{Toomre}(r) = \frac{\bar{c}_{s}(r)\kappa(r)}{\pi \Sigma(r)},
where :math:`\kappa` is the epicyclic frequency and :math:`\bar{c}_{s}`
is the RMS sound speed, is calculated using the above surface density,
assuming a Keplerian rotation profile and a central star mass of unity
(i.e., :math:`\kappa(r) = \Omega(r)`, where
:math:`\Omega(r) = r^{-3/2}`). The sound speed for each particle
:math:`i` is calculated from the stored thermal energy and
:math:`\gamma` (ratio of specific heats) according to
.. math::
c_{s,i}^{2} = \left\{ \begin{array}{ll}
\frac23 u_{i}, & \gamma = 1; \\
(\gamma-1)\gamma u_i, & \gamma \neq 1;
\end{array}\right.
from which the RMS sound speed is calculated as the square root of the
average of :math:`c_{s}^{2}` on the particles in the annulus.
danieljprice-splash-4d1f09c/docs/basic.rst 0000664 0000000 0000000 00000051544 14773653671 0020646 0 ustar 00root root 0000000 0000000 .. _sec:basic:
Basic splash usage
==================
Simple two column plot
----------------------
Once you have successfully compiled splash with a read data file that
will read your data format, splash is invoked with the name of the data
file(s) on the command line, e.g.
::
splash myrun*.dat
| where splash should be replaced with `splash -f gadget`, `splash -f magma` etc.
depending on the data format.
| After a successful data read, the menu should appear as something like
the following (the example given is for a “minidump†from Stephan
Rosswog’s SPH code, MAGMA):
::
dprice$ splash -magma minidump.00001
::
_ _
(_) _ _ _ _ (_)_
_ (_) ___ _ __ | | __ _ ___| |__ (_) _ (_)
_ (_) _ / __| '_ \| |/ _` / __| '_ \ _ (_)
(_) _ (_) \__ \ |_) | | (_| \__ \ | | | _ (_) _
(_) _ |___/ .__/|_|\__,_|___/_| |_| (_) _ (_)
(_) (_)|_| (_) (_) (_)(_) (_)(_) (_)(_)
( B | y ) ( D | a | n | i | e | l ) ( P | r | i | c | e )
...etc...
::
You may choose from a delectable sample of plots
-------------------------------------------------------
1) x 7) particle mass
2) y 8) B\dx
3) z 9) B\dy
4) h 10) B\dz
5) \gr 11) div B
6) T
-------------------------------------------------------
12) multiplot [ 4 ] m) set multiplot
-------------------------------------------------------
d(ata) p(age) o(pts) l(imits) le(g)end h(elp)
r(ender) v(ector) x(sec/rotate) s(ave) q(uit)
-------------------------------------------------------
Please enter your selection now (y axis or option):
The simplest plot is of two quantities which are not both coordinates.
For example, to plot density vs smoothing length, type
::
Please enter your selection now (y axis or option): 5
(x axis) (default=1): 4
Graphics device/type (? to see list, default /xwin): /xw
The ``default=`` refers to the default value assigned if you just press
the return key. The last prompt asks for the device to which output
should be directed.
.. hint::
A full list of available graphics devices is given by typing ``?`` at the prompt.
Some of the most useful devices are given
in :ref:`tab:devices`. In the above we have selected
the X-window driver which means that the output is sent to the screen
(provided X-windows is running), as demonstrated in the screenshot shown
in :numref:`fig:rhoh`.
.. figure:: figs/rhoh.jpg
:alt: Screenshot of simple two column plot to an X-window
:name: fig:rhoh
:width: 80.0%
Screenshot of simple two column plot to an X-window
.. table:: Commonly used graphics devices available in giza
:name: tab:devices
+-----------------+-----------------+-----------------+-----------------+
| ``/xw``, | X-Window | ``/png`` | Portable |
| ``/xwin`` | (interactive) | | Network |
| | | | Graphics |
| | | | (bitmap) |
+-----------------+-----------------+-----------------+-----------------+
| ``/eps`` | Encapsulated | ``/svg`` | Scalable Vector |
| | postscript (one | | Graphics |
| | file per page) | | |
+-----------------+-----------------+-----------------+-----------------+
| ``/pdf`` | PDF | ``/null`` | null device (no |
| | | | output) |
+-----------------+-----------------+-----------------+-----------------+
| ``/ps`` | Postscript (all | | |
| | pages in one | | |
| | file) | | |
+-----------------+-----------------+-----------------+-----------------+
.. _sec:interactive:
Interactive mode
-----------------
Many useful tasks can now be achieved by moving the mouse to the plot
window and selecting areas or pressing keystrokes – this is :ref:`sec:interactive`.
Most useful are:
- press ``l`` with the mouse over the colour bar for a *log axis*
- ``a`` to *adapt the plot limits* (with mouse on the colour bar, inside the plot, or positioned next to the x or y axes)
- ``left click`` to *select an area* with the mouse and ``click`` to *zoom*
- ``left click`` on the colour bar to *change the rendering limits*
- ``space`` to *skip to the next file* (``right click`` or ``b`` to go back)
- ``-`` or ``+`` to *zoom in* or *out*
- ``Enter`` for :ref:`sec:hollywood`
- ``o`` to *recentre the plot* on the origin
- ``r`` to *refresh* the plot (e.g. after changing the window size)
- ``g`` to *plot a line and find its gradient*
- ``m`` or ``M`` to *change the colour map*
- ``f`` to *flip the rendering* to the next quantity
- ``<``, ``>``, ``{``, ``}`` and ``/``, ``\`` to *rotate particles* around *z*, *y* and *x axes*, respectively
- ``G`` to *move the legend*
- ``ctrl-t`` to *annotate with text*
- ``backspace`` to delete annotation
- ``s`` in the plot window to *save changes* between timesteps, otherwise the settings
will revert when you move to the next timestep.
- ``q`` in the plot window to *quit the plotting window* and return to the menu
- ``q`` again from the splash main menu to *quit splash altogether*.
- ``h`` in the plot window for the full list of commands
On particle plots you can additionally:
- select an area and press ``0``-``9`` to *colour particles* (particle colours stick
between plots, so you can use this to find particles with unusual parameters)
- select an area and press ``0`` to *hide selected particles*
- move the mouse over a particle and press ``c`` to see the size of the *smoothing
circle* for that particle
These tasks can also be achieved non-interactively by a series of
text-based :ref:`sec:menu` (see :ref:`sec:settings`). For example limits changing options are contained in the
:ref:`sec:menu-l`, so to manually set plot limits we would type ``l`` from
the main menu, then ``2`` for option 2 (set manual limits) and follow the
prompts to set the limits for a particular data column.
See also :ref:`sec:menu-i`.
.. _sec:renderplot:
Rendered plots
--------------
A more complicated plot is where both the :math:`x-` and :math:`y-` axes
refer to coordinates. For example
::
Please enter your selection now (y axis or option):2
(x axis) (default=1): 1
(render) (0=none) ([0:11], default=0):5
(vector plot) (0=none, 8=B) ([0:8], default=0):0
Graphics device/type (? to see list, default /xwin): /xw
You can produce the same graph without answering prompts using::
splash -y 2 -x 1 -r 5 -dev /xw minidump.00001
or, since the other options are default anyway, simply::
splash -r 5 minidump.00001
Notice that in this case that options appeared for rendered and vector
plots. Our choice of ``5`` at the (render) prompt corresponds to column 5,
which in this case is the density, producing the plot shown in the
screenshot in :numref:`fig:renderplot`.
.. figure:: figs/renderplot.jpg
:alt: Screenshot of 3D column density plot to an X-window
:name: fig:renderplot
:width: 80.0%
Screenshot of 3D column density plot to an X-window
.. important::
Rendered plots only work if columns for density, particle mass and
smoothing length are correctly identified in the data, and provided the
number of coordinates is 2 or greater. Without these, rendering will
just colour the points according to the selected column.
See :ref:`sec:writeyourown` for internal details.
.. _sec:xsec:
Cross section
--------------
To plot a cross section slice instead of a projection in 3D, simply
use ``--xsec`` flag on the command line::
splash --xsec -r 5 minidump.00001
Or, type ``x`` at
the main menu to open the :ref:`sec:menu-x` and
choose option ``1) switch between cross section and projection``. Then
re-plot the rendered plot again (exactly as in the previous example
:ref:`sec:renderplot`), setting the slice position at the prompt:
::
enter z position for cross-section slice: ([-8.328:8.327], default=0.000):
which produces the plot shown in the screenshot in :numref:`fig:renderplot_xsec`
.. figure:: figs/renderplot_xsec.jpg
:alt: Screenshot of 3D cross section slice plot to an X-window
:name: fig:renderplot_xsec
:width: 80.0%
Screenshot of 3D :ref:`sec:xsec` slice plot to an X-window
.. _sec:vectorplots:
Vector plots
------------
A prompt to plot vector arrows on top of :ref:`sec:renderplot` (or on top of
particle plots) appears whenever vectors are present in the data (for
details of how to specify this in your data read, see
:ref:`sec:writeyourown`), taking the form:
::
(vector plot) (0=none, 8=B) ([0:8], default=0):0
where the number refers to the column of the first component of the
vector quantity.
Vector plots in 3D show either the integral of each component along the
line of sight or, for a :ref:`sec:xsec`, the vector arrows in a :ref:`sec:xsec`
slice (depending on whether a projection or :ref:`sec:xsec` has
been selected for 3D plots – see the rendering examples given
previously). In 2D vector plots simply show the vector arrows mapped to
a pixel array using the SPH kernel.
Settings related to vector plots can be changed via :ref:`sec:menu-v`.
The size of the arrows is set by the maximum plot limit over all of the vector components.
Alternatively the arrow size can be changed interactively using ``v``, ``V`` (*decrease
/increase the arrow size*) and ``w`` (*automatically
adjust arrow size so longest arrow is one pixel width*).
Contour plots
-------------
To plot contours of a quantity instead of :ref:`sec:renderplot`, simply set
the colour scheme used for rendering to 0 (contours only) via the
“change colour scheme†option in the :ref:`sec:menu-r` (type “r2†from the
main menu as a shortcut to option 2 in the :ref:`sec:menu-r`).
Contours of an additional quantity can also be plotted on top of
:ref:`sec:renderplot`. However the prompt for an additional contour plot does not
appear by default – it can be turned on via the ``plot contours`` option
in the :ref:`sec:menu-r` (type ``r3`` at the main menu as a shortcut). With
this option set *and a non-zero response to the render prompt*, a prompt
appears below the render prompt:
::
(render) (0=none) ([0:11], default=0):5
(contours) (0=none) ([0:11], default=0):6
Entering the column to use in the contour plot at this prompt (e.g.
column 6 in the above example would correspond to the temperature) gives
a rendered plot with overlaid contours.
Entering the same quantity used in the rendering at this prompt (e.g.
column 5 in the above example) triggers a subsequent prompt for the
contour limits which can then be set differently to those used in the
render plot. In this way it is possible to make a plot where the density
of one particle type is shown by the rendered plot and the density of
another particle type (with different limits) is shown by contours. This
can be achieved because once contour plotting is turned on, the
contribution of a given particle type to either the contours or rendered
plots can be turned on or off via the ``turn on/off particles by type``
option in the :ref:`sec:menu-o`.
Moving forwards and backwards through data files
------------------------------------------------
See :ref:`sec:interactive`. If you have put more than one file on the command line (or alternatively
the file contains more than one dump), it is then possible to move
forwards and backwards through the data:
- press the ``space bar`` to move to the next file
(with the cursor in the plot window - this is :ref:`sec:interactive`).
- press ``b`` to load and plot the previous file
- type `9` and press ``space`` to move forward by 9 files
- type `10` and press ``b`` to move back by 10 files
Press ``h`` in :ref:`sec:interactive` for more.
.. important::
If you plot to
a non-interactive device, splash simply cycles through all the files on
the command line automatically.
Zooming in and out / changing plot limits
-----------------------------------------
See :ref:`sec:interactive`. Having plotted to an interactive device (e.g. ``/xw``), tasks such as
zooming in and out, selecting, colouring and hiding particles, changing
the limits of both the plot and the colour bar and many other things can
be achieved using either the mouse (i.e., selecting an area on which to
zoom in) or by a combination of the mouse and a keystroke.
.. _sec:postscript:
Producing figures for LaTeX documents
--------------------------------------
Producing a pdf or postscript plot suitable for inclusion in a LaTeX file is
simple. At the device prompt, type
::
Graphics device/type (? to see list, default /xw): myfile.eps
that is, instead of ``/xw`` (for an X-window), simply type ``/eps`` or
``.eps`` to use the encapsulated postscript driver. This produces a file
which by default is called ``splash.eps``, or if multiple files have
been read, a sequence of files called ``splash_0000.eps``,
``splash_0001.eps``, etc. To specify both the device and filename, type
the full filename (e.g. ``myfile.eps``) as the device. Files produced in
this way can be directly incorporated into LaTeX using standard packages.
.. danger::
Do **not** use the ``/png`` driver to produce files for LaTeX documents. Your
axes will appear pixellated and blurred.
Use a vector graphics device (eps or pdf) instead. These give clean, sharp
and infinitely scalable text and lines.
.. hint::
Using ``eps`` format is recommended for LaTeX as it will always crop
to the exact boundaries of the plot. The inbuilt ``pdf`` driver may
require cropping of whitespace. Encapsulated postscript can be easily
converted to pdf (for pdflatex) on the command line using::
epstopdf file.eps
Most pdflatex engines (including `Overleaf `_)
will handle/convert eps automatically.
.. _sec:movies:
Producing a movie of your simulation
-------------------------------------
To make a movie of your simulation, first specify all of the files you
want to use on the command line:
::
splash dump_*
and use an interactive device to adjust options until it looks right.
.. hint::
Movies look best with minimal annotation, e.g. using :ref:`sec:hollywood`
or the backspace key in interactive mode to manually delete annotation
If in interactive mode type ``s`` to save the current settings, then plot the
same thing again but to a non-interactive device.
In the latest version of splash you can generate an mp4 directly ::
Graphics device/type (? to see list, default /xw): splash.mp4
In older splash versions, or for more control, first generate a sequence of png files ::
Graphics device/type (? to see list, default /xw): /png
This will generate a series of images named ``splash_0000.png``,
``splash_0001.png``, ``splash_0002.png`` corresponding to each new
plotting page generated (or enter “``myfile.png``†at the device prompt
to generate ``myfile_0000.png``, ``myfile_0001.png``,
``myfile_0002.png``\ …).
.. hint::
Avoid prompts altogether using the :ref:`sec:commandline`. For example, to make
a movie as per the prompts above, simply type::
splash -r 5 --movie dump_*
which is a shortcut for::
splash -r 5 -dev splash.mp4 dump_*
To produce a sequence of images from the command line, use ::
splash -r 5 -dev /png
See also :ref:`sec:batchmode`.
.. _sec:animations:
Producing a movie from a sequence of images
--------------------------------------------
Having obtained a sequence of images there are a variety of ways to make
these into an animation using both free and commercial software. The simplest
is to use `ffmpeg `_::
ffmpeg -i splash_%04d.png -r 10 -vb 50M -bt 100M -pix_fmt yuv420p -vf setpts=4.*PTS movie.mp4
A simple script which executes the above command is included in the source file distribution
::
~/splash/scripts/movie.sh
Alternatively, it is possible to create an animation from a list of image files::
ffmpeg -f concat -r 25 -i list.txt -vb 50M -bt 100M -vcodec mpeg4 -vf setpts=4.*PTS movie.mp4
Where list.txt contains the image files you want to use like this::
file 'path/to/file1.png'
file 'path/to/file2.png' etc
See :ref:`sec:moviemaking` for more.
.. _sec:hollywood:
Hollywood mode
---------------
Press ``Enter`` or ``ctrl-m`` in the interactive plot window to start ``Hollywood mode``,
which changes to plot settings better suited to movies.
The following shows :ref:`fig:default`:
.. figure:: figs/default-mode.png
:name: fig:default
:width: 80.0%
A circumbinary disc simulation viewed in default mode
and :ref:`fig:hollywood`
.. figure:: figs/hollywood-mode.png
:name: fig:hollywood
:width: 100.0%
The same simulation viewed in Hollywood mode
.. _sec:remote:
Remote visualisation
--------------------
Visualisation of data in-situ on a cluster or supercomputer is simple. Just
log in using ssh with X-windows forwarding, e.g.::
ssh -Y dprice@gadi.nci.org.au
Then just plot to an interactive device (``/xw``) as usual and everything
in :ref:`sec:interactive` should *just work*.
splash has few dependencies and is simple to :ref:`install in your home space ` if necessary.
That said, it is always a good idea to get admins to install a shared package for all users.
Ten quick hints for producing good-looking plots
------------------------------------------------
These can improve the look of a visualisation substantially
compared to the default options:
#. **Log the colour bar**. To do this simply move the cursor over the colour
bar and hit ``l`` (for log) in :ref:`sec:interactive`. Or non-interactively via the
``apply log or inverse transformations to columns`` option in the :ref:`sec:menu-l`.
#. **Adjust the colour bar limits**. Position the mouse over the colour bar
and left-click in :ref:`sec:interactive`. To revert to the widest max/min possible for the data
plotted, press ``a`` with the cursor positioned over the colour bar.
Limits can also be set manually in the :ref:`sec:menu-l`.
#. **Change the colour scheme**. Press ``m`` or ``M`` in :ref:`sec:interactive`
to cycle forwards or backwards through the available colour schemes.
#. **Change the paper size**. To produce high-resolution images/movies, use
the ``change paper size`` option in the :ref:`sec:menu-p` to set the paper
size in pixels.
#. **Try normalised or exact interpolation**. If your simulation does *not*
involve free surfaces (or alternatively if the free surfaces are not
visible in the figure), turning the ``normalise interpolations`` option
on (in the :ref:`sec:menu-r`) may improve the smoothness of the
rendering. This is turned off by default because it leads to
funny-looking edges. Exact rendering performs exact sub-pixel rendering
so is more accurate but slower.
#. **Remove annotation/axes**. For movies, often axes are unnecessary and
detract from the visual appeal. Use :ref:`sec:hollywood` or delete
annotation by pressing backspace in :ref:`sec:interactive`. Alternatively each can
be turned off manually – axes via the ``axes options`` option in the
:ref:`sec:menu-p`; the colour bar by the ``colour bar options`` entry in
the :ref:`sec:menu-r` and the legends via options in the :ref:`sec:menu-g`.
#. **Change axes/page colours**. The background colour (colour of the page)
and foreground colour (used for axes etc) can be changed vie the
``set foreground/background colours`` option in the :ref:`sec:menu-p`.
#. **Move the legend or turn it off**. The time legend can be moved by
positioning the mouse and pressing ``G`` in interactive mode. The
legend can be turned off in the :ref:`sec:menu-g` or by pressing
backspace in interactive mode. Similarly the vector plot legend can
be turned on/off in the :ref:`sec:menu-v` and moved by positioning the
cursor and pressing ``H``.
#. **Use physical units on the axes**. These can be set via the :ref:`sec:menu-d`.
See :ref:`sec:changingunits` for more details.
#. **Save settings to disk**! Don’t waste your effort without being able to
reproduce the plot you have been working on. Pressing ``s`` in
interactive mode only saves the current settings for subsequent
timesteps. Pressing ``s`` from the main menu saves these settings to
disk. Pressing ``S`` from the main menu saves both the plot options
*and* the plot limits, so that the current plot can be reproduced
exactly when splash is next invoked. Adding an ``a``, as in ``SA``, ``Sa``
or ``sa`` to the save options gives a prompt for a different prefix to
the filenames (e.g. ``splash.defaults`` becomes ``myplot.defaults``),
which splash can be invoked to use via the ``-p`` command line option
(e.g. ``splash -p myplot file1 file2...``).
danieljprice-splash-4d1f09c/docs/bibstyle.bst 0000775 0000000 0000000 00000050650 14773653671 0021362 0 ustar 00root root 0000000 0000000 % This style produces citations in the `author-year' format.
% It supports two forms of citation: the \cite command produces: (Author, year)
% in the text; the \cite* command only: (year) .
ENTRY
{ address
author
booktitle
chapter
edition
editor
howpublished
institution
journal
key
note
number
organization
pages
publisher
school
series
title
type
volume
year
}
{}
{ label extra.label sort.label }
INTEGERS { output.state before.all mid.sentence after.sentence
after.block after.colon }
FUNCTION {init.state.consts}
{ #0 'before.all :=
#1 'mid.sentence :=
#2 'after.sentence :=
#3 'after.block :=
#4 'after.colon :=
}
STRINGS { s t }
FUNCTION {output.nonnull}
{ 's :=
output.state mid.sentence =
{ ", " * write$ }
{ output.state after.block =
{ add.period$ write$
newline$
"\newblock " write$
}
{ output.state before.all =
'write$
{ output.state after.colon =
'write$
{ add.period$ " " * write$ }
if$
}
if$
}
if$
mid.sentence 'output.state :=
}
if$
s
}
FUNCTION {output.nonnull.extra}
{ 's :=
output.state mid.sentence =
{ " " * write$ }
{ output.state after.block =
{ add.period$ write$
newline$
"\newblock " write$
}
{ output.state before.all =
'write$
{ output.state after.colon =
'write$
{ add.period$ " " * write$ }
if$
}
if$
}
if$
mid.sentence 'output.state :=
}
if$
s
}
FUNCTION {output}
{ duplicate$ empty$
'pop$
'output.nonnull
if$
}
FUNCTION {output.extra}
{ duplicate$ empty$
'pop$
'output.nonnull.extra
if$
}
FUNCTION {output.check}
{ 't :=
duplicate$ empty$
{ pop$ "empty " t * " in " * cite$ * warning$ }
'output.nonnull
if$
}
FUNCTION {output.check.extra}
{ 't :=
duplicate$ empty$
{ pop$ "empty " t * " in " * cite$ * warning$ }
'output.nonnull.extra
if$
}
FUNCTION {output.year.check}
{ year empty$
{ "empty year in " cite$ * warning$ }
{ write$
": " year * extra.label *
mid.sentence 'output.state :=
}
if$
}
FUNCTION {output.bibitem}
{ newline$
"\bibitem[" write$
label write$
"]{" write$
cite$ write$
"}" write$
newline$
""
before.all 'output.state :=
}
FUNCTION {fin.entry}
{ add.period$
write$
newline$
}
FUNCTION {new.block}
{ output.state before.all =
'skip$
{ after.block 'output.state := }
if$
}
FUNCTION {new.sentence}
{ output.state after.block =
'skip$
{ output.state before.all =
'skip$
{ after.sentence 'output.state := }
if$
}
if$
}
FUNCTION {not}
{ { #0 }
{ #1 }
if$
}
FUNCTION {and}
{ 'skip$
{ pop$ #0 }
if$
}
FUNCTION {or}
{ { pop$ #1 }
'skip$
if$
}
FUNCTION {new.block.checkb}
{ empty$
swap$ empty$
and
'skip$
'new.block
if$
}
FUNCTION {field.or.null}
{ duplicate$ empty$
{ pop$ "" }
'skip$
if$
}
FUNCTION {boldface}
{ duplicate$ empty$
{ pop$ "" }
{ "{\bf " swap$ * "}" * }
if$
}
FUNCTION {emphasize}
{ duplicate$ empty$
{ pop$ "" }
{ "{\em " swap$ * "}" * }
if$
}
INTEGERS { nameptr namesleft numnames }
FUNCTION {format.names}
{ 's :=
#1 'nameptr :=
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > }
{ nameptr #1 >
{ s nameptr "{f. }{vv~}{ll}{, jj}" format.name$ 't := }
{ s nameptr "{vv~}{ll}{, jj}{, f.}" format.name$ 't := }
if$
nameptr #1 >
{ namesleft #1 >
{ ", " * t * }
{ numnames #2 >
{ "," * }
'skip$
if$
t "others" =
{ " et~al." * }
{ " and " * t * }
if$
}
if$
}
't
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
}
while$
}
FUNCTION {format.ed.names}
{ 's :=
#1 'nameptr :=
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > }
{ nameptr #1 >
{ s nameptr "{f. }{vv~}{ll}{, jj}" format.name$ 't := }
{ s nameptr "{f. }{vv~}{ll}{, jj}" format.name$ 't := }
if$
nameptr #1 >
{ namesleft #1 >
{ ", " * t * }
{ numnames #2 >
{ "," * }
'skip$
if$
t "others" =
{ " et~al." * }
{ " and " * t * }
if$
}
if$
}
't
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
}
while$
}
FUNCTION {format.authors}
{ author empty$
{ "" }
{ author format.names }
if$
}
FUNCTION {format.key}
{ empty$
{ key field.or.null }
{ "" }
if$
}
FUNCTION {format.editors}
{ editor empty$
{ "" }
{ editor format.names
editor num.names$ #1 >
{ " (eds.)" * }
{ " (ed.)" * }
if$
}
if$
}
FUNCTION {format.editors.extra}
{ editor empty$
{ "" }
{ editor format.ed.names
editor num.names$ #1 >
{ " (eds.)" * }
{ " (ed.)" * }
if$
}
if$
}
FUNCTION {format.title}
{ title empty$
{ "" }
{ "`" title "'" * * }
if$
}
FUNCTION {n.dashify}
{ 't :=
""
{ t empty$ not }
{ t #1 #1 substring$ "-" =
{ t #1 #2 substring$ "--" = not
{ "--" *
t #2 global.max$ substring$ 't :=
}
{ { t #1 #1 substring$ "-" = }
{ "-" *
t #2 global.max$ substring$ 't :=
}
while$
}
if$
}
{ t #1 #1 substring$ *
t #2 global.max$ substring$ 't :=
}
if$
}
while$
}
FUNCTION {first.page.number}
{ 't :=
""
{ t "" =
{ #0 }
{ t #1 #1 substring$ "-" = not }
if$
}
{ t #1 #1 substring$ *
t #2 global.max$ substring$ 't :=
}
while$
}
FUNCTION {format.btitle}
{ title emphasize
}
FUNCTION {tie.or.space.connect}
{ duplicate$ text.length$ #3 <
{ "~" }
{ " " }
if$
swap$ * *
}
FUNCTION {either.or.check}
{ empty$
'pop$
{ "can't use both " swap$ * " fields in " * cite$ * warning$ }
if$
}
FUNCTION {format.bvolume}
{ volume empty$
{ "" }
{ "Vol." volume tie.or.space.connect
series empty$
'skip$
{ " of " * series emphasize * }
if$
"volume and number" number either.or.check
}
if$
}
FUNCTION {format.number.series}
{ volume empty$
{ number empty$
{ series field.or.null }
{ output.state mid.sentence =
{ "No." }
{ "No." }
if$
number tie.or.space.connect
series empty$
{ "there's a number but no series in " cite$ * warning$ }
{ " in " * series * }
if$
}
if$
}
{ "" }
if$
}
FUNCTION {format.edition}
{ edition empty$
{ "" }
{ output.state mid.sentence =
{ edition "l" change.case$ " edition" * }
{ edition "t" change.case$ " edition" * }
if$
}
if$
}
INTEGERS { multiresult }
FUNCTION {multi.page.check}
{ 't :=
#0 'multiresult :=
{ multiresult not
t empty$ not
and
}
{ t #1 #1 substring$
duplicate$ "-" =
swap$ duplicate$ "," =
swap$ "+" =
or or
{ #1 'multiresult := }
{ t #2 global.max$ substring$ 't := }
if$
}
while$
multiresult
}
FUNCTION {format.pages}
{ pages empty$
{ "" }
{ pages multi.page.check
{ "pp." pages n.dashify tie.or.space.connect }
{ "p." pages tie.or.space.connect }
if$
}
if$
}
FUNCTION {format.page}
{ pages empty$
{ "" }
{ "p.~" pages first.page.number * }
if$
}
FUNCTION {format.vol.num.pages}
{ volume field.or.null
volume empty$
'skip$
{ boldface }
if$
number empty$
'skip$
{ "(" number * ")" * *
volume empty$
{ "there's a number but no volume in " cite$ * warning$ }
'skip$
if$
}
if$
pages empty$
'skip$
{ duplicate$ empty$
{ pop$ format.pages }
{ ", " * pages n.dashify * }
if$
}
if$
}
FUNCTION {format.vol.num.page}
{ volume field.or.null
volume empty$
'skip$
{ boldface }
if$
number empty$
'skip$
{ "(" number * ")" * *
volume empty$
{ "there's a number but no volume in " cite$ * warning$ }
'skip$
if$
}
if$
pages empty$
'skip$
{ duplicate$ empty$
{ pop$ format.pages }
{ ", " * pages first.page.number * }
if$
}
if$
}
FUNCTION {format.chapter.pages}
{ chapter empty$
'format.pages
{ type empty$
{ "Chapt." }
{ type "l" change.case$ }
if$
chapter tie.or.space.connect
pages empty$
'skip$
{ ", " * format.pages * }
if$
}
if$
}
FUNCTION {format.in.ed.booktitle}
{ booktitle empty$
{ "" }
{ editor empty$
{ "In: " booktitle emphasize * }
{ "In: " format.editors.extra * ": " * booktitle emphasize * }
if$
}
if$
}
FUNCTION {format.in.booktitle.or.series}
{ booktitle empty$
{ series empty$
{ "" }
{ "In: " series emphasize * }
if$
}
{ editor empty$
{ "In: " booktitle emphasize * }
{ "In: " format.editors.extra * ": " * booktitle emphasize * }
if$
}
if$
}
FUNCTION {format.thesis.type}
{ type empty$
'skip$
{ pop$
type "t" change.case$
}
if$
}
FUNCTION {format.tr.number}
{ type empty$
{ "Technical Report" }
'type
if$
number empty$
{ "t" change.case$ }
{ number tie.or.space.connect }
if$
}
FUNCTION {format.article.crossref}
{ "In"
" \cite{" * crossref * "}" *
}
FUNCTION {format.book.crossref}
{ volume empty$
{ "empty volume in " cite$ * "'s crossref of " * crossref * warning$
"In "
}
{ "Vol." volume tie.or.space.connect
" of " *
}
if$
"\cite{" * crossref * "}" *
}
FUNCTION {format.incoll.inproc.crossref}
{ "In"
" \cite{" * crossref * "}" *
}
FUNCTION {article}
{ output.bibitem
format.authors "author" output.check
author format.key output
output.year.check
format.title "title" output.check
new.block
crossref missing$
{ journal emphasize "journal" output.check.extra
format.vol.num.pages output.extra
}
{ format.article.crossref output.nonnull
format.pages output
}
if$
new.block
note output
fin.entry
}
FUNCTION {book}
{ output.bibitem
author empty$
{ format.editors "author and editor" output.check
editor format.key output
}
{ format.authors output.nonnull
crossref missing$
{ "author and editor" editor either.or.check }
'skip$
if$
}
if$
output.year.check
format.btitle "title" output.check
crossref missing$
{ format.bvolume output
format.number.series output
new.block
address empty$
'skip$
{ address ": " * output
after.colon 'output.state :=
}
if$
publisher "publisher" output.check.extra
}
{ new.block
format.book.crossref output.nonnull
}
if$
format.edition output
new.block
note output
fin.entry
}
FUNCTION {booklet}
{ output.bibitem
format.authors output
author format.key output
output.year.check
format.btitle "title" output.check
new.block
howpublished output
address output
new.block
note output
fin.entry
}
FUNCTION {inbook}
{ output.bibitem
author empty$
{ format.editors "author and editor" output.check
editor format.key output
}
{ format.authors output.nonnull
crossref missing$
{ "author and editor" editor either.or.check }
'skip$
if$
}
if$
output.year.check
format.btitle "title" output.check
crossref missing$
{ format.bvolume output
format.chapter.pages "chapter and pages" output.check
format.number.series output
new.block
address empty$
'skip$
{ address ": " * output
after.colon 'output.state :=
}
if$
publisher "publisher" output.check.extra
}
{ format.chapter.pages "chapter and pages" output.check
new.block
format.book.crossref output.nonnull
}
if$
format.edition output
new.block
note output
fin.entry
}
FUNCTION {incollection}
{ output.bibitem
format.authors "author" output.check
author format.key output
output.year.check
format.title "title" output.check
new.block
crossref missing$
{ format.in.ed.booktitle "booktitle" output.check
format.bvolume output
format.number.series output
new.block
address empty$
'skip$
{ address ": " * output
after.colon 'output.state :=
}
if$
publisher "publisher" output.check.extra
format.edition output
format.chapter.pages output
}
{ format.incoll.inproc.crossref output.nonnull
format.chapter.pages output
}
if$
new.block
note output
fin.entry
}
FUNCTION {inproceedings}
{ output.bibitem
format.authors "author" output.check
author format.key output
output.year.check
format.title "title" output.check
new.block
crossref missing$
{ format.in.booktitle.or.series "booktitle or series" output.check
format.bvolume output
new.sentence
address output
format.pages output
}
{ format.incoll.inproc.crossref output.nonnull
format.pages output
}
if$
publisher output
new.block
note output
fin.entry
}
FUNCTION {conference} { inproceedings }
FUNCTION {manual}
{ output.bibitem
format.authors output
author format.key output
output.year.check
format.title "title" output.check
new.block
organization output
address output
format.edition output
new.block
note output
fin.entry
}
FUNCTION {mastersthesis}
{ output.bibitem
format.authors "author" output.check
author format.key output
output.year.check
format.title "title" output.check
new.block
"Master's thesis" format.thesis.type output.nonnull
school "school" output.check
address output
new.block
note output
fin.entry
}
FUNCTION {misc}
{ output.bibitem
format.authors output
author format.key output
output.year.check
format.title output
new.block
howpublished output
new.block
note output
fin.entry
}
FUNCTION {phdthesis}
{ output.bibitem
format.authors "author" output.check
author format.key output
output.year.check
format.title "title" output.check
new.block
"Ph.D. thesis" format.thesis.type output.nonnull
school "school" output.check
address output
new.block
note output
fin.entry
}
FUNCTION {proceedings}
{ output.bibitem
format.editors output
editor format.key output
output.year.check
format.title "title" output.check
format.bvolume output
format.number.series output
new.block
address empty$
'skip$
{ address ": " * output
after.colon 'output.state :=
}
if$
organization output.extra
publisher output
new.block
note output
fin.entry
}
FUNCTION {techreport}
{ output.bibitem
format.authors "author" output.check
author format.key output
output.year.check
format.title "title" output.check
new.block
format.tr.number output.nonnull
institution "institution" output.check
address output
new.block
note output
fin.entry
}
FUNCTION {unpublished}
{ output.bibitem
format.authors "author" output.check
author format.key output
output.year.check
format.title "title" output.check
new.block
note "note" output.check
fin.entry
}
FUNCTION {default.type} { misc }
MACRO {jan} {"Jan."}
MACRO {feb} {"Feb."}
MACRO {mar} {"Mar."}
MACRO {apr} {"Apr,"}
MACRO {may} {"May"}
MACRO {jun} {"June"}
MACRO {jul} {"July"}
MACRO {aug} {"Aug."}
MACRO {sep} {"Sept."}
MACRO {oct} {"Oct."}
MACRO {nov} {"Nov."}
MACRO {dec} {"Dec."}
READ
FUNCTION {sortify}
{ purify$
"l" change.case$
}
INTEGERS { len }
FUNCTION {chop.word}
{ 's :=
'len :=
s #1 len substring$ =
{ s len #1 + global.max$ substring$ }
's
if$
}
FUNCTION {format.lab.names}
{ 's :=
s #1 "{vv~}{ll}" format.name$
s num.names$ duplicate$
#2 >
{ pop$ " et~al." * }
{ #2 <
'skip$
{ s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
{ " et~al." * }
{ " and " * s #2 "{vv~}{ll}" format.name$ * }
if$
}
if$
}
if$
}
FUNCTION {author.key.label}
{ author empty$
{ key empty$
{ cite$ #1 #3 substring$ }
'key
if$
}
{ author format.lab.names }
if$
}
FUNCTION {author.editor.key.label}
{ author empty$
{ editor empty$
{ key empty$
{ cite$ #1 #3 substring$ }
'key
if$
}
{ editor format.lab.names }
if$
}
{ author format.lab.names }
if$
}
FUNCTION {editor.key.label}
{ editor empty$
{ key empty$
{ cite$ #1 #3 substring$ }
'key
if$
}
{ editor format.lab.names }
if$
}
FUNCTION {calc.label}
{ type$ "book" =
type$ "inbook" =
or
'author.editor.key.label
{ type$ "proceedings" =
'editor.key.label
'author.key.label
if$
}
if$
"\protect\citeauthoryear{" swap$ * "}{"
*
year field.or.null purify$ #-1 #4 substring$
*
'label :=
}
FUNCTION {sort.format.names}
{ 's :=
#1 'nameptr :=
""
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > }
{ nameptr #1 >
{ " " * }
'skip$
if$
s nameptr "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}" format.name$ 't :=
nameptr numnames = t "others" = and
{ "et al" * }
{ t sortify * }
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
}
while$
}
FUNCTION {sort.format.title}
{ 't :=
"A " #2
"An " #3
"The " #4 t chop.word
chop.word
chop.word
sortify
#1 global.max$ substring$
}
FUNCTION {author.sort}
{ author empty$
{ key empty$
{ "to sort, need author or key in " cite$ * warning$
""
}
{ key sortify }
if$
}
{ author sort.format.names }
if$
}
FUNCTION {author.editor.sort}
{ author empty$
{ editor empty$
{ key empty$
{ "to sort, need author, editor, or key in " cite$ * warning$
""
}
{ key sortify }
if$
}
{ editor sort.format.names }
if$
}
{ author sort.format.names }
if$
}
FUNCTION {editor.sort}
{ editor empty$
{ key empty$
{ "to sort, need editor or key in " cite$ * warning$
""
}
{ key sortify }
if$
}
{ editor sort.format.names }
if$
}
FUNCTION {presort}
{ calc.label
label sortify
" "
*
type$ "book" =
type$ "inbook" =
or
'author.editor.sort
{ type$ "proceedings" =
'editor.sort
'author.sort
if$
}
if$
#1 entry.max$ substring$
'sort.label :=
sort.label
*
" "
*
title field.or.null
sort.format.title
*
#1 entry.max$ substring$
'sort.key$ :=
}
ITERATE {presort}
SORT % by label, sort.label, title---for final label calculation
STRINGS { last.label next.extra }
INTEGERS { last.extra.num }
FUNCTION {initialize.extra.label.stuff}
{ #0 int.to.chr$ 'last.label :=
"" 'next.extra :=
#0 'last.extra.num :=
}
FUNCTION {forward.pass}
{ last.label label =
{ last.extra.num #1 + 'last.extra.num :=
last.extra.num int.to.chr$ 'extra.label :=
}
{ "a" chr.to.int$ 'last.extra.num :=
"" 'extra.label :=
label 'last.label :=
}
if$
}
FUNCTION {reverse.pass}
{ next.extra "b" =
{ "a" 'extra.label := }
'skip$
if$
label extra.label * "}" * 'label :=
extra.label 'next.extra :=
}
EXECUTE {initialize.extra.label.stuff}
ITERATE {forward.pass}
REVERSE {reverse.pass}
FUNCTION {bib.sort.order}
{ sort.label
" "
*
year field.or.null sortify
*
" "
*
title field.or.null
sort.format.title
*
#1 entry.max$ substring$
'sort.key$ :=
}
ITERATE {bib.sort.order}
SORT % by sort.label, year, title---giving final bibliography order
FUNCTION {begin.bib}
{ preamble$ empty$
'skip$
{ preamble$ write$ newline$ }
if$
"\begin{thebibliography}{}" write$ newline$
}
EXECUTE {begin.bib}
EXECUTE {init.state.consts}
ITERATE {call.type$}
FUNCTION {end.bib}
{ newline$
"\end{thebibliography}" write$ newline$
}
EXECUTE {end.bib}
danieljprice-splash-4d1f09c/docs/conf.py 0000664 0000000 0000000 00000004270 14773653671 0020324 0 ustar 00root root 0000000 0000000 # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import sphinx_rtd_theme
# -- Project information -----------------------------------------------------
project = 'splash'
copyright = '2004-2025 Daniel Price and contributors'
author = 'Daniel Price'
# The full version, including alpha/beta/rc tags
release = 'v3.11.2'
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx_rtd_theme'
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The master toctree document.
master_doc = 'index'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# -- Figure and equation numbering
numfig = True
math_numfig = True
numfig_secnum_depth = 2
math_eqref_format = "Eq. {number}"
def setup(app):
app.add_css_file('css/custom.css')
danieljprice-splash-4d1f09c/docs/contribs.rst 0000664 0000000 0000000 00000006100 14773653671 0021374 0 ustar 00root root 0000000 0000000
Contributing
============
Please contribute! All user contributions or suggestions are greatly
appreciated. In particular, please send:
- Bugs! (best way is to `file an issue `_)
- `Feature requests/suggestions `_
- Pretty pictures for `the gallery `_.
If you are \*really\* keen, you may also like to consider:
- Exact solution routines for test problem(s). Even just an analytic
description from which I can write the code.
- Suggestions/tips on possible visualisation techniques
- More colour schemes (simply email me a table of the rgb colour
indices, or failing that simply an image of the colour scheme and I
will add it).
For discussion, feel free to `raise an issue on the tracker `_.
Otherwise, you can send an email to the `mailing list `_ or `get in touch directly `_.
Acknowledgements
================
Josh Calcino contributed significantly to development of the unified
splash binary used in version 3. James Wetter led original development
of the giza backend used in version 2 onwards.
Several of the routines were developed from ideas used by Matthew Bate
and splash has been refined by many useful discussions with Matthew. The
polytrope exact solution is from a routine by Joe Monaghan. I am
indebted to one Thomas S. Ullrich at the University of Heidelberg who
wrote the prompting module which is used throughout the program and to
Roland Schmehl who wrote the excellent function parser module (made
available at http://fparser.sourceforge.net). Last but not least, a huge
thanks especially to all the users who have given feedback which has
helped to improve splash including, but not limited to:
Stefan Adami,
Craig Agnor,
Richard Alexander,
Gabe Altay,
Pau Amaro-Seoane,
Alessandro Atrani,
Sumedh Anathpindika,
Ben Ayliffe,
Andreas Bauswein,
Mark Bennett,
Sergei Biriukov,
David Brown,
Florian Buerzle,
Josh Calcino,
Paul Cornwall,
Jared Coughlin,
Carlos Cuesta,
Daniel Cunnama,
Alan Duffy,
Clare Dobbs,
Carrie Elliot,
Claude-Andr\'e Faucher-Gigu\`ere,
Stefano Facchini,
Juan Pablo Farias,
Christoph Federrath,
Laure Fouchet,
Sergio Gelato,
Thomas Grief,
Doron Grossman,
Jean-Fran\c{c}ois Gonzalez,
Johnny Hitti,
Mark Hutchison,
Vid Ir\v{s}i\v{c},
John Jones,
Sky King,
Laura Kreidberg,
Guillaume Laibe,
Ben Lewis,
David Liptai,
Giuseppe Lodato,
Hayley Macpherson,
David Madlener,
John Mansour,
Ruben Martin,
Daniel Mentiplay,
Farzana Meru,
Andrew McLeod,
Nick Moeckel,
Shazrene Mohamed,
Rebecca Nealon,
Chris Nixon,
Alex Pettitt,
Cody Raskin,
John Regan,
Sahl Rowther,
Dave Rundle,
Alison Sills,
Kevin Sooley,
Phil Sutton,
Robert Thompson,
St\'even Toupin,
Terry Tricco,
Yusuke Tsukamoto,
Sigfried Vanaverbeke,
Enrique Vazquez-Semadeni
Antonio Vazquez,
Tim Waters,
James Wurster,
Matt Young.
And to everyone who has cited the splash paper!
danieljprice-splash-4d1f09c/docs/exact.rst 0000664 0000000 0000000 00000016655 14773653671 0020675 0 ustar 00root root 0000000 0000000
.. _sec:exact:
Exact solutions
================
splash contains a library of exact or analytic solutions to common
test problems that have been used extensively in benchmarking
codes (e.g. [PM04]_, [RP07]_, [Price12]_, [Price18]_).
Errors
------
The error norms calculated when exact solutions are plotted are as
follows: The error for each particle is given by
.. math:: e_i = f_i - f_{exact},
where the exact solution :math:`f_{exact}(x)` is the solution returned
from the exact solution subroutines (with resolution adjustable in the
exact solution options menu option) interpolated to the position of the
current particle :math:`x_i` via a simple linear interpolation. The
absolute :math:`L_1` error norm is simply the average of the errors
across the domain, calculated according to
.. math:: \Vert e \Vert_{L_1} = \frac{1}{N f_{max}} \sum_{i=1}^N \vert e_i \vert,
where :math:`f_{max}` is the maximum value of the exact solution in the
region in which the particles lie (also only particles in the current
plot are used) which is used to normalise the error estimate. A better
error norm is the :math:`L_2` or *Root Mean Square* (RMS) norm given by
.. math::
\Vert e \Vert_{L_2} = \left[\frac{1}{N} \left( \frac{1}{f_{max}^2} \sum_{i=1}^N \vert e_i
\vert^2 \right)\right]^{1/2}.
Finally the maximum error, or :math:`L_\infty` norm is calculated
according to
.. math:: \Vert e \Vert_{L_\infty} = \frac{1}{f_{max}} {\rm max}_i \vert e_i \vert.
which is the most stringent error norm.
The inset plot of the individual particle errors shows the fractional
deviation for each particle given by
.. math:: e_{i,frac} = (f_i - f_{exact}) / f_{exact}.
Shock tubes (Riemann problem)
-----------------------------
The subroutine ``exact_shock`` plots the exact solution for a
one-dimensional shock tube (Riemann problem). The difficult bit of the
problem is to determine the jump in pressure and velocity across the
shock front given the initial left and right states. This is performed
in a separate subroutine (riemannsolver) as there are many different
methods by which this can be done (see e.g.
[Toro92]_). The actual subroutine exact_shock
reconstructs the shock profile (consisting of a rarefaction fan, contact
discontinuity and shock, summarised in :numref:`fig:shocktube`), given the post-shock values of
pressure and velocity.
.. figure:: figs/sodshock.pdf
:alt: exact solution for one-dimensional shock tube
:name: fig:shocktube
:width: 100.0%
Example of exact solution for one-dimensional shock tube problem (red
line) compared to the SPH solution (black line/particles), utilising
the exact solutions incorporated in splash
The speed at which the shock travels into the ‘right’ fluid can be
computed from the post shock velocity using the relation
.. math:: v_{shock} = v_{post}\frac{(\rho_{post}/\rho_R)}{(\rho_{post}/\rho_R)- 1},
where the jump conditions imply
.. math:: \frac{\rho_{post}}{\rho_R} = \frac{(P_{post}/P_R) + \beta}{1 + \beta (P_{post}/P_R)}
with
.. math:: \beta = \frac{\gamma - 1}{\gamma + 1}.
Riemann solver
~~~~~~~~~~~~~~~
The algorithm for determining the post-shock velocity and pressure is
taken from [Toro92]_.
Polytrope
---------
The subroutine ``exact_polytrope`` computes the exact solution for a
static polytrope with arbitrary :math:`\gamma`. From Poisson’s equation
.. math:: \nabla^2 \phi = 4\pi G \rho,
assuming only radial dependence this is given by
.. math::
:label: eq_poissonsph
\frac{1}{r^{2}} \frac{d}{dr} \left(r^{2} \frac{d\phi}{dr} \right) = 4\pi G \rho(r).
The momentum equation assuming an equilibrium state
(:math:`{\bf v} = 0`) and a polytropic equation of state
:math:`P = K\rho^{\gamma}` gives
.. math::
:label: eq_polyk
\frac{d\phi}{dr} = - \frac{\gamma K}{\gamma-1}\frac{d}{dr} \left[\rho^{(\gamma -1)} \right]
Combining (:eq:`eq_poissonsph`) and
(:eq:`eq_polyk`) we obtain an equation for the density
profile
.. math::
:label: eq:dens
\frac{\gamma K}{4\pi G (\gamma - 1)} \frac{1}{r^{2}} \frac{d}{dr} \left[r^{2}
\frac{d}{dr}\left( \rho^{\gamma-1} \right) \right] + \rho(r) = 0.
This equation can be rearranged to give
.. math::
\frac{\gamma K}{4\pi G (\gamma - 1)} \frac{d^2}{dr^2}
\left[r\rho^{\gamma-1}\right] + r\rho = 0.
The program solves this equation numerically by defining a variable
.. math:: \mathcal{E} = r \rho^{\gamma-1}
and finite differencing the equation according to
.. math::
\frac{\mathcal{E}^{i+1} - \mathcal{E}^i + \mathcal{E}^{i-1}}{(\Delta r)^2} =
\frac{4\pi G (\gamma - 1)}{\gamma K} r
\left(\frac{\mathcal{E}}{r}\right)^{1/(\gamma-1)}.
Linear wave
-----------
The subroutine ``exact_wave`` simply plots a sine function on a given
graph. The function is of the form
.. math:: y = \sin{(k x - \omega t)}
where :math:`k` is the wavenumber and :math:`\omega` is the angular
frequency. These parameters are set via the input values of wavelength
:math:`\lambda = 2\pi/k` and wave period :math:`P = 2\pi/\omega`.
.. table:: Input parameters for the linear wave exact solution
+-----------------+------------+
| :math:`\lambda` | wavelength |
+-----------------+------------+
| :math:`P` | period |
+-----------------+------------+
Sedov blast wave
----------------
The subroutine ``exact_sedov`` computes the self-similar Sedov solution
for a blast wave.
Toy stars
---------
The subroutine ``exact_toystar1D`` computes the exact solutions for the
‘Toy Stars’ described in [MP04]_. The system is one
dimensional with velocity :math:`v`, density :math:`\rho`, and pressure
:math:`P`. The acceleration equation is
.. math:: \frac{dv}{dt} = - \frac{1}{\rho} \frac{\partial P}{\partial x} - \Omega^2 x,
We assume the equation of state is
.. math:: P = K \rho^\gamma,
The exact solutions provided assume the equations are scaled such that
:math:`\Omega^2 = 1`.
Static structure
~~~~~~~~~~~~~~~~~
The static structure is given by
.. math:: \bar \rho = 1- x^2,
Linear solutions
~~~~~~~~~~~~~~~~~
The linear solution for the velocity is given by
.. math:: v = 0.05 C_s G_n(x) \cos{\omega t} ).
The density is
.. math:: \rho = \bar{\rho} + \eta,
where
.. math:: \eta = 0.1 C_s \omega P_{n+1}(x) \sin{(\omega t)}.
Non-linear solution
~~~~~~~~~~~~~~~~~~~~
In this case the velocity is given by
.. math:: v = A(t) x,
while the density solution is
.. math:: \rho^{\gamma -1} = H(t) - C(t) x^2.
where the parameters A, H and C are determined by solving the ordinary
differential equations
.. math::
\begin{aligned}
\dot{H} & = & -AH(\gamma -1), \\
\dot{A} & = & \frac{2K \gamma}{\gamma -1} C - 1 - A^2 \\
\dot{C} & = & -AC(1+ \gamma),\end{aligned}
The relation
.. math::
:label: eq:kconst
A^2 = -1 - \frac{2 \sigma C}{\gamma -1} + kC^{\frac{2}{\gamma +1}},
is used to check the quality of the solution of the differential
equations by evaluating the constant :math:`k` (which should remain
close to its initial value).
MHD shock tubes
---------------
These are some tabulated solutions for specific MHD shock tube problems
at a given time taken from the tables given in [DW94]_
and [RJ95]_.
h vs :math:`\rho`
-----------------
The subroutine exact_hrho simply plots the relation between smoothing
length and density, i.e.,
.. math:: h = h_{\rm fact} \left(\frac{m}{\rho}\right)^{1/\nu}
where :math:`\nu` is the number of spatial dimensions. The parameter
:math:`h_{\rm fact}` is output by the code into the header of each timestep.
For particles of different masses, a different curve is plotted for each
different mass value.
danieljprice-splash-4d1f09c/docs/faq.rst 0000775 0000000 0000000 00000014522 14773653671 0020332 0 ustar 00root root 0000000 0000000 Frequently Asked Questions
==========================
Here is a collection of the most common problems with using SPLASH. You may also wish to browse the archives of the `splash-users `_ discussion list. See also the old `pgplot faq `__.
.. _sec:moviemaking:
How do I make a movie from splash output?
-----------------------------------------
At the graphics device prompt, choose /png. This will produce a series of files::
splash_0000.png
splash_0001.png
splash_0002.png
...
There are then many procedures for getting from these files to an animation. See :ref:`sec:movies`
Using ffmpeg to make a movie from png files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
With ffmpeg installed, you can use the script provided in splash/scripts/movie.sh, e.g.::
~/splash/scripts/movie.sh
This should produce a movie called ``movie.mp4`` from your splash_*.png files. The contents of this script are just some options for ffmpeg that produce a nice movie::
#!/bin/bash
#
# script to make an mpeg4 movie from splash_*.png files
# requires ffmpeg utility
#
# DJP, Feb 2014
#
opts='-r 10 -vb 50M -bt 100M -vf setpts=4.*PTS'
ffmpeg -i splash_%04d.png $opts movie.mp4
The main options to play with are the bitrate (``-bt 100M``) that controls the quality and the ``-vf setpts=4.*PTS`` which controls how fast the movie plays (``setpts=1.*PTS`` gives 10 frames per second, this is usually too fast so we slow it down).
The industry-standard compression codec is the ``H.264`` MPEG codec which gives a nice small movie that is still good quality. The best way to reduce the movie size further is to restrict the data rate.
.. important::
The .mp4 files produced by ffmpeg as above currently not play directly in the Slack app. To ensure this you need to mandate that the pixel format is
"yuv420p", by adding the flag ``-pix_fmt yuv420p``. You must also ensure that the page dimensions are given in even (not odd) numbers of pixels.
Can I make animated gifs?
~~~~~~~~~~~~~~~~~~~~~~~~~
Another option is to produce an animated gif using the
``convert`` utility that comes with the `ImageMagick `_ package. As an example (kindly provided by John Mansour), use::
convert -delay 10 -loop 0 splash_*.png animatedgif.gif
where delay gives a delay in ms between frames, and loop determines whether the animated gif will loop (0= infinite, 1=1
loop, etc). The problem with an animated GIF is that they are slow unless you have *lots* of memory. However it is easy to convert an animated GIF into other movie formats.
I'm getting a segmentation fault, is splash broken?
----------------------------------------------------
This could be a stacksize issue (particularly with large data reads). Try::
ulimit -s unlimited
before invoking splash.
How do I write a postscript/eps file for LaTeX?
-----------------------------------------------
See :ref:`sec:postscript`. At the graphics device prompt, type::
Graphics device/type (? to see list, default /xw): /eps
choose ``/eps``. This will write the output to a file called splash.eps in the current directory.
Alternatively you can specify the filename explicitly by typing "myfile.eps". The
file can be incorporated directly into LaTeX documents.
How can I get a colour scheme like the one Joe Bloggs uses?
-----------------------------------------------------------
Send me an image (any sensible format will do) containing a colour bar using the scheme you
want to rip off and I will add it into splash. Also feel free to play with `my scripts for grabbing colour maps `_ yourself.
What about boundaries? How does the rendering work near a boundary?
-------------------------------------------------------------------
Usual practice in SPH simulations near boundaries is to introduce ghost
particles which mirror the real particles. splash does not explicitly
setup any ghost particles but will use any that are present in the data
(see next question for how to specify multiple particle types).
Additional particle types contribute to the rendering calculations but
not to the determination of the plot limits. Note, however, that splash
does *not* set up ghost particles itself, as this may depend on the type
and location of the boundary. Thus if your simulation uses ghost
particle boundaries, the ghost particles should be dumped alongside the
gas particles in the output file so that their positions, masses,
densities and smoothing lengths can be read into splash and used to
render the image appropriately.
How does splash handle multiple particle types?
-----------------------------------------------
splash can handle up to 6 different particle types. These can be turned
on and off in the :ref:`sec:menu-o`.
These types are be specified in the set_labels part of the read_data
routine, which contains some lines of code along the lines of:
::
ntypes = 3
labeltype(1) = 'gas'
labeltype(2) = 'ghost'
labeltype(3) = 'sink'
UseTypeInRenderings(1) = .true.
UseTypeInRenderings(2) = .true.
UseTypeInRenderings(3) = .false.
which says that there are 3 particle types, with names as given, and
that types 1 and 2 are SPH particles and should be used in the rendering
where appropriate (i.e., only when plotting of this type is turned on in
the :ref:`sec:menu-o`). Particle types which are to be used in renderings
should have masses, densities and smoothing lengths read. Non-SPH
particle types (e.g. sink particles) can be optionally plotted on top of
:ref:`sec:renderplot`.
What does SPLASH stand for?
----------------------------
Urrmmm... it has SPH in it and it sounded good. I thought of:
- "Some Pretty Little Application for Smoothed (particle) Hydrodynamics"
- "Smoothed Particles Look Amazingly Stunning Here"
- "So People Love Analysing Simulations of Hydrodynamics"
- "Simulating Particles Like A Superfast Horse"
Your suggestions on a postcard please.
SPLASH is so great. Can I send you loads of money?
--------------------------------------------------
I accept donations in the form of citations to the
`SPLASH paper `_ (Price, 2007, PASA, 24, 159-173). Just like sending cash, only... not.
This may change if I am flooded with requests from people wanting to send large
sums of money.
danieljprice-splash-4d1f09c/docs/figs/ 0000775 0000000 0000000 00000000000 14773653671 0017752 5 ustar 00root root 0000000 0000000 danieljprice-splash-4d1f09c/docs/figs/colourparts.pdf 0000664 0000000 0000000 00000477722 14773653671 0023045 0 ustar 00root root 0000000 0000000 %PDF-1.3
%Äåòåë§ó ÐÄÆ
4 0 obj
<< /Length 5 0 R /Filter /FlateDecode >>
stream
x´ËެKΖçuuÔŸçØ3Āآ‘Ôì·Ïó؇3T)ZjíÊw9|ˆ£Ãáˆï_ßÿéû_ßÇÃáçp¹}_ïŸëåzý>>O?÷Ëóø}|<~nçóõûý×ïÿòý?¿ï?§ïÿý}üþüÿ¿ÿÛøûøýßþö¿§¯üï¹~_ü￾ßÿÖçËéy?¾çŸ-ô~»ÿïÏï¿þù}½œ?·Ë×ùx:ýoß"ÏãÏñtþ>oÏŸÛãû|ÿçPùÿñ×fÜ\^§¬ß1>]ïWô;~?~Ž×çõÊ'tþ9Žß7«îyý¥Ê§ëéüszüáü¢àéJ_ï?Ò®?ÏãópþµÖ“ÏõÛíçŸÏËÏõú ©[×/|è”ò®ú>~÷ÇùòkÞ/|ާäýü¹\¾“5ÐïÔ¾è¹ÏÓ7àçþ|ZÛº^é݇ßêüÎ…Ú¸ÿÜoÆïgŒÿ`38·¿«Œ`}:Ÿÿoµñ!ëUÛñçsÇá|ÿ¹:6ùÆ‹íñx±Gëß}Èør>ýœíp×¥ð± ßwû¯ŒÎRßÇB>ã{:N?×—^ЇŒO»sü¨‰SA2¾ÞÏô„Æ}Èøqe’Ï*®Nq*è3Ægº cy´ÝB>äËJüóÒt®Í ²½/?÷—
>ô!ãçóɺ4[î\ÐgŒ/´Ó[_[ЇŒ¯÷ÃOöát—>äú¸²0¿Tð¥ Ï_—X‚Ƙ[ЇŒ/§ÛÏãe0_úãÛ—ðp¸é|,JMðÍwMçƒñ‚>ÔxÍç“óGS<î9KüõÞ3úäüÑ$ßµ±¦ôÁyAÖÆšÓ'ç¦ùsÏóíÂà ÆÔÿ©Î=ÑoÎMôÝ‚k^µ± u®™}2þd®ïZ^3ûdüÑd¿9÷lßµüÙlßœ×Ü>t^Ðïj¹Û¯¦÷Éø“ kÜ3~×Åg3~s^óûPyA¿«‹Í¹çüÖù³9ÿzdù¿žð\oçkyõ
ÝgÚßéŒÅúšúÄÏ+A
Ö¿à*~Ì5ÝÍãㆫ|FJˆû5Û76jû8ýœ.0þ@ÙÁBŽ÷»{XÞ.?Ï_»„ïl^8+â÷•Û
&›YOœ®_G‡º.“‹|ó/:‡ýï×Íöʾ§Ãùçq¦Žþñëÿ;9O?b+Ÿr~c#çÓÕmä‡uñÆE¾çËÏ!Gà'÷Î&8?~X8Pù£þv:¿²yáüÑÙœ“ÍKmü¾¿íªÈÙçÄÖî~µ>š}ÞÙ¨íɰ,ñá;ûT¢-N—çã9Bmp>¢:ñ߈µü–ë`!Ǭãó‘pÈï‡ÜùÖ¤ã\Ì?ØÈ¹V½O9¿±ój·+ãœk4Øvïl‚sÃÕI~Ù+Ö˜[l^8_LE¿íÅ›s²y©
b¿ðîÚH6r®‘÷áÈ;8ï^wÿõÂôÂCž=F>à9yÈsçN„Þ¸È7¦Úk²cù˜lè>é_Á†Ã¸Åfq('Î_މ¥àåÊ~Æs±fY¾Ä9ÖoÇÄæìaSðf„ïå#_-=êÅFÓýPá&r-oór½Åaäo«øÍç8túu7çd3k‚cÛßÏg]ŸÉE¾éÈÒMn†y[¯\à»üØËíðÑ4Y^õb#çòcôK•ßÙÈ9Ýáëâ‹|k½\?j¼w6Á9PBqôÛº(wx±yáüÑYèj/µóǯUÎ-FM
ò-—xM¿eüÆ&8§KçƒÇc¿ã|yœÏ8Çy@º1þö×¼¯¬GO¼ö>iý§³|aò>ÑòOÞ}Æûü¼ßH¼ðÞØíúsý}œoÁ³+j7ô¡Ö—Ãíç@ÈdÝØ‡¼§Ø2OÖúŒóéA ƒÇÁ¹¡9ëO¼æADªŒÐgmx:á>^T.ä3Ï»9G/©û÷Íl˜×>MŠSaò¾,Ó/=ïØØ‡¼IÆúaµžµ}lì³v|°ÀºOÞûLïëõÄA=áâѱ7öïl¸H¯=°±Ïx÷Ü%u*S
ôIúPÏüƒóZ>Ëâ ׂÁyCŸèܳ>Mw3üýÏï}ĹÖòZ>«‹óšñã
}¤qMøƒq#Ÿð]Óý滑øÖü¿›nMÿŸÕpÍþCÝœü?ãÚóüæ; Oê¡gùÁyMüê¼æøÁyCé¼føÝx=é¦sÏï[ç}¢sÏî›ó€>áÜóýæ< O83™™îtþ¾àßÝép9ÁF"êåþ¸ÿrgq~ž
Nß×û“kñ^Ùkg2J>æ½ø81“®Ë™Ü•ðÀ_³~cœM@Ä’%íw{-”zã#o–Y–ëõðs¶~ËúÍà|#¯[/çC΋ͬöI'úЯY¯úX|ä}?’Ín¯ÁǾ?~ßCÞùÈž¤ù_O¶µ°~c#gâ™t½O¿ra·l"-»£+ã6r&ƒòb=¯ºÿ]÷ø“Oðv?ðM"Â'=Ö¯lçÏFKs^lf}|6Æw}Ÿ‡¹¯`ÜDùxfúƒœ‰c^È¿gZeúþí`9]aC"ôõzI— c W²5od¬ür„ÿɇ$ âç¦{|8OÿÁFÎ ;~^ï|ä}C×kúœë*ÈÇòÎGÞÛý¸ßØÈ™¹Š¹úÌïfw.“ïg“Çæ¼øŒÚølÊëJ]lä¼êþ³UëO>ò®.óÙâò9¯~þ)ëw>ò®Qþi…¼±‘óš›Výÿ¶ï½ó Þ9®NókÖ¯lçœbÇ÷x¸;A3è¶K½±Ï®?ùüóûX™&ÎL°‘óÁK‹»Ôò Þqàû¡K
ëW6ƒógÝ£9/6³>>ëÔ»>yG"ÒÇ.õŸ|äÍ
Úßw.Á7´>ô¨aüÊFÎDfÃñýlfú“¼#›ãc§úO>Á;2’?tªaýÊfp^Þð/'§Åy±™õñáÜõzeÞÛN5õOnÀùS7ò6jmöÌóÝ‹ü·Ïåó¿þæŠ9iˆßÿÅ¥õ#lI`¾añíq¹|Qvc$à,ryž¹ž}åžèÕ[‘ÐY7"/â/W\ðEõ%ÂÑü%âÔHÊûÎrEeüàæUúæÄ¦ƒ¤8µ¼D¢û†Ôª°¡ysz·ï¯ï|Ÿ8빞 iõý|öÆÕÀu ^ätæf°ö°K¹
y»oäë¯À.Ov/T\ûÉz(N¼HÉËro×Ç—Ü‹öÜîÇ)¯ËµVM5¬)N ûÂj’0Î÷°Çê%v€Õ³‚oÏ@÷jÅËézþ:¸§x †‚P÷b„é³e¥
äp9Q1" €’öWpZÐùy¸N6ó<>)a…(ìúS*5Ušòe§wã4ùø8ÿ¼}ߘ1HcðjýFHÏ/©O“Ilº_É9o„n
v~ð‰P/ØgxÁ)‘àò²\Q±ßŽ>Ñœ<»ôF–WˆåZ«¦jkšS#e_vo*åA›„^8Íѽ+éòt>´¿Y77BI^!÷õNöáFœOF|Ôà :àoNÒˆlyY®±#[‹É íyÓ åÁ©»wkU˜H[œ^«öE[;«}1§ŽNª§lt(3é^0ú]ªË9š˜ nÑÀ‰8ºÜx%ÀURTt4BealqHÈËrMEë¿'óÕ5(y…¤î¥Õ jkŠÓ»}Ñ脌”ÎxÌ6Ÿ¹Rß¼"Àµ„l(”bÎ1м;²¹Y?º"8 ärä¶}v§`ƒû±ee1¡hKîƒA:á!«~[h©3HÊæœÇ=ô{±ªZš‰òqà´¹«Xì\yÜ‚0Íaú±Ï8ÜÇ/òî1HëAÎc&>ë“sÝBäeú1øÆŽÜ†´(üýÕ²,“H?ŸÞ0]<@¼Ü°rR›„PÏD³2¢Ø$Ì
ë Z)·l]P›Êr‰
4Ù2Ì¥‘ÔÁ ‚‹*Ù]“
Oøª›ÓB–8Ë
,5mNeßWÀ_±„§NM³
).hsc]~œË^摲P²¼¤–;¤‹âã’t¾Ð.¦OGuÔ€Ý
ìzyl,–\öâYʼn¥:íE\kè|HÞÉGKví’"‹-6ÕÒ$
…±f…wö·«%Ësh´ôýž^Jc˜~¼è¥ÄêÌu9
½pLž‹êâ