ywangd / mspms2

Automatically exported from code.google.com/p/mspms2
0 stars 1 forks source link

Change erfrc() and rafrc() related functions for accepting parameters for pair calculations #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The related functions, such as loop_ij(), loop_14(), etc. need to take
parameters. So they can be used to calculate pair interactions. For an
example, loop_ij(1,2) will calculation the interaction between molecule 1
and 2. The two parameters are the molecule index. If -1 is provided, all
molecules will be calculated. e.g., loop(-1,-1) calculates the interactions
for the whole system. loop(1,-1) calculates the interactions for molecule 1
with the whole system.
The energy result for the pair interaction also needs to be returned. The
functions currently only calculates the total energy. This needs to be
changed for two reasons:
1. should also calculates the pair energy.
2. should not modify the total energy if it is only for pair interactions.

Original issue reported on code.google.com by ywa...@gmail.com on 12 Dec 2007 at 6:59

GoogleCodeExporter commented 9 years ago
The loop_ij() etc. functions have been modified to take parameters for pair
interaction calculations.
Still need more work, e.g. returning the energy results.

Original comment by ywa...@gmail.com on 13 Dec 2007 at 3:57

GoogleCodeExporter commented 9 years ago
The functions need to be changed to save energy results into Session variables
instead of Total variables.
Session Variables are specifically for the loop. Total variables are for the 
whole
system.
Session Variables are added into vars.h. They have common name of gXXXSession. 
Use
them to store the results from each loop. The total energies for the whole 
system or
pair interaction energies can all be calculated from them.

Original comment by ywa...@gmail.com on 13 Dec 2007 at 10:24

GoogleCodeExporter commented 9 years ago
The changes are made for erfrc() and rafrc() related functions.

All of the energy/pressure results are saved in Session variables. Forces are 
still
saved in global variables, because they are not required for pair interaction
calculations.

Original comment by ywa...@gmail.com on 14 Dec 2007 at 1:55