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
Shaker.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 Shaker
28  public:
29 
31 
32 
33  public:
34 
36  this = this@models.muscle.AMuscleConfig(varargin[:]);
37  this.init;
38  this.VelocityBCTimeFun= general.functions.Sinus(50); /* 50Hz */
39 
40  }
41 
42 
43  function configureModel(m) {
44  configureModel@models.muscle.AMuscleConfig(this, m);
45  m.T= 75;
46  m.dt= .5;
47 
48  mu = m.DefaultMu;
49  /* Small viscosity */
50  mu(1) = .005;
51  m.DefaultMu= mu;
52  }
53 
54 
55 
56  protected:
57 
58 
59  function geo = getGeometry() {
60  belly = fem.geometry.Belly(4,10," Radius ",1," InnerRadius ",.4," Gamma ",2);
61  geo = belly.scale(20);
62  this.ylen= 100;
63  }
64 
65 
66  function displ_dir = setPositionDirichletBC(displ_dir) {
67  geo = this.FEM.Geometry;
68  /* Fix ends in xz direction */
69  displ_dir([1 3],geo.Elements(1:4,geo.MasterFaces(3,:))) = true;
70  displ_dir([1 3],geo.Elements(13:16,geo.MasterFaces(4,:))) = true;
71  }
80  function [velo_dir , velo_dir_val ] = setVelocityDirichletBC(velo_dir,velo_dir_val) {
81  geo = this.FEM.Geometry;
82  /* Fix ends in xz direction */
83  velo_dir(2,geo.Elements(1:4,geo.MasterFaces(3,:))) = true;
84  velo_dir(2,geo.Elements(13:16,geo.MasterFaces(4,:))) = true;
85 /* for k = [1 2 7 8 5 6 11 12]
86  * pos = geo.Elements(k,geo.MasterFaces(3,:));
87  * velo_dir(1,pos) = true;
88  * %velo_dir_val(1,pos) = 1;
89  * end */
90  velo_dir_val(velo_dir) = 2;
91  }
100  function anull = seta0(anull) {
101  anull(2,:,:) = 1;
102  }
111  public: /* ( Static ) */
112 
113  static function test_Shaker() {
114  m = models.muscle.Model(models.muscle.examples.Shaker);
115  m.simulateAndPlot;
116  }
117 
118 
119 
120 };
121 }
122 }
123 }
124 
125 
126 
static function test_Shaker()
Definition: Shaker.m:113
function displ_dir = setPositionDirichletBC(displ_dir)
% Dirichlet conditions: Position (fix one side)
Definition: Shaker.m:66
function geo = getGeometry()
Returns the intended geometry for this model config.
Definition: Shaker.m:59
function [ velo_dir , velo_dir_val ] = setVelocityDirichletBC(velo_dir, velo_dir_val)
% Dirichlet conditions: Position (fix one side)
Definition: Shaker.m:80
function anull = seta0(anull)
Direction is y.
Definition: Shaker.m:100
A variable number of input arguments.
VelocityBCTimeFun
Velocity conditions application function.
Definition: AFEMConfig.m:65
function configureModel(m)
Definition: Shaker.m:43