Skip to content
Open
Show file tree
Hide file tree
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
7 changes: 5 additions & 2 deletions .github/workflows/mcstas-basictest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -429,13 +429,14 @@ jobs:
export DIFFBASE=$(git merge-base origin/main HEAD)
fi
echo "Diffing against: $DIFFBASE"

export RUNALL="NO"
export CHANGEDCOMPS=$(git diff --name-only $DIFFBASE HEAD | grep '\.comp$' | grep mcstas-comps | xargs -n1 basename | sed 's/\.comp//g' | sort | uniq | xargs echo)
export NUMCHANGEDCOMPS=$(git diff --name-only $DIFFBASE HEAD | grep '\.comp$' | grep mcstas-comps | wc -l | xargs echo)
cd -
compindex=0
if [ "$NUMCHANGEDCOMPS" != "0" ];
then
if [ "$NUMCHANGEDCOMPS" -lt "5" ]; then
for comp in $CHANGEDCOMPS;
do
echo Finding tests including component $comp
Expand All @@ -448,10 +449,12 @@ jobs:
echo No matching tests found
fi
done
else
export RUNALL="YES"
fi
fi

cd src
export RUNALL="NO"
export CHANGEDINSTR=$(git diff --name-only $DIFFBASE HEAD | grep '\.instr$' | grep mcstas-comps | xargs -n1 basename | sed 's/\.instr//g' | sort | uniq | xargs echo | sed 's/ /,/g')
export NUMCHANGEDINSTR=$(git diff --name-only $DIFFBASE HEAD | grep '\.instr$' | grep mcstas-comps | wc -l | xargs echo)
echo ----
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/mcxtrace-basictest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -436,13 +436,14 @@ jobs:
export DIFFBASE=$(git merge-base origin/main HEAD)
fi
echo "Diffing against: $DIFFBASE"

export CHANGEDCOMPS=$(git diff --name-only $DIFFBASE HEAD | grep '\.comp$' | grep mcxtrace-comps | xargs -n1 basename | sed 's/\.comp//g' | sort | uniq | xargs echo)
export NUMCHANGEDCOMPS=$(git diff --name-only $DIFFBASE HEAD | grep '\.comp$' | grep mcxtrace-comps | wc -l | xargs echo)
export RUNALL="NO"
export CHANGEDCOMPS=$(git diff --name-only $DIFFBASE HEAD | grep '\.comp$' | grep mcstas-comps | xargs -n1 basename | sed 's/\.comp//g' | sort | uniq | xargs echo)
export NUMCHANGEDCOMPS=$(git diff --name-only $DIFFBASE HEAD | grep '\.comp$' | grep mcstas-comps | wc -l | xargs echo)
cd -
compindex=0
if [ "$NUMCHANGEDCOMPS" != "0" ];
then
if [ "$NUMCHANGEDCOMPS" -lt "5" ]; then
for comp in $CHANGEDCOMPS;
do
echo Finding tests including component $comp
Expand All @@ -455,10 +456,12 @@ jobs:
echo No matching tests found
fi
done
else
export RUNALL="YES"
fi
fi

cd src
export RUNALL="NO"
export CHANGEDINSTR=$(git diff --name-only $DIFFBASE HEAD | grep '\.instr$' | grep mcxtrace-comps | xargs -n1 basename | sed 's/\.instr//g' | sort | uniq | xargs echo | sed 's/ /,/g')
export NUMCHANGEDINSTR=$(git diff --name-only $DIFFBASE HEAD | grep '\.instr$' | grep mcxtrace-comps | wc -l | xargs echo)
echo ----
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