Skip to content

Commit

Permalink
Fix stochasticity in the results of the CLEED simulations (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
yakutovicha authored Aug 5, 2024
1 parent 1974fb1 commit f1d7e89
Show file tree
Hide file tree
Showing 3 changed files with 172 additions and 222 deletions.
31 changes: 26 additions & 5 deletions cleedpy/cleed/src/leed.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
#include "leed.h"

void print_phase_shift(struct phs_str phs_shift)
{
int i;
printf("Phase shift:\n");
printf(" lmax: %d\n", phs_shift.lmax);
printf(" neng: %d\n", phs_shift.neng);
printf(" t_type: %d\n", phs_shift.t_type);
printf(" eng_max: %lf\n", phs_shift.eng_max);
printf(" eng_min: %lf\n", phs_shift.eng_min);
printf(" energy: %lf\n", phs_shift.energy[0]);
printf(" dr: %lf\n", phs_shift.dr[0]);
printf(" input_file: %s\n", phs_shift.input_file);
printf(" pshift: ");
for (i=0; i<phs_shift.neng; i++)
{
printf("%lf ", phs_shift.pshift[i]);
if (i % 10 == 0)
printf("\n");
}
printf("\n");

}

real ** leed(
char * par_file,
char * bul_file,
Expand All @@ -18,7 +41,7 @@ real ** leed(

int n_beams_now, n_beams_set;

int i_c, i_set, offset;
int i_c, i_set, offset, i;
int i_layer;
int energy_index;
int n_set;
Expand All @@ -40,11 +63,12 @@ real ** leed(
FILE *res_stream;

// Read input parameters
printf("HERE %s\n", bul_file);
inp_rdbul_nd(&bulk, &phs_shifts, bul_file);
inp_rdpar(&v_par, &eng, bulk, bul_file);
inp_rdovl_nd(&over, &phs_shifts, bulk, par_file);
inp_showbop(bulk, over, phs_shifts);
for (i=0; (phs_shifts + i)->lmax != I_END_OF_LIST; i++)
print_phase_shift(phs_shifts[i]);


// Construct energy list
Expand All @@ -55,9 +79,6 @@ real ** leed(
energy_list[energy_index] = eng->ini + energy_index * eng->stp;
}

// Printing stuff
inp_showbop(bulk, over, phs_shifts);


res_stream = fopen(res_file,"w");

Expand Down
Loading

0 comments on commit f1d7e89

Please sign in to comment.