#include "potentials/tersoff.h"
#endif
-
-/*
- * global variables, pse and atom colors (only needed here)
- */
-
-static char *pse_name[]={
- "*",
- "H",
- "He",
- "Li",
- "Be",
- "B",
- "C",
- "N",
- "O",
- "F",
- "Ne",
- "Na",
- "Mg",
- "Al",
- "Si",
- "P",
- "S",
- "Cl",
- "Ar",
-};
-
-static char *pse_col[]={
- "*",
- "White",
- "He",
- "Li",
- "Be",
- "B",
- "Gray",
- "N",
- "Blue",
- "F",
- "Ne",
- "Na",
- "Mg",
- "Al",
- "Yellow",
- "P",
- "S",
- "Cl",
- "Ar",
-};
-
/*
* the moldyn functions
*/
return 0;
}
+int set_p_scale(t_moldyn *moldyn,u8 ptype,double ptc) {
+
+ moldyn->pt_scale&=(~(P_SCALE_MASK));
+ moldyn->pt_scale|=ptype;
+ moldyn->p_tc=ptc;
+
+ printf("[moldyn] p scaling:\n");
+
+ printf(" p: %s",ptype?"yes":"no ");
+ if(ptype)
+ printf(" | type: %02x | factor: %f",ptype,ptc);
+ printf("\n");
+
+ return 0;
+}
+
+int set_t_scale(t_moldyn *moldyn,u8 ttype,double ttc) {
+
+ moldyn->pt_scale&=(~(T_SCALE_MASK));
+ moldyn->pt_scale|=ttype;
+ moldyn->t_tc=ttc;
+
+ printf("[moldyn] t scaling:\n");
+
+ printf(" t: %s",ttype?"yes":"no ");
+ if(ttype)
+ printf(" | type: %02x | factor: %f",ttype,ttc);
+ printf("\n");
+
+ return 0;
+}
+
int set_pt_scale(t_moldyn *moldyn,u8 ptype,double ptc,u8 ttype,double ttc) {
moldyn->pt_scale=(ptype|ttype);
moldyn->func3b_k1=tersoff_mult_3bp_k1;
moldyn->func3b_j2=tersoff_mult_3bp_j2;
moldyn->func3b_k2=tersoff_mult_3bp_k2;
- // missing: check 2b bond func
+ moldyn->check_2b_bond=tersoff_mult_check_2b_bond;
break;
case MOLDYN_POTENTIAL_AM:
moldyn->func3b_j1=albe_mult_3bp_j1;
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;
printf("[moldyn] WARNING: forces too high / tau too small!\n");
/* zero absolute time */
- moldyn->time=0.0;
- moldyn->total_steps=0;
+ // should have right values!
+ //moldyn->time=0.0;
+ //moldyn->total_steps=0;
/* debugging, ignore */
moldyn->debug=0;
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);
-
- link_cell_init(moldyn,VERBOSE);
-
itom=moldyn->atom;
for(i=0;i<moldyn->count;i++) {
if(moldyn->check_2b_bond(moldyn,itom,jtom,bc)==FALSE)
return 0;
- d=sqrt(d);
-
/* now count this bonding ... */
ba=data;