Praveen Chandrashekar

Centre for Applicable Mathematics, TIFR, Bangalore

[ People | News | Codes | Talks | Teaching | Publications | Calendar | Hiking | Contact ]

NCM Workshop on FVSMHP 2023

The workshop on Finite Volume and Spectral Methods for Hyperbolic Problems will take place in TIFR-CAM during 4–15 December, 2023. See here for original announcement

https://www.atmschools.org/school/2023/NCMW/fvsmhp

Numerical examples will require some softwares, and all participants are advised to bring a laptop with the following softwares installed.

You will need to use Linux/Unix to run these programs. To install required softwares, follow the instructions below and execute them in a terminal.

If you use Windows

First install WSL and then install packages under WSL. For more details on how to set up WSL for coding work, see here. Do not install conda and clawpack as root user, and also do not run these programs as root user.

Compilers, build tools, etc.

Install gcc compiler, etc. using your package manager. For example, using apt on Debian-based systems

sudo apt install gcc g++ gfortran gnuplot make curl wget git vim

Python

To get python and related packages, you should install some distribution of conda. I recommend miniforge but another alternative is Anaconda.

To install miniforge, download the installer using curl or wget or your favorite program and run the script in a terminal. For eg:

cd $HOME
curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
bash Miniforge3-$(uname)-$(uname -m).sh

or

cd $HOME
wget "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
bash Miniforge3-$(uname)-$(uname -m).sh

Follow the instructions to install. Update the base packages

conda update -y conda && conda update -y --all

And then install few additional packages.

conda install numpy scipy sympy matplotlib sympy prettytable jupyterlab

Clawpack

You can run a shell script to do the installation which requires conda to be already installed.

wget https://raw.githubusercontent.com/cpraveen/cfdlab/master/bin/clawpack.sh
export CLAW=$HOME/clawpack   # Set to where you want to put clawpack sources
bash ./clawpack.sh v5.9.2

You must also set the CLAW variable in your shell configuration file; this is usually $(HOME)/.bashrc or $(HOME)/.zshrc for bash and zsh shells, respectively; add following line in that file

export CLAW=$HOME/clawpack

If you are an expert user, see here for other ways to install.

Test clawpack

You must activate the claw env before running any clawpack code

conda activate claw

Then

python $CLAW/pyclaw/examples/advection_1d/advection_1d.py iplot=1

If this works, start an ipython session and type following there

from clawpack.pyclaw import examples
claw = examples.shock_bubble_interaction.setup()
claw.run()
claw.plot()

WARNING: It is best not to run inside $(CLAW) directory or to modify any code there. You can make a copy of $(CLAW) to some other place and work inside that directory.

Codes for lectures by Praveen C

The codes can be read here: numpde and chpde.

Download them using git

git clone https://github.com/cpraveen/numpde
git clone https://github.com/cpraveen/chpde

Many of these codes are still being made and updated, so you should download them frequently to get the latest version. E.g., to update chpde codes

cd chpde
git pull