]> hackdaworld.org Git - physik/posic.git/commitdiff
even more testing ...
authorhackbard <hackbard>
Wed, 5 Apr 2006 23:16:30 +0000 (23:16 +0000)
committerhackbard <hackbard>
Wed, 5 Apr 2006 23:16:30 +0000 (23:16 +0000)
moldyn.c
posic.c
posic.h

index db575e9059ac2f88ebad208af55fb28e3053624c..7f9745ad29ef2f8e7dd52a52301a4f0a05ad0283 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("-t <timestep tau> [s] (%f)\n",MOLDYN_TAU);
+       printf("-t <timestep tau> [s] (%.15f)\n",MOLDYN_TAU);
        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,
-                                        (-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);
                        }
@@ -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++) {
-                       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 */
@@ -580,14 +580,14 @@ int force_lennard_jones(t_moldyn *moldyn) {
        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++) {
-                       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) {
@@ -600,7 +600,7 @@ int force_lennard_jones(t_moldyn *moldyn) {
                                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);
diff --git a/posic.c b/posic.c
index 992f9d153d91286f9fbf7d13ef773f1630460cf5..8bbfe0e39fa869bb5cdf7de287d851456374dcb9 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));
-       si[0].r.x=0.23*sqrt(3.0)*LC_SI/2.0;
+       si[0].r.x=0.13*sqrt(3.0)*LC_SI/2.0;
        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;
-       ho.spring_constant=4.0*LJ_EPSILON_SI;
+       ho.spring_constant=1.0;
 
        u=get_e_pot(&md);
 
diff --git a/posic.h b/posic.h
index d31331fa796321fdc01195acb560e06602e9c2a4..44caf1845039537af9d96e10d8b5b0834cb0e398 100644 (file)
--- a/posic.h
+++ b/posic.h
@@ -23,9 +23,9 @@
 
 #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)