PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
This guide provides step-by-step instructions for setting up your environment, installing dependencies, cloning the source code, and compiling the PICurv solver platform.
Before you begin, ensure you have the following software installed on your system. These are essential for building and running the solver.
pic.flow
conductor script.This section describes how to install the required dependencies. Correctly installing PETSc is the most critical step.
On most Linux distributions, you can install the essential tools using the system's package manager.
For Debian/Ubuntu:
For CentOS/RHEL/Fedora:
We strongly recommend building PETSc from source to ensure all components required by PICurv are enabled.
bash git clone -b v3.20.3 https://gitlab.com/petsc/petsc.git cd petsc
Configure PETSc: PICurv specifically requires DMSwarm
. We recommend a configuration like the one below. Run this from the petsc
source directory.
For a debugging build (recommended for development): bash ./configure --with-cc=mpicc --with-cxx=mpicxx --with-fc=mpif90 \ --download-fblaslapack --download-metis --download-parmetis \ --with-dmswarm=1 \ --with-debugging=1
For an optimized build (recommended for production runs): bash ./configure --with-cc=mpicc --with-cxx=mpicxx --with-fc=mpif90 \ --download-fblaslapack --download-metis --download-parmetis \ --with-dmswarm=1 \ --with-debugging=0 --COPTFLAGS='-O3' --CXXOPTFLAGS='-O3' --FOPTFLAGS='-O3'
bash make all make check
Once PETSc is built, you must set two environment variables so that other applications (like PICurv) can find it.
Set Environment Variables: Add the following lines to your shell startup file (e.g., ~/.bashrc
, ~/.zshrc
). Replace /path/to/your/petsc
with the actual path. The PETSC_ARCH
name will be printed on screen after you run ./configure
.
bash @section autotoc_md8 Example for a debug build on Linux export PETSC_DIR=/path/to/your/petsc export PETSC_ARCH=arch-linux-c-debug
bash source ~/.bashrc
echo $PETSC_DIR
and echo $PETSC_ARCH
. They should print the paths you just set. This is a critical step; PICurv's Makefile
will fail if these are not set correctly.With all prerequisites in place, you can now clone the PICurv repository.
The PICurv platform is managed by the pic.flow
conductor script, which provides a simple interface to the underlying Makefile
.
PICurv/
directory.Build the Solver and Postprocessor: Use the build
command of the pic.flow
script.
bash ./bin/pic-flow build
This command will invoke the Makefile
and compile all C source code. If the compilation is successful, you will find the executables picsolver
and postprocessor
in the bin/
directory.
The build
command can pass arguments directly to make
. This is useful for cleaning the project or building for different systems.
config.cluster.mk
): Congratulations, you have successfully built the PICurv solver platform!
You are now ready to run your first simulation. Please proceed to the next tutorial: Tutorial: Your First Simulation (Flat Channel).