Skip to content

Commit 4f1f038

Browse files
committed
Change vf_list to be as long as the energy scans
1 parent 1c5cd21 commit 4f1f038

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

mcstas-comps/samples/Phonon_simple.comp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
* target_z: [m] position of target to focus at. Straight ahead.
5252
* target_index: [1] relative index of component to focus at, e.g. next is +1
5353
* gap: [meV] Bandgap energy (unphysical)
54+
* e_steps_low [50] Amount of possible intersections beneath the elastic line
55+
* e_steps_high [50] Amount of possible intersections above the elastic line
56+
*
5457
*
5558
* CALCULATED PARAMETERS:
5659
* V_rho: [AA^-3] Atomic density
@@ -359,13 +362,13 @@ DECLARE
359362
double V_my_s;
360363
double V_my_a_v;
361364
double DV;
362-
double vf_list[100];// List of allowed final velocities. Has length of scan_steps
365+
double* vf_list;// List of allowed final velocities. Has length of scan_steps
363366
struct neutron_and_phonon_params parms;
364367

365368
%}
366369
INITIALIZE
367370
%{
368-
memset(vf_list, 0, sizeof(vf_list));
371+
vf_list = (double *)calloc( e_steps_low*e_steps_high, sizeof(double));
369372
V_rho = 4/(a*a*a);
370373
V_my_s = (V_rho * 100 * sigma_inc);
371374
V_my_a_v = (V_rho * 100 * sigma_abs * 2200);

0 commit comments

Comments
 (0)