source: MML/trunk/at/simulator/element/user/epukick.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 11 years ago

Initial import--MML version from SOLEIL@2013

File size: 1.5 KB
Line 
1function z=epukick(fname,nx,ny,XEPU,YEPU,PXEPU,PYEPU,method)
2
3%   epukick(fname,nx,ny,XEPU,YEPU,PXEPU,PYEPU,method)
4%   creates a new family in the FAMLIST - a structure with fields
5%   FamName         family name
6%   nx              number of points in x
7%   ny              number of points in y
8%   XEPU            meshgrid of x
9%   YEPU            meshgrid of y
10%   PXEPU           meshgrid of px
11%   PYEPU           meshgrid of py
12%   PassMethod      name of the function to use for tracking
13%
14%   internally the additional structure fields are set:
15%
16%   R1              6 x 6 rotation matrix at the entrance
17%   R2              6 x 6 rotation matrix at the entrance
18%   T1              6 x 1 translation at entrance
19%   T2              6 x 1 translation at exit4
20%
21%   returns assigned address in the FAMLIST that uniquely identifies
22%   the family
23
24ElemData.FamName = fname;  % add check for identical family names
25ElemData.Length = 0;
26ElemData.NumX = nx;
27ElemData.NumY = ny;
28for i=1:ny
29    for j=1:nx
30        ElemData.XGrid(i,j) = XEPU(i,j);
31        ElemData.YGrid(i,j) = YEPU(i,j);
32        ElemData.PxGrid(i,j) = PXEPU(i,j);
33        ElemData.PyGrid(i,j) = PYEPU(i,j);
34    end
35end
36
37ElemData.R1 = diag(ones(6,1));
38ElemData.R2 = diag(ones(6,1));
39ElemData.T1 = zeros(1,6);
40ElemData.T2 = zeros(1,6);
41ElemData.PassMethod=method;
42
43global FAMLIST
44z = length(FAMLIST)+1; % number of declare families including this one
45FAMLIST{z}.FamName = fname;
46FAMLIST{z}.NumKids = 0;
47FAMLIST{z}.KidsList= [];
48FAMLIST{z}.ElemData= ElemData;
Note: See TracBrowser for help on using the repository browser.