Finite size particles

Hello

Thank for your last respond, I want to write a c++ code to define some finite size particles which doesn’t exist in lammps atom style command,
But I have no idea about making particles and writing code, for example, how can i define a solid and massive finite size particle? Can i achieve c++ lammps source code about making finite size particls to inspire? such as line, spherical and so on that exist in lammps?
Thank you so much
ent from Yahoo Mail on Android

Hello

Thank for your last respond, I want to write a c++ code to define some finite size particles which doesn’t exist in lammps atom style command,
But I have no idea about making particles and writing code, for example, how can i define a solid and massive finite size particle? Can i achieve c++ lammps source code about making finite size particls to inspire? such as line, spherical and so on that exist in lammps?

the major problem is not going to be to write a new atom style, but to write a new pair style where you compute the interactions and the resulting forces and torques.
if you start from setup where all particles are the same (or only differ by size), you can re-use atom style ellipsoid and also the asphere time integration fixes and now only need to write a pair style, that takes existing per-particle parameters for shape and orientation and then compute force and torque, which is then used to do the time integration of the center of mass translation and rotation around the center of mass in the time integration like in fix nve/asphere.

again, you can start from the existing work and create a copy of an ellipsoid pair style (say, gayberne) and modify it for your needs (for starters, you would only need to keep the ELLIPSOID vs. ELLIPSOID code path. but keep in mind, that ellipsoids are comparatively easy, since they have no edges. computing forces for particles with edges is “tricky”, for obvious reasons. now if you want multiple shapes at the same time, things can get very complicated very quickly. i will thus suggest again, that you consider building your shaped particles from a collection of (overlapping) spherical particles of different size. the rigid fixes allow to read in moments of inertia for such rigid objects and thus handle the problem of computing the mass with overlap in such a case.

to summarize, don’t look at how to define a particle, but instead look at “what information is needed for time integration?” and “what is needed to compute forces and torques?”

axel.