KerMor  0.9
Model order reduction for nonlinear dynamical systems and nonlinear approximation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
split_KR.m
Go to the documentation of this file.
2 namespace models{
3 namespace beam{
4 
5 
6 /* (Autoinserted by mtoc++)
7  * This source code has been filtered by the mtoc++ executable,
8  * which generates code that can be processed by the doxygen documentation tool.
9  *
10  * On the other hand, it can neither be interpreted by MATLAB, nor can it be compiled with a C++ compiler.
11  * Except for the comments, the function bodies of your M-file functions are untouched.
12  * Consequently, the FILTER_SOURCE_FILES doxygen switch (default in our Doxyfile.template) will produce
13  * attached source files that are highly readable by humans.
14  *
15  * Additionally, links in the doxygen generated documentation to the source code of functions and class members refer to
16  * the correct locations in the source code browser.
17  * However, the line numbers most likely do not correspond to the line numbers in the original MATLAB source files.
18  */
19 
20 function models.beam.DynLinTimoshenkoModel.split_KR() {
21 
22 /* Zerlegung lokal oder global
23  *Liefert p_new, RO/KR_new */
24 
25 p = this.Points;
26 
27 if (size(this.KR_raw,1) == 0)
28  return;
29 end
30 
31 /* Zerlege KR Rohre */
32 
33 /* globale Verfeinerung */
34 if this.KR_factor_global > 1
35 
36  this.KR_raw(:,5) = this.KR_factor_global;
37 
38  KR_raw_new = zeros(this.KR_factor_global * size(this.KR_raw,1),5);
39  /* KR_raw_new(:,1) = KR_mat; */
40  p_new = zeros(size(p,1) + size(this.KR_raw,1)*(this.KR_factor_global-1),3);
41 
42  KR_raw_new(:,5) = this.KR_factor_global;
43 
44 end
45 
46 /* lokaleVerfeinerung */
47 if this.KR_factor_global <= 1
48 
49  /* this.KR_raw(:,4) = this.KR_factor_global; */
50 
51  KR_count_add = 0;
52  for j=1:size(this.KR_raw,1)
53  if this.KR_raw(j,5) >= 1
54  KR_count_add = KR_count_add + this.KR_raw(j,5) - 1;
55  end
56  end
57 
58  KR_raw_new = zeros(size(this.KR_raw,1)+KR_count_add,5);
59  /* KR_raw_new(:,1) = KR_mat; */
60  p_new = zeros(size(p,1) +KR_count_add,3);
61 end
62 
63 p_new(1:size(p,1),:) = p;
64 KR_count = 1;
65 point_count = 1;
66 for i = 1:size(this.KR_raw,1)
67 
68  KR_factor = this.KR_raw(i,5);
69  KR_mat_act = this.KR_raw(i,1);
70 
71  if KR_factor <= 1
72 
73  /* Füge keine neuen Punkte ein, füge altes Rohr wieder ein */
74 
75  KR_raw_new(KR_count,2) = this.KR_raw(i,2);
76  KR_raw_new(KR_count,3) = this.KR_raw(i,3);
77  KR_raw_new(KR_count,4) = this.KR_raw(i,4);
78  KR_raw_new(KR_count,5) = 1;
79  /* setze altes Material */
80  KR_raw_new(KR_count,1) = this.KR_raw(i,1);
81  KR_count = KR_count+1;
82 
83  continue;
84  end
85 
86  /* Punktkoordinaten der Zwischenpunkte */
87 
88  /* Anfangs- und Endpunkt */
89  P_start = [this.KR_raw(i,2) this.KR_raw(i,3)];
90  P_end = this.KR_raw(i, 4);
91 
92  KR_factor_act = this.KR_raw(i,5);
93  s = ( 0 : (pi/2)/KR_factor_act : pi/2 );
94 
95  e_x = ( p_new(P_start(1),:) - p_new(P_end,:) )^t;
96  rad = norm(e_x);
97  e_x = e_x / norm(e_x);
98  e_y = (p(P_start(2),:) - p(P_end,:))^t /norm(e_x);
99  e_y = e_y - (e_x^t*e_y) * e_x;
100  e_y = e_y / norm(e_y);
101  e_z = [e_x(2)*e_y(3) - e_x(3)*e_y(2);
102  e_x(3)*e_y(1) - e_x(1)*e_y(3);
103  e_x(1)*e_y(2) - e_x(2)*e_y(1)];
104  e_z = e_z / norm(e_z);
105  T = [e_x e_y e_z];
106 
107  x = rad * cos(s);
108  y = rad * sin(s);
109  z = 0*s;
110  COR = T * [x; y; z];
111  COR2 = [( p_new(P_end, 1) + COR(1,:))" ( p_new(P_end, 2) + COR(2,:)) " ( p_new(P_end, 3) + COR(3,:))^t];
112 
113  for j = 1:KR_factor-1
114 
115  p_new(size(p,1)+point_count,1) = COR2(j+1,1);
116  p_new(size(p,1)+point_count,2) = COR2(j+1,2);
117  p_new(size(p,1)+point_count,3) = COR2(j+1,3);
118 
119  P_act = size(p,1)+point_count;
120 
121  point_count = point_count+1;
122 
123  /* Füge Anfangsrohr ein */
124  if (j==1)
125  KR_raw_new(KR_count,2) = P_start(1);
126  KR_raw_new(KR_count,3) = P_act;
127 
128  KR_raw_new(KR_count,4) = P_end;
129 
130  KR_raw_new(KR_count,5) = KR_factor_act;
131 
132  KR_raw_new(KR_count,1) = KR_mat_act;
133  KR_count = KR_count+1;
134 
135  end
136 
137  /* Füge Zwischenrohr(e) ein
138  *j */
139  if(j~=1 )
140  KR_raw_new(KR_count,2) = P_old;
141  KR_raw_new(KR_count,3) = P_act;
142 
143  KR_raw_new(KR_count,4) = P_end;
144 
145  KR_raw_new(KR_count,5) = KR_factor_act;
146 
147  KR_raw_new(KR_count,1) = KR_mat_act;
148  KR_count = KR_count+1;
149  /* KR_count */
150  end
151 
152  /* Füge Endrohr ein */
153  if (j==KR_factor-1)
154  KR_raw_new(KR_count,2) = P_act;
155  KR_raw_new(KR_count,3) = P_start(2);
156 
157  KR_raw_new(KR_count,4) = P_end;
158 
159  KR_raw_new(KR_count,5) = KR_factor_act;
160 
161  KR_raw_new(KR_count,1) = KR_mat_act;
162  KR_count = KR_count+1;
163  end
164 
165  P_old = P_act;
166  end
167 end
168 
169 fprintf(" \nNeue Größen\n ");
170 fprintf(" Size KR_new: %d\n ",size(KR_raw_new,1));
171 fprintf(" Size P_new: %d\n ",size(p_new,1));
172 
173 
174 fprintf(" \nAlte Größen\n ");
175 fprintf(" Size KR: %d\n ",size(this.KR_raw,1));
176 fprintf(" Size P: %d\n ",size(p,1));
177 
178 this.Points= p_new;
179 this.KR_raw= KR_raw_new;
180 
181 }
182 
183 };
184 };