int count;
int ret;
t_3dvec origin;
- t_atom *atom;
count=a*b*c;
- atom=moldyn->atom;
if(type==FCC) count*=4;
if(type==DIAMOND) count*=8;
- atom=malloc(count*sizeof(t_atom));
- if(atom==NULL) {
+ moldyn->atom=malloc(count*sizeof(t_atom));
+ if(moldyn->atom==NULL) {
perror("malloc (atoms)");
return -1;
}
switch(type) {
case FCC:
- ret=fcc_init(a,b,c,lc,atom,&origin);
+ ret=fcc_init(a,b,c,lc,moldyn->atom,&origin);
break;
case DIAMOND:
- ret=diamond_init(a,b,c,lc,atom,&origin);
+ ret=diamond_init(a,b,c,lc,moldyn->atom,&origin);
break;
default:
printf("unknown lattice type (%02x)\n",type);
moldyn->count=count;
while(count) {
- atom[count-1].element=element;
- atom[count-1].mass=mass;
- atom[count-1].attr=attr;
- atom[count-1].bnum=bnum;
+ moldyn->atom[count-1].element=element;
+ moldyn->atom[count-1].mass=mass;
+ moldyn->atom[count-1].attr=attr;
+ moldyn->atom[count-1].bnum=bnum;
count-=1;
}
#include "posic.h"
-#define TRUE 1
-#define FALSE 0
-
int main(int argc,char **argv) {
/* main moldyn structure */
/* potential parameters */
t_lj_params lj;
t_ho_params ho;
- //t_tersoff_mult_params tp;
+ t_tersoff_mult_params tp;
/* misc variables, mainly to initialize stuff */
t_3dvec r,v;
/* create the lattice / place atoms */
printf("[sic] creating atoms\n");
- memset(&v,0,sizeof(t_3dvec));
- r.y=0;
- r.z=0;
- r.x=0.23*sqrt(3.0)*LC_SI/2.0;
- add_atom(&md,SI,M_SI,0,ATOM_ATTR_2BP,&r,&v);
- r.x=-r.x;
- add_atom(&md,SI,M_SI,0,ATOM_ATTR_2BP,&r,&v);
+ //memset(&v,0,sizeof(t_3dvec));
+ //r.y=0;
+ //r.z=0;
+ //r.x=0.23*sqrt(3.0)*LC_SI/2.0;
+ //add_atom(&md,SI,M_SI,0,ATOM_ATTR_2BP,&r,&v);
+ //r.x=-r.x;
+ //add_atom(&md,SI,M_SI,0,ATOM_ATTR_2BP,&r,&v);
+ create_lattice(&md,DIAMOND,LC_SI,SI,M_SI,ATOM_ATTR_2BP,0,10,10,10);
/* set temperature */
printf("[sic] setting temperature\n");
dprintf(v->fd,"rotate y 10\n");
dprintf(v->fd,"set ambient 20\n");
dprintf(v->fd,"set specular on\n");
+ dprintf(v->fd,"set boundbox on\n");
//dprintf(v->fd,"label\n");
sprintf(file,"%s-%.15f.ppm",v->fb,time);
dprintf(v->fd,"write ppm %s\n",file);