function out = model % % yarg.m % % Model exported on Jan 21 2011, 14:27 by COMSOL 4.1.0.112. import com.comsol.model.* import com.comsol.model.util.* model = ModelUtil.create('Model'); model.modelPath('X:\Hodgson\COMSOLviaMATLAB'); model.modelNode.create('mod1'); model.param.set('ridge.W', 9); model.param.set('ridge.w', 3); model.param.set('ridge.S', 3); model.param.set('ridge.t', 5); model.param.set('ridge.Z', 0); model.param.set('ridge.r', 1); model.geom.create('geom1', 3); model.geom('geom1').lengthUnit('in'); model.geom('geom1').feature.create('b1', 'Block'); model.geom('geom1').feature('b1').set('size', {'ridge.w' 'ridge.W/2-ridge.S/2-ridge.r' 'ridge.t'}); model.geom('geom1').feature('b1').set('base', 'center'); model.geom('geom1').feature('b1').set('pos', {'0' '(ridge.S/2+ridge.r+ridge.W/2)/2' 'ridge.t/2+ridge.Z'}); model.geom('geom1').run('b1'); model.geom('geom1').feature.create('wp1', 'WorkPlane'); model.geom('geom1').feature('wp1').set('planetype', 'faceparallel'); model.geom('geom1').feature('wp1').selection('face').set('b1', 3); model.geom('geom1').feature('wp1').geom.feature.create('r1', 'Rectangle'); model.geom('geom1').feature('wp1').geom.feature('r1').set('base', 'center'); model.geom('geom1').feature('wp1').geom.feature('r1').set('size', {'ridge.t-2*ridge.r' 'ridge.w-2*ridge.r'}); model.geom('geom1').feature('wp1').geom.feature.create('r2', 'Rectangle'); model.geom('geom1').feature('wp1').geom.feature('r2').set('base', 'center'); model.geom('geom1').feature('wp1').geom.feature('r2').set('size', {'ridge.r' 'ridge.w-2*ridge.r'}); model.geom('geom1').feature('wp1').geom.feature('r2').set('pos', {'ridge.t/2-ridge.r/2' '0'}); model.geom('geom1').feature('wp1').geom.feature.create('r3', 'Rectangle'); model.geom('geom1').feature('wp1').geom.feature('r3').set('base', 'center'); model.geom('geom1').feature('wp1').geom.feature('r3').set('size', {'ridge.r' 'ridge.w-2*ridge.r'}); model.geom('geom1').feature('wp1').geom.feature('r3').set('pos', {'-ridge.t/2+ridge.r/2' '0'}); model.geom('geom1').feature('wp1').geom.feature.create('r4', 'Rectangle'); model.geom('geom1').feature('wp1').geom.feature('r4').set('base', 'center'); model.geom('geom1').feature('wp1').geom.feature('r4').set('size', {'ridge.t-2*ridge.r' 'ridge.r'}); model.geom('geom1').feature('wp1').geom.feature('r4').set('pos', {'0' 'ridge.w/2-ridge.r/2'}); model.geom('geom1').feature('wp1').geom.feature.create('r5', 'Rectangle'); model.geom('geom1').feature('wp1').geom.feature('r5').set('base', 'center'); model.geom('geom1').feature('wp1').geom.feature('r5').set('size', {'ridge.t-2*ridge.r' 'ridge.r'}); model.geom('geom1').feature('wp1').geom.feature('r5').set('pos', {'0' '-ridge.w/2+ridge.r/2'}); model.geom('geom1').feature('wp1').geom.feature.create('s1', 'Square'); model.geom('geom1').feature('wp1').geom.feature('s1').set('base', 'center'); model.geom('geom1').feature('wp1').geom.feature('s1').set('size', 'ridge.r'); model.geom('geom1').feature('wp1').geom.feature('s1').set('pos', {'ridge.t/2-ridge.r/2' 'ridge.w/2-ridge.r/2'}); model.geom('geom1').feature('wp1').geom.feature.create('s2', 'Square'); model.geom('geom1').feature('wp1').geom.feature('s2').set('base', 'center'); model.geom('geom1').feature('wp1').geom.feature('s2').set('size', 'ridge.r'); model.geom('geom1').feature('wp1').geom.feature('s2').set('pos', {'ridge.t/2-ridge.r/2' '-ridge.w/2+ridge.r/2'}); model.geom('geom1').feature('wp1').geom.feature.create('s3', 'Square'); model.geom('geom1').feature('wp1').geom.feature('s3').set('base', 'center'); model.geom('geom1').feature('wp1').geom.feature('s3').set('size', 'ridge.r'); model.geom('geom1').feature('wp1').geom.feature('s3').set('pos', {'-ridge.t/2+ridge.r/2' 'ridge.w/2-ridge.r/2'}); model.geom('geom1').feature('wp1').geom.feature.create('s4', 'Square'); model.geom('geom1').feature('wp1').geom.feature('s4').set('base', 'center'); model.geom('geom1').feature('wp1').geom.feature('s4').set('size', 'ridge.r'); model.geom('geom1').feature('wp1').geom.feature('s4').set('pos', {'-ridge.t/2+ridge.r/2' '-ridge.w/2+ridge.r/2'}); model.geom('geom1').run; model.geom('geom1').feature.create('ext1', 'Extrude'); model.geom('geom1').feature('ext1').selection('input').set({'wp1.r1'}); model.geom('geom1').feature('ext1').set('crossfaces', 'off'); model.geom('geom1').feature('ext1').set('distance', 'ridge.r'); model.geom('geom1').run; out = model;