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_RO.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_RO() {
21 
22 /* Zerlegung lokal oder global
23  *Liefert p_new, RO/KR_new */
24 
25 /* KR_raw_new = KR_raw; */
26 p = this.Points;
27 
28 
29 /* globale Verfeinerung */
30 if this.RO_factor_global > 1
31 
32  this.RO_raw(:,4) = this.RO_factor_global;
33 
34 
35 
36  RO_raw_new = zeros(this.RO_factor_global * size(this.RO_raw,1),3);
37  /* RO_raw_new(:,1) = RO_mat; */
38  p_new = zeros(size(p,1) + size(this.RO_raw,1)*(this.RO_factor_global-1),3);
39 
40 end
41 
42 /* lokaleVerfeinerung */
43 if this.RO_factor_global <= 1
44 
45  /* this.RO_raw(:,4) = this.RO_factor_global; */
46 
47  RO_count_add = 0;
48  for j=1:size(this.RO_raw,1)
49  if this.RO_raw(j,4) >= 1
50  RO_count_add = RO_count_add + this.RO_raw(j,4) - 1;
51  end
52  end
53 
54  /* RO_count_add */
55 
56 
57  RO_raw_new = zeros(size(this.RO_raw,1)+RO_count_add,3);
58  /* RO_raw_new(:,1) = RO_mat; */
59  p_new = zeros(size(p,1) +RO_count_add,3);
60 
61 
62 end
63 
64 
65 
66 /* this.RO_raw */
67 
68 
69 p_new(1:size(p,1),:) = p;
70 RO_count = 1;
71 point_count = 1;
72 
73 
74 for i = 1:size(this.RO_raw,1)
75 
76  RO_factor = this.RO_raw(i,4);
77  RO_mat_act = this.RO_raw(i,1);
78 
79  if RO_factor <= 1
80 
81  /* Füge keine neuen Punkte ein, füge altes Rohr wieder ein */
82 
83  RO_raw_new(RO_count,2) = this.RO_raw(i,2);
84  RO_raw_new(RO_count,3) = this.RO_raw(i,3);
85  /* setze altes Material */
86  RO_raw_new(RO_count,1) = this.RO_raw(i,1);
87  RO_count = RO_count+1;
88 
89  continue;
90  end
91 
92  /* RO_factor */
93 
94  /* P_start = this.RO_raw(i,2)
95  *P_end = this.RO_raw(i,3) */
96 
97  /* x_coord_start = p(this.RO_raw(i,2),1) */
98 
99  lx = p(this.RO_raw(i,3),1) - p(this.RO_raw(i,2),1);
100  ly = p(this.RO_raw(i,3),2) - p(this.RO_raw(i,2),2);
101  lz = p(this.RO_raw(i,3),3) - p(this.RO_raw(i,2),3);
102  dx = lx/RO_factor;
103  dy = ly/RO_factor;
104  dz = lz/RO_factor;
105 
106  /* Füge neue Punkte ein */
107 
108  for j = 1:RO_factor-1
109 
110  /* size(p,1) */
111 
112  p_new(size(p,1)+point_count,1) = p(this.RO_raw(i,2),1) + j*dx ;
113  p_new(size(p,1)+point_count,2) = p(this.RO_raw(i,2),2) + j*dy ;
114  p_new(size(p,1)+point_count,3) = p(this.RO_raw(i,2),3) + j*dz ;
115 
116 
117 
118 
119 
120  P_start = this.RO_raw(i,2);
121 
122 
123  P_act = size(p,1)+point_count;
124 
125  /* P_act */
126 
127  point_count = point_count+1;
128 
129  P_end = this.RO_raw(i,3);
130 
131  /* Füge Anfangsrohr ein */
132  if (j==1)
133  RO_raw_new(RO_count,2) = P_start;
134  RO_raw_new(RO_count,3) = P_act;
135  RO_raw_new(RO_count,1) = RO_mat_act;
136  RO_count = RO_count+1;
137 
138  end
139 
140  /* Füge Zwischenrohr(e) ein
141  *j */
142  if(j~=1 )
143  RO_raw_new(RO_count,2) = P_old;
144  RO_raw_new(RO_count,3) = P_act;
145  RO_raw_new(RO_count,1) = RO_mat_act;
146  RO_count = RO_count+1;
147  /* RO_count */
148  end
149 
150  /* Füge Endrohr ein */
151  if (j==RO_factor-1)
152  RO_raw_new(RO_count,2) = P_act;
153  RO_raw_new(RO_count,3) = P_end;
154  RO_raw_new(RO_count,1) = RO_mat_act;
155  RO_count = RO_count+1;
156  end
157 
158  P_old = P_act;
159 
160  end
161 
162 
163 
164 /* %Füge neue Rohre ein
165  * for j = 1:RO_factor
166  *
167  * %Startpunkt
168  * RO_raw_new(j+(i-1)*(RO_factor),2) = size(p,1)+j+(i-1)*(RO_factor-1);
169  * %Endpunkt
170  * RO_raw_new(j+(i-1)*(RO_factor),3) = size(p,1)+j+1+(i-1)*(RO_factor-1);
171  *
172  * end */
173 
174 
175 
176 end
177 
178 /* if this.RO_factor_global ~= 1
179  *RO_raw_new */
180 
181 /* fprintf('\nSize RO_new: %d\n',size(RO_raw_new,1));
182  * fprintf('Size P_new: %d\n',size(p_new,1));
183  *
184  * fprintf('\nSize RO: %d\n',size(this.RO_raw,1));
185  * fprintf('Size P: %d\n',size(p,1)); */
186 
187 /* this.RO_raw = RO_raw_new;
188  *p=p_new; */
189 
190 /* if KR_factor_global ~= 1
191  *KR_raw_new */
192 
193 fprintf(" \nNeue Größen\n ");
194 fprintf(" Size RO_new: %d\n ",size(RO_raw_new,1));
195 fprintf(" Size P_new: %d\n ",size(p_new,1));
196 
197 fprintf(" \nAlte Größen\n ");
198 fprintf(" Size RO: %d\n ",size(this.RO_raw,1));
199 fprintf(" Size P: %d\n ",size(p,1));
200 
201 this.Points= p_new;
202 this.RO_raw= RO_raw_new;
203 /* p_new2
204  * KR_raw_new */
205 
206 /* fprintf('\nSize RO_new: %d\n',size(RO_raw_new,1));
207  * fprintf('Size P_new: %d\n',size(p_new,1));
208  *
209  * fprintf('\nSize RO: %d\n',size(this.RO_raw,1));
210  * fprintf('Size P: %d\n',size(p,1)); */
211 
212 
213 }
214 
215 };
216 };