1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
|
/*******************************************************************************
* Instrument: Test_GROUP
*
* %Identification
* Written by: Erik Knudsen, Peter Willendrup
* Date: 2021/09/30
* Origin: DTU
* %INSTRUMENT_SITE: Tests_grammar
*
* Tests that GROUP logic works as expected
*
* %Description
* Unit test for the GROUP logic
*
* %Example: SIGNI=1 Detector: psd00_I=7.9e-8
* %Example: SIGNI=-1 Detector: psd00_I=7.9e-8
*
* %Parameters
* SLITW: [m] Width of the GROUP'ed slits
* SIGNI: [1] Which slit should be hit (left or right)
*
* %End
*******************************************************************************/
DEFINE INSTRUMENT Test_GROUP(SLITW=1e-6,SIGNI=1)
DECLARE
%{
double slit_offset;
double signi;
#pragma acc declare create(slit_offset,signi)
%}
INITIALIZE
%{
slit_offset=4e-6;
signi=SIGNI;
#pragma acc update device(slit_offset,signi)
%}
TRACE
COMPONENT origin = Progress_bar()
AT (0, 0, 0) RELATIVE ABSOLUTE
// insert components here (e.g. Insert -> Source -> ...)
COMPONENT source = Source_flat(
yheight=0.001,
xwidth=0.001,
dist=1,
focus_xw=0.001,
focus_yh=0.001,
lambda0=5,
dlambda=1)
AT (0, 0, 0) RELATIVE PREVIOUS
EXTEND
%{
x=signi*slit_offset;
y=0;
z=0;
double k=sqrt(kx*kx+ky*ky+kz*kz);
kx=ky=0;
kz=k;
%}
COMPONENT s1 = Slit(
xwidth=SLITW, yheight=0.8e-6)
AT(slit_offset,0,1) RELATIVE source
GROUP slits
COMPONENT s2 = COPY(s1)()
AT(-slit_offset,0,1) RELATIVE source
GROUP slits
COMPONENT psd00 = PSD_monitor(
yheight=2e-6, xwidth=200e-6, nx=501, ny=2, filename="psd00")
AT(0,0,1+1e-6) RELATIVE source
FINALLY
%{
%}
END
|