function[verticesIn,verticesOut,out] = eyeModel(meshCoordinates) % % simulation4.m % % Model exported on Sep 14 2012, 08:17 by COMSOL 4.2.1.110. %% Initialization import com.comsol.model.* import com.comsol.model.util.* model = ModelUtil.create('Model'); model.modelPath('C:\Users\Jose\Documents\Mauricio\Dropbox\Proyecto Especial\Simulaciones\Simulacion1'); model.name('simulation4.mph'); %% Global parameters model.param.set('RCE', '6.822[mm]', 'Exterior curvature radius (Radio de curvatura exterior)'); model.param.set('ECC', '0.52[mm]'); model.param.set('ECP', '1.44*ECC'); model.param.set('HC', 'RCE*0.57'); model.param.set('k', '(ECC^2-ECP^2+2*RCE*(ECP-ECC))/(2*(HC-ECC))', 'Excentricity (Excentricidad)'); model.param.set('RCI', 'RCE-ECC-k'); model.param.set('Em', '2.055[MPa]'); model.param.set('pR', '0.499'); model.param.set('den', '1[kg/m^3]'); model.param.set('RIE', '5[mm]'); model.param.set('EI', '1[mm]'); model.param.set('RCE2', '6.822[mm]', 'RCE as used by Jose'); model.param.set('RCI2', '5.844[mm]', 'RCI as used by Jose'); model.param.set('k2', '0.4373[mm]', 'k as used by Jose'); model.param.set('r', '3[mm]', 'Radius from appice to center of incision'); model.param.set('d', '0.1', 'Depth of incision'); model.param.set('alpha1', '0.6[mm]', 'External width of incision'); model.param.set('alpha2', '0.4[mm]', 'Internal width of incision'); model.param.set('Theta', '80 [deg]'); model.param.set('phi', 'asin(r/RCE2)'); model.param.set('ThetaAlpha1', 'asin(alpha1/RCE2)'); model.param.set('ThetaAlpha2', 'asin(alpha2/RCE2)'); model.param.set('xi1', 'pi/2-phi-ThetaAlpha1/2'); model.param.set('xi2', 'pi/2-phi-ThetaAlpha2/2'); model.param.set('ThetaEmpty', '(360-3*Theta)/3', 'Angle of non cutted section'); model.modelNode.create('mod1'); %% Geometry model.geom.create('geom1', 3); model.geom('geom1').lengthUnit('mm'); model.geom('geom1').geomRep('comsol'); model.geom('geom1').feature.create('wp1', 'WorkPlane'); model.geom('geom1').feature('wp1').geom.feature.create('c1', 'Circle'); model.geom('geom1').feature('wp1').geom.feature.create('c2', 'Circle'); model.geom('geom1').feature('wp1').geom.feature.create('dif1', 'Difference'); model.geom('geom1').feature('wp1').geom.feature.create('r1', 'Rectangle'); model.geom('geom1').feature('wp1').geom.feature.create('int1', 'Intersection'); model.geom('geom1').feature('wp1').geom.feature.create('b1', 'BezierPolygon'); model.geom('geom1').feature('wp1').geom.feature.create('rot1', 'Rotate'); model.geom('geom1').feature('wp1').geom.feature.create('mir1', 'Mirror'); model.geom('geom1').feature('wp1').geom.feature.create('dif2', 'Difference'); model.geom('geom1').feature.create('rev3', 'Revolve'); model.geom('geom1').feature.create('wp4', 'WorkPlane'); model.geom('geom1').feature('wp4').geom.feature.create('c1', 'Circle'); model.geom('geom1').feature('wp4').geom.feature.create('c2', 'Circle'); model.geom('geom1').feature('wp4').geom.feature.create('dif1', 'Difference'); model.geom('geom1').feature('wp4').geom.feature.create('r1', 'Rectangle'); model.geom('geom1').feature('wp4').geom.feature.create('int1', 'Intersection'); model.geom('geom1').feature('wp4').geom.feature.create('b1', 'BezierPolygon'); model.geom('geom1').feature('wp4').geom.feature.create('rot1', 'Rotate'); model.geom('geom1').feature('wp4').geom.feature.create('mir1', 'Mirror'); model.geom('geom1').feature('wp4').geom.feature.create('dif2', 'Difference'); model.geom('geom1').feature.create('rev4', 'Revolve'); model.geom('geom1').feature.create('wp5', 'WorkPlane'); model.geom('geom1').feature('wp5').geom.feature.create('c1', 'Circle'); model.geom('geom1').feature('wp5').geom.feature.create('c2', 'Circle'); model.geom('geom1').feature('wp5').geom.feature.create('dif1', 'Difference'); model.geom('geom1').feature('wp5').geom.feature.create('r1', 'Rectangle'); model.geom('geom1').feature('wp5').geom.feature.create('int1', 'Intersection'); model.geom('geom1').feature('wp5').geom.feature.create('b1', 'BezierPolygon'); model.geom('geom1').feature('wp5').geom.feature.create('rot1', 'Rotate'); model.geom('geom1').feature('wp5').geom.feature.create('mir1', 'Mirror'); model.geom('geom1').feature('wp5').geom.feature.create('dif2', 'Difference'); model.geom('geom1').feature.create('rev5', 'Revolve'); model.geom('geom1').feature.create('wp6', 'WorkPlane'); model.geom('geom1').feature('wp6').geom.feature.create('c1', 'Circle'); model.geom('geom1').feature('wp6').geom.feature.create('c2', 'Circle'); model.geom('geom1').feature('wp6').geom.feature.create('dif1', 'Difference'); model.geom('geom1').feature('wp6').geom.feature.create('r1', 'Rectangle'); model.geom('geom1').feature('wp6').geom.feature.create('int1', 'Intersection'); model.geom('geom1').feature('wp6').geom.feature.create('rot1', 'Rotate'); model.geom('geom1').feature.create('rev6', 'Revolve'); model.geom('geom1').feature.create('wp7', 'WorkPlane'); model.geom('geom1').feature('wp7').geom.feature.create('c1', 'Circle'); model.geom('geom1').feature('wp7').geom.feature.create('c2', 'Circle'); model.geom('geom1').feature('wp7').geom.feature.create('dif1', 'Difference'); model.geom('geom1').feature('wp7').geom.feature.create('r1', 'Rectangle'); model.geom('geom1').feature('wp7').geom.feature.create('int1', 'Intersection'); model.geom('geom1').feature('wp7').geom.feature.create('rot1', 'Rotate'); model.geom('geom1').feature.create('rev7', 'Revolve'); model.geom('geom1').feature.create('wp8', 'WorkPlane'); model.geom('geom1').feature('wp8').geom.feature.create('c1', 'Circle'); model.geom('geom1').feature('wp8').geom.feature.create('c2', 'Circle'); model.geom('geom1').feature('wp8').geom.feature.create('dif1', 'Difference'); model.geom('geom1').feature('wp8').geom.feature.create('r1', 'Rectangle'); model.geom('geom1').feature('wp8').geom.feature.create('int1', 'Intersection'); model.geom('geom1').feature('wp8').geom.feature.create('rot1', 'Rotate'); model.geom('geom1').feature.create('rev8', 'Revolve'); model.geom('geom1').feature('wp1').name('Incision1'); model.geom('geom1').feature('wp1').geom.feature('c1').name('External circle'); model.geom('geom1').feature('wp1').geom.feature('c1').set('pos', {'-1*k2' '0'}); model.geom('geom1').feature('wp1').geom.feature('c1').set('r', 'RCE2'); model.geom('geom1').feature('wp1').geom.feature('c1').set('angle', '90'); model.geom('geom1').feature('wp1').geom.feature('c2').name('Internal circle'); model.geom('geom1').feature('wp1').geom.feature('c2').set('pos', {'0' '0'}); model.geom('geom1').feature('wp1').geom.feature('c2').set('r', 'RCI2'); model.geom('geom1').feature('wp1').geom.feature('c2').set('angle', '90'); model.geom('geom1').feature('wp1').geom.feature('dif1').name('Superposition'); model.geom('geom1').feature('wp1').geom.feature('dif1').selection('input').set({'c1'}); model.geom('geom1').feature('wp1').geom.feature('dif1').selection('input2').set({'c2'}); model.geom('geom1').feature('wp1').geom.feature('r1').set('pos', {'RCI+ECC-HC' '0'}); model.geom('geom1').feature('wp1').geom.feature('r1').set('size', {'HC' 'RCE'}); model.geom('geom1').feature('wp1').geom.feature('int1').selection('input').set({'dif1' 'r1'}); model.geom('geom1').feature('wp1').geom.feature('b1').set('p', {'(RCE2-d)*cos(xi2)' '(RCE2)*1.005*cos(xi1)' '(RCE2)*1.005*cos(xi1+ThetaAlpha1)' '(RCE2-d)*cos(xi2+ThetaAlpha2)' '(RCE2-d)*cos(xi2)'; '(RCE2-d)*sin(xi2)-k2' '(RCE2)*1.005*sin(xi1)-k2' '(RCE2)*1.005*sin(xi1+ThetaAlpha1)-k2' '(RCE2-d)*sin(xi2+ThetaAlpha2)-k2' '(RCE2-d)*sin(xi2)-k2'}); model.geom('geom1').feature('wp1').geom.feature('b1').set('degree', {'1' '1' '1' '1'}); model.geom('geom1').feature('wp1').geom.feature('b1').set('w', {'1' '1' '1' '1' '1' '1' '1' '1'}); %model.geom('geom1').feature('wp1').geom.feature('b1').feature.comments(''); model.geom('geom1').feature('wp1').geom.feature('rot1').set('rot', '90'); model.geom('geom1').feature('wp1').geom.feature('rot1').selection('input').set({'int1'}); model.geom('geom1').feature('wp1').geom.feature('mir1').selection('input').set({'b1'}); model.geom('geom1').feature('wp1').geom.feature('dif2').selection('input').set({'rot1'}); model.geom('geom1').feature('wp1').geom.feature('dif2').selection('input2').set({'mir1'}); model.geom('geom1').feature('rev3').name('Revolution 1. Cornea with'); model.geom('geom1').feature('rev3').set('angle2', 'Theta'); model.geom('geom1').feature('rev3').selection('input').set({'wp1'}); model.geom('geom1').feature('wp4').name('Incision2'); model.geom('geom1').feature('wp4').geom.feature('c1').name('External circle'); model.geom('geom1').feature('wp4').geom.feature('c1').set('pos', {'-1*k2' '0'}); model.geom('geom1').feature('wp4').geom.feature('c1').set('r', 'RCE2'); model.geom('geom1').feature('wp4').geom.feature('c1').set('angle', '90'); %model.geom('geom1').feature('wp4').geom.feature('c1').feature.comments(''); model.geom('geom1').feature('wp4').geom.feature('c2').name('Internal circle'); model.geom('geom1').feature('wp4').geom.feature('c2').set('pos', {'0' '0'}); model.geom('geom1').feature('wp4').geom.feature('c2').set('r', 'RCI2'); model.geom('geom1').feature('wp4').geom.feature('c2').set('angle', '90'); %model.geom('geom1').feature('wp4').geom.feature('c2').feature.comments(''); model.geom('geom1').feature('wp4').geom.feature('dif1').name('Superposition'); model.geom('geom1').feature('wp4').geom.feature('dif1').selection('input').set({'c1'}); model.geom('geom1').feature('wp4').geom.feature('dif1').selection('input2').set({'c2'}); %model.geom('geom1').feature('wp4').geom.feature('dif1').feature.comments(''); model.geom('geom1').feature('wp4').geom.feature('r1').set('pos', {'RCI+ECC-HC' '0'}); model.geom('geom1').feature('wp4').geom.feature('r1').set('size', {'HC' 'RCE'}); %model.geom('geom1').feature('wp4').geom.feature('r1').feature.comments(''); model.geom('geom1').feature('wp4').geom.feature('int1').selection('input').set({'dif1' 'r1'}); %model.geom('geom1').feature('wp4').geom.feature('int1').feature.comments(''); model.geom('geom1').feature('wp4').geom.feature('b1').set('p', {'(RCE2-d)*cos(xi2)' '(RCE2)*1.005*cos(xi1)' '(RCE2)*1.005*cos(xi1+ThetaAlpha1)' '(RCE2-d)*cos(xi2+ThetaAlpha2)' '(RCE2-d)*cos(xi2)'; '(RCE2-d)*sin(xi2)-k2' '(RCE2)*1.005*sin(xi1)-k2' '(RCE2)*1.005*sin(xi1+ThetaAlpha1)-k2' '(RCE2-d)*sin(xi2+ThetaAlpha2)-k2' '(RCE2-d)*sin(xi2)-k2'}); model.geom('geom1').feature('wp4').geom.feature('b1').set('degree', {'1' '1' '1' '1'}); model.geom('geom1').feature('wp4').geom.feature('b1').set('w', {'1' '1' '1' '1' '1' '1' '1' '1'}); %model.geom('geom1').feature('wp4').geom.feature('b1').feature.comments(''); model.geom('geom1').feature('wp4').geom.feature('rot1').set('rot', '90'); model.geom('geom1').feature('wp4').geom.feature('rot1').selection('input').set({'int1'}); %model.geom('geom1').feature('wp4').geom.feature('rot1').feature.comments(''); model.geom('geom1').feature('wp4').geom.feature('mir1').selection('input').set({'b1'}); %model.geom('geom1').feature('wp4').geom.feature('mir1').feature.comments(''); model.geom('geom1').feature('wp4').geom.feature('dif2').selection('input').set({'rot1'}); model.geom('geom1').feature('wp4').geom.feature('dif2').selection('input2').set({'mir1'}); %model.geom('geom1').feature('wp4').geom.feature('dif2').feature.comments(''); %model.geom('geom1').feature('wp4').feature.comments(''); model.geom('geom1').feature('rev4').set('angle1', 'Theta+ThetaEmpty'); model.geom('geom1').feature('rev4').set('angle2', '2*Theta+ThetaEmpty'); model.geom('geom1').feature('rev4').selection('input').set({'wp4'}); model.geom('geom1').feature('wp5').name('Incision3'); model.geom('geom1').feature('wp5').geom.feature('c1').name('External circle'); model.geom('geom1').feature('wp5').geom.feature('c1').set('pos', {'-1*k2' '0'}); model.geom('geom1').feature('wp5').geom.feature('c1').set('r', 'RCE2'); model.geom('geom1').feature('wp5').geom.feature('c1').set('angle', '90'); %model.geom('geom1').feature('wp5').geom.feature('c1').feature.comments(''); model.geom('geom1').feature('wp5').geom.feature('c2').name('Internal circle'); model.geom('geom1').feature('wp5').geom.feature('c2').set('pos', {'0' '0'}); model.geom('geom1').feature('wp5').geom.feature('c2').set('r', 'RCI2'); model.geom('geom1').feature('wp5').geom.feature('c2').set('angle', '90'); %model.geom('geom1').feature('wp5').geom.feature('c2').feature.comments(''); model.geom('geom1').feature('wp5').geom.feature('dif1').name('Superposition'); model.geom('geom1').feature('wp5').geom.feature('dif1').selection('input').set({'c1'}); model.geom('geom1').feature('wp5').geom.feature('dif1').selection('input2').set({'c2'}); %model.geom('geom1').feature('wp5').geom.feature('dif1').feature.comments(''); model.geom('geom1').feature('wp5').geom.feature('r1').set('pos', {'RCI+ECC-HC' '0'}); model.geom('geom1').feature('wp5').geom.feature('r1').set('size', {'HC' 'RCE'}); %model.geom('geom1').feature('wp5').geom.feature('r1').feature.comments(''); model.geom('geom1').feature('wp5').geom.feature('int1').selection('input').set({'dif1' 'r1'}); %model.geom('geom1').feature('wp5').geom.feature('int1').feature.comments(''); model.geom('geom1').feature('wp5').geom.feature('b1').set('p', {'(RCE2-d)*cos(xi2)' '(RCE2)*1.005*cos(xi1)' '(RCE2)*1.005*cos(xi1+ThetaAlpha1)' '(RCE2-d)*cos(xi2+ThetaAlpha2)' '(RCE2-d)*cos(xi2)'; '(RCE2-d)*sin(xi2)-k2' '(RCE2)*1.005*sin(xi1)-k2' '(RCE2)*1.005*sin(xi1+ThetaAlpha1)-k2' '(RCE2-d)*sin(xi2+ThetaAlpha2)-k2' '(RCE2-d)*sin(xi2)-k2'}); model.geom('geom1').feature('wp5').geom.feature('b1').set('degree', {'1' '1' '1' '1'}); model.geom('geom1').feature('wp5').geom.feature('b1').set('w', {'1' '1' '1' '1' '1' '1' '1' '1'}); %model.geom('geom1').feature('wp5').geom.feature('b1').feature.comments(''); model.geom('geom1').feature('wp5').geom.feature('rot1').set('rot', '90'); model.geom('geom1').feature('wp5').geom.feature('rot1').selection('input').set({'int1'}); %model.geom('geom1').feature('wp5').geom.feature('rot1').feature.comments(''); model.geom('geom1').feature('wp5').geom.feature('mir1').selection('input').set({'b1'}); %model.geom('geom1').feature('wp5').geom.feature('mir1').feature.comments(''); model.geom('geom1').feature('wp5').geom.feature('dif2').selection('input').set({'rot1'}); model.geom('geom1').feature('wp5').geom.feature('dif2').selection('input2').set({'mir1'}); %model.geom('geom1').feature('wp5').geom.feature('dif2').feature.comments(''); %model.geom('geom1').feature('wp5').feature.comments(''); model.geom('geom1').feature('rev5').set('angle1', '2*Theta+2*ThetaEmpty'); model.geom('geom1').feature('rev5').set('angle2', '3*Theta+2*ThetaEmpty'); model.geom('geom1').feature('rev5').selection('input').set({'wp5'}); model.geom('geom1').feature('wp6').name('Space1'); model.geom('geom1').feature('wp6').geom.feature('c1').name('External circle'); model.geom('geom1').feature('wp6').geom.feature('c1').set('pos', {'-1*k2' '0'}); model.geom('geom1').feature('wp6').geom.feature('c1').set('r', 'RCE2'); model.geom('geom1').feature('wp6').geom.feature('c1').set('angle', '90'); % model.geom('geom1').feature('wp6').geom.feature('c1').feature.comments(''); model.geom('geom1').feature('wp6').geom.feature('c2').name('Internal circle'); model.geom('geom1').feature('wp6').geom.feature('c2').set('pos', {'0' '0'}); model.geom('geom1').feature('wp6').geom.feature('c2').set('r', 'RCI2'); model.geom('geom1').feature('wp6').geom.feature('c2').set('angle', '90'); %model.geom('geom1').feature('wp6').geom.feature('c2').feature.comments(''); model.geom('geom1').feature('wp6').geom.feature('dif1').name('Superposition'); model.geom('geom1').feature('wp6').geom.feature('dif1').selection('input').set({'c1'}); model.geom('geom1').feature('wp6').geom.feature('dif1').selection('input2').set({'c2'}); %model.geom('geom1').feature('wp6').geom.feature('dif1').feature.comments(''); model.geom('geom1').feature('wp6').geom.feature('r1').set('pos', {'RCI+ECC-HC' '0'}); model.geom('geom1').feature('wp6').geom.feature('r1').set('size', {'HC' 'RCE'}); % model.geom('geom1').feature('wp6').geom.feature('r1').feature.comments(''); model.geom('geom1').feature('wp6').geom.feature('int1').selection('input').set({'dif1' 'r1'}); % model.geom('geom1').feature('wp6').geom.feature('int1').feature.comments(''); model.geom('geom1').feature('wp6').geom.feature('rot1').set('rot', '90'); model.geom('geom1').feature('wp6').geom.feature('rot1').selection('input').set({'int1'}); % model.geom('geom1').feature('wp6').geom.feature('rot1').feature.comments(''); % model.geom('geom1').feature('wp6').feature.comments(''); model.geom('geom1').feature('rev6').set('polres', '500'); model.geom('geom1').feature('rev6').set('angle1', 'Theta'); model.geom('geom1').feature('rev6').set('angle2', 'Theta+ThetaEmpty'); model.geom('geom1').feature('rev6').selection('input').set({'wp6'}); model.geom('geom1').feature('wp7').name('Space2'); model.geom('geom1').feature('wp7').geom.feature('c1').name('External circle'); model.geom('geom1').feature('wp7').geom.feature('c1').set('pos', {'-1*k2' '0'}); model.geom('geom1').feature('wp7').geom.feature('c1').set('r', 'RCE2'); model.geom('geom1').feature('wp7').geom.feature('c1').set('angle', '90'); % model.geom('geom1').feature('wp7').geom.feature('c1').feature.comments(''); model.geom('geom1').feature('wp7').geom.feature('c2').name('Internal circle'); model.geom('geom1').feature('wp7').geom.feature('c2').set('pos', {'0' '0'}); model.geom('geom1').feature('wp7').geom.feature('c2').set('r', 'RCI2'); model.geom('geom1').feature('wp7').geom.feature('c2').set('angle', '90'); % model.geom('geom1').feature('wp7').geom.feature('c2').feature.comments(''); model.geom('geom1').feature('wp7').geom.feature('dif1').name('Superposition'); model.geom('geom1').feature('wp7').geom.feature('dif1').selection('input').set({'c1'}); model.geom('geom1').feature('wp7').geom.feature('dif1').selection('input2').set({'c2'}); % model.geom('geom1').feature('wp7').geom.feature('dif1').feature.comments(''); model.geom('geom1').feature('wp7').geom.feature('r1').set('pos', {'RCI+ECC-HC' '0'}); model.geom('geom1').feature('wp7').geom.feature('r1').set('size', {'HC' 'RCE'}); % model.geom('geom1').feature('wp7').geom.feature('r1').feature.comments(''); model.geom('geom1').feature('wp7').geom.feature('int1').selection('input').set({'dif1' 'r1'}); % model.geom('geom1').feature('wp7').geom.feature('int1').feature.comments(''); model.geom('geom1').feature('wp7').geom.feature('rot1').set('rot', '90'); model.geom('geom1').feature('wp7').geom.feature('rot1').selection('input').set({'int1'}); % model.geom('geom1').feature('wp7').geom.feature('rot1').feature.comments(''); % model.geom('geom1').feature('wp7').feature.comments(''); model.geom('geom1').feature('rev7').set('angle1', '2*Theta+ThetaEmpty'); model.geom('geom1').feature('rev7').set('angle2', '2*Theta+2*ThetaEmpty'); model.geom('geom1').feature('rev7').selection('input').set({'wp7'}); model.geom('geom1').feature('wp8').name('Space3'); model.geom('geom1').feature('wp8').geom.feature('c1').name('External circle'); model.geom('geom1').feature('wp8').geom.feature('c1').set('pos', {'-1*k2' '0'}); model.geom('geom1').feature('wp8').geom.feature('c1').set('r', 'RCE2'); model.geom('geom1').feature('wp8').geom.feature('c1').set('angle', '90'); % model.geom('geom1').feature('wp8').geom.feature('c1').feature.comments(''); model.geom('geom1').feature('wp8').geom.feature('c2').name('Internal circle'); model.geom('geom1').feature('wp8').geom.feature('c2').set('pos', {'0' '0'}); model.geom('geom1').feature('wp8').geom.feature('c2').set('r', 'RCI2'); model.geom('geom1').feature('wp8').geom.feature('c2').set('angle', '90'); % model.geom('geom1').feature('wp8').geom.feature('c2').feature.comments(''); model.geom('geom1').feature('wp8').geom.feature('dif1').name('Superposition'); model.geom('geom1').feature('wp8').geom.feature('dif1').selection('input').set({'c1'}); model.geom('geom1').feature('wp8').geom.feature('dif1').selection('input2').set({'c2'}); % model.geom('geom1').feature('wp8').geom.feature('dif1').feature.comments(''); model.geom('geom1').feature('wp8').geom.feature('r1').set('pos', {'RCI+ECC-HC' '0'}); model.geom('geom1').feature('wp8').geom.feature('r1').set('size', {'HC' 'RCE'}); % model.geom('geom1').feature('wp8').geom.feature('r1').feature.comments(''); model.geom('geom1').feature('wp8').geom.feature('int1').selection('input').set({'dif1' 'r1'}); % model.geom('geom1').feature('wp8').geom.feature('int1').feature.comments(''); model.geom('geom1').feature('wp8').geom.feature('rot1').set('rot', '90'); model.geom('geom1').feature('wp8').geom.feature('rot1').selection('input').set({'int1'}); % model.geom('geom1').feature('wp8').geom.feature('rot1').feature.comments(''); % model.geom('geom1').feature('wp8').feature.comments(''); model.geom('geom1').feature('rev8').set('angle1', '3*Theta+2*ThetaEmpty'); model.geom('geom1').feature('rev8').selection('input').set({'wp8'}); model.geom('geom1').run; model.selection.create('solid_dst_pc1', 'Explicit'); model.variable.create('var1'); model.view('view5').tag('view51'); model.view('view3').tag('view5'); model.view('view6').tag('view61'); model.view('view4').tag('view6'); model.view('view7').tag('view71'); model.view('view51').tag('view7'); model.view('view61').tag('view8'); model.view('view71').tag('view9'); model.view('view1').hideObjects.create('hide1'); %% Material Properties model.material.create('mat1'); model.material('mat1').propertyGroup('def').set('youngsmodulus', '2.055[MPa]'); model.material('mat1').propertyGroup('def').set('poissonsratio', '0.499'); model.material('mat1').propertyGroup('def').set('density', '1'); %% Physics Interface model.physics.create('solid', 'SolidMechanics', 'geom1'); model.physics('solid').feature.create('roll1', 'Roller', 2); model.physics('solid').feature('roll1').selection.set([1 3 9 23 41 42]); model.physics('solid').feature.create('sym1', 'SymmetrySolid', 2); model.physics('solid').feature('sym1').selection.set([2 8 22 27 28 29]); model.physics('solid').feature.create('bndl1', 'BoundaryLoad', 2); model.physics('solid').feature('bndl1').selection.set([6 7 11 25 30 31]); model.physics('solid').feature.create('vel1', 'Velocity', 2); model.physics('solid').feature('vel1').selection.set([23]); model.physics('solid').feature.create('fix1', 'Fixed', 2); model.physics('solid').feature('fix1').selection.set([23]); model.physics('solid').feature.create('disp1', 'Displacement2', 2); model.physics('solid').feature.create('pc1', 'PeriodicCondition', 2); model.physics('solid').feature('bndl1').set('FperArea', {'0'; '0'; '1866.51'}); model.physics('solid').feature('bndl1').set('LoadType', 'FollowerPressure'); model.physics('solid').feature('bndl1').set('FollowerPressure', '1866.51'); model.physics('solid').feature('vel1').selection.active(false); model.physics('solid').feature('vel1').set('Direction', {'0'; '0'; '1'}); model.physics('solid').feature('vel1').set('coordinateSystem', 'sys1'); model.physics('solid').feature('vel1').active(false); model.physics('solid').feature('fix1').selection.active(false); model.physics('solid').feature('fix1').active(false); model.physics('solid').feature('disp1').selection.active(false); model.physics('solid').feature('disp1').set('Direction', {'1'; '1'; '1'}); model.physics('solid').feature('disp1').set('Notation', 'GeneralNotation'); model.physics('solid').feature('disp1').active(false); model.physics('solid').feature('pc1').selection.active(false); model.physics('solid').feature('pc1').active(false); %% Mesh model.mesh.create('mesh1', 'geom1'); model.mesh('mesh1').feature.create('ftet1', 'FreeTet'); model.mesh('mesh1').feature('ftet1').selection.geom('geom1', 3); model.mesh('mesh1').feature('ftet1').selection.all; model.result.table.create('evl3', 'Table'); model.view('view1').hideObjects('hide1').set({}); model.view('view2').axis.set('xmin', '-7.489181995391846'); model.view('view2').axis.set('xmax', '1.3382201194763184'); model.view('view2').axis.set('ymin', '0.1928711235523224'); model.view('view2').axis.set('ymax', '8.705009460449219'); model.view('view5').name('View 5.1'); model.view('view5').axis.set('xmin', '-6.458510398864746'); model.view('view5').axis.set('xmax', '0.3075481355190277'); model.view('view5').axis.set('ymin', '1.186733603477478'); model.view('view5').axis.set('ymax', '7.711147785186768'); model.view('view6').name('View 6.1'); model.view('view6').axis.set('xmin', '-6.765309810638428'); model.view('view6').axis.set('xmax', '6.750330448150635'); model.view('view6').axis.set('ymin', '-2.06752872467041'); model.view('view6').axis.set('ymax', '10.965410232543945'); model.view('view7').name('View 7.1'); model.view('view7').axis.set('xmin', '-8.878253936767578'); model.view('view7').axis.set('xmax', '9.111991882324219'); model.view('view7').axis.set('ymin', '-5.4815192222595215'); model.view('view7').axis.set('ymax', '11.866218566894531'); model.view('view8').name('View 8'); model.view('view9').name('View 9'); model.mesh('mesh1').feature('size').set('hauto', 7); model.mesh('mesh1').run; verticesIn = model.mesh('mesh1').getVertex; model.result.table('evl3').name('Evaluation 3D'); model.result.table('evl3').comments('Interactive 3D values'); tri = model.mesh('mesh1').getElem('tri'); %% Deform mesh if meshCoordinates ~= 0 model.geom.create('geom2', 3); model.mesh.create('mesh2', 'geom2'); model.mesh('mesh2').data().transferMesh('mesh1'); % model.mesh('mesh1').feature().clear(); model.mesh('mesh2').data.setElem('tri',tri); model.mesh('mesh2').data.setVertex(meshCoordinates); model.mesh('mesh2').data.createMesh; model.mesh('mesh2').run; verticesIn = model.mesh('mesh2').getVertex; end %% Study model.study.create('std1'); model.study('std1').feature.create('stat', 'Stationary'); model.sol.create('sol1'); model.sol('sol1').study('std1'); model.sol('sol1').attach('std1'); model.sol('sol1').feature.create('st1', 'StudyStep'); model.sol('sol1').feature.create('v1', 'Variables'); model.sol('sol1').feature.create('s1', 'Stationary'); model.sol('sol1').feature('s1').feature.create('fc1', 'FullyCoupled'); model.sol('sol1').feature('s1').feature.remove('fcDef'); %% Results model.result.create('pg1', 'PlotGroup3D'); model.result('pg1').feature.create('surf1', 'Surface'); model.result('pg1').feature('surf1').feature.create('def', 'Deform'); model.result.create('pg2', 'PlotGroup1D'); model.result('pg2').set('probetag', 'none'); model.result('pg2').feature.create('tblp1', 'Table'); model.result('pg2').feature('tblp1').set('probetag', 'none'); model.result.create('pg3', 'PlotGroup3D'); model.result('pg3').feature.create('surf1', 'Surface'); model.result('pg3').feature('surf1').feature.create('def1', 'Deform'); model.result('pg2').feature('tblp1').set('probetag', 'none'); model.study('std1').feature('stat').set('geometricNonlinearity', true); model.sol('sol1').feature('st1').name('Compile Equations: Stationary'); model.sol('sol1').feature('st1').set('studystep', 'stat'); model.sol('sol1').feature('s1').set('control', 'stat'); model.sol('sol1').feature('s1').feature('fc1').set('probesel', 'manual'); model.sol('sol1').runAll; model.result('pg1').name('Stress (solid)'); model.result('pg1').feature('surf1').set('expr', 'solid.mises'); model.result('pg1').feature('surf1').set('unit', 'N/m^2'); model.result('pg1').feature('surf1').set('descr', 'von Mises stress'); model.result('pg1').feature('surf1').feature('def').set('descractive', true); model.result('pg1').feature('surf1').feature('def').set('titletype', 'auto'); model.result('pg1').feature('surf1').feature('def').set('scale', '22.490387740126433'); model.result('pg1').feature('surf1').feature('def').set('scaleactive', false); model.result('pg2').set('xlabel', 'x'); model.result('pg2').set('xlabelactive', false); model.result('pg3').feature('surf1').feature('def1').set('scale', '42.520485381618215'); model.result('pg3').feature('surf1').feature('def1').set('scaleactive', false); %% Get deformed coordinates verticesOut = struct2cell(mpheval(model, {'x' 'y' 'z'})); verticesOut = cell2mat(verticesOut(2:4)); out = model;