- Conda (Miniconda or Anaconda)
- Git
- CMake ≥ 3.16
- A C++ compiler with MPI support (e.g. OpenMPI via Homebrew on macOS)
- Python 3.12
git clone https://github.com/nanoMLMS/NPGrowth_V1.git
cd NPGrowth_V1conda create -n NPGrowth_V1 python=3.12
conda activate NPGrowth_V1From inside the NPGrowth_V1 directory:
git clone https://github.com/lammps/lammps.git
cd lammps
git checkout stableNPGrowth_V1 requires a patched version of fix_deposit that supports the target keyword. Copy the modified files into the LAMMPS source tree:
cp ../lammps_deposition_modified/fix_deposit.cpp src/
cp ../lammps_deposition_modified/fix_deposit.h src/The patched file uses an older minimum_image API. Update it to match the current LAMMPS version:
sed -i '' 's/domain->minimum_image(delx,dely,delz)/domain->minimum_image(FLERR, delx, dely, delz)/g' src/fix_deposit.cppNote (Linux): omit the
''after-i:sed -i 's/domain->minimum_image(delx,dely,delz)/domain->minimum_image(FLERR, delx, dely, delz)/g' src/fix_deposit.cpp
Verify the fix was applied (should show 2 lines with FLERR):
grep "minimum_image" src/fix_deposit.cppmkdir build
cd build
(on indaco:
module load intel-oneapi-mpi
module load intel-oneapi-mkl
cmake ../cmake \
-DCMAKE_INSTALL_PREFIX=$HOME/lammps \
-DBUILD_MPI=on \
-DBUILD_OMP=off \
-DPKG_MOLECULE=on \
-DPKG_MANYBODY=on \
-DPKG_KSPACE=on \
-DFFT=MKL \
-DCMAKE_C_COMPILER=mpicc \
-DCMAKE_CXX_COMPILER=mpicxx
)
cmake ../cmake \
-DCMAKE_INSTALL_PREFIX=$HOME/lammps \
-DPKG_MOLECULE=on \
-DPKG_MANYBODY=on \
-DPKG_KSPACE=on \
-DBUILD_MPI=yes
make -j 8
make installThe compiled binary will be installed at $HOME/lammps/bin/lmp.
Navigate to the sample directory and launch LAMMPS with MPI:
cd ../../sample
mpirun -np 4 $HOME/lammps/bin/lmp -in sample.inAdjust -np 4 to match the number of CPU cores available on your machine.
NPGrowth_V1/
├── code/ # Python scripts
├── lammps/ # LAMMPS source (cloned in Step 3)
├── lammps_deposition_modified/ # Patched fix_deposit files
│ ├── fix_deposit.cpp
│ └── fix_deposit.h
├── sample/ # Example simulation
│ ├── sample.in # Main LAMMPS input script
│ ├── molecule0.txt
│ ├── potentials/
│ ├── make_deposit/
│ └── seeds/
## To run:
To create the configuartion for the deposition:
python3 make_deposition.py \
--config config/single_gun_single_target.json \
--output output/test_0
then to run the lammps:
mpirun -np 4 $HOME/lammps/bin/lmp -in sample.in