Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions mcstas-comps/samples/PowderN.comp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
* density: [g/cm^3] Density of material. rho=density/weight/1e24*N_A.
* nb_atoms: [1] Number of sub-unit per unit cell, that is ratio of sigma for chemical formula to sigma per unit cell
* target_index: [1] Relative index of component to focus incoherent scattering at, e.g. next is +1
* order: [1] Flag that determines whether the intensity should (1) not (0) be dampened by weighting multiple scattering
*
* CALCULATED PARAMETERS:
* line_info: [struct] internal structure containing many members/info
Expand Down Expand Up @@ -205,7 +206,7 @@ SETTING PARAMETERS (string reflections="NULL", string geometry="NULL",
radius=0, yheight=0, xwidth=0, zdepth=0, thickness=0,
pack=1, Vc=0, sigma_abs=0, sigma_inc=0, delta_d_d=0, p_inc=0.1, p_transmit=0.1,
DW=0, nb_atoms=1, d_omega=0, d_phi=0, tth_sign=0, p_interact=0.8,
concentric=0, density=0, weight=0, barns=1, Strain=0, focus_flip=0, int target_index=0)
concentric=0, density=0, weight=0, barns=1, Strain=0, focus_flip=0, int target_index=0, int order=1)


/* Neutron parameters: (x,y,z,vx,vy,vz,t,sx,sy,sz,p) */
Expand Down Expand Up @@ -992,8 +993,11 @@ TRACE
} else {
dt = dt * (t3 - t2) + (t2-t0) ; /* Possibly also 'backside' part */
}

my_s = line_info.my_s_v2_sum/(v*v)+line_info.my_inc;
if (order){
my_s = line_info.my_s_v2_sum/(v*v)+line_info.my_inc;
} else {
my_s = line_info.my_inc;
}
/* Total attenuation from scattering */
lfree=0;
ntype = rand01();
Expand Down Expand Up @@ -1136,9 +1140,10 @@ TRACE


l_1 = v*(t3 - t2 + t1 - t0); /* Length to exit */

pmul *= Nq*l_full*my_s_n*exp(-(line_info.my_a_v/v+my_s)*(l+l_1))
pmul *= Nq*l_full*my_s_n *exp(-(line_info.my_a_v/v+my_s)*(l+l_1))
/(1-(p_inc+p_transmit));

/* Correction in case of d_phi focusing - BUT only when d_phi != 0 */
if (d_phi_thread) {
pmul *= alpha/PI;
Expand Down
Loading