set_potential(&moldyn,MOLDYN_POTENTIAL_AM);
albe_mult_set_params(&moldyn,SI,C);
+ /* link cell init */
+ link_cell_init(&moldyn,VERBOSE);
+
/* analyzing ... */
bond_analyze(&moldyn,quality);
## temperature / pressure ##
-temperature -273.0
+temperature 0.0
pressure 0.0
## initial lattice ##
#lattice zincblende
element1 14
element2 6
-fill lc 9 9 9
+fill lc 9 9 9 5.429
## atom attributes ##
char *wptr;
char word[16][32];
int wcnt;
- int i;
+ int i,o;
t_insert_atoms_params iap;
t_continue_params cp;
mdrun->lx=atoi(word[2]);
mdrun->ly=atoi(word[3]);
mdrun->lz=atoi(word[4]);
+ mdrun->lc=atof(word[5]);
}
else if(!strncmp(word[0],"aattr",5)) {
// for aatrib line we need a special stage
break;
}
}
- i=1;
+ i=2;
if(cap.type&CHAATTR_REGION) {
cap.x0=atof(word[1]);
cap.y0=atof(word[2]);
cap.element=atoi(word[i]);
i+=1;
}
- wptr=word[i];
- for(i=0;i<strlen(wptr);i++) {
- switch(word[2][i]) {
+ for(o=0;o<strlen(word[i]);o++) {
+ switch(word[i][o]) {
case 'b':
cap.attr|=ATOM_ATTR_VB;
break;
/* default steps and tau values */
steps=mdrun->relax_steps;
-printf("-------> %d\n",mdrun->relax_steps);
tau=mdrun->timestep;
/* check whether relaxation steps are necessary */
t_moldyn moldyn;
t_3dvec o;
- /* clear mdrun struct */
+ /* clear structs */
memset(&mdrun,0,sizeof(t_mdrun));
+ memset(&moldyn,0,sizeof(t_moldyn));
/* parse arguments */
if(mdrun_parse_argv(&mdrun,argc,argv)<0)
if(set_int_alg(&moldyn,mdrun.intalgo)<0)
return -1;
set_cutoff(&moldyn,mdrun.cutoff);
- set_nn_dist(&moldyn,mdrun.nnd);
if(set_potential(&moldyn,mdrun.potential)<0)
return -1;
switch(mdrun.potential) {
switch(mdrun.lattice) {
case FCC:
create_lattice(&moldyn,FCC,mdrun.lc,mdrun.element1,
- mdrun.m1,0,0,mdrun.lx,
+ mdrun.m1,DEFAULT_ATOM_ATTR,0,mdrun.lx,
mdrun.ly,mdrun.lz,NULL);
break;
case DIAMOND:
create_lattice(&moldyn,DIAMOND,mdrun.lc,mdrun.element1,
- mdrun.m1,0,0,mdrun.lx,
+ mdrun.m1,DEFAULT_ATOM_ATTR,0,mdrun.lx,
mdrun.ly,mdrun.lz,NULL);
break;
case ZINCBLENDE:
o.x=0.5*0.25*mdrun.lc; o.y=o.x; o.z=o.x;
create_lattice(&moldyn,FCC,mdrun.lc,mdrun.element1,
- mdrun.m1,0,0,mdrun.lx,
+ mdrun.m1,DEFAULT_ATOM_ATTR,0,mdrun.lx,
mdrun.ly,mdrun.lz,&o);
o.x+=0.25*mdrun.lc; o.y=o.x; o.z=o.x;
create_lattice(&moldyn,FCC,mdrun.lc,mdrun.element2,
- mdrun.m2,0,1,mdrun.lx,
+ mdrun.m2,DEFAULT_ATOM_ATTR,1,mdrun.lx,
mdrun.ly,mdrun.lz,&o);
break;
default:
t_3dvec orig;
void *ptr;
t_atom *atom;
+ char name[16];
new=a*b*c;
count=moldyn->count;
case CUBIC:
set_nn_dist(moldyn,lc);
ret=cubic_init(a,b,c,lc,atom,&orig);
+ strcpy(name,"cubic");
break;
case FCC:
if(!origin)
v3_scale(&orig,&orig,0.5);
set_nn_dist(moldyn,0.5*sqrt(2.0)*lc);
ret=fcc_init(a,b,c,lc,atom,&orig);
+ strcpy(name,"fcc");
break;
case DIAMOND:
if(!origin)
v3_scale(&orig,&orig,0.25);
set_nn_dist(moldyn,0.25*sqrt(3.0)*lc);
ret=diamond_init(a,b,c,lc,atom,&orig);
+ strcpy(name,"diamond");
break;
default:
printf("unknown lattice type (%02x)\n",type);
}
moldyn->count+=new;
- printf("[moldyn] created lattice with %d atoms\n",new);
+ printf("[moldyn] created %s lattice with %d atoms\n",name,new);
for(ret=0;ret<new;ret++) {
atom[ret].element=element;
atom=moldyn->atom;
/* initialize linked cell method */
-printf(" hier soll es sein\n");
link_cell_init(moldyn,VERBOSE);
/* logging & visualization */
temperature_calc(moldyn);
virial_sum(moldyn);
pressure_calc(moldyn);
- //thermodynamic_pressure_calc(moldyn);
+ /*
+ thermodynamic_pressure_calc(moldyn);
+ printf("\n\nDEBUG: numeric pressure calc: %f\n\n",
+ moldyn->tp/BAR);
+ */
/* calculate fluctuations + averages */
average_and_fluctuation_calc(moldyn);
t_list *this;
lc=&(moldyn->lc);
-
- /* only init link cell if it doesn't exist! */
- HIER WEITER
- link_cell_init(moldyn,VERBOSE);
-
itom=moldyn->atom;
for(i=0;i<moldyn->count;i++) {
#define ATOM_ATTR_2BP 0x20 /* pair potential */
#define ATOM_ATTR_3BP 0x40 /* 3 body potential */
+#define DEFAULT_ATOM_ATTR 0x74 // 1,2,3 body interaction + visualize
+
/* cell lists */
typedef struct s_linkcell {
int nx,ny,nz; /* amount of cells in x, y and z direction */
return -1;
}
+ /* link cell init */
+ link_cell_init(&moldyn,VERBOSE);
+
calculate_pair_correlation(&moldyn,dr,stat);
fd=open("pair_corr_func.txt",
--- /dev/null
+if [ -z "$1" ]; then
+ echo "specify a directory for logging and save files"
+ exit
+fi
+
+if [ ! -f ./config ]; then
+ echo "no config file found"
+ exit
+fi
+
+[ ! -d $1 ] && mkdir $1
+
+./clean $1
+
+./mdrun -c ./config -s $1
+
+if [ "$?" == "0" ]; then
+ #./perms
+ if [ "$1" ] ; then
+ # whole simulation cell
+ #./visualize -w 640 -h 480 -d $1
+
+ # center unit cell
+ ./visualize -w 640 -h 480 -d $1 \
+ -nll -0.56 -0.56 -0.56 -fur 0.56 0.56 0.56 \
+ -b -0.5 -0.5 -0.5 0.5 0.5 0.5 \
+ -c -0.2 -2.0 0.6 -L 0 0 -0.1 \
+ -r 0.6 -B 0.1
+
+ # old rasmol
+ #rasmol -32 -nodisplay < $1/visualize.scr > /dev/null 2>&1
+ ./ppm2avi $1
+
+ # copy config
+ cp -v config $1/config
+ fi
+fi
--- /dev/null
+if [ -z "$1" ]; then
+ exit
+fi
+
+if [ ! -f ./config ]; then
+ exit
+fi
+
+[ ! -d $1 ] && mkdir $1
+./clean $1
+
+# create run file
+rf=`basename $1`
+cat > run_$rf <<-EOF
+#!/bin/bash
+#$ -cwd
+
+./mdrun -c ./config -s $1
+
+EOF
+
+# submit job
+qsub run_$rf
+
+if [ "$?" == "0" ]; then
+ #./perms
+ if [ "$1" ] ; then
+ # whole simulation cell
+ #./visualize -w 640 -h 480 -d $1
+
+ # center unit cell
+ #./visualize -w 640 -h 480 -d $1 \
+ # -nll -2.4 -2.4 -2.4 -fur 3.8 3.8 3.8 \
+ # -b -2.03 -2.03 -2.03 3.39 3.39 3.39 \
+ # -r 0.6 -c 0.5 -11.0 2.5 -B 0.1
+
+ # old rasmol
+ #rasmol -32 -nodisplay < $1/visualize.scr > /dev/null 2>&1
+ #./ppm2avi $1
+
+ # copy config and main prog
+ cp -v config $1/config
+ fi
+fi