LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] can new atom's property be calculated using an existing pair_style?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lammps-users] can new atom's property be calculated using an existing pair_style?


From: Axel Kohlmeyer <akohlmey@...24...>
Date: Wed, 25 Oct 2017 14:34:15 -0400

On Wed, Oct 25, 2017 at 2:21 PM, Quang Ha <quang.t.ha.20@...24...> wrote:
> Is there any implemented fixes that calculate the atom properties and do
> timestep update (i.e. update the change of the property at each time step)
> that I could use as a reference? I feel lost skimming through the
> documentation page with such abundant available options...

it is difficult to give a specific advice here, since different fixes
solve different problems in different ways.
many times the computation of a property is imported from requesting a
compute from inside the fix or requiring the compute to be defined and
passing the compute-id as an argument to the fix command.

the most obvious case of a fix manipulating a per-atom property are
the charge equilibration fixes (fix qeq/*). NOTE: those are run
*before* the pair forces are computed. if you want to update your
per-atom data at a different point in the time stepping, you have to
implement a different fix function and use different fix-flags in
Fix::setmask().

axel.

>
> QT
>
> On 25 October 2017 at 10:31, Axel Kohlmeyer <akohlmey@...24...> wrote:
>>
>> On Wed, Oct 25, 2017 at 9:51 AM, Quang Ha <quang.t.ha.20@...24...> wrote:
>> > Thanks, Axel.
>> >
>> > A quick follow-up question - if I just want my new property (i.e.
>> > concentration) to diffuse from one atom to nearby, would it be
>> > sufficient to
>> > write only my fix subroutine or does it have to be coupled with a
>> > pair_style
>> > as well?
>>
>> you can read from and write to your custom property from anywhere you
>> like.
>>
>> the only issue, that you have to be careful with is whether you access
>> that property from "ghost" atoms, i.e. atoms that are copies from
>> neighboring subdomains.
>> these are usually not updated unless explicitly requested, and you may
>> have to do an explicit reverse and/or forward communication to update
>> those after you made changes to "local" atoms (index in atom->x[] <
>> atom->nlocal).
>>
>> axel.
>>
>> >
>> > Quang
>> >
>> > On 24 October 2017 at 18:13, Axel Kohlmeyer <akohlmey@...24...> wrote:
>> >>
>> >> On Tue, Oct 24, 2017 at 1:56 PM, Quang Ha <quang.t.ha.20@...24...>
>> >> wrote:
>> >> > Hi,
>> >> >
>> >> > I am skeptical this is not possible, but just want to ask before
>> >> > shooting.
>> >> > For the new property, says foo, defined using fix property/atom
>> >> > command,
>> >> > can
>> >> > I allocate an existing pair_style so that the value of foo property
>> >> > can
>> >> > be
>> >> > calculated at each time step? Example: I want to have LJ potential to
>> >> > be
>> >> > applied to foo. Can I called the existing LJ potential pair_style or
>> >> > do
>> >> > I
>> >> > have to write new cpp/h files to define the pair_style for foo?
>> >>
>> >> you are not making sense here.
>> >> the LJ potential is a pairwise interaction. what fix property/atom
>> >> provides is a per-atom property. how will you generate the latter from
>> >> the former?
>> >> pair style hybrid is an example for how you can maintain multiple
>> >> instances of a pair style, however, if you want to capture any results
>> >> from that, you will have to do your own data management, since each
>> >> pair style will tally its results into global arrays and variables.
>> >>
>> >> axel.
>> >>
>> >>
>> >> >
>> >> > Thanks,
>> >> > Quang
>> >> >
>> >> >
>> >> >
>> >> > ------------------------------------------------------------------------------
>> >> > Check out the vibrant tech community on one of the world's most
>> >> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> >> > _______________________________________________
>> >> > lammps-users mailing list
>> >> > lammps-users@lists.sourceforge.net
>> >> > https://lists.sourceforge.net/lists/listinfo/lammps-users
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Dr. Axel Kohlmeyer  akohlmey@...24...  http://goo.gl/1wk0
>> >> College of Science & Technology, Temple University, Philadelphia PA,
>> >> USA
>> >> International Centre for Theoretical Physics, Trieste. Italy.
>> >
>> >
>>
>>
>>
>> --
>> Dr. Axel Kohlmeyer  akohlmey@...24...  http://goo.gl/1wk0
>> College of Science & Technology, Temple University, Philadelphia PA, USA
>> International Centre for Theoretical Physics, Trieste. Italy.
>
>



-- 
Dr. Axel Kohlmeyer  akohlmey@...24...  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.