Quantcast
Channel: Latest Discussions - COMSOL Forums
Viewing all articles
Browse latest Browse all 26527

Meshing in matlab

$
0
0
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

Viewing all articles
Browse latest Browse all 26527

Trending Articles