/********************************************/ /* Program To Fit Finnis-Sinclair Potential */ /* */ /* V1.0 May 13 2000 Ju Li (MIT) */ /********************************************/ #include #include #include /* atom */ #define MAX_TYPE 2 #define Zr_ATOM 0 #define C_ATOM 1 #define MAX_ATOM 8 /* interaction */ #define MAX_FIRST 32 #define MAX_IMAGE 256 /* structure */ #define NaCl 0 #define ZnS 1 #define CsCl 2 #define ZrVAC 3 #define CVAC 4 #define PureZr 5 #define PureC 6 #define ZrC_CDIS 7 #define ZrC_ZrDIS 8 #define DIS_DEL (DELTA*100) #define ZrC_TEST 9 #define TEST_DEL (SMALL/100) #define MAX_STRUCTURE 10 /* target */ #define LATTICE_CONSTANT 4.695 #define MAX_XTAL_STRUCTURE 3 #define XTAL_EQ_A 0 #define XTAL_EQ_POTE 1 #define MAX_XTAL_PROPERTY 2 /* parameter */ #define MAX_CATEGORY 8 #define MAX_OP 16 /* info */ #define REP_FILENAME "rep" #define SIG_SUCCESS SIGUSR1 typedef struct { char *name; /* structure name */ double H[3][3]; /* Bravais lattice measured in a */ double volume; /* cell volume in a^3 */ double HI[3][3]; /* matrix inverse of H[3][3] */ int n; /* number of atoms in this unit cell */ int *t; /* atom type specified in Z[] */ double mass; /* mass of the unit cell in g */ double *s; /* x = s . H */ double *ds; /* neighbor atom delta s */ double a; /* lattice constant in A */ double *dx; /* neighbor atom delta x */ double *X; /* embedding function of each atom */ double pote; /* potential energy [eV] / unit cell */ bool calculate_force; /* carry out force calculation */ double *f; /* force in x,y,z directions */ } Structure; /* main.c: */ void construct_neighbor_list (Structure *S); double potential_energy (Structure *S, double param[MAX_OP]); double fe (double guess[MAX_OP]); void wrap_up (int sig); /* targets.c: */ /* Equilibrium lattice constant [A], energy per unit cell [eV] */ extern const int Z[MAX_TYPE]; extern const double xtal_target[MAX_XTAL_STRUCTURE][MAX_XTAL_PROPERTY]; extern const double c11_target, c12_target, c44_target; /* in GPa */ #define bulk_modulus_target ((c11_target+2*c12_target)/3) extern const double schottky_energy_target; extern const double NaCl_cohesive_energy_target; /* eV/pair */ extern const double PureZr_atomic_volume_target; /* in A^3 */ extern const double PureZr_bulk_modulus_target; /* in GPa */ extern const double PureZr_cohesive_energy_target; /* eV/atom */ extern const double PureC_atomic_volume_target; /* in A^3 */ extern const double PureC_bulk_modulus_target; /* in GPa */ extern const double PureC_cohesive_energy_target; /* eV/atom */ extern const double ZrC_CDIS_fx_target [8]; extern const double ZrC_ZrDIS_fx_target [8]; extern const double heat_of_formation_target; extern Structure my[MAX_STRUCTURE], *this_structure; extern int n_category, category_ops[MAX_CATEGORY]; extern TermString category_name[MAX_CATEGORY]; extern double bound[2][MAX_OP], param[MAX_OP]; extern double lattice_constant_range[MAX_STRUCTURE][2]; extern double xtal_weight[MAX_STRUCTURE][MAX_XTAL_PROPERTY], exponent; extern double bulk_modulus_weight, c11_weight, c12_weight, c44_weight; extern double schottky_energy_weight; extern double bulk_modulus, c11, c12, c44, schottky_energy; extern double PureZr_atomic_volume_weight, PureZr_bulk_modulus_weight; extern double PureZr_cohesive_energy_weight; extern double PureC_atomic_volume_weight, PureC_bulk_modulus_weight; extern double PureC_cohesive_energy_weight; extern double heat_of_formation_weight, ZrC_CDIS_fx_weight[8], ZrC_ZrDIS_fx_weight[8]; extern int print_freq, maxkb, just_print_it, kb; /* elastic_constants.c: */ double Bulk_Modulus (Structure *S); double C11_C12 (Structure *S); double C44_0 (Structure *S); /* info.c: */ void print_param (FILE *out); void print_property (FILE *out); void plot_cohesive_energy_curves (char filename[]); void write_config (Structure *S, double x0[3], double H0[3][3], double magnification, char filename[]);