Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.
Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
Meshing in matlab
Posted Jul 8, 2011, 5:47 a.m. EDT Mesh Version 4.2 2 Replies
Please login with a confirmed email address before reporting spam
Hi,
I am having real difficulty to control my mesh in matlab. Basically I don't have any control over it. Its quite a simple model but im finding that if I change the numbers in the code, I get the same mesh size. Here is the code:
model.mesh('mesh1').feature.create('ftri1', 'FreeTri');
model.mesh('mesh1').feature('ftri1').selection.set([4]);
model.mesh('mesh1').feature('ftri1').feature.create('size1', 'Size');
model.mesh('mesh1').feature('ftri1').feature('size1').set('hmax', '0.000156');
model.mesh('mesh1').feature('ftri1').feature('size1').set('hmin', '.113E-4');
model.mesh('mesh1').feature('ftri1').feature('size1').set('hcurve', '0.4');
model.mesh('mesh1').feature('ftri1').feature('size1').set('hnarrow', '0.7');
model.mesh('mesh1').feature('ftri1').feature('size1').set('hgrad', '1.4');
model.mesh('mesh1').feature('ftri1').feature('size1').set('hauto', '3');
model.mesh('mesh1').feature.create('swe1', 'Sweep');
model.mesh('mesh1').feature('swe1').feature.create('size1', 'Size');
model.mesh('mesh1').feature('swe1').feature('size1').set('hmax', '5.65E-4');
model.mesh('mesh1').feature('swe1').feature('size1').set('hmin', '5.65E-6');
model.mesh('mesh1').feature('swe1').feature('size1').set('hcurve', '0.2');
model.mesh('mesh1').feature('swe1').feature('size1').set('hnarrow', '1');
model.mesh('mesh1').feature('swe1').feature('size1').set('hgrad', '1.3');
model.mesh('mesh1').feature('swe1').feature('size1').set('hauto', '1');
model.mesh('mesh1').run;
Its a triangular mesh that is swept throught the object. The mesh doesnt ever seem to change, meaning that I get a poor mesh on larger models. The reason it matters is because I want to have the same size mesh elements reagrdless of the size of my model. Has anyone else had the same problem? Can anyone help here?
Thanks
I am having real difficulty to control my mesh in matlab. Basically I don't have any control over it. Its quite a simple model but im finding that if I change the numbers in the code, I get the same mesh size. Here is the code:
model.mesh('mesh1').feature.create('ftri1', 'FreeTri');
model.mesh('mesh1').feature('ftri1').selection.set([4]);
model.mesh('mesh1').feature('ftri1').feature.create('size1', 'Size');
model.mesh('mesh1').feature('ftri1').feature('size1').set('hmax', '0.000156');
model.mesh('mesh1').feature('ftri1').feature('size1').set('hmin', '.113E-4');
model.mesh('mesh1').feature('ftri1').feature('size1').set('hcurve', '0.4');
model.mesh('mesh1').feature('ftri1').feature('size1').set('hnarrow', '0.7');
model.mesh('mesh1').feature('ftri1').feature('size1').set('hgrad', '1.4');
model.mesh('mesh1').feature('ftri1').feature('size1').set('hauto', '3');
model.mesh('mesh1').feature.create('swe1', 'Sweep');
model.mesh('mesh1').feature('swe1').feature.create('size1', 'Size');
model.mesh('mesh1').feature('swe1').feature('size1').set('hmax', '5.65E-4');
model.mesh('mesh1').feature('swe1').feature('size1').set('hmin', '5.65E-6');
model.mesh('mesh1').feature('swe1').feature('size1').set('hcurve', '0.2');
model.mesh('mesh1').feature('swe1').feature('size1').set('hnarrow', '1');
model.mesh('mesh1').feature('swe1').feature('size1').set('hgrad', '1.3');
model.mesh('mesh1').feature('swe1').feature('size1').set('hauto', '1');
model.mesh('mesh1').run;
Its a triangular mesh that is swept throught the object. The mesh doesnt ever seem to change, meaning that I get a poor mesh on larger models. The reason it matters is because I want to have the same size mesh elements reagrdless of the size of my model. Has anyone else had the same problem? Can anyone help here?
Thanks
2 Replies Last Post Dec 13, 2012, 9:40 p.m. EST