DEPS += potentials/lennard_jones.o potentials/harmonic_oscillator.o
DEPS += potentials/tersoff.o potentials/albe.o
-ALL = posic sic fluctuation_calc postproc pair_correlation_calc diffusion_calc
+ALL = mdrun sic fluctuation_calc postproc pair_correlation_calc diffusion_calc
ALL += bond_analyze
all: $(ALL)
-posic: $(DEPS)
+mdrun: $(DEPS)
sic: $(DEPS) config.h
-# default configuration for a molecular dynamics run
-
#
-# molecular dynamic variables
+# mdrun configuration file
#
-# delta t in fs
-DELTA_T 1.0
+## potential ##
-# temperature in kelvin
-TEMP 298.0
+potential albe
+cutoff 2.96
-# t/p control
-BER_THERMO 1
-BER_BARO 0
+## integration algorithm ##
-#
-# lattice & atoms
-#
+intalgo verlet
+timestep 1.0
+
+## simulation volume ##
+
+volume
+pbc 1 1 1
+
+## temperature / pressure ##
+
+temperature 450.0
+pressure 0.0
+
+## ensemble control ##
-# lattice/atom type
-L_TYPE DIAMOND Si C
+eattrib 100.0 100.0
-# lattice constant in angstrom
-L_CONSTANT 4.359
+## equi ctrl ##
-# lattice offset in lattice constants
-L_OFFSET 0.125
+equictrl 1.0 1.0
-# fixed atoms
-FX 0 0
-FY 0 0
-FZ 0 0
+## initial lattice ##
-# atoms coupled to heat bath
-HX 0 0
-HY 0 0
-HZ 0 0
+lattice diamond
+#lattice zincblende
+element1 silicon
+#element2 carbon
+fill lc 9 9 9
+aattrib all h
+
+## initial simulation run ##
+
+prerun 100
+avgskip 0
+
+## more stages ##
+
+# format:
+# stage <action> <attr>
#
-# simulation cell
+# actions:
#
+# ins_atoms <#insertions> <#atoms> <element> \
+# <#atom-attrib> <position>
+#
+# continue <#runs>
+#
+# anneal <#annealing-steps> <delta_t>
+
+stage ins_atoms 10 1 14 v h rand 0 0 0 11 11 11
+stage ins_atoms 1 1 6 v h rand 0 0 0 5.429 5.429 5.429
+stage continue 10000
+stage anneal 723 -1.0
-# size in lattice constants
-LC_COUNT_X 10
-LC_COUNT_Y 10
-LC_COUNT_Z 10
+## report / log / visualization / save files ##
-# periodic boundary conditions
-PER_BOUND_X 1
-PER_BOUND_Y 1
-PER_BOUND_Z 1
+elog 10
+tlog 10
+plog 10
+vlog 10
+save 100
+visualize 100
--- /dev/null
+/*
+ * mdrun.c - main code to run a md simulation
+ *
+ * author: Frank Zirkelbach <frank.zirkelbach@physik.uni-augsburg.de>
+ *
+ */
+
+#include "mdrun.h"
+
+/* potential */
+#include "potentials/harmonic_oscillator.h"
+#include "potentials/lennard_jones.h"
+#include "potentials/albe.h"
+#ifdef TERSOFF_ORIG
+#include "potentials/tersoff_orig.h"
+#else
+#include "potentials/tersoff.h"
+#endif
+
+#define ME "[mdrun]"
+
+/*
+ * parse function
+ */
+
+int mdrun_usage(void) {
+
+ printf("%s usage:\n",ME);
+
+ return 0;
+}
+
+int mdrun_parse_argv(t_mdrun *mdrun,int argc,char **argv) {
+
+ int i;
+
+ for(i=1;i<argc;i++) {
+
+ if(argv[i][0]!='-') {
+ printf("%s unknown switch: %s\n",ME,argv[i]);
+ return -1;
+ }
+
+ switch(argv[i][1]) {
+ case 'c':
+ strncpy(mdrun->cfile,argv[++i],128);
+ break;
+ case 's':
+ strncpy(mdrun->sdir,argv[++i],128);
+ break;
+ case 'h':
+ mdrun_usage();
+ break;
+ default:
+ printf("%s unknown option: %s\n",ME,argv[i]);
+ mdrun_usage();
+ return -1;
+ }
+
+ }
+
+ return 0;
+}
+
+int mdrun_parse_config(t_mdrun *mdrun) {
+
+ int fd,ret;
+ char error[128];
+ char line[128];
+ char *wptr;
+ char word[16][32];
+ int wcnt;
+
+ /* open config file */
+ fd=open(mdrun->cfile,O_RDONLY);
+ if(fd<0) {
+ snprintf(error,128,"%s open cfile %s",ME,mdrun->cfile);
+ perror(error);
+ return fd;
+ }
+
+ /* read, parse, set */
+ ret=1;
+ while(ret>0) {
+
+ /* read */
+ ret=get_line(fd,line,128);
+
+ /* parse */
+
+ // ignore # lines and \n
+ if((line[0]=='#')|(ret==1))
+ continue;
+
+ // get command + args
+ wcnt=0;
+ while(1) {
+ if(wcnt)
+ wptr=strtok(NULL," \t");
+ else
+ wptr=strtok(line," \t");
+ if(wptr==NULL)
+ break;
+ strncpy(word[wcnt],wptr,32);
+ wcnt+=1;
+ }
+
+ if(!strncmp(word[0],"potential",9)) {
+ if(!strncmp(word[1],"albe",4))
+ mdrun->potential=MOLDYN_POTENTIAL_AM;
+ if(!strncmp(word[1],"tersoff",7))
+ mdrun->potential=MOLDYN_POTENTIAL_TM;
+ if(!strncmp(word[1],"ho",2))
+ mdrun->potential=MOLDYN_POTENTIAL_HO;
+ if(!strncmp(word[1],"lj",2))
+ mdrun->potential=MOLDYN_POTENTIAL_LJ;
+ }
+ else if(!strncmp(word[0],"cutoff",6))
+ mdrun->cutoff=atof(word[1]);
+ else if(!strncmp(word[0],"intalgo",7)) {
+ if(!strncmp(word[1],"verlet",5))
+ mdrun->intalgo=MOLDYN_INTEGRATE_VERLET;
+ }
+ else if(!strncmp(word[0],"timestep",8))
+ mdrun->timestep=atof(word[1]);
+ else if(!strncmp(word[0],"volume",6)) {
+ mdrun->dim.x=atof(word[1]);
+ mdrun->dim.y=atof(word[2]);
+ mdrun->dim.z=atof(word[3]);
+ if(strncmp(word[4],"0",1))
+ mdrun->vis=TRUE;
+ }
+ else if(!strncmp(word[0],"pbc",3)) {
+ if(strncmp(word[1],"0",1))
+ mdrun->pbcx=TRUE;
+ else
+ mdrun->pbcx=FALSE;
+ if(strncmp(word[2],"0",1))
+ mdrun->pbcy=TRUE;
+ else
+ mdrun->pbcy=FALSE;
+ if(strncmp(word[3],"0",1))
+ mdrun->pbcz=TRUE;
+ else
+ mdrun->pbcz=FALSE;
+ }
+ else if(!strncmp(word[0],"temperature",11))
+ mdrun->temperature=atof(word[1]);
+ else if(!strncmp(word[0],"pressure",8))
+ mdrun->pressure=atof(word[1]);
+ else if(!strncmp(word[0],"lattice",7)) {
+ if(!strncmp(word[1],"zincblende",10))
+ mdrun->lattice=ZINCBLENDE;
+ if(!strncmp(word[1],"fcc",3))
+ mdrun->lattice=FCC;
+ if(!strncmp(word[1],"diamond",7))
+ mdrun->lattice=DIAMOND;
+ }
+ else if(!strncmp(word[0],"element1",8)) {
+ mdrun->element1=atoi(word[1]);
+ switch(mdrun->element1) {
+ case SI:
+ mdrun->m1=M_SI;
+ break;
+ case C:
+ mdrun->m1=M_C;
+ break;
+ default:
+ printf("%s unknown element1: %s|%d\n",
+ ME,word[1],mdrun->element1);
+ return -1;
+ }
+ }
+ else if(!strncmp(word[0],"element2",8)) {
+ mdrun->element2=atoi(word[1]);
+ switch(mdrun->element2) {
+ case SI:
+ mdrun->m2=M_SI;
+ break;
+ case C:
+ mdrun->m2=M_C;
+ break;
+ default:
+ printf("%s unknown element2: %s|%d\n",
+ ME,word[1],mdrun->element2);
+ return -1;
+ }
+ }
+ else if(!strncmp(word[0],"filllc",6)) {
+ mdrun->lx=atoi(word[1]);
+ mdrun->ly=atoi(word[2]);
+ mdrun->lz=atoi(word[3]);
+ }
+ else if(!strncmp(word[0],"aattrib",7)) {
+ // for aatrib line we need a special stage
+ // containing one schedule of 0 loops ...
+ printf("%s aattrib: %s\n",ME,word[1]);
+ }
+ else if(!strncmp(word[0],"eattrib",7)) {
+ mdrun->p_tau=atof(word[1]);
+ mdrun->t_tau=atof(word[2]);
+ }
+ else if(!strncmp(word[0],"prerun",6))
+ mdrun->prerun=atoi(word[1]);
+ else if(!strncmp(word[0],"avgskip",7))
+ mdrun->avgskip=atoi(word[1]);
+ else if(!strncmp(word[0],"elog",4))
+ mdrun->elog=atoi(word[1]);
+ else if(!strncmp(word[0],"tlog",4))
+ mdrun->tlog=atoi(word[1]);
+ else if(!strncmp(word[0],"plog",4))
+ mdrun->plog=atoi(word[1]);
+ else if(!strncmp(word[0],"vlog",4))
+ mdrun->vlog=atoi(word[1]);
+ else if(!strncmp(word[0],"save",4))
+ mdrun->save=atoi(word[1]);
+ else if(!strncmp(word[0],"visualize",9))
+ mdrun->visualize=atoi(word[1]);
+ else if(!strncmp(word[0],"stage",5)) {
+ // for every stage line, add a stage
+ printf("%s stage: %s\n",ME,word[1]);
+ }
+ else {
+ printf("%s unknown command %s, skipped!\n",ME,wptr);
+ continue;
+ }
+ }
+
+ return 0;
+}
+
+int main(int argc,char **argv) {
+
+ t_mdrun mdrun;
+ t_moldyn moldyn;
+ t_3dvec o;
+
+ /* clear mdrun struct */
+ memset(&mdrun,0,sizeof(t_mdrun));
+
+ /* parse arguments */
+ if(mdrun_parse_argv(&mdrun,argc,argv)<0)
+ return -1;
+
+ /* parse config file */
+ mdrun_parse_config(&mdrun);
+
+ /* sanity check! */
+
+ /* prepare simulation */
+ moldyn_init(&moldyn,argc,argv);
+ if(set_int_alg(&moldyn,mdrun.intalgo)<0)
+ return -1;
+ set_cutoff(&moldyn,mdrun.cutoff);
+ if(set_potential(&moldyn,mdrun.potential)<0)
+ return -1;
+ switch(mdrun.potential) {
+ case MOLDYN_POTENTIAL_AM:
+ albe_mult_set_params(&moldyn,
+ mdrun.element1,
+ mdrun.element2);
+ break;
+ case MOLDYN_POTENTIAL_TM:
+ tersoff_mult_set_params(&moldyn,
+ mdrun.element1,
+ mdrun.element2);
+ break;
+ case MOLDYN_POTENTIAL_HO:
+ harmonic_oscillator_set_params(&moldyn,mdrun.element1);
+ break;
+ case MOLDYN_POTENTIAL_LJ:
+ lennard_jones_set_params(&moldyn,mdrun.element1);
+ break;
+ default:
+ printf("%s unknown potential: %02x\n",
+ ME,mdrun.potential);
+ return -1;
+ }
+ set_dim(&moldyn,mdrun.dim.x,mdrun.dim.y,mdrun.dim.z,mdrun.vis);
+ set_pbc(&moldyn,mdrun.pbcx,mdrun.pbcy,mdrun.pbcz);
+ switch(mdrun.lattice) {
+ case FCC:
+ create_lattice(&moldyn,FCC,mdrun.lc,mdrun.element1,
+ mdrun.m1,0,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.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.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,0,mdrun.lx,
+ mdrun.ly,mdrun.lz,&o);
+ break;
+ default:
+ printf("%s unknown lattice type: %02x\n",
+ ME,mdrun.lattice);
+ return -1;
+ }
+ moldyn_bc_check(&moldyn);
+ set_temperature(&moldyn,mdrun.temperature);
+ set_pressure(&moldyn,mdrun.pressure);
+ thermal_init(&moldyn,TRUE);
+ moldyn_add_schedule(&moldyn,mdrun.prerun,mdrun.timestep);
+ moldyn_set_log_dir(&moldyn,mdrun.sdir);
+ moldyn_set_report(&moldyn,"CHANGE ME","CHANGE ME TOO");
+ if(mdrun.elog)
+ moldyn_set_log(&moldyn,LOG_TOTAL_ENERGY,mdrun.elog);
+ if(mdrun.tlog)
+ moldyn_set_log(&moldyn,LOG_TEMPERATURE,mdrun.tlog);
+ if(mdrun.plog)
+ moldyn_set_log(&moldyn,LOG_PRESSURE,mdrun.plog);
+ if(mdrun.vlog)
+ moldyn_set_log(&moldyn,LOG_VOLUME,mdrun.vlog);
+ if(mdrun.visualize)
+ moldyn_set_log(&moldyn,VISUAL_STEP,mdrun.visualize);
+ if(mdrun.save)
+ moldyn_set_log(&moldyn,SAVE_STEP,mdrun.save);
+ moldyn_set_log(&moldyn,CREATE_REPORT,0);
+ set_avg_skip(&moldyn,mdrun.avgskip);
+
+ /* prepare the hook function */
+
+ /* run the simulation */
+ moldyn_integrate(&moldyn);
+
+ /* shutdown */
+ moldyn_shutdown(&moldyn);
+
+ return 0;
+}
--- /dev/null
+/*
+ * mdrun.h - mdrun header file
+ *
+ * author: Frank Zirkelbach <frank.zirkelbach@physik.uni-augsburg.de>
+ *
+ */
+
+#ifndef MDRUN_H
+#define MDRUN_H
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include <math.h>
+
+/* main molecular dynamics api */
+#include "moldyn.h"
+
+/* list api */
+#include "list/list.h"
+
+/* potentials */
+#include "potentials/harmonic_oscillator.h"
+#include "potentials/lennard_jones.h"
+#include "potentials/albe.h"
+#ifdef TERSOFF_ORIG
+#include "potentials/tersoff_orig.h"
+#else
+#include "potentials/tersoff.h"
+#endif
+
+/*
+ * datatypes
+ */
+
+typedef struct s_stage {
+ u8 type;
+ u8 attr;
+ int runs;
+} t_stage;
+
+typedef struct s_mdrun {
+ char cfile[128]; // config file
+ u8 intalgo; // integration algorithm
+ double timestep; // timestep
+ u8 potential; // potential
+ double cutoff; // cutoff radius
+ t_3dvec dim; // simulation volume
+ u8 pbcx; // periodic boundary conditions
+ u8 pbcy;
+ u8 pbcz;
+ int element1; // element 1
+ double m1;
+ int element2; // element 2
+ double m2;
+ double lc; // lattice constant
+ int lx; // amount of lc units
+ int ly;
+ int lz;
+ u8 aattrib; // atom attributes
+ u8 lattice; // type of lattice
+ double temperature; // temperature
+ double pressure; // pressure
+ double p_tau; // pressure tau
+ double t_tau; // temperature tau
+ int prerun; // amount of loops in first run
+ int elog; // logging
+ int tlog;
+ int plog;
+ int vlog;
+ int save;
+ int visualize;
+ u8 vis;
+ int avgskip; // average skip
+ char sdir[128]; // save root
+ t_list stage; // list of stages
+} t_mdrun;
+
+/*
+ * function prototypes
+ */
+
+
+#endif
int set_cutoff(t_moldyn *moldyn,double cutoff) {
moldyn->cutoff=cutoff;
+ moldyn->cutoff_square=cutoff*cutoff;
printf("[moldyn] cutoff [A]: %f\n",moldyn->cutoff);
return 0;
}
-int set_bondlen(t_moldyn *moldyn,double b0,double b1,double bm) {
-
- moldyn->bondlen[0]=b0*b0;
- moldyn->bondlen[1]=b1*b1;
- if(bm<0)
- moldyn->bondlen[2]=b0*b1;
- else
- moldyn->bondlen[2]=bm*bm;
-
- return 0;
-}
-
int set_temperature(t_moldyn *moldyn,double t_ref) {
moldyn->t_ref=t_ref;
/* sqaure of some variables */
moldyn->tau_square=moldyn->tau*moldyn->tau;
- moldyn->cutoff_square=moldyn->cutoff*moldyn->cutoff;
/* get current time */
gettimeofday(&t1,NULL);
ret=read(fd,line+count,1);
if(ret<=0) return ret;
if(line[count]=='\n') {
- line[count]='\0';
+ memset(line+count,0,max-count-1);
+ //line[count]='\0';
return count+1;
}
count+=1;
return 0;
}
+int visual_bonds_process(t_moldyn *moldyn,t_atom *itom,t_atom *jtom,
+ void *data,u8 bc) {
+
+ t_vb *vb;
+
+ vb=data;
+
+ if(itom->tag>=jtom->tag)
+ return 0;
+
+ if(moldyn->check_2b_bond(moldyn,itom,jtom,bc)==FALSE)
+ return 0;
+
+ if((itom->attr&ATOM_ATTR_VB)|(jtom->attr&ATOM_ATTR_VB))
+ dprintf(vb->fd,"# [B] %f %f %f %f %f %f\n",
+ itom->r.x,itom->r.y,itom->r.z,
+ jtom->r.x,jtom->r.y,jtom->r.z);
+
+ return 0;
+}
+
int visual_atoms(t_moldyn *moldyn) {
- int i,j,fd;
+ int i;
char file[128+64];
t_3dvec dim;
double help;
t_visual *v;
t_atom *atom;
- t_atom *btom;
- t_linkcell *lc;
-#ifdef STATIC_LISTS
- int *neighbour[27];
- int p;
-#else
- t_list neighbour[27];
-#endif
- u8 bc;
- t_3dvec dist;
- double d2;
- u8 brand;
+ t_vb vb;
v=&(moldyn->vis);
dim.x=v->dim.x;
dim.y=v->dim.y;
dim.z=v->dim.z;
atom=moldyn->atom;
- lc=&(moldyn->lc);
help=(dim.x+dim.y);
sprintf(file,"%s/atomic_conf_%07.f.xyz",v->fb,moldyn->time);
- fd=open(file,O_WRONLY|O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR);
- if(fd<0) {
+ vb.fd=open(file,O_WRONLY|O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR);
+ if(vb.fd<0) {
perror("open visual save file fd");
return -1;
}
/* write the actual data file */
// povray header
- dprintf(fd,"# [P] %d %07.f <%f,%f,%f>\n",
+ dprintf(vb.fd,"# [P] %d %07.f <%f,%f,%f>\n",
moldyn->count,moldyn->time,help/40.0,help/40.0,-0.8*help);
// atomic configuration
- for(i=0;i<moldyn->count;i++) {
+ for(i=0;i<moldyn->count;i++)
// atom type, positions, color and kinetic energy
- dprintf(fd,"%s %f %f %f %s %f\n",pse_name[atom[i].element],
- atom[i].r.x,
- atom[i].r.y,
- atom[i].r.z,
- pse_col[atom[i].element],
- atom[i].ekin);
-
- /*
- * bond detection should usually be done by potential
- * functions. brrrrr! EVIL!
- *
- * todo: potentials need to export a 'find_bonds' function!
- */
-
- // bonds between atoms
- if(!(atom[i].attr&ATOM_ATTR_VB))
- continue;
- link_cell_neighbour_index(moldyn,
- (atom[i].r.x+moldyn->dim.x/2)/lc->x,
- (atom[i].r.y+moldyn->dim.y/2)/lc->y,
- (atom[i].r.z+moldyn->dim.z/2)/lc->z,
- neighbour);
- for(j=0;j<27;j++) {
- bc=j<lc->dnlc?0:1;
-#ifdef STATIC_LISTS
- p=0;
- while(neighbour[j][p]!=0) {
- btom=&(atom[neighbour[j][p]]);
- p++;
-#else
- list_reset_f(&neighbour[j]);
- if(neighbour[j].start==NULL)
- continue;
- do {
- btom=neighbour[j].current->data;
-#endif
- if(btom==&atom[i]) // skip identical atoms
- continue;
- //if(btom<&atom[i]) // skip half of them
- // continue;
- v3_sub(&dist,&(atom[i].r),&(btom->r));
- if(bc) check_per_bound(moldyn,&dist);
- d2=v3_absolute_square(&dist);
- brand=atom[i].brand;
- if(brand==btom->brand) {
- if(d2>moldyn->bondlen[brand])
- continue;
- }
- else {
- if(d2>moldyn->bondlen[2])
- continue;
- }
- dprintf(fd,"# [B] %f %f %f %f %f %f\n",
- atom[i].r.x,atom[i].r.y,atom[i].r.z,
- btom->r.x,btom->r.y,btom->r.z);
-#ifdef STATIC_LISTS
- }
-#else
- } while(list_next_f(&neighbour[j])!=L_NO_NEXT_ELEMENT);
-#endif
- }
- }
-
+ dprintf(vb.fd,"%s %f %f %f %s %f\n",pse_name[atom[i].element],
+ atom[i].r.x,
+ atom[i].r.y,
+ atom[i].r.z,
+ pse_col[atom[i].element],
+ atom[i].ekin);
+
+ // bonds between atoms
+ process_2b_bonds(moldyn,&vb,visual_bonds_process);
+
// boundaries
if(dim.x) {
- dprintf(fd,"# [D] %f %f %f %f %f %f\n",
+ dprintf(vb.fd,"# [D] %f %f %f %f %f %f\n",
-dim.x/2,-dim.y/2,-dim.z/2,
dim.x/2,-dim.y/2,-dim.z/2);
- dprintf(fd,"# [D] %f %f %f %f %f %f\n",
+ dprintf(vb.fd,"# [D] %f %f %f %f %f %f\n",
-dim.x/2,-dim.y/2,-dim.z/2,
-dim.x/2,dim.y/2,-dim.z/2);
- dprintf(fd,"# [D] %f %f %f %f %f %f\n",
+ dprintf(vb.fd,"# [D] %f %f %f %f %f %f\n",
dim.x/2,dim.y/2,-dim.z/2,
dim.x/2,-dim.y/2,-dim.z/2);
- dprintf(fd,"# [D] %f %f %f %f %f %f\n",
+ dprintf(vb.fd,"# [D] %f %f %f %f %f %f\n",
-dim.x/2,dim.y/2,-dim.z/2,
dim.x/2,dim.y/2,-dim.z/2);
- dprintf(fd,"# [D] %f %f %f %f %f %f\n",
+ dprintf(vb.fd,"# [D] %f %f %f %f %f %f\n",
-dim.x/2,-dim.y/2,dim.z/2,
dim.x/2,-dim.y/2,dim.z/2);
- dprintf(fd,"# [D] %f %f %f %f %f %f\n",
+ dprintf(vb.fd,"# [D] %f %f %f %f %f %f\n",
-dim.x/2,-dim.y/2,dim.z/2,
-dim.x/2,dim.y/2,dim.z/2);
- dprintf(fd,"# [D] %f %f %f %f %f %f\n",
+ dprintf(vb.fd,"# [D] %f %f %f %f %f %f\n",
dim.x/2,dim.y/2,dim.z/2,
dim.x/2,-dim.y/2,dim.z/2);
- dprintf(fd,"# [D] %f %f %f %f %f %f\n",
+ dprintf(vb.fd,"# [D] %f %f %f %f %f %f\n",
-dim.x/2,dim.y/2,dim.z/2,
dim.x/2,dim.y/2,dim.z/2);
- dprintf(fd,"# [D] %f %f %f %f %f %f\n",
+ dprintf(vb.fd,"# [D] %f %f %f %f %f %f\n",
-dim.x/2,-dim.y/2,dim.z/2,
-dim.x/2,-dim.y/2,-dim.z/2);
- dprintf(fd,"# [D] %f %f %f %f %f %f\n",
+ dprintf(vb.fd,"# [D] %f %f %f %f %f %f\n",
-dim.x/2,dim.y/2,dim.z/2,
-dim.x/2,dim.y/2,-dim.z/2);
- dprintf(fd,"# [D] %f %f %f %f %f %f\n",
+ dprintf(vb.fd,"# [D] %f %f %f %f %f %f\n",
dim.x/2,-dim.y/2,dim.z/2,
dim.x/2,-dim.y/2,-dim.z/2);
- dprintf(fd,"# [D] %f %f %f %f %f %f\n",
+ dprintf(vb.fd,"# [D] %f %f %f %f %f %f\n",
dim.x/2,dim.y/2,dim.z/2,
dim.x/2,dim.y/2,-dim.z/2);
}
- close(fd);
+ close(vb.fd);
return 0;
}
double cutoff; /* cutoff radius */
double cutoff_square; /* square of the cutoff radius */
double nnd; /* nearest neighbour distance (optional) */
- double bondlen[3]; /* bond lengthes (only 2 atomic systems) */
t_linkcell lc; /* linked cell list interface */
int tcnt;
} t_ba;
+typedef struct s_vb {
+ int fd;
+} t_vb;
+
/*
*
* defines
#define CUBIC 0x01
#define FCC 0x02
#define DIAMOND 0x04
+#define ZINCBLENDE 0x08
/*
*
int set_int_alg(t_moldyn *moldyn,u8 algo);
int set_cutoff(t_moldyn *moldyn,double cutoff);
-int set_bondlen(t_moldyn *moldyn,double b0,double b1,double bm);
int set_temperature(t_moldyn *moldyn,double t_ref);
int set_pressure(t_moldyn *moldyn,double p_ref);
int set_pt_scale(t_moldyn *moldyn,u8 ptype,double ptc,u8 ttype,double ttc);
int bond_analyze(t_moldyn *moldyn,double *quality);
int visual_init(t_moldyn *moldyn,char *filebase);
+int visual_bonds_process(t_moldyn *moldyn,t_atom *itom,t_atom *jtom,
+ void *data,u8 bc);
int visual_atoms(t_moldyn *moldyn);
#endif
return -1;
}
-
return 0;
}
/* cutoff radius & bondlen */
#ifdef ALBE
set_cutoff(&md,ALBE_S_SI);
- set_bondlen(&md,ALBE_S_SI,ALBE_S_C,ALBE_S_SIC);
//set_cutoff(&md,ALBE_S_C);
#else
set_cutoff(&md,TM_S_SI);
- set_bondlen(&md,TM_S_SI,TM_S_C,-1.0);
//set_cutoff(&md,TM_S_C);
#endif