From 55fd772a75e72968f166743b495ee751a633b305 Mon Sep 17 00:00:00 2001 From: hackbard Date: Tue, 9 Sep 2008 12:36:06 +0200 Subject: [PATCH] optional elment and brand type in fill cmd now --- mdrun.c | 19 +++++++++++++++---- mdrun.h | 3 +++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/mdrun.c b/mdrun.c index dd8679e..17ce277 100644 --- a/mdrun.c +++ b/mdrun.c @@ -284,6 +284,14 @@ int mdrun_parse_config(t_mdrun *mdrun) { mdrun->ly=atoi(word[3]); mdrun->lz=atoi(word[4]); mdrun->lc=atof(word[5]); + if(wcnt==8) { + mdrun->fill_element=atoi(word[6]); + mdrun->fill_brand=atoi(word[7]); + } + else { + mdrun->fill_element=mdrun->element1; + mdrun->fill_brand=0; + } } else if(!strncmp(word[0],"aattr",5)) { // for aatrib line we need a special stage @@ -1155,13 +1163,16 @@ int main(int argc,char **argv) { set_pbc(&moldyn,mdrun.pbcx,mdrun.pbcy,mdrun.pbcz); switch(mdrun.lattice) { case FCC: - create_lattice(&moldyn,FCC,mdrun.lc,mdrun.element1, - mdrun.m1,DEFAULT_ATOM_ATTR,0,mdrun.lx, + create_lattice(&moldyn,FCC,mdrun.lc,mdrun.fill_element, + mdrun.m1,DEFAULT_ATOM_ATTR, + mdrun.fill_brand,mdrun.lx, mdrun.ly,mdrun.lz,NULL); break; case DIAMOND: - create_lattice(&moldyn,DIAMOND,mdrun.lc,mdrun.element1, - mdrun.m1,DEFAULT_ATOM_ATTR,0,mdrun.lx, + create_lattice(&moldyn,DIAMOND,mdrun.lc, + mdrun.fill_element, + mdrun.m1,DEFAULT_ATOM_ATTR, + mdrun.fill_brand,mdrun.lx, mdrun.ly,mdrun.lz,NULL); break; case ZINCBLENDE: diff --git a/mdrun.h b/mdrun.h index 953ec0d..71c4d83 100644 --- a/mdrun.h +++ b/mdrun.h @@ -78,6 +78,9 @@ typedef struct s_mdrun { int lz; u8 lattice; // type of lattice + int fill_element; + u8 fill_brand; + u8 sattr; // system attributes double temperature; // temperature double pressure; // pressure -- 2.39.2