I apologize in advance for not knowing how to do this -- I would imagine this is pretty simple for someone who knows what they are doing (this excludes me, apparently):
I am trying to develop a sintering interaction (pair_gran_sinter.cpp) for LIGGGHTS 1.4.6, and I need to ensure that it is conserving particle volume as the particles sinter together (see movie below for example). To do this, I need to store an array of initial particle sizes (radii) such that it is available to pair_gran_sinter.cpp for subsequent volume and updated radius calculations.
I have added an init_radius array to atom.cpp, and I am pretty sure it is accessible from my pair_gran_sinter.cpp.
The problem comes in initializing it. I have tried to modify fix store/coord to become fix store/radius so that I can record the initial radii at the start (or anywhere else) in the run, but I am having segfault problems. Mostly I am not sure how much of fix store/coord I really need to retain, and if maybe I am making a mistake in trying to re-work a fix designed for 3D data (position) instead of 1D data (radius).
Am I making this too difficult? Is there a simple way to do this from within pair_gran_sinter.cpp, or should I continue down the road of modifying fix store/coord? I have attached my attempted fix_store_radius.txt for your amusement.
Thanks for any insight here -- the model is looking OK now, but I am stymied by this init_radius thing, mostly because I can't program my way out of a wet paper bag.
Here is a quick movie for anyone interested:
http://flash.thayer.dartmouth.edu/~dbreton/madgewiki/uploads/Notebooks/f...
Thanks
DAN
Attachment | Size |
---|---|
![]() | 3.98 KB |
moritzhoefert | Wed, 11/09/2011 - 09:13
Hi Dan,my first approach to
Hi Dan,
my first approach to that issue would be a registering a peratom quantity maybe in the constructor of pair_gran_sinter.cpp that will hold the initial radius. In fix_heat_gran.cpp you'll find an example that shows how to register such a global peratom quantity. It can be accessed from other fixes and pair potentials. So you can write a fix that is called once after the creation of all atoms that stores the radii. Then the original values will be available at all times.
Best,
Moritz
dbreton | Wed, 11/09/2011 - 19:37
global peratom
Hi Moritz,
Thanks for writing back so soon... and I agree after struggling some more with this that it must be a GLOBAL peratom quantity.
I am looking at fix_heat_gran.cpp and I am guessing that temperature is an example of the kind of peratom quantity I am supposed to be emulating for my problem, so I will start there and forge ahead.
Thanks again for your suggestions,
DAN
ckloss | Wed, 11/09/2011 - 09:45
Hi Dan, there is the fix
Hi Dan,
there is the fix store/state (fix_store_state.cpp) available to do this.
Alternatively, you could use a fix property/atom as suggested by Moritz (however, you would have to create the fix in post_create rather than in the constructor) and copy the radius values upon first execution of pair_sinter.
Cheers, Christoph
dbreton | Wed, 11/09/2011 - 20:05
fix store/state
Hi Christoph,
I looked at fix store/state and it *almost* looked like what I wanted to do... but then I could not figure out how to make these values accessible to pair_gran_sinter, which is where the new particle sizes want to be calculated. I suppose that as long as I have managed to correctly create an init_radius array in pair_gran_sinter then I could do something like this in my input script:
## my sintering particles are in group "regular"
fix 1 regular store/state radius #store initial radii
set group regular property/peratom init_radius f_1
Thanks for the input.
DAN
ckloss | Thu, 11/10/2011 - 08:43
Hi Dan, what you should do is
Hi Dan,
what you should do is initiate the fix store/state in the constructor as opposed to the input script. This is then "hidden" from the user. Then with modify->find_fix() you can get a pointer to the fix and access it's vector_atom quantity, which is the radius.
Cheers, Christoph
ckloss | Thu, 11/10/2011 - 08:42
correction: for a pair style
correction: for a pair style it is correct to create a fix in the constructor (not so for a fix). sorry for confusion
Cheers, Christoph