Dear Steve, Axel and list,
I took a whack and wrote a new compute which works with the 10Aug15 version. I also wrote an fcm/chunk to compute the total force on chunk normalized by chunk mass (now that I think of it, I should have called it acm/chunk or something), which followed trivially from the vcm/chunk compute.
The design of the expandchunk/atom compute is exactly what Steve and Axel suggested. It reads in the global chunk arrays and generates a peratom vector. Usage and context is provided below.
I had to add the following two lines in the compute_(fcm/vcm/com)_chunk.cpp files to get them to work with my new compute:
nchunk = cchunk->setup_chunks();
size_array_rows = nchunk;
They go below the init() call on line 47, and were required as <size_array_rows> was not getting initialized to the desired value.
I’ve attached the new compute files to this mail. If anyone would like to use it, remember to add the corresponding
header files to style_compute.h.
The usage and syntax are as follows:
compute cc1 all chunk/atom molecule
compute myChunkVCOM all vcm/chunk cc1
compute myChunkFCOM all fcm/chunk cc1
compute chF all expandchunk/atom cc1 c_myChunkFCOM c_myChunkFCOM c_myChunkFCOM
compute chV all expandchunk/atom cc1 c_myChunkVCOM c_myChunkVCOM c_myChunkVCOM
variable forcex atom -massc_chF
variable forcey atom -massc_chF
variable forcez atom -mass*c_chF
variable velx atom -c_chV
variable vely atom -c_chV
variable velz atom -c_chV
It has worked for me so far, but if there are any issues/bugs, kindly send me a personal email as my lammps emails get directed
to a folder I don’t check often.
compute_expand_chunk_atom.cpp (10.1 KB)
compute_expand_chunk_atom.h (1.68 KB)
compute_fcm_chunk.cpp (6.81 KB)
compute_fcm_chunk.h (1.76 KB)