User defined parameter

Dear All,

I would like to play around with a new interacting potential between particle i and j. The potential strength “alpha” is used in the pair_style dpd.

So far I declare in the pair_dpd.cpp this variable:

double alpha=0.1;

and whenever I change this value, I have to recompile LAMMPS.

My question if there is a way to define alpha as a parameter in the input file, and called by LAMMPS such that I can change this value without recompile LAMMPS?

I have tried to with:

variable alpha equal 0.1

But don’t know how to call by pair_dpd.cpp

Thank you very much.

The LAMMPS manual has a detailed discussion of implementing a pair style from scratch and that includes how to set either global or per pair of type parameters. Please check out: 4.7.1. Writing new pair styles — LAMMPS documentation