Problem Assigning Charges

Submitted by abhishek on Fri, 08/24/2012 - 10:33

Hello Liggghts Users,

I am new to liggghts and lammps too. I am trying to make changes in the example files (LIGGGHTS) by assigning external electric field using Fix. But I am unable to set charges to the particles using SET command.

The error says : Set command with no atoms existing.

Can somebody explain what I am doing wrong ? or how to assign charges in example file "in.conveyor". (*Sorry for such a stupid question*)

Thanks,

Best Regards,

abhishek

tapsab | Sun, 08/26/2012 - 00:03

Abhisek,
I dont think you can generate atoms and set some property using the "set" command in the same step. You would either need to split the simulation in two steps, one where you generate the atoms and the next one where you apply the "set" to the generated atoms. Or if you want to generate a continuous stream of particles and assign them some property after each step you can use the "run every......." command.

If you are just doing it as an example it might be easier to pick an example where the atoms are already defined rather than being dynamically generated using the "insert/stream" command as in the conveyor example.

Best,
Tapan

ckloss's picture

ckloss | Mon, 08/27/2012 - 10:11

Hi Abhisek,

when using insert/stream there are two possibilities - either you use the set command periodically with "run every......." or you add a line to particleToInsert.cpp where you set the charge of your particles (hardcoded)

Christoph