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
Cube2ForceBC.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 
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= 5;
44  m.dt= m.T / 400;
45  m.DefaultMu(1) = .1;
46  m.DefaultMu(3) = .1;
47  m.DefaultInput= 1;
48  os = m.ODESolver;
49  os.RelTol= .0001;
50  os.AbsTol= .05;
51  }
52 
53 
54  function P = getBoundaryPressure(elemidx,faceidx) {
55  P = [];
56  if elemidx == 1 && faceidx == 2
57  P = -.8;
58  end
59  if elemidx == 2 && faceidx == 5
60  P = -.4;
61  end
62  }
76  function u = getInputs() {
77  u = [this.getAlphaRamp(1,1)];
78  }
79 
80 
81  protected:
82 
83 
84  function geo = getGeometry() {
85  geo = fem.geometry.RegularHex8Grid(0:1,-1:2,0:1);
86  geo = geo.scale(.1);
87  geo = geo.toCube20Node;
88 /* geo = geo.toCube27Node; */
89  }
90 
91 
92  function displ_dir = setPositionDirichletBC(displ_dir) {
93  geo = this.FEM.Geometry;
94  /* Fix all on left and only the y,z directions of the back right
95  * nodes */
96  displ_dir(:,geo.Elements(3,geo.MasterFaces(4,:))) = true;
97 /* displ_dir(1,geo.Elements(3,[9 18 27])) = false; */
98  displ_dir(1,geo.Elements(3,[8 16 20])) = false;
99  }
108  function anull = seta0(anull) {
109  anull([1 3],:,:) = 1;
110  }
119  public: /* ( Static ) */
120 
121  static function test_Cube2ForceBC() {
122  m = models.muscle.Model(models.muscle.examples.Cube2ForceBC);
123  m.simulateAndPlot;
124  }
125 
126 
127 
128 };
129 }
130 }
131 }
132 
133 
134 
function alpha = getAlphaRamp(ramptime,double alphamax,double starttime)
Creates a linearly increasing scalar function starting at starttime milliseconds ranging from zero to...
Cube2ForceBC(varargin)
Single cube with same config as reference element.
Definition: Cube2ForceBC.m:30
function anull = seta0(anull)
Direction is xz.
Definition: Cube2ForceBC.m:108
function displ_dir = setPositionDirichletBC(displ_dir)
% Dirichlet conditions: Position (fix one side)
Definition: Cube2ForceBC.m:92
A variable number of input arguments.
function geo = getGeometry()
Returns the intended geometry for this model config.
Definition: Cube2ForceBC.m:84
function P = getBoundaryPressure(elemidx, faceidx)
Determines the neumann forces on the boundary.
Definition: Cube2ForceBC.m:54