projects
/
physik
/
posic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8358faa
)
even more testing ...
author
hackbard
<hackbard>
Wed, 5 Apr 2006 23:16:30 +0000
(23:16 +0000)
committer
hackbard
<hackbard>
Wed, 5 Apr 2006 23:16:30 +0000
(23:16 +0000)
moldyn.c
patch
|
blob
|
history
posic.c
patch
|
blob
|
history
posic.h
patch
|
blob
|
history
diff --git
a/moldyn.c
b/moldyn.c
index
db575e9
..
7f9745a
100644
(file)
--- a/
moldyn.c
+++ b/
moldyn.c
@@
-33,7
+33,7
@@
int moldyn_usage(char **argv) {
printf("-V <steps> <filebase> (rasmol file)\n");
printf("--- physics options ---\n");
printf("-T <temperature> [K] (%f)\n",MOLDYN_TEMP);
printf("-V <steps> <filebase> (rasmol file)\n");
printf("--- physics options ---\n");
printf("-T <temperature> [K] (%f)\n",MOLDYN_TEMP);
- printf("-t <timestep tau> [s] (%f)\n",MOLDYN_TAU);
+ printf("-t <timestep tau> [s] (%
.15
f)\n",MOLDYN_TAU);
printf("-R <runs> (%d)\n",MOLDYN_RUNS);
printf("\n");
printf("-R <runs> (%d)\n",MOLDYN_RUNS);
printf("\n");
@@
-520,7
+520,7
@@
int force_harmonic_oscillator(t_moldyn *moldyn) {
d=v3_norm(&distance);
if(d<=moldyn->cutoff) {
v3_scale(&force,&distance,
d=v3_norm(&distance);
if(d<=moldyn->cutoff) {
v3_scale(&force,&distance,
-
(-sc*(1.0-(equi_dist/d)
)));
+
-sc*(1.0-(equi_dist/d
)));
v3_add(&(atom[i].f),&(atom[i].f),&force);
v3_sub(&(atom[j].f),&(atom[j].f),&force);
}
v3_add(&(atom[i].f),&(atom[i].f),&force);
v3_sub(&(atom[j].f),&(atom[j].f),&force);
}
@@
-554,7
+554,7
@@
double potential_lennard_jones(t_moldyn *moldyn) {
u=0.0;
for(i=0;i<count;i++) {
for(j=0;j<i;j++) {
u=0.0;
for(i=0;i<count;i++) {
for(j=0;j<i;j++) {
- v3_sub(&distance,&(atom[
j].r),&(atom[i
].r));
+ v3_sub(&distance,&(atom[
i].r),&(atom[j
].r));
d=1.0/v3_absolute_square(&distance); /* 1/r^2 */
help=d*d; /* 1/r^4 */
help*=d; /* 1/r^6 */
d=1.0/v3_absolute_square(&distance); /* 1/r^2 */
help=d*d; /* 1/r^4 */
help*=d; /* 1/r^6 */
@@
-580,14
+580,14
@@
int force_lennard_jones(t_moldyn *moldyn) {
count=moldyn->count;
params=moldyn->pot_params;
eps=params->epsilon4;
count=moldyn->count;
params=moldyn->pot_params;
eps=params->epsilon4;
- sig6=params->sigma6;
- sig12=params->sigma12;
+ sig6=
6*
params->sigma6;
+ sig12=
12*
params->sigma12;
for(i=0;i<count;i++) v3_zero(&(atom[i].f));
for(i=0;i<count;i++) {
for(j=0;j<i;j++) {
for(i=0;i<count;i++) v3_zero(&(atom[i].f));
for(i=0;i<count;i++) {
for(j=0;j<i;j++) {
- v3_sub(&distance,&(atom[
j].r),&(atom[i
].r));
+ v3_sub(&distance,&(atom[
i].r),&(atom[j
].r));
v3_per_bound(&distance,&(moldyn->dim));
d=v3_absolute_square(&distance);
if(d<=moldyn->cutoff_square) {
v3_per_bound(&distance,&(moldyn->dim));
d=v3_absolute_square(&distance);
if(d<=moldyn->cutoff_square) {
@@
-600,7
+600,7
@@
int force_lennard_jones(t_moldyn *moldyn) {
h2*=sig6;
/* actually there would be a '-', *
* but f=-d/dr potential */
h2*=sig6;
/* actually there would be a '-', *
* but f=-d/dr potential */
- d=
-12.0*h1+6.0*
h2;
+ d=
h1+
h2;
d*=eps;
v3_scale(&force,&distance,d);
v3_add(&(atom[i].f),&(atom[i].f),&force);
d*=eps;
v3_scale(&force,&distance,d);
v3_add(&(atom[i].f),&(atom[i].f),&force);
diff --git
a/posic.c
b/posic.c
index
992f9d1
..
8bbfe0e
100644
(file)
--- a/
posic.c
+++ b/
posic.c
@@
-60,7
+60,7
@@
int main(int argc,char **argv) {
/* testing purpose
count=2;
si=malloc(2*sizeof(t_atom));
/* testing purpose
count=2;
si=malloc(2*sizeof(t_atom));
- si[0].r.x=0.
2
3*sqrt(3.0)*LC_SI/2.0;
+ si[0].r.x=0.
1
3*sqrt(3.0)*LC_SI/2.0;
si[0].r.y=0;
si[0].r.z=0;
si[0].element=SI;
si[0].r.y=0;
si[0].r.z=0;
si[0].element=SI;
@@
-111,7
+111,7
@@
int main(int argc,char **argv) {
lj.epsilon4=4.0*LJ_EPSILON_SI;
ho.equilibrium_distance=0.25*sqrt(3.0)*LC_SI;
lj.epsilon4=4.0*LJ_EPSILON_SI;
ho.equilibrium_distance=0.25*sqrt(3.0)*LC_SI;
- ho.spring_constant=
4.0*LJ_EPSILON_SI
;
+ ho.spring_constant=
1.0
;
u=get_e_pot(&md);
u=get_e_pot(&md);
diff --git
a/posic.h
b/posic.h
index
d31331f
..
44caf18
100644
(file)
--- a/
posic.h
+++ b/
posic.h
@@
-23,9
+23,9
@@
#define TEMPERATURE 273.0
#define TEMPERATURE 273.0
-#define LEN_X
3
-#define LEN_Y
3
-#define LEN_Z
3
+#define LEN_X
10
+#define LEN_Y
10
+#define LEN_Z
10
#define R_CUTOFF (0.25*LEN_Z)
#define R_CUTOFF (0.25*LEN_Z)