Skip to content
64 changes: 32 additions & 32 deletions mcstas-comps/examples/Tests_samples/Test_Powders/Test_Powders.instr
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,38 @@
* %Description
* A test instrument for Powder output from different sample components.
*
* %Example: lambda=2.5 directbeam=0 comp=0 material=Ge SPLITS=1 Detector: Sph_mon_I=3.67e+08
* %Example: lambda=2.5 directbeam=0 comp=0 material=Ge SPLITS=1 Detector: psd_mon_I=7.35e+05
* %Example: lambda=2.5 directbeam=0 comp=1 material=Ge SPLITS=1 Detector: Sph_mon_I=4.2e+08
* %Example: lambda=2.5 directbeam=0 comp=1 material=Ge SPLITS=1 Detector: psd_mon_I=8.3e+05
* %Example: lambda=2.5 directbeam=0 comp=2 material=Ge SPLITS=1 Detector: Sph_mon_I=4.2e+08
* %Example: lambda=2.5 directbeam=0 comp=2 material=Ge SPLITS=1 Detector: psd_mon_I=8.3e+05
* %Example: lambda=2.5 directbeam=0 comp=3 material=Ge SPLITS=1 Detector: Sph_mon_I=4.2e+08
* %Example: lambda=2.5 directbeam=0 comp=3 material=Ge SPLITS=1 Detector: psd_mon_I=8.3e+05
* %Example: lambda=2.5 directbeam=0 comp=0 material=Al twotheta=76.5 SPLITS=1 Detector: Sph_mon_I=9.1e+07
* %Example: lambda=2.5 directbeam=0 comp=0 material=Al twotheta=76.5 SPLITS=1 Detector: psd_mon_I=1.94e+05
* %Example: lambda=2.5 directbeam=0 comp=1 material=Al twotheta=76.5 SPLITS=1 Detector: Sph_mon_I=1.1e+08
* %Example: lambda=2.5 directbeam=0 comp=1 material=Al twotheta=76.5 SPLITS=1 Detector: psd_mon_I=2e+05
* %Example: lambda=2.5 directbeam=0 comp=2 material=Al twotheta=76.5 SPLITS=1 Detector: Sph_mon_I=1.1e+08
* %Example: lambda=2.5 directbeam=0 comp=2 material=Al twotheta=76.5 SPLITS=1 Detector: psd_mon_I=2e+05
* %Example: lambda=2.5 directbeam=0 comp=3 material=Al twotheta=76.5 SPLITS=1 Detector: Sph_mon_I=1.1e+08
* %Example: lambda=2.5 directbeam=0 comp=3 material=Al twotheta=76.5 SPLITS=1 Detector: psd_mon_I=2.19e+05
* %Example: lambda=2.5 directbeam=0 comp=0 material=LaMnO3 twotheta=80 SPLITS=1 Detector: Sph_mon_I=2.48e+08
* %Example: lambda=2.5 directbeam=0 comp=0 material=LaMnO3 twotheta=80 SPLITS=1 Detector: psd_mon_I=1.78e+05
* %Example: lambda=2.5 directbeam=0 comp=1 material=LaMnO3 twotheta=80 SPLITS=1 Detector: Sph_mon_I=3.1e+08
* %Example: lambda=2.5 directbeam=0 comp=1 material=LaMnO3 twotheta=80 SPLITS=1 Detector: psd_mon_I=2.1e+05
* %Example: lambda=2.5 directbeam=0 comp=2 material=LaMnO3 twotheta=80 SPLITS=1 Detector: Sph_mon_I=3.1e+08
* %Example: lambda=2.5 directbeam=0 comp=2 material=LaMnO3 twotheta=80 SPLITS=1 Detector: psd_mon_I=1.9e+05
* %Example: lambda=2.5 directbeam=0 comp=3 material=LaMnO3 twotheta=80 SPLITS=1 Detector: Sph_mon_I=3.1e+08
* %Example: lambda=2.5 directbeam=0 comp=3 material=LaMnO3 twotheta=80 SPLITS=1 Detector: psd_mon_I=1.9e+05
* %Example: lambda=2.5 directbeam=0 comp=0 material=NaCl twotheta=78 SPLITS=1 Detector: Sph_mon_I=2.13e+08
* %Example: lambda=2.5 directbeam=0 comp=0 material=NaCl twotheta=78 SPLITS=1 Detector: psd_mon_I=3.2e+05
* %Example: lambda=2.5 directbeam=0 comp=1 material=NaCl twotheta=78 SPLITS=1 Detector: Sph_mon_I=2.5e+08
* %Example: lambda=2.5 directbeam=0 comp=1 material=NaCl twotheta=78 SPLITS=1 Detector: psd_mon_I=3.4e+05
* %Example: lambda=2.5 directbeam=0 comp=2 material=NaCl twotheta=78 SPLITS=1 Detector: Sph_mon_I=2.5e+08
* %Example: lambda=2.5 directbeam=0 comp=2 material=NaCl twotheta=78 SPLITS=1 Detector: psd_mon_I=3.4e+05
* %Example: lambda=2.5 directbeam=0 comp=3 material=NaCl twotheta=78 SPLITS=1 Detector: Sph_mon_I=2.5e+08
* %Example: lambda=2.5 directbeam=0 comp=3 material=NaCl twotheta=78 SPLITS=1 Detector: psd_mon_I=3.4e+05
* %Example: lambda=2.5 directbeam=0 comp=0 material=Ge SPLITS=1 Detector: Sph_mon_I=3.67298e+08
* %Example: lambda=2.5 directbeam=0 comp=0 material=Ge SPLITS=1 Detector: psd_mon_I=773137
* %Example: lambda=2.5 directbeam=0 comp=1 material=Ge SPLITS=1 Detector: Sph_mon_I=3.85947e+08
* %Example: lambda=2.5 directbeam=0 comp=1 material=Ge SPLITS=1 Detector: psd_mon_I=811340
* %Example: lambda=2.5 directbeam=0 comp=2 material=Ge SPLITS=1 Detector: Sph_mon_I=3.914e+08
* %Example: lambda=2.5 directbeam=0 comp=2 material=Ge SPLITS=1 Detector: psd_mon_I=723428
* %Example: lambda=2.5 directbeam=0 comp=3 material=Ge SPLITS=1 Detector: Sph_mon_I=4.68483e+08
* %Example: lambda=2.5 directbeam=0 comp=3 material=Ge SPLITS=1 Detector: psd_mon_I=786876
* %Example: lambda=2.5 directbeam=0 comp=0 material=Al twotheta=76.5 SPLITS=1 Detector: Sph_mon_I=9.12821e+07
* %Example: lambda=2.5 directbeam=0 comp=0 material=Al twotheta=76.5 SPLITS=1 Detector: psd_mon_I=197078
* %Example: lambda=2.5 directbeam=0 comp=1 material=Al twotheta=76.5 SPLITS=1 Detector: Sph_mon_I=1.10426e+08
* %Example: lambda=2.5 directbeam=0 comp=1 material=Al twotheta=76.5 SPLITS=1 Detector: psd_mon_I=230205
* %Example: lambda=2.5 directbeam=0 comp=2 material=Al twotheta=76.5 SPLITS=1 Detector: Sph_mon_I=9.9981e+07
* %Example: lambda=2.5 directbeam=0 comp=2 material=Al twotheta=76.5 SPLITS=1 Detector: psd_mon_I=178603
* %Example: lambda=2.5 directbeam=0 comp=3 material=Al twotheta=76.5 SPLITS=1 Detector: Sph_mon_I=1.20784e+08
* %Example: lambda=2.5 directbeam=0 comp=3 material=Al twotheta=76.5 SPLITS=1 Detector: psd_mon_I=204570
* %Example: lambda=2.5 directbeam=0 comp=0 material=LaMnO3 twotheta=80 SPLITS=1 Detector: Sph_mon_I=2.48616e+08
* %Example: lambda=2.5 directbeam=0 comp=0 material=LaMnO3 twotheta=80 SPLITS=1 Detector: psd_mon_I=171164
* %Example: lambda=2.5 directbeam=0 comp=1 material=LaMnO3 twotheta=80 SPLITS=1 Detector: Sph_mon_I=2.93457e+08
* %Example: lambda=2.5 directbeam=0 comp=1 material=LaMnO3 twotheta=80 SPLITS=1 Detector: psd_mon_I=196096
* %Example: lambda=2.5 directbeam=0 comp=2 material=LaMnO3 twotheta=80 SPLITS=1 Detector: Sph_mon_I=3.11548e+08
* %Example: lambda=2.5 directbeam=0 comp=2 material=LaMnO3 twotheta=80 SPLITS=1 Detector: psd_mon_I=183894
* %Example: lambda=2.5 directbeam=0 comp=3 material=LaMnO3 twotheta=80 SPLITS=1 Detector: Sph_mon_I=3.40544e+08
* %Example: lambda=2.5 directbeam=0 comp=3 material=LaMnO3 twotheta=80 SPLITS=1 Detector: psd_mon_I=192638
* %Example: lambda=2.5 directbeam=0 comp=0 material=NaCl twotheta=78 SPLITS=1 Detector: Sph_mon_I=2.1313e+08
* %Example: lambda=2.5 directbeam=0 comp=0 material=NaCl twotheta=78 SPLITS=1 Detector: psd_mon_I=305947
* %Example: lambda=2.5 directbeam=0 comp=1 material=NaCl twotheta=78 SPLITS=1 Detector: Sph_mon_I=2.35283e+08
* %Example: lambda=2.5 directbeam=0 comp=1 material=NaCl twotheta=78 SPLITS=1 Detector: psd_mon_I=341363
* %Example: lambda=2.5 directbeam=0 comp=2 material=NaCl twotheta=78 SPLITS=1 Detector: Sph_mon_I=2.49715e+08
* %Example: lambda=2.5 directbeam=0 comp=2 material=NaCl twotheta=78 SPLITS=1 Detector: psd_mon_I=375832
* %Example: lambda=2.5 directbeam=0 comp=3 material=NaCl twotheta=78 SPLITS=1 Detector: Sph_mon_I=2.69224e+08
* %Example: lambda=2.5 directbeam=0 comp=3 material=NaCl twotheta=78 SPLITS=1 Detector: psd_mon_I=311818
*
* %Parameters
* comp: [1] 0=PowderN-with-NCMAT, 1=PowderN, 2=Single_crystal, 3=NCrystal
Expand Down
17 changes: 4 additions & 13 deletions mcstas-comps/samples/PowderN.comp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@
* 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 @@ -206,7 +205,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, int order=1)
concentric=0, density=0, weight=0, barns=1, Strain=0, focus_flip=0, int target_index=0)

DEPENDENCY "@NCRYSTALFLAGS@"

Expand Down Expand Up @@ -452,9 +451,7 @@ SHARE
struct line_data* list = NULL;
list = (struct line_data*)malloc (nhkl * sizeof (struct line_data));
if (!list) {
exit (fprintf (stderr,
"PowderN: %s: Error: Could not allocate line array\n",
info->compname));
exit (fprintf (stderr, "PowderN: %s: Error: Could not allocate line array\n", info->compname));
}
info->sigma_a = ncrystal_info_getxsectabsorption (ncobj);
info->sigma_i = ncrystalpowdern_determine_sigma_inc (ncobj);
Expand Down Expand Up @@ -608,9 +605,7 @@ SHARE
/* allocate line_data array */
list = (struct line_data*)malloc (size * sizeof (struct line_data));
if (!list) {
exit (fprintf (stderr,
"PowderN: %s: Error: Could not allocate line array\n",
info->compname));
exit (fprintf (stderr, "PowderN: %s: Error: Could not allocate line array\n", info->compname));
}

for (i = 0; i < size; i++) {
Expand Down Expand Up @@ -1142,11 +1137,7 @@ TRACE
} else {
dt = dt * (t3 - t2) + (t2 - t0); /* Possibly also 'backside' part */
}
if (order) {
my_s = line_info.my_s_v2_sum / (v * v) + line_info.my_inc;
} else {
my_s = line_info.my_inc;
}
my_s = line_info.my_s_v2_sum / (v * v) + line_info.my_inc;
/* Total attenuation from scattering */
lfree = 0;
ntype = rand01 ();
Expand Down
Loading