function out = model % % model-eig2.m % % Model exported on Mar 2 2012, 20:52 by COMSOL 4.2.1.110. import com.comsol.model.* import com.comsol.model.util.* model = ModelUtil.create('Model'); model.modelPath('/home/ekb08138/Desktop/comsol files/Laplace eigenvalues/Aprroximate values and meshes'); model.modelNode.create('mod1'); model.geom.create('geom1', 2); model.mesh.create('mesh1', 'geom1'); model.physics.create('c', 'CoefficientFormPDE', 'geom1', {'u'}); model.study.create('std1'); model.study('std1').feature.create('eigv', 'Eigenvalue'); model.geom('geom1').run; model.physics('c').feature.create('cfeq2', 'CoefficientFormPDE', 2); model.physics('c').feature('cfeq2').set('f', 1, '0'); model.physics('c').feature('cfeq2').selection.all; model.geom('geom1').feature.create('c1', 'Circle'); model.geom('geom1').runAll; model.geom('geom1').run; model.physics('c').feature.create('dir1', 'DirichletBoundary', 1); model.physics('c').feature('dir1').selection.all; model.mesh('mesh1').feature.create('ftri1', 'FreeTri'); model.mesh('mesh1').feature('size').set('hauto', '9'); model.physics('c').feature.create('disc1', 'Discretization', -1); model.sol.create('sol1'); model.sol('sol1').study('std1'); model.sol('sol1').feature.create('st1', 'StudyStep'); model.sol('sol1').feature('st1').set('study', 'std1'); model.sol('sol1').feature('st1').set('studystep', 'eigv'); model.sol('sol1').feature.create('v1', 'Variables'); model.sol('sol1').feature.create('e1', 'Eigenvalue'); model.sol('sol1').feature('e1').set('shift', '0'); model.sol('sol1').feature('e1').set('neigs', 6); model.sol('sol1').feature('e1').set('control', 'eigv'); model.sol('sol1').attach('std1'); model.result.create('pg1', 2); model.result('pg1').set('data', 'dset1'); model.result('pg1').feature.create('surf1', 'Surface'); model.result('pg1').feature('surf1').set('expr', 'u'); model.sol('sol1').runAll; model.result('pg1').run; model.physics('c').feature('disc1').set('order', 1, '3'); model.sol('sol1').study('std1'); model.sol('sol1').feature.remove('e1'); model.sol('sol1').feature.remove('v1'); model.sol('sol1').feature.remove('st1'); model.sol('sol1').feature.create('st1', 'StudyStep'); model.sol('sol1').feature('st1').set('study', 'std1'); model.sol('sol1').feature('st1').set('studystep', 'eigv'); model.sol('sol1').feature.create('v1', 'Variables'); model.sol('sol1').feature.create('e1', 'Eigenvalue'); model.sol('sol1').feature('e1').set('shift', '0'); model.sol('sol1').feature('e1').set('neigs', 6); model.sol('sol1').feature('e1').set('control', 'eigv'); model.sol('sol1').attach('std1'); model.sol('sol1').runAll; model.result('pg1').run; out = model;