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
SprengerUnitCube8Elem.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 
30  public:
31 
33 
34 
35  public:
36 
38  varargin(end+1:end+2) = [" FL ",2];
39  this = this@models.muscle.AMuscleConfig(varargin[:]);
40  this.init;
41  }
42 
43 
44  function configureModel(m) {
45  configureModel@models.muscle.AMuscleConfig(this, m);
46  m.T= 1;
47  m.dt= .01;
48  mu = m.DefaultMu;
49  mu([1 2]) = [1 .1];
50  m.DefaultMu= mu;
51 
52  /* % Material configuration from CMISS/3Elem_sprenger.xml
53  * c3M = 3.05907e-10 MPa */
54  mu(5) = 3.05907e-10; /* [MPa]
55  * c4M */
56 
57  mu(6) = 47.270456264135881; /* [-] */
58 
59 
60  /* c01 ^= c1M = 3.56463903963e-02 MPa */
61  mu(9) = 3.6463903963e-2; /* [MPa]
62  * c01 ^= c2M = 3.859558659683e-3 MPa */
63 
64  mu(10) = 3.859558659683e-3; /* [MPa] */
65 
66 
67  /* sigma_max_calculation */
68  mu(13) = .300; /* [MPa]
69  * Exponential FL-fun */
70 
71  mu(14) = .57; /* [-] */
72 
73 
74  m.DefaultMu= mu;
75  }
76 
77 
78  protected:
79 
80 
81  function geo = getGeometry() {
82  s = load(fullfile(fileparts(which(mfilename))," Sprenger8Elem.mat "));
83  geo = s.geo27;
84  }
85 
86 
87  function displ_dir = setPositionDirichletBC(displ_dir) {
88  geo = this.FEM.Geometry;
89  displ_dir(:,geo.Elements([1 3 5 7],geo.MasterFaces(1,:))) = true;
90  displ_dir(:,geo.Elements([2 4 6 8],geo.MasterFaces(2,:))) = true;
91  }
100  function anull = seta0(anull) {
101  anull(1,:,:) = 1;
102  }
111  public: /* ( Static ) */
112 
114  c = models.muscle.examples.SprengerUnitCube8Elem;
115  m = c.createModel;
116  dfpos = m.getPositionDirichletBCFaceIdx([1 3 5 7],1);
117  dfpos2 = m.getPositionDirichletBCFaceIdx([2 4 6 8],2);
118 
119  alphas = [.1 .2];/* .3 .4]; */
120 
121  vis = [1 1];/* 4 5]; */
122 
123  forces = zeros(2,length(alphas));
124  pi = ProcessIndicator(" Running tests for %d alpha values ",length(alphas),false,length(alphas));
125  mu = m.DefaultMu;
126  for k = 1:length(alphas)
127  mu(1) = vis(k);
128  c.ActivationRampMax= alphas(k);
129  [t,y] = m.simulate(mu);
130  df = m.getResidualForces(t,y);
131  forces(1,k) = sum(df(dfpos,end));
132  forces(2,k) = sum(df(dfpos2,end));
133  pi.step;
134  end
135  pi.stop;
136  disp(" Units are mN (milliNewton) ");
137  disp(forces);
138  }
147 };
148 }
149 }
150 }
151 
152 
153 
function displ_dir = setPositionDirichletBC(displ_dir)
% Dirichlet conditions: Position (fix one side)
Different tests for comparison between CMISS and KerMor.
A variable number of input arguments.
static function test_SprengerUnitCube8Elem_ForceComparison()
.1 .2 .3 .4 14.9477 28.5314 41.0593 52.7679
disp
Handle object disp method which is called by the display method. See the MATLAB disp function...
function anull = seta0(anull)
Direction is xz.
function geo = getGeometry()
Returns the intended geometry for this model config.
ProcessIndicator: A simple class that indicates process either via waitbar or text output...