File: Test_GROUP.instr

package info (click to toggle)
mccode 3.5.19%2Bds5-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,113,256 kB
  • sloc: ansic: 40,697; python: 25,137; yacc: 8,438; sh: 5,405; javascript: 4,596; lex: 1,632; cpp: 742; perl: 296; lisp: 273; makefile: 226; fortran: 132
file content (81 lines) | stat: -rw-r--r-- 1,628 bytes parent folder | download
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