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
read_file.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 [points , RO , KR , FH , mat , lager , lasten ] = models.beam.DynLinTimoshenkoModel.read_file(file) {
21 
22 /* clc; */
23 
24 /* %-----------------------------------------------------------
25  * %Read Materialparameter
26  * %-----------------------------------------------------------
27  * mat = read_in3('MAT',4,file);
28  *
29  * %-----------------------------------------------------------
30  * %Read Points
31  * %-----------------------------------------------------------
32  * points = read_in3('Knoten','Elemente',4,file);
33  *
34  *
35  * %-----------------------------------------------------------
36  * %Read Rohre
37  * %-----------------------------------------------------------
38  * %-----------------------------------------------------------
39  * %Read RO Rohre
40  * %-----------------------------------------------------------
41  * RO = read_in('Elemente','Lager','RO',3,file);
42  * %-----------------------------------------------------------
43  * %Read KR Rohre
44  * %-----------------------------------------------------------
45  * KR = read_in('Elemente','Lager','KR',4,file);
46  *
47  *
48  * %-----------------------------------------------------------
49  * %Read DIR Lager
50  * %-----------------------------------------------------------
51  * lager = read_in('Lager','Lasten','DIR',13,file);
52  *
53  *
54  * %-----------------------------------------------------------
55  * %Read NEU Lasten
56  * %-----------------------------------------------------------
57  * lasten = read_in('Lasten','Ende','NEU',7,file); */
58 
59 /* -----------------------------------------------------------
60  *Read Materialparameter
61  *----------------------------------------------------------- */
62 mat = read_in3(" MAT ",12,file);
63 mat = mat(:,2:12);
64 
65 /* -----------------------------------------------------------
66  *Read Points
67  *----------------------------------------------------------- */
68 points = read_in3(" KNO ",4,file);
69 points = points(:,2:4);
70 
71 /* ----------------------------------------------------------- */
72 
73 /* Read RO Rohre
74  *----------------------------------------------------------- */
75 RO = read_in3(" RO ",4,file);
76 /* ----------------------------------------------------------- */
77 
78 /* Read KR Rohre
79  *----------------------------------------------------------- */
80 KR = read_in3(" KR ",5,file);
81 /* ----------------------------------------------------------- */
82 
83 /* Read FH Federhänger
84  *----------------------------------------------------------- */
85 FH = read_in3(" FH ",3,file);
86 
87 /* -----------------------------------------------------------
88  *Read DIR Lager
89  *----------------------------------------------------------- */
90 lager = read_in3(" DIR ",15,file);
91 
92 /* -----------------------------------------------------------
93  *Read NEU Lasten
94  *----------------------------------------------------------- */
95 lasten = read_in3(" NEU ",8,file);
96 
97  function output = read_in3(keyword,count,file)
98 
99  /* -----------------------------------------------------------
100  *Read_in mit Keyword über gesamtes File
101  *----------------------------------------------------------- */
102 
103  fid = fopen(file);
104  k = 1;
105 
106  while ~feof(fid)
107 
108 
109  str = fscanf(fid, " %s ", 1);
110 
111 
112  if (strcmp(str," # "))
113  str_temp = fscanf(fid, " %s ", 1);
114  continue;
115  end
116 
117 
118  if (strcmp(str,keyword))
119 
120  for i=1:count
121  val = fscanf(fid, " %g ", 1);
122 
123  if isempty(val)
124 
125  output(k) = 0;
126  k=k+1;
127 
128  continue;
129  end
130 
131  output(k) = val;
132  k=k+1;
133 
134  end
135  end
136 
137  end
138 
139 
140  /* output */
141 
142  fclose(fid);
143 
144  if exist(" output ")
145 
146  fprintf(" Read_in: \t Anzahl: %g \t Keyword: %s \n ",length(output)/count,keyword);
147  output = reshape(output,count,length(output)/count)^t;
148 
149  else
150  output = [];
151  fprintf(" Keyword %s does not exist\n ",keyword);
152  end
153 
154 
155  end
156 end
157 
158 
159 }
171 };
172 };