22 this.nfevals= this.nfevals+1;
25 isproj = ~isempty(this.V);
28 uvwdof = this.V*uvwdof;
33 unassembled = this.ComputeUnassembled;
36 uvwcomplete = sys.includeDirichletValues(t, uvwdof);
41 mc = sys.Model.Config;
43 geo = fe_pos.Geometry;
44 fe_press = mc.PressureFEM;
46 num_u_glob = geo.NumNodes*3;
50 flfun = this.ForceLengthFun;
52 havefibres = sys.HasFibres;
53 havefibretypes = sys.HasFibreTypes;
54 usecrossfibres = this.crossfibres;
59 ldotpos = this.lambda_dot_pos;
61 c10 = sys.MuscleTendonParamc10;
62 c01 = sys.MuscleTendonParamc01;
63 mooneyrivlin_ic_const = sys.MooneyRivlinICConst;
68 anisomusclefun = this.AnisoPassiveMuscle;
69 hastendons = sys.HasTendons;
71 tmrgp = sys.MuscleTendonRatioGP;
72 anisotendonfun = this.AnisoPassiveTendon;
76 fibretypeweights = mc.FibreTypeWeights;
78 FibreForces = mc.Pool.getActivation(t);
79 elseif sys.HasForceArgument
80 FibreForces = fibreforces;
82 FibreForces = ones(size(fibretypeweights,2),1)*this.alpha(t);
86 alphaconst = this.alpha(t);
90 dofsperelem_u = geo.DofsPerElement;
91 num_gp = fe_pos.GaussPointsPerElem;
92 num_elements = geo.NumElements;
96 Kuvw = zeros(this.fDim_unass,1);
98 Kuvw = zeros(num_u_glob,1);
101 idx_u_elems_local = sys.idx_u_elems_local;
103 idx_p_elems_global = sys.idx_p_elems_local+2*num_u_glob;
104 for m = 1:num_elements
106 elemidx_u = idx_u_elems_local(:,:,m);
108 elemidx_v = num_u_glob + elemidx_u;
110 u = uvwcomplete(elemidx_u);
111 w = uvwcomplete(idx_p_elems_global(:,m));
114 ftwelem = fibretypeweights(:,:,m)*FibreForces;
117 integrand_u = zeros(3,dofsperelem_u);
121 p = w^t * fe_press.Ngp(:,gp,m);
123 pos = 3*(gp-1)+1:3*gp;
124 dtn = fe_pos.transgrad(:,pos,m);
127 fprintf(" NaNs in models.muscle.Dynamics
#evaluateCoreFun! Have a look.\n ");
136 I1 = C(1,1) + C(2,2) + C(3,3);
139 P = mooneyrivlin_ic_const(gp,m)*eye(3) + p*inv(F)^t + 2*(c10(gp,m) + I1*c01(gp,m))*F ...
144 fibrenr = (m-1)*num_gp + gp;
145 fibres = sys.a0Base(:,:,fibrenr);
146 lambdaf = norm(F*fibres(:,1));
150 tendonpart = tmrgp(gp,m);
151 musclepart = 1-tendonpart;
154 alpha = musclepart*ftwelem(gp);
156 alpha = musclepart*alphaconst;
159 passive_aniso_stress = 0;
166 passive_aniso_stress = musclepart*anisomusclefun(lambdaf);
168 passive_aniso_stress = passive_aniso_stress + tendonpart*anisotendonfun(lambdaf);
175 gval = passive_aniso_stress + (Pmax/lambdaf)*fl*alpha;
176 P = P + gval*F*sys.a0oa0(:,:,fibrenr);
180 lambdaf = norm(F*fibres(:,2));
182 g1 = (b1cf/lambdaf^2)*(lambdaf^d1cf-1);
183 P = P + g1*F*sys.a0oa0n1(:,:,fibrenr);
185 lambdaf = norm(F*fibres(:,3));
187 g2 = (b1cf/lambdaf^2)*(lambdaf^d1cf-1);
188 P = P + g2*F*sys.a0oa0n2(:,:,fibrenr);
195 k = find(ldotpos(1,:) == m & ldotpos(2,:) == gp);
197 Fdot = uvwcomplete(elemidx_v) * dtn;
198 this.lambda_dot(
k) = (F*fibres(:,1))^t*(Fdot*fibres(:,1))/lambdaf;
210 weight = fe_pos.GaussWeights(gp) * fe_pos.elem_detjac(m,gp);
212 integrand_u = integrand_u + weight * P * dtn^t;
219 pos = (1:3*dofsperelem_u) + (m-1) * 3 * dofsperelem_u;
220 Kuvw(pos) = -integrand_u(:);
226 elemidx_v_out = elemidx_v - num_u_glob;
233 Kuvw(elemidx_v_out) = Kuvw(elemidx_v_out) - integrand_u;
239 Kuvw(this.idx_uv_bc_glob_unass) = [];
242 this.LastBCResiduals= Kuvw(sys.idx_v_bc_local);
245 Kuvw(sys.idx_v_bc_local) = [];
249 Kuvw = this.W^t*Kuvw;
function fx = evaluate(x, t)
Evaluates the f-approximation. Depending on a possible projection and the CustomProjection-property t...