These are an assortment of notes compiled to aid new users in understanding and executing SQu1D. They are more freeform than the official readme and get into the underlying operation of the code, not just how to run it.
[Intel MKL Link Advisor] (https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/)
MKL install location: /opt/intel/parallel_studio_xe_2016.3.067
See note: Academic Research Performance Libraries from Intel
- update and upgrade packages
- Download and install inlet MPI and MKL libraries
- install MPICH2:
sudo apt-get install libcr-dev mpich2 mpich2-doc
- Install LAPACK
sudo apt-get install libblas-dev liblapack-dev liblapacke-dev
- Download latest tar ball
- unzip
- copy
make.inc.example
tomake.inc
- run
make blaslib
to ensure a successful build - run
make
- Change directories to the LAPACKE folder
- run
make
- Download SQu1D files:
make
- for intel compiler and libraries, just run
make
- for lapack, run
make -f "makefile_LP"
- on flux, run
make -f "makefile_FLUX"
- for intel compiler and libraries, just run
- Add environmental variable
export LD_LIBRARY_PATH=/opt/intel/mkl/lib/intel64
- run
./PIC.exe
- Execution folder must contain:
- PIC.exe
- Cross section folder
- SolverType.inp
- SolverInput.inp
- Run
./PIC.exe
(****: species name; #: number)
- Gives values of cell centered and edge values of parameters
- position (2D), density, velocity (3D), temperature (3D), energy (1D), electric field (3D), magnetic field (3D), heat flux (I think?) (3D)
- Gives values of individual particles
- Position (2D), velocity (3D), energy
- Provides some parameters of the simulation
- Binned phase space data
- Position (1D), velocity (1D), f (?), Vi (?), fx, fy, fz
- Velocity distribution function
- total velocity, total vdf, Vx, fx, Vy, fy, Vz, fz
- binary file
- A few values without labels
- A variety of values
- Position (2D), number density, charge density, potential energy, kinetic energy, total energy
- position of edges
- 2D mesh, X and Y
- position of centers
- 2D mesh, X and Y
- Empty
- GnuPlot
- Linux: install gnuplot (using version 4.6 here) and gnuplot-x11 (for graphics)
- Use script plot.sh for quick plotting to view results
- solvertype.cpp
- sType
- initializesolver.cpp
- initializeSolver
- variables.h
- solverVars
- fields
- boundvars
- spclvars
- particles
- contnm
- mesh.h
- Mesh
- solver.h
- solver
- boundary.h
- boundary
- mathfunctions.h
- mathFunctions
- writeoutput.h
- writeOutput
- exprtk.hpp
- external package
- equation parser
- run the program (main_PIC.cpp)
- Initialize the MPI environment
- Uses the open MPI environment through the wrapper compiler mpic++.
- Set flags for the compiler type and simulation type
- Initialize the solver (initializeSolver.cpp)
- Creates object with methods but no data
- Only used to set the solver flag
- Initialize the solver type (solverType.cpp)
- Set the solver flag (initializeSolver::readSolver)
- Opens SolverType.inp and reads first line
- Execute one of the solvers (solverType.cpp)
- Electrostatic 1D PIC
- This is the main process where the simulation happens
- Define some variables
- Create uninitialized vector of particles (variables.h)
- Create uninitialized vector of continuum parameters (variables.h)
- Create uninitialized MPI variables (variables.h)
- Initialize the code (initializesolver::readdata)
- Set MPI size and rank
- Seed random number generator
- Create uninitialized solver (initializeSolver.cpp)
- Create uninitialized solver variables (variables.h)
- Create uninitialized mesh (mesh.h)
- Create uninitialized fields (variables.h)
- Create uninitialized solver (solver.h)
- Create uninitialized boundary (boundary.h)
- Create math functions (mathFunctions.h)
- Create uninitialized boundary variables (variables.h)
- Create uninitialized special variables (variables.h)
- Read data into solver variables, mesh, boundaries, and special variables (initializeSolver::readdata)
- Define input file names (hard coded)
- Read a bunch of parameters
- Set the mesh flags
- write
- symmetry
- solver type
- Create mesh parameters
- Set length, starting point, boundaries, number of points on mesh
- Set cell weight, inlet area, and number of ghost cells
- Set particle distribution (What does this mean?)
- Read data into information for outputs in solver variables
- Read data into solver specific information into solver variables
- Read data into particle weight, interpolation scheme,
- Read data into particle mover algorithm
- Read data into background charge density
- Read solver input file
- Read data into initial condition variables
- Initialize output object (writeOutput.cpp)
- Create mesh (mesh::generatePICmesh)
- Create mesh points and centers
- Create array of mesh point and center neighbors (centers to points, centers to centers, points to centers, points to points)
- Initialize PIC (initializeSolver::initializePIC)
- Initialize phi and E and B
- Set mesh area
- Load restart file, if being used (initializeSolver::initializeRestart)
- Initialize particle locations
- Initialize continuum values
- Place particles on mesh
- Apply boundary conditions
- Seed particles (boundary::seedParticles)
- Set density, velocity, and temperature (at the boundary, I think)
- Call the seeding algorithm
- Main Loop (inside solvertype::electrostatic1DPIC)
- Solve Poisson's equation for phi (solver::poisson1D)
- Depends on boundary conditions
- Create the vectors of the solvertridiagonal matrix elements
- Solve the matrix equation
- Assign values to phi
- Set E field BC, if appropriate
- Calculate the E field from the electric potential (solver::phitoE)/in
- Apply E field boundary (solver::applyEfieldBoundary)
- Update the particle velocities (solver::updatePartVel)
- Get the E field at the particle location (solver::weighEfield)
- Get new particle velocity
- Redistribute particles (solver::redistributeparticles)
- Output files
- Get continuum values (n, u, v, ...)
- Weigh the contributions from the individual particles
- Smooth the data
- Apply continuum boundary conditions
- Write PIC fields (and continuum values) for each particle type (writeOutput::writePICField)
- Write the individual particle information (writeOutput::writeParticles)
- Write the vdfs (writeOutput::findvdf)
- Write the phase space (writeOutput::findPhaseSpace)
- Write restart files (writeOutput::writeRestart)
- Update particle positions
- Get continuum values (n, u, v, ...)
- Solve Poisson's equation for phi (solver::poisson1D)
- Electromagnetic 2D PIC
- Not implemented
- Euler 1D
- Not implemented
- Euler 2D
- Not implemented
- Close out the MPI environment
- Electrostatic 1D PIC
- Initialize the MPI environment
Modules to load
- gcc/4.8.5
- intel/16.0.3
- openmpi/1.10.2/intel/16.0.3
- mkl/11.3.3
Interactive node: qsub -I -V -A sheehanj_fluxod -q fluxod -l nodes=1:ppn=1,pmem=1gb,walltime=1:00:00,qos=flux
alias: interact
interactive: idev -m 15
(15 minutes)
load module cxx11