LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] Adding new attributes to atom_style(?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lammps-users] Adding new attributes to atom_style(?)


From: Quang Ha <quang.t.ha.20@...24...>
Date: Tue, 24 Oct 2017 11:50:59 -0400

It works now - thank you very much!

QT

On 24 October 2017 at 11:45, Axel Kohlmeyer <akohlmey@...24...> wrote:
On Tue, Oct 24, 2017 at 10:50 AM, Quang Ha <quang.t.ha.20@...24...> wrote:
> Thanks Axel. I am trying to get my example to run. Here is my attempt to add
> a new property and set its value:
>
> # Try adding a new property
> fix             prop all property/atom d_cA
> set             atom * d_cA 1.0
> dump            test all custom 10 tmp.dump id x y z d_cA
>
> But the output doesn't seem to be changed:
>
>> less tmp.dump
>
> ITEM: ATOMS id x y z d_cA
> 442 0.00506017 0.00462825 0.0005 0
> 664 0.0209455 0.0030418 0.0005 0
> 545 0.0227331 0.00759905 0.0005 0
> 549 0.0329678 0.00897803 0.0005 0
> 2 0.0358786 0.00115459 0.0005 0
> 643 0.0409961 0.00208396 0.0005 0
>
> ...
>
> Am I doing something wrong? I have a feeling it must be something pretty
> basic...

you need to either define the fix *before* creating the simulation box
(this fix is allowed to be defined this early)
or you have to initialize its storage with a "run 0" before you can
use the set command.

axel.


>
> Quang
>
> On 24 October 2017 at 06:51, Axel Kohlmeyer <akohlmey@...24...> wrote:
>>
>> On Mon, Oct 23, 2017 at 11:39 PM, Quang Ha <quang.t.ha.20@...24...>
>> wrote:
>> > Hi all,
>> >
>> > I am trying to add new attributes to the existing atom_style meso of the
>> > SPH
>> > package. Specifically, I want each atom to carry concentration of a
>> > specific
>> > substance (beside rho, e and cv). What would be the proper way around
>> > it?
>> > Here are the steps I believe I need to add
>> >
>> > 1. Add the new properties to atom_vec_meso.h
>> > 2. Add compute codes for the new attributes
>> > 3. Add new pair_style for the new attributes
>> >
>> > Is that all or am I missing something?
>>
>> please have a look at fix property/atom. this allows you to add custom
>> properties (integer or floating point) to any atom style without
>> having to modify that style.
>> you can then get hold of that property via atom->find_custom() in your
>> custom pair style.
>>
>> 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@...396...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@...43...4...  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.