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
CubePull.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 CubePull
28  public:
29 
31  this = this@models.muscle.AMuscleConfig(varargin[:]);
32  this.init;
33  }
41  function configureModel(m) {
42  configureModel@models.muscle.AMuscleConfig(this, m);
43  m.T= 150;
44  m.dt= .5;
45  m.DefaultMu(1) = .5;
46  m.DefaultMu(3) = .1;
47  m.DefaultInput= 1;
48  }
49 
50 
51  function configureModelFinal() {
52  m = this.Model;
53  m.SpaceReducer.Value= m.System.NumStateDofs;
54  configureModelFinal@models.muscle.AMuscleConfig(this);
55  }
63  function P = getBoundaryPressure(elemidx,faceidx) {
64  P = [];
65  if elemidx == 1 && faceidx == 3
66  P = 1;
67  end
68  }
82  function u = getInputs() {
83  u = [this.getAlphaRamp(this.Model.T/3,1)];
84  }
85 
86 
87  protected:
88 
89 
90  function geo = getGeometry() {
91  geo = fem.geometry.RegularHex8Grid([0 5],-1:10,[0 5]);
92  geo = geo.toCube27Node;
93  /* geo = geo.toCube20Node; */
94  }
102  function displ_dir = setPositionDirichletBC(displ_dir) {
103  geo = this.FEM.Geometry;
104  /* Fix all on left and only the y,z directions of the back right
105  * nodes */
106  displ_dir(2,geo.Elements(end,geo.MasterFaces(4,:))) = true;
107  displ_dir(:,geo.Elements(end,geo.MasterFaces(4,1))) = true;
108  }
117  function anull = seta0(anull) {
118  }
128  public: /* ( Static ) */
129 
130  static function test_CubePull() {
131  m = models.muscle.Model(models.muscle.examples.CubePull);
132  mu = m.getRandomParam;
133  mu(3) = .1;
134  m.simulateAndPlot(true,mu,1);
135  }
136 
137 
138 };
139 }
140 }
141 }
142 
143 
144 
static function test_CubePull()
Definition: CubePull.m:130
function alpha = getAlphaRamp(ramptime,double alphamax,double starttime)
Creates a linearly increasing scalar function starting at starttime milliseconds ranging from zero to...
function u = getInputs()
Definition: CubePull.m:82
function anull = seta0(anull)
Direction is xz anull([1 3],:,:) = 1;.
Definition: CubePull.m:117
function geo = getGeometry()
geo = fem.geometry.RegularHex8Grid([0 2.5 5],-1:20,[0 2.5 5]);
Definition: CubePull.m:90
function configureModelFinal()
Set desired reduction to full state space dimension by default.
Definition: CubePull.m:51
A variable number of input arguments.
double T
The final timestep up to which to simulate.
Definition: BaseModel.m:271
function displ_dir = setPositionDirichletBC(displ_dir)
% Dirichlet conditions: Position (fix one side)
Definition: CubePull.m:102
CubePull(varargin)
Single cube with same config as reference element.
Definition: CubePull.m:30
function P = getBoundaryPressure(elemidx, faceidx)
Determines the neumann forces on the boundary.
Definition: CubePull.m:63
Model: Model for a FEM-discretized muscle model.
Definition: Model.m:19