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.

discretize block into smaller blocks

Please login with a confirmed email address before reporting spam

Hi,

I have a block domai (500x5000x500), which I want to discretize it into smaller blocks of 25x25x25.

I tried to create 19 layers of 25m width (left,front,top), but after 20 min of running, I gave up. Is there a faster way to do this?





P.S.
The commands I used to do this
model.geom('geom1').feature.create('blk1', 'Block');
model.geom('geom1').feature('blk1').set('pos', {'0' '0' '-250'});
model.geom('geom1').feature('blk1').set('base', 'center');
model.geom('geom1').feature('blk1').set('size', {'500' '500' '500'});



thickness=num2str(25);
for i=1:20-1
model.geom('geom1').feature('blk1').setIndex('layer', thickness, i-1);
end

6 Replies Last Post Jun 13, 2012, 3:20 a.m. EDT
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 12, 2012, 2:59 p.m. EDT
Hi

not sure why but that makes some 20*200*20 = 80000 blocks, that is almost a mesh ;)
I can believe it takes somet time, still it should be possible, but you have to deal with 6 time as many boundaries (in asembly something less in Union mode). You should at least turn off the automatic node update and plot update in the preferences ifyou navigate with such a model. With our largest model and some 1200 COMSOL generated domains we needed 5 minutes to travel up and down in the model tree

Are you sure you cannot use a mapped mesh instead and distrbute your variablesin the BCs and the physics as interpoaltion functions over the spatial variables ?

--
Good luck
Ivar
Hi not sure why but that makes some 20*200*20 = 80000 blocks, that is almost a mesh ;) I can believe it takes somet time, still it should be possible, but you have to deal with 6 time as many boundaries (in asembly something less in Union mode). You should at least turn off the automatic node update and plot update in the preferences ifyou navigate with such a model. With our largest model and some 1200 COMSOL generated domains we needed 5 minutes to travel up and down in the model tree Are you sure you cannot use a mapped mesh instead and distrbute your variablesin the BCs and the physics as interpoaltion functions over the spatial variables ? -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 12, 2012, 3:21 p.m. EDT
Hi Ivar,

Thanks again.

The main concerain I am doing this, is to be able to refer to a spefic block easily, like block number 111.

With mapped mesh, I haven't found an easy way to assign attributes to blocks, especially when I am using parametric solver.


Any ideas/suggestions would be nice.
Hi Ivar, Thanks again. The main concerain I am doing this, is to be able to refer to a spefic block easily, like block number 111. With mapped mesh, I haven't found an easy way to assign attributes to blocks, especially when I am using parametric solver. Any ideas/suggestions would be nice.

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 12, 2012, 3:43 p.m. EDT
Hi

In COMSOL you do not access the mesh, you access the domains and the boundaries, based on their coordinates (x,y,z,t). Most physics and BC entries are expecting fields V(x,y,z,t) and not just constant or Parameter values. All physics apply to the element dx*dy*dz which might map to a mesh element or to several. The entity is not the mesh, that is "just" a discretization of the domain and boundaries for the maths of the numerical processing. And a mesh element is further discretized y higher order functions (instead of having 3-4-6-9 ... node elemets)

This is a fundamental difference between COMSOL and most older FEM programmes.
And a source of confusion and frustration for those of us having dealt too long with older programmes. This is so until you catch the new approach, then you ask yourself how you could have been working in the old way for so long ...

--
Good luck
Ivar
Hi In COMSOL you do not access the mesh, you access the domains and the boundaries, based on their coordinates (x,y,z,t). Most physics and BC entries are expecting fields V(x,y,z,t) and not just constant or Parameter values. All physics apply to the element dx*dy*dz which might map to a mesh element or to several. The entity is not the mesh, that is "just" a discretization of the domain and boundaries for the maths of the numerical processing. And a mesh element is further discretized y higher order functions (instead of having 3-4-6-9 ... node elemets) This is a fundamental difference between COMSOL and most older FEM programmes. And a source of confusion and frustration for those of us having dealt too long with older programmes. This is so until you catch the new approach, then you ask yourself how you could have been working in the old way for so long ... -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 12, 2012, 5:09 p.m. EDT
Hi Ivar,

I need your advise again.

In the attached model, if I used a mapped mesh, (mesh1), I fail to find a solution (convergence of CG).
If I use tetrahedra (mesh2), I can find a solution.

Why is that?

Thanks in advance.
Hi Ivar, I need your advise again. In the attached model, if I used a mapped mesh, (mesh1), I fail to find a solution (convergence of CG). If I use tetrahedra (mesh2), I can find a solution. Why is that? Thanks in advance.


Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 13, 2012, 3:07 a.m. EDT
Hi

first of all onthe principle, you can leave the mapped sweep mesh for the cube, only convert the 6 BOUNDARIES of the cube to tri, and then finish with a Thets

Apart from that I do not see why the mesh should matter, but i might be missing somethingt too ;)

But why do you not trust thet mesh, if it solves ?

It could be that your source term is to abrupt and that you should "smooth" it with some rectangle functions

--
Good luck
Ivar
Hi first of all onthe principle, you can leave the mapped sweep mesh for the cube, only convert the 6 BOUNDARIES of the cube to tri, and then finish with a Thets Apart from that I do not see why the mesh should matter, but i might be missing somethingt too ;) But why do you not trust thet mesh, if it solves ? It could be that your source term is to abrupt and that you should "smooth" it with some rectangle functions -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 13, 2012, 3:20 a.m. EDT
Surprisingly enough, I replaced the distribution on the mesh, from 2*19 with 38, and it works!!!.

I guess it is some kind of a bug.

Thank you for your help.
Surprisingly enough, I replaced the distribution on the mesh, from 2*19 with 38, and it works!!!. I guess it is some kind of a bug. Thank you for your help.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.