From: hackbard Date: Wed, 29 Jul 2009 16:51:34 +0000 (+0200) Subject: fixed attrr region + ifdef'ed constraints along 110 + write final save and visual... X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=beac6be36b6859ff09d1d5c426b762a9fb34c03d;p=physik%2Fposic.git fixed attrr region + ifdef'ed constraints along 110 + write final save and visual file! --- diff --git a/mdrun.c b/mdrun.c index f0edd0b..31e5f0a 100644 --- a/mdrun.c +++ b/mdrun.c @@ -420,12 +420,12 @@ int mdrun_parse_config(t_mdrun *mdrun) { } i=2; if(cap.type&CHAATTR_REGION) { - cap.x0=atof(word[1]); - cap.y0=atof(word[2]); - cap.z0=atof(word[3]); - cap.x1=atof(word[4]); - cap.y1=atof(word[5]); - cap.z1=atof(word[6]); + cap.x0=atof(word[2]); + cap.y0=atof(word[3]); + cap.z0=atof(word[4]); + cap.x1=atof(word[5]); + cap.y1=atof(word[6]); + cap.z1=atof(word[7]); i+=6; } if(cap.type&CHAATTR_ELEMENT) { @@ -1095,22 +1095,25 @@ int chaatr(t_moldyn *moldyn,t_mdrun *mdrun) { continue; } if(cap->type&CHAATTR_REGION) { - if(cap->x0r.x) + if(cap->x0>atom->r.x) continue; - if(cap->y0r.y) + if(cap->y0>atom->r.y) continue; - if(cap->z0r.z) + if(cap->z0>atom->r.z) continue; - if(cap->x1>atom->r.x) + if(cap->x1r.x) continue; - if(cap->y1>atom->r.y) + if(cap->y1r.y) continue; - if(cap->z1>atom->r.z) + if(cap->z1r.z) continue; } + printf(" changing attributes of atom %d (0x%x)\n",i,cap->attr); atom->attr=cap->attr; } + printf("\n\n"); + return 0; } diff --git a/moldyn.c b/moldyn.c index 12cb49b..d3d63eb 100644 --- a/moldyn.c +++ b/moldyn.c @@ -78,6 +78,10 @@ int moldyn_init(t_moldyn *moldyn,int argc,char **argv) { pthread_mutex_init(&emutex,NULL); #endif +#ifdef CONSTRAINT_110_5832 + printf("\n\n\nWARNING! WARNING! WARNING!\n\n\n"); + printf("\n\n\n!! -- constraints enabled -- !!\n\n\n"); +#endif return 0; } @@ -2228,6 +2232,22 @@ printf("sched:%d, steps:%d/%d, T:%4.1f/%4.1f P:%4.1f/%4.1f V:%6.1f (%d)\n", } + /* writing a final save file! */ + if(s) { + snprintf(dir,128,"%s/s-final.save",moldyn->vlsdir); + fd=open(dir,O_WRONLY|O_TRUNC|O_CREAT,S_IRUSR|S_IWUSR); + if(fd<0) perror("[moldyn] save fd open"); + else { + write(fd,moldyn,sizeof(t_moldyn)); + write(fd,moldyn->atom, + moldyn->count*sizeof(t_atom)); + } + close(fd); + } + /* writing a final visual file! */ + if(a) + visual_atoms(moldyn); + return 0; } @@ -2245,6 +2265,12 @@ int velocity_verlet(t_moldyn *moldyn) { tau=moldyn->tau; tau_square=moldyn->tau_square; +#ifdef CONSTRAINT_110_5832 + if(count==5833) { + atom[5832].f.x=0.5*(atom[5832].f.x-atom[5832].f.y); + atom[5832].f.y=-atom[5832].f.x; + } +#endif for(i=0;i