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
LongForceBC.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 
29  public:
30 
32  this = this@models.muscle.AMuscleConfig(varargin[:]);
33  this.init;
34 
35  this.ActivationRampMax= .4;
36  }
37 
38 
39  function configureModel(m) {
40  configureModel@models.muscle.AMuscleConfig(this, m);
41  m.T= 40;
42  m.dt= .2;
43  m.DefaultMu(1) = .1; /* viscosity [g/(mm*ms)] = [kP] (kiloPoiseulle) */
44 
45  m.DefaultMu(2) = 5; /* activation ramp time [ms] */
46 
47  m.DefaultMu(3) = 1; /* neumann pressure [MPa] */
48 
49  m.DefaultInput= 1;
50  os = m.ODESolver;
51  os.RelTol= .001;
52  os.AbsTol= .05;
53  }
54 
55 
56  function u = getInputs() {
57  u = [this.getAlphaRamp(1,1)];
58  }
78  function P = getBoundaryPressure(elemidx,faceidx) {
79  P = [];
80  if elemidx == 1 && faceidx == 1
81  P = [1 0 0
82  0 0 0;
83  0 0 0];
84  elseif elemidx == 5 && faceidx == 2
85  P = [1 0 0
86  0 0 0;
87  .5 0 0];
88  end
89  }
103  protected:
104 
105 
106  function geo = getGeometry() {
107  geo = fem.geometry.RegularHex8Grid([0 20],-40:10:40,[0 15],.1);
108  geo = geo.toCube20Node;
109  }
117  function displ_dir = setPositionDirichletBC(displ_dir) {
118  geo = this.FEM.Geometry;
119  displ_dir(:,geo.Elements(8,geo.MasterFaces(4,:))) = true;
120  }
129  function anull = seta0(anull) {
130  anull([1 3],:,:) = 1;
131  }
140  public: /* ( Static ) */
141 
142  static function test_LongForceBC() {
143  m = models.muscle.Model(models.muscle.examples.LongForceBC);
144  m.simulateAndPlot;
145  }
146 
147 
148 
149 };
150 }
151 }
152 }
153 
154 
155 
static function test_LongForceBC()
Definition: LongForceBC.m:142
function alpha = getAlphaRamp(ramptime,double alphamax,double starttime)
Creates a linearly increasing scalar function starting at starttime milliseconds ranging from zero to...
function geo = getGeometry()
Single cube with same config as reference element.
Definition: LongForceBC.m:106
Demo class with a long beam, diagonal fibre direction and two-point boundary face forces in opposing ...
Definition: LongForceBC.m:20
function displ_dir = setPositionDirichletBC(displ_dir)
% Dirichlet conditions: Position (fix one side)
Definition: LongForceBC.m:117
function anull = seta0(anull)
Direction is xz.
Definition: LongForceBC.m:129
A variable number of input arguments.
function u = getInputs()
Returns the inputs of the model.
Definition: LongForceBC.m:56
double ActivationRampMax
Determines the default value for maximum activation in activation ramps.
Definition: AMuscleConfig.m:63
function P = getBoundaryPressure(elemidx, faceidx)
Determines the neumann forces on the boundary.
Definition: LongForceBC.m:78