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
Long.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 Long
29  public:
30 
32  this = this@models.muscle.AMuscleConfig(varargin[:]);
33  this.addOption(" Devi ",1);
34  this.init;
35  }
36 
37 
38  function configureModel(m) {
39  configureModel@models.muscle.AMuscleConfig(this, m);
40  m.T= 50;
41  m.dt= 1;
42  m.DefaultMu(1) = .1;
43  m.DefaultMu(2) = 20;
44  }
45 
46 
47  protected:
48 
49 
50  function geo = getGeometry() {
51  geo = fem.geometry.RegularHex20Grid(-10:10:10,-40:10:40, [0 10], this.Options.Devi);
52  }
60  function displ_dir = setPositionDirichletBC(displ_dir) {
61  geo = this.FEM.Geometry;
62  for k = [8 16]
63  displ_dir(:,geo.Elements(k,[6:8 11 12 18:20])) = true;
64  end
65  }
74  function anull = seta0(anull) {
75  fe = this.FEM;
76  if fe.GaussPointsPerElem ~= 27
77  warning(" a0 designed for 27 gauss points! ");
78  end
79  x = linspace(0,1,8*3);
80  basea0 = [sin(x*pi); cos(x*pi)]; /* ; zeros(size(x)) */
81 
82  front = fe.GaussPoints(2,:) < 0;
83  mid = fe.GaussPoints(2,:) == 0;
84  back = fe.GaussPoints(2,:) > 0;
85  /* Direction is x */
86  for m = 1:8
87  off = (m-1)*3;
88  anull([1 3],front,[m m+8]) = basea0(2,off+1);
89  anull([1 3],mid,[m m+8]) = basea0(2,off+2);
90  anull([1 3],back,[m m+8]) = basea0(2,off+3);
91 
92  anull(2,front,[m m+8]) = basea0(1,off+1);
93  anull(2,mid,[m m+8]) = basea0(1,off+2);
94  anull(2,back,[m m+8]) = basea0(1,off+3);
95  end
96  }
97 
98 
99  public: /* ( Static ) */
100 
101  static function test_Long() {
102  m = models.muscle.Model(models.muscle.examples.Long);
103  m.simulateAndPlot;
104  }
105 
106 
107 
108 };
109 }
110 }
111 }
112 
113 
114 
function addOption(name, default, varargin)
Definition: AFEMConfig.m:219
function geo = getGeometry()
Single cube with same config as reference element.
Definition: Long.m:50
function configureModel(m)
Definition: Long.m:38
static function test_Long()
Definition: Long.m:101
A variable number of input arguments.
A long geometry with 20% deviation from default cubic positions and complex fibre structure...
Definition: Long.m:20
function displ_dir = setPositionDirichletBC(displ_dir)
% Dirichlet conditions: Position (fix one side)
Definition: Long.m:60
function anull = seta0(anull)
Definition: Long.m:74