1 | function 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 | |
---|
24 | ElemData.FamName = fname; % add check for identical family names |
---|
25 | ElemData.Length = 0; |
---|
26 | ElemData.NumX = nx; |
---|
27 | ElemData.NumY = ny; |
---|
28 | for 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 |
---|
35 | end |
---|
36 | |
---|
37 | ElemData.R1 = diag(ones(6,1)); |
---|
38 | ElemData.R2 = diag(ones(6,1)); |
---|
39 | ElemData.T1 = zeros(1,6); |
---|
40 | ElemData.T2 = zeros(1,6); |
---|
41 | ElemData.PassMethod=method; |
---|
42 | |
---|
43 | global FAMLIST |
---|
44 | z = length(FAMLIST)+1; % number of declare families including this one |
---|
45 | FAMLIST{z}.FamName = fname; |
---|
46 | FAMLIST{z}.NumKids = 0; |
---|
47 | FAMLIST{z}.KidsList= []; |
---|
48 | FAMLIST{z}.ElemData= ElemData; |
---|