diff --git a/tightbind/driver.c b/tightbind/driver.c index 5243bd4b..73d9f07d 100644 --- a/tightbind/driver.c +++ b/tightbind/driver.c @@ -35,6 +35,40 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // For booleans #include "stdbool.h" +void set_details_defaults(details) + detail_type *details; + /* Set defaults struct to default options, ie off*/ +{ + details->walsh_details.num_steps = 1; + details->walsh_details.num_vars = 0; + details->use_symmetry = 0; + details->find_princ_axes = 0; + details->vary_zeta = 0; + details->avg_props = 0; + details->just_geom = 0; + details->dump_overlap = 0; + details->dump_hamil = 0; + details->sparsify_value = 0.0; + details->Execution_Mode = FAT; + details->the_const = THE_CONST; + details->weighted_Hij = 1; + details->eval_electrostat = 0; + details->close_nn_contact = NN_DISTANCE; + details->symm_tol = SYMM_TOL; + details->muller_mix = MULLER_MIX_DEF; + details->muller_E_tol = MULLER_E_TOL_DEF; + details->muller_Z_tol = MULLER_Z_TOL_DEF; + details->num_moments = 4; + details->line_width = 80; + details->k_offset = K_OFFSET; +} +void set_cell_defaults(cell) + cell_type *cell; +{ + cell->equiv_atoms = 0; + cell->charge = -1000.0; +} + void inner_wrapper(char *file_name, bool use_stdin_stdout){ char temp_file_name[500],err_string[500]; FILE *temp_file; diff --git a/tightbind/fileio.c b/tightbind/fileio.c index a150bec0..a9e4add1 100644 --- a/tightbind/fileio.c +++ b/tightbind/fileio.c @@ -1533,34 +1533,11 @@ void read_inputfile(cell,details,name,num_orbs,orbital_lookup_table,the_file, /******* initialize some variables ********/ - details->walsh_details.num_steps = 1; - details->walsh_details.num_vars = 0; - details->use_symmetry = 0; - details->find_princ_axes = 0; - details->vary_zeta = 0; - details->avg_props = 0; - details->just_geom = 0; - details->dump_overlap = 0; - details->dump_hamil = 0; - details->sparsify_value = 0.0; + set_details_defaults(details); + set_cell_defaults(cell); got_params = 0; got_muller_params = 0; got_geom = 0; - details->Execution_Mode = FAT; - details->the_const = THE_CONST; - details->weighted_Hij = 1; - details->eval_electrostat = 0; - details->close_nn_contact = NN_DISTANCE; - details->symm_tol = SYMM_TOL; - details->muller_mix = MULLER_MIX_DEF; - details->muller_E_tol = MULLER_E_TOL_DEF; - details->muller_Z_tol = MULLER_Z_TOL_DEF; - details->num_moments = 4; - details->line_width = 80; - details->k_offset = K_OFFSET; - cell->equiv_atoms = 0; - - cell->charge = -1000.0; /*************** diff --git a/tightbind/prototypes.h b/tightbind/prototypes.h index c89d2a58..8052056a 100644 --- a/tightbind/prototypes.h +++ b/tightbind/prototypes.h @@ -349,6 +349,8 @@ extern void gen_k_point_mesh PROTO((point_type * *points, int num_per_vect[3], real offset)); extern void automagic_k_points PROTO((detail_type * details, cell_type *cell)); +extern void set_details_defaults PROTO((detail_type*)); +extern void set_cell_defaults PROTO((cell_type*)); extern void run_bind PROTO((char *, bool, char *)); extern void run_eht PROTO((FILE *)); diff --git a/tightbind/test_driver.c b/tightbind/test_driver.c index 1dadecf4..079f93c1 100644 --- a/tightbind/test_driver.c +++ b/tightbind/test_driver.c @@ -52,34 +52,11 @@ void main(int argc, char **argv){ /******* initialize some variables ********/ - details->walsh_details.num_steps = 1; - details->walsh_details.num_vars = 0; - details->use_symmetry = 0; - details->find_princ_axes = 0; - details->vary_zeta = 0; - details->avg_props = 0; - details->just_geom = 0; - details->dump_overlap = 0; - details->dump_hamil = 0; - details->sparsify_value = 0.0; - details->Execution_Mode = FAT; - details->the_const = THE_CONST; - details->weighted_Hij = 1; - details->eval_electrostat = 0; - details->close_nn_contact = NN_DISTANCE; - details->symm_tol = SYMM_TOL; - details->muller_mix = MULLER_MIX_DEF; - details->muller_E_tol = MULLER_E_TOL_DEF; - details->muller_Z_tol = MULLER_Z_TOL_DEF; - details->num_moments = 4; - details->line_width = 80; - details->k_offset = K_OFFSET; - unit_cell->equiv_atoms = 0; - + set_details_defaults(details); + set_cell_defaults(unit_cell); safe_strcpy(details->title,"test job"); - // molecular calculation details->Execution_Mode = MOLECULAR; details->num_KPOINTS = 1;