HetSys PX915 group project (group B): Cahn-Hilliard Solver
Before building the dependencies and compiling the code, ensure that you have the following available:
- GCC/10.2.0
- CMake/3.20.1
- OpenMPI/4.0.5
- HDF5/1.10.7
- Python/3.8.6
- FFTW/3.3.8
If you are using Environment Modules (eg on Warwick's HetMathSys nodes) then this can be accomplished via
module purge
module load GCC/10.2.0 CMake/3.20.1 OpenMPI/4.0.5 HDF5/1.10.7 Python/3.8.6 FFTW/3.3.8
First clone the repository (and the required submodules) onto your machine:
git clone --recurse-submodules https://github.com/HetSys/CHSolver
The code requires a number of third party dependencies. We have included a build script
source ./build_deps
that will call the correct commands to build these locally and set up the Python environment. If you also require the ability to run unit tests you will also need to run
./build_pfunit
This may take a while (particularly ./build_pfunit
), but this only needs to be done once.
Once these have been built you can compile the code with
make
which will produce the executable chsolver
.
To run the code you must fully specify the output times and solver parameters. We have included the a script
./restore_json
that we generate a valid JSON input file, but these can be replaced (or overridden) using command line flags (see ./chsolver -h
for a full list).
Since the code uses MPI the code must be run with
mpirun -np <num_procs> ./chsolver
<num_procs>
must either be 1 (for the pseudo-spectral solver) or a power of 4 (for the finite-difference solver).
Once the output data has been generated (in the out
directory), the script
./run_visualisation
will produce an mp4 of the system over time and an image of the energy decay.
Detailed documentation can be generated via Doxygen:
make docs
The pseudo spectral solver is based on this paper (Li and Qiao, 2016) and the finite-difference solver is based on this paper (Ceniceros and Roma, 2007).