Particle Assembler is a software tool designed to generate particle assemblies in cylindrical and cylinder shell geometries using the FIRE (Fast Inertial Relaxation Engine) iterative algorithm. This software is particularly useful for creating initial configurations of particle systems for simulations in computational physics, materials science, and granular mechanics.
Creating well-packed particle assemblies is a fundamental challenge in particle-based simulations. This software implements the FIRE algorithm to efficiently relax particle systems into stable configurations within cylindrical and cylindrical shell geometries.
The Fast Inertial Relaxation Engine (FIRE) is a molecular dynamics-based minimization algorithm that efficiently finds local energy minima of particle systems. Unlike traditional steepest descent or conjugate gradient methods, FIRE adapts the timestep and introduces artificial damping to accelerate convergence.
The key advantage of FIRE is its ability to handle systems with many degrees of freedom and complex energy landscapes, making it ideal for particle packing problems.
The FIRE algorithm is based on a modified molecular dynamics approach with adaptive timestep control. The core equations governing particle motion are:
Position update:
Velocity update:
where
Modified velocity (FIRE-specific):
At each timestep, velocities are modified using:
where:
-
$\alpha$ is a mixing parameter (typically initialized to 0.1) -
$\hat{\mathbf{F}}_i = \mathbf{F}_i / |\mathbf{F}_i|$ is the normalized force direction
Power criterion:
The algorithm monitors the power:
When
The FIRE algorithm proceeds as follows:
-
Initialize parameters:
-
$\Delta t = \Delta t_{\text{init}}$ (initial timestep) -
$\alpha = \alpha_{\text{start}}$ (typically 0.1) -
$N_{\text{min}} = 5$ (minimum number of steps before increasing$\Delta t$ )
-
-
MD integration step:
- Compute forces
$\mathbf{F}_i$ on all particles - Update positions and velocities using velocity-Verlet integration
- Apply velocity modification:
$\mathbf{v}_i = (1 - \alpha)\mathbf{v}_i + \alpha \hat{\mathbf{F}}_i |\mathbf{v}_i|$
- Compute forces
-
Check power
$P = \sum_i \mathbf{F}_i \cdot \mathbf{v}_i$ :If
$P > 0$ :- Increment counter:
$N_{\text{stable}} = N_{\text{stable}} + 1$ - If
$N_{\text{stable}} > N_{\text{min}}$ :- Increase timestep:
$\Delta t = \min(f_{\text{inc}} \Delta t, \Delta t_{\text{max}})$ (with$f_{\text{inc}} = 1.1$ ) - Decrease mixing:
$\alpha = f_{\text{dec}} \alpha$ (with$f_{\text{dec}} = 0.99$ )
- Increase timestep:
If
$P \leq 0$ :- Set all velocities to zero:
$\mathbf{v}_i = 0$ - Decrease timestep:
$\Delta t = f_{\text{dec}} \Delta t$ (with$f_{\text{dec}} = 0.5$ ) - Reset mixing:
$\alpha = \alpha_{\text{start}}$ - Reset counter:
$N_{\text{stable}} = 0$
- Increment counter:
-
Convergence check:
- Continue until maximum force
$\max_i |\mathbf{F}_i|$ falls below a tolerance threshold - Typical convergence criterion: $\max_i |\mathbf{F}i| < F{\text{tol}}$
- Continue until maximum force
-
Repeat steps 2-4 until convergence
Particles are confined within a cylinder of radius
where
Radial constraint: For a particle at position
Axial constraints:
For a cylindrical shell (annular cylinder), particles are confined between an inner radius
with the same axial constraint:
- C++ compiler with C++17 support
- CMake 3.10 or higher
- Python 3.x with NumPy and PyVista (for visualization)
# Clone the repository
git clone https://github.com/chaos-polymtl/particle_assembler.git
cd particle_assembler
# Create build directory
mkdir build
cd build
# Configure and build
cmake ..
make
# The executable will be created as particle_assemblerThe particle assembler generates a packed particle assembly in a cylindrical shell geometry:
# Run the assembler
./particle_assembler examples/tetlow_phi_10p.jsonThis will:
- Initialize N particles randomly within the cylindrical shell
- Gradually grow particle radii from an initial low packing fraction to the target packing fraction
- Use FIRE algorithm to relax overlaps at each growth step
- Output the final particle configuration to
output.txt
NOTE: The syntax of the particle assembler is currently unstable
Key parameters are defined in json files (ex: examples/tetlow_phi_10p.json:
n_particles: Number of particles (no default)phi_target: Target packing fraction (no default)r_in: Inner radius of cylindrical shell (no default)thickness: Shell thickness, distance between outer and inner radius (no default)height: Cylinder height (no default)k_pair: Particle-particle interaction stiffness (default: 1e3)k_wall: Particle-wall interaction stiffness (default: 1e3)grow_rate: Particle radius growth rate per cycle (default: 1.02)fire_max_steps: Maximum FIRE iterations per cycle (default: 100000)fire_dt: FIRE timestep (default: 1e-5)FIRE_ftol: Force convergence tolerance (default: 1e-6)
The software outputs a file output.txt with the following format:
# x y z radius
x1 y1 z1 r
x2 y2 z2 r
...
Convert the output to VTP format for visualization in ParaView:
cd python
python convert_output.py --input ../build/output.txtThe script supports the following options:
input_file: (required) Input file containing particle positions and radii--output-vtp: Output VTP file name (default:particles.vtp)--output-lethe: Output Lethe insertion file name (default:insertion_file.dat)
Example with custom output names:
python convert_output.py --input output.txt --output-vtp my_particles.vtp --output-lethe my_insertion.datThis will generate:
particles.vtp(or custom name): VTK PolyData file for ParaView visualizationinsertion_file.dat(or custom name): Lethe-compatible particle insertion file
-
Bitzek, E., Koskinen, P., Gähler, F., Moseler, M., & Gumbsch, P. (2006). Structural Relaxation Made Simple. Physical Review Letters, 97(17), 170201. DOI: 10.1103/PhysRevLett.97.170201
-
Guénolé, J., Nöhring, W. G., Vaid, A., Houllé, F., Xie, Z., Prakash, A., & Bitzek, E. (2020). Assessment and optimization of the fast inertial relaxation engine (fire) for energy minimization in atomistic simulations and its implementation in lammps. Computational Materials Science, 175, 109584.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.