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
Constraint.m
Go to the documentation of this file.
1 namespace models{
2 namespace muscle{
3 
4 
5 /* (Autoinserted by mtoc++)
6  * This source code has been filtered by the mtoc++ executable,
7  * which generates code that can be processed by the doxygen documentation tool.
8  *
9  * On the other hand, it can neither be interpreted by MATLAB, nor can it be compiled with a C++ compiler.
10  * Except for the comments, the function bodies of your M-file functions are untouched.
11  * Consequently, the FILTER_SOURCE_FILES doxygen switch (default in our Doxyfile.template) will produce
12  * attached source files that are highly readable by humans.
13  *
14  * Additionally, links in the doxygen generated documentation to the source code of functions and class members refer to
15  * the correct locations in the source code browser.
16  * However, the line numbers most likely do not correspond to the line numbers in the original MATLAB source files.
17  */
18 
20  :public dscomponents.ACoreFun {
28  public:
29 
31 
32 
33  private:
34 
35  fsys;
43  public:
44 
46 
48 
50 
51 
52  public:
53 
54  Constraint(sys) {
55  this = this@dscomponents.ACoreFun(sys);
56  }
57 
58 
59  function configUpdated() {
60  sys = this.fsys;
61  mc = sys.Model.Config;
62  if ~isempty(mc)
63  this.fDim= sys.NumAlgebraicDofs;
64  this.xDim= sys.NumAlgebraicDofs;
65  this.JSparsityPattern= this.computeSparsityPattern;
66  this.precomputeUnassembledData;
67  end
68  }
69 
70 
71  function setSystem(sys) {
72  setSystem@dscomponents.ACoreFun(this, sys);
73  if isa(sys," models.ReducedSecondOrderSystem ")
74  this.fsys= sys.Model.FullModel.System;
75  else
76  this.fsys= sys;
77  end
78  }
79 
80 
81  function evaluateCoreFun() {
82  error(" Do not call. evaluate is implemented directly. ");
83  }
84 
85 
86  function projected = project(V,W) {
87  projected = this.clone;
88  projected = project@dscomponents.ACoreFun(this, V, W, projected);
89  }
90 
91 
92  function copy = clone() {
93  copy = muscle.ConstraintsFun(this.System);
94  copy = clone@dscomponents.ACoreFun(this, copy);
95  }
103  private:
104 
105  function precomputeUnassembledData() {
106  sys = this.System;
107  mc = sys.Model.Config;
108  fem = mc.PressureFEM;
109  geo = fem.Geometry;
110 
111  [I, ~] = find(fem.Sigma);
112 
113  n = numel(I);
114  S = sparse(I,1:n,ones(n,1),geo.NumNodes,n);
115 
116  /* Take out nodes with dirichlet BC on output side
117  * S(sys.idx_v_bc_local,:) = [];
118  * Find corresponding unassembled dofs that would be ignored
119  * (due to dirichlet velocity values, pressure dirichlet not
120  * implemented)
121  * bc_unass = find(sum(S,1) == 0);
122  * Remove them, too. The unassembled evaluation also removes the
123  * corresponding entries of the unassembled vector.
124  * S(:,bc_unass) = []; */
125 
126  this.Sigma= S;
127 
128  this.fDim_unass= size(S,2);
129 
130  /* Create boolean array that determines which unassembled dofs
131  * belong to which element
132  * dg dofs */
133  hlp = repmat(1:geo.NumElements,geo.DofsPerElement,1);
134  hlp = hlp(:);
135  ass = false(geo.NumElements,length(hlp));
136  for k = 1:geo.NumElements
137  ass(k,:) = hlp == k;
138  end
139  this.idx_p_elems_unass= ass;
140  }
141 
142 
143 
144 };
145 }
146 }
147 
148 
149 
integer fDim
The current output dimension of the function.
Definition: ACoreFun.m:171
MuscleFibreSystem: The global dynamical system used within the MuscleFibreModel.
Definition: System.m:19
function projected = project(V, W)
Definition: Constraint.m:86
CONSTRAINT Summary of this class goes here Detailed explanation goes here.
Definition: Constraint.m:19
Model
The Model this System is attached to.
#define I(x, y, z)
Definition: CalcMD5.c:171
function configUpdated()
Definition: Constraint.m:59
Basic interface for all dynamical system's core functions Inherits the AProjectable interface...
Definition: ACoreFun.m:18
integer xDim
The current state space dimension of the function's argument .
Definition: ACoreFun.m:151
models.BaseFirstOrderSystem System
The system associated with the current ACoreFun.
Definition: ACoreFun.m:193
V
The matrix of the biorthogonal pair .
Definition: AProjectable.m:61
function setSystem(sys)
Definition: Constraint.m:71
sparse< logical > JSparsityPattern
Sparsity pattern for the jacobian matrix.
Definition: ACoreFun.m:127
W
The matrix of the biorthogonal pair .
Definition: AProjectable.m:72
function copy = clone()
Create new instance.
Definition: Constraint.m:92
function evaluateCoreFun()
Definition: Constraint.m:81