31 this =
this@models.muscle.AMuscleConfig(varargin[:]);
49 m.ODESolver.RelTol= 1e-6;
50 m.ODESolver.AbsTol= 1e-3;
56 tmr = zeros(1,size(points,2));
60 tmr(points(3,:)<.5 & points(1,:)>.5) = 1;
61 tmr(points(3,:)>2.5 & points(1,:)<.5) = 1;
63 tmr(points(2,:)<.5 & points(3,:)>.5) = 1;
64 tmr(points(2,:)>2.5 & points(3,:)<.5) = 1;
66 tmr(points(1,:)<.5 & points(3,:)>.5) = 1;
67 tmr(points(1,:)>2.5 & points(3,:)<.5) = 1;
85 xr = linspace(0,3,this.
Options.GeoNr+1);
88 geo = fem.geometry.RegularHex8Grid([0 1],[0 1], xr);
90 geo = fem.geometry.RegularHex8Grid([0 1],xr,[0 1]);
92 geo = fem.geometry.RegularHex8Grid(xr,[0 1],[0 1]);
94 geo = geo.toCube27Node;
104 geo = this.
FEM.Geometry;
107 displ_dir(:,geo.Elements(1,geo.MasterFaces(5,:))) =
true;
110 displ_dir(:,geo.Elements(1,geo.MasterFaces(3,:))) =
true;
113 displ_dir(:,geo.Elements(1,geo.MasterFaces(1,:))) =
true;
121 geo = this.
FEM.Geometry;
124 velo_dir(3,geo.Elements(
this.Options.GeoNr,geo.MasterFaces(6,:))) =
true;
126 velo_dir(2,geo.Elements(
this.Options.GeoNr,geo.MasterFaces(4,:))) =
true;
128 velo_dir(1,geo.Elements(
this.Options.GeoNr,geo.MasterFaces(2,:))) =
true;
130 velo_dir_val(velo_dir) = .02;
143 anull(this.
Options.Flip,:,:) = 1;
157 c = models.muscle.examples.SubElemInhomogMaterial(
" GeoNr ",gn,
" Flip ",
fl);
159 m.setGaussIntegrationRule(6);
161 df = m.getResidualForces(
t,y);
162 idx = m.getPositionDirichletBCFaceIdx(1,1+(
fl-1)*2);
163 force = sum(df(idx,end));
164 fprintf(
" Flip %d - Forces at pos dirichlet side at end: %g\n ",
fl,force);
166 m.plot(
t,y,
" DF ",df,
" F ",2);
168 err = tril(v*o
" -(v*o ")^
t)
169 rel1 = err ./ (v*o^
t)
170 rel2 = err ./ (v*o
" ) "
171 res =
all(abs(rel1(:)) < 1e-4) &&
all(abs(rel2(:)) < 1e-4)
function configureModel(m)
function addOption(name, default, varargin)
SubElemInhomogMaterial(varargin)
Creates a Debug simple muscle model configuration.
function geo = getGeometry()
Single cube with same config as reference element.
static function res = test_SubElem(gn)
function displ_dir = setPositionDirichletBC(displ_dir)
A variable number of input arguments.
function anull = seta0(anull)
VelocityBCTimeFun
Velocity conditions application function.
function [ velo_dir , velo_dir_val ] = setVelocityDirichletBC(velo_dir, velo_dir_val)
Determines the dirichlet velocities.
function tmr = getTendonMuscleRatio(points)
Returns the [0,1] ratio between tendon and muscle at all specified points.