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
Belly.m
Go to the documentation of this file.
1 namespace models{
2 namespace muscle{
3 namespace examples{
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 class Belly
28  private:
29 
30  NumParts;
31 
32 
33  public:
34 
36  this = this@models.muscle.AMuscleConfig(varargin[:]);
37  this.init;
38 
39  /* % Muscle fibre weights */
40  types = [0 .2 .4 .6 .8 1];
41  ftw = zeros(this.FEM.GaussPointsPerElem,length(types),this.FEM.Geometry.NumElements);
42  /* Test: Use only slow-twitch muscles */
43  ftw(:,1,:) = .4;
44  ftw(:,2,:) = .05;
45  ftw(:,3,:) = .05;
46  ftw(:,4,:) = .1;
47  ftw(:,5,:) = .2;
48  ftw(:,6,:) = .2;
49  this.FibreTypeWeights= ftw;
50  p = models.motorunit.Pool;
51  p.FibreTypes= types;
52  this.Pool= p;
53  }
54 
55 
56  function configureModel(m) {
57  configureModel@models.muscle.AMuscleConfig(this, m);
58  m.T= 150;
59  m.dt= .1;
60  m.DefaultMu(4) = 6;
61  m.Plotter.DefaultArgs= [" Pool ",true];
62  }
63 
64 
65  protected:
66 
67 
68  function geo = getGeometry() {
69  np = 4;
70  geo = fem.geometry.Belly(np,10," Radius ",1," InnerRadius ",.5," Gamma ",2);
71  this.NumParts= np;
72  }
73 
74 
75  function displ_dir = setPositionDirichletBC(displ_dir) {
76  geo = this.FEM.Geometry;
77  for k = geo.NumElements-3:geo.NumElements
78  displ_dir(:,geo.Elements(k,geo.MasterFaces(4,:))) = true;
79  end
80  for k = 1:4
81  displ_dir(:,geo.Elements(k,geo.MasterFaces(3,:))) = true;
82  end
83  }
92  function anull = seta0(anull) {
93  anull(2,:,:) = 1;
94  }
95 
96 
97  public: /* ( Static ) */
98 
99  static function res = test_BellyGeometryGeneration() {
100  g = fem.geometry.Belly(4,35," InnerRadius ",.2," Gamma ",7);
101  g = fem.geometry.Belly(4,35," InnerRadius ",[.2 .6]," Gamma ",5);
102  g = fem.geometry.Belly(4,35," InnerRadius ",.2," Gamma ",[10 20]);
103  g = fem.geometry.Belly(4,35," InnerRadius ",[.2 .6]," Gamma ",[10 20]);
104  g = fem.geometry.Belly(4,35," Radius ",[4 2]," InnerRadius ",.5," Gamma ",[10 20]);
105  g = fem.geometry.Belly(4,35," Radius ",@(x)[sqrt(abs(x)); 1./(x-34).^2]," InnerRadius ",.2);
106  g.plot;
107  g = fem.geometry.Belly(4,35," Radius ",@(x)sqrt(abs(x)));
108  g.plot;
109 /* g = fem.geometry.Belly(4,35,'Radius',[4 2],'InnerRadius',.5,...
110  * 'Gamma',[10 20],'MinZ',-1.5);
111  * g.plot; */
112  g = fem.geometry.Belly(4,35," Radius ",@(x)sqrt(abs(x))," Layers ",[.4 .7 1]);
113  g.plot;
114  res = 1;
115  }
116 
117 
118  static function test_BellyModel() {
119  m = models.muscle.Model(models.muscle.examples.Belly);
120  m.dt= min(m.T/10,2);
121  m.simulateAndPlot;
122  }
123 
124 
125 
126 };
127 }
128 }
129 }
130 
131 
132 
function anull = seta0(anull)
Definition: Belly.m:92
function displ_dir = setPositionDirichletBC(displ_dir)
% Dirichlet conditions: Position (fix one side)
Definition: Belly.m:75
A variable number of input arguments.
function geo = getGeometry()
Returns the intended geometry for this model config.
Definition: Belly.m:68
function configureModel(m)
Definition: Belly.m:56
static function test_BellyModel()
Definition: Belly.m:118
static function res = test_BellyGeometryGeneration()
Definition: Belly.m:99