Add force to a group of atoms

Hi all,

I am trying to simulate a polymer system. Where the interactions are
governed by harmonic spring and angular potentials. Moreover, during the
course of run, I wish to exert force to a particular group of atoms.
I have the data file from which LAMMPS has to read the components of
the force.
I have used the variable command like this
'variable f file force.dat'
Now, I want to apply the force on the group (say group 1) of atoms
through out the simulation. And it is where I am failing to provide the
exact command (another 'variable' command and a 'fix' command)to LAMMPS.
Can you kindly provide some way out.

Thanking you,

Best,

Have a look at the fix addforce doc page.

Steve

Have a look at the fix addforce doc page.

Yes, I checked the doc page you recommended earlier.
But, I could not find any discussion regarding my query.
To be specific,say I have 20 atoms in my system. I have a file
where in the first column the atom id's are printed. In the 2nd column
the force component is there (for simplicity, consider a 1-d chain).
Now, in fix addforce command , I wish to apply the force to the
group of atoms in each timestep . LAMMPS has to read from the force
file I have provided and apply the force to the atoms which is mentioned in
the file. I am attaching the force file (force.dat) for convenience.
Is there any way out now..

Hi all,

I am trying to simulate a polymer system. Where the interactions are
governed by harmonic spring and angular potentials. Moreover, during
the
course of run, I wish to exert force to a particular group of atoms.
I have the data file from which LAMMPS has to read the components of
the force.
I have used the variable command like this
'variable f file force.dat'
Now, I want to apply the force on the group (say group 1) of atoms
through out the simulation. And it is where I am failing to provide the
exact command (another 'variable' command and a 'fix' command)to
LAMMPS.
Can you kindly provide some way out.

Thanking you,

Best,
******************
Saikat Basu
Senior Research Fellow
Room no:C/312,Centenary Building
Department of Solid State Physics
Indian Association for the Cultivation of Science,
Jadavpur
Kolkata-700032
Ph no- 03324734971(extn- 2114)

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models.
Explore
techniques for threading, error checking, porting, and tuning. Get the
most
from the latest Intel processors and coprocessors. See abstracts and
register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
lammps-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lammps-users

Thanking you,

Best,

force.dat (31.1 KB)

Have a look at the fix addforce doc page.

Yes, I checked the doc page you recommended earlier.
But, I could not find any discussion regarding my query.
To be specific,say I have 20 atoms in my system. I have a file
where in the first column the atom id's are printed. In the 2nd column
the force component is there (for simplicity, consider a 1-d chain).
Now, in fix addforce command , I wish to apply the force to the
group of atoms in each timestep . LAMMPS has to read from the force
file I have provided and apply the force to the atoms which is mentioned in
the file. I am attaching the force file (force.dat) for convenience.
Is there any way out now..

your problem is that you have the process backward. rather that
preparing a file and then telling LAMMPS "eat it and make me happy"
you have to look up which options LAMMPS offers and tailor your
actions to it.

as you discovered, you can read variables from a file and there are
two options for that: file and atomfile
the former has the implication that it is like an index style
variables and the latter is like an atom style variable.

from there on it is straightforward and logical that the file you
created *cannot* work. and why should it? there is nothing in the
entire manual that states that this kind of format is supported
anywhere.

[...]

looking at the file contents on top of that i am wondering, why you go
through those pains, if you could just define two groups and use fix
addforce with a fixed force or +/- 10.0 on each of them. you
desperately need to feed it from a script to LAMMPS, you can just as
easily insert the group addition script code into your LAMMPS script
code.

in order to help yourself with future issues of this kind, i suggest
you have a look at the book "how to think like a programmer" as it
highlights problem solving strategies that *everybody* in our filed
needs. writing a LAMMPS input and designing an MD simulation is
conceptually not different from writing a fortran or java program or
an iOS or Android app. in fact, i often apply problem solving
strategies that i learned in organic synthetic chemistry and those
apply very well to programming (just as my training in analytic
chemistry helps me with debugging...). now i don't suggest that you
have to become a chemist to be good at programming or simulation (far
from it, most chemists don't fit that bill either), but i want to
point out that solving a problem is *much* more than knowing the
syntax and the features that one has to look beyond that.

axel.