int create_lattice(t_moldyn *moldyn,u8 type,double lc,int element,
u8 attr,u8 brand,int a,int b,int c,t_3dvec *origin,
- t_part_params *p_params,t_defect_params *d_params) {
+ t_part_params *p_params,t_defect_params *d_params,
+ t_offset_params *o_params) {
int new,count;
int ret;
switch(type) {
case CUBIC:
+ if(o_params->use)
+ v3_add(&orig,&orig,&(o_params->o));
set_nn_dist(moldyn,lc);
ret=cubic_init(a,b,c,lc,atom,&orig,p_params,d_params);
strcpy(name,"cubic");
case FCC:
if(!origin)
v3_scale(&orig,&orig,0.5);
+ if(o_params->use)
+ v3_add(&orig,&orig,&(o_params->o));
set_nn_dist(moldyn,0.5*sqrt(2.0)*lc);
ret=fcc_init(a,b,c,lc,atom,&orig,p_params,d_params);
strcpy(name,"fcc");
case DIAMOND:
if(!origin)
v3_scale(&orig,&orig,0.25);
+ if(o_params->use)
+ v3_add(&orig,&orig,&(o_params->o));
set_nn_dist(moldyn,0.25*sqrt(3.0)*lc);
ret=diamond_init(a,b,c,lc,atom,&orig,p_params,d_params);
strcpy(name,"diamond");
case DEFECT_STYPE_DB_Z:\
d_o.z=d_params->od;\
d_d.z=d_params->dd;\
-d_d.x=0.9;\
-d_d.y=0.9;\
break;\
case DEFECT_STYPE_DB_R:\
break;\
int create_lattice(t_moldyn *moldyn,u8 type,double lc,int element,
u8 attr,u8 brand,int a,int b,int c,t_3dvec *origin,
- t_part_params *p_params,t_defect_params *d_params);
+ t_part_params *p_params,t_defect_params *d_params,
+ t_offset_params *o_params);
int add_atom(t_moldyn *moldyn,int element,u8 brand,u8 attr,
t_3dvec *r,t_3dvec *v);
int del_atom(t_moldyn *moldyn,int tag);