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
- Add the new properties to atom_vec_meso.h
- Add compute codes for the new attributes
- Add new pair_style for the new attributes
Is that all or am I missing something?
Thanks,
Quang
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 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…
Quang
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.
It works now - thank you very much!
QT