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.

Matlab Script - "Draw mode does not match the analyzed geometry"

Please login with a confirmed email address before reporting spam

Hi,

I am trying to setup a simple model using Matlab and Comsol 3.5a.

When I run the Matlab script, and then import it to Comsol, and then want to switch to the "Draw Mode", I get the error:
"Draw mode does not match the analyzed geometry"

At this time Comsol asks whether I want to:
- "Use current Draw mode geometry objetcts", or
- "Use analyzed geometry"

Can somebody tell me what is wrong in my Matlab script, and how I can avoid this error? I made the script just for the purpose of figuring out how to avoid this error, so it is incomplete with regards to the modelling of the physics settings.

Thanks a lot.
Alois Pfenniger


6 Replies Last Post 10.09.2010, 05:05 GMT-4
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 08.09.2010, 05:17 GMT-4
Hi

this has to do with the way geometries are "analysd in COMSOL. there is the raw Draw mode geometry (I say traditionally based on points , lines, faces and volumes going from 0D to 3D) and then these items are "analysed" to become points, edges, boundaries and (sub-)domains, for the respective 0d, to 3D representation of FEM ready geometries.
Comsol, via its "anayse pahse", drops all ortphans, combine (union) common/overlapping boundaries, edges or points and apply numbering identifications. If you select "assembly" then overlapping boundaries might be dedoubled, such that the aseembled domains are complete coherent items

I suspect that in your case the "geomcsg" has filles the"analysed geoemtry tab, and when you return to the GUI environment, it has not registered the drawing primitives. So COMSOL (v3.5) is proposing to attempt to regenerate the "draw primitives".

I would suggest that you try again, but you drop your "analysed" geometry part in your M file, ten load into the GUI and then you pass from the "Draw" mode to the FEM point/edge/boundary or (sub-domain) mode (by clicking on the corresponding icon on the top right of the Window border, this will internally call for the geomanalyse function and then you would have both geoemtries defined in the GUI environment.

Basically nothing is "wrong" but one must understand the sequence from generating geoemtry to getting to FEM definition entities that COMSOl is doing, I agree, I ahvent found this written out anywhere, it what I interprete from the use of Comsol over some years. So I might be slightly wrong too ;)

--
Good luck
Ivar
Hi this has to do with the way geometries are "analysd in COMSOL. there is the raw Draw mode geometry (I say traditionally based on points , lines, faces and volumes going from 0D to 3D) and then these items are "analysed" to become points, edges, boundaries and (sub-)domains, for the respective 0d, to 3D representation of FEM ready geometries. Comsol, via its "anayse pahse", drops all ortphans, combine (union) common/overlapping boundaries, edges or points and apply numbering identifications. If you select "assembly" then overlapping boundaries might be dedoubled, such that the aseembled domains are complete coherent items I suspect that in your case the "geomcsg" has filles the"analysed geoemtry tab, and when you return to the GUI environment, it has not registered the drawing primitives. So COMSOL (v3.5) is proposing to attempt to regenerate the "draw primitives". I would suggest that you try again, but you drop your "analysed" geometry part in your M file, ten load into the GUI and then you pass from the "Draw" mode to the FEM point/edge/boundary or (sub-domain) mode (by clicking on the corresponding icon on the top right of the Window border, this will internally call for the geomanalyse function and then you would have both geoemtries defined in the GUI environment. Basically nothing is "wrong" but one must understand the sequence from generating geoemtry to getting to FEM definition entities that COMSOl is doing, I agree, I ahvent found this written out anywhere, it what I interprete from the use of Comsol over some years. So I might be slightly wrong too ;) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 08.09.2010, 07:30 GMT-4
Hi,

thanks for your answer. If I remove the "analysed part", when I import the fem structure in Comsol, I directly get in the Draw mode. From there it is indeed possible to switch to the subdomains mode and then back to the draw mode without getting a warning message.

So this implies that it is not possible, by using Matlab script, to import a fem structure into Comsol where both the draw mode and the subdomains mode are correctly configured.

Alois
Hi, thanks for your answer. If I remove the "analysed part", when I import the fem structure in Comsol, I directly get in the Draw mode. From there it is indeed possible to switch to the subdomains mode and then back to the draw mode without getting a warning message. So this implies that it is not possible, by using Matlab script, to import a fem structure into Comsol where both the draw mode and the subdomains mode are correctly configured. Alois

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 08.09.2010, 17:06 GMT-4
Hi

No I believe your conclusions is too quick, have you tried the geomanalyze() function, instead of the geomsc() ? there is something in the doc about that, but I havent been using COMSOL/matlab imported geometries for several months, so it's somewhat vague. try a pdf search, or an indexed search on the pdf of the 3.5 doc

--
Good luck
Ivar
Hi No I believe your conclusions is too quick, have you tried the geomanalyze() function, instead of the geomsc() ? there is something in the doc about that, but I havent been using COMSOL/matlab imported geometries for several months, so it's somewhat vague. try a pdf search, or an indexed search on the pdf of the 3.5 doc -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 09.09.2010, 03:16 GMT-4
Hi,

I also thought of using geomanalyze, but it does not work if you want to import the fem structure in Comsol.

Matlab Interface Guide, p.97:
A third way of generating an analyzed geometry is by using the function geomanalyze. In contrast to geomcsg and geomcomp, this function keeps track of the associative rules between the geometry objects. For this reason, geomanalyze is the most convenient option to choose when working with a model where the geometry changes, because physics settings are then automatically updated. In this behavior, geomanalyze mimics GUI-based modeling. Note, however, that M-files where geomanalyze is used cannot be opened in the COMSOL Multiphysics GUI.

By the way, I like you new signature "Good luck"... Sometimes I really have the impression that with Comsol it is a question of luck ;-)

Have a nice day,

Alois
Hi, I also thought of using geomanalyze, but it does not work if you want to import the fem structure in Comsol. Matlab Interface Guide, p.97: A third way of generating an analyzed geometry is by using the function geomanalyze. In contrast to geomcsg and geomcomp, this function keeps track of the associative rules between the geometry objects. For this reason, geomanalyze is the most convenient option to choose when working with a model where the geometry changes, because physics settings are then automatically updated. In this behavior, geomanalyze mimics GUI-based modeling. Note, however, that M-files where geomanalyze is used cannot be opened in the COMSOL Multiphysics GUI. By the way, I like you new signature "Good luck"... Sometimes I really have the impression that with Comsol it is a question of luck ;-) Have a nice day, Alois

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 10.09.2010, 04:48 GMT-4
Hi

It's not a question of luck, but with COMSOL we are back to fundamental physics, and many of us have left thisdomain dormant for many years, and forget to build a fully coherent model. In other FEM softwares, thiose I call "clickable engineering" you have only predefine choices, whch is very restrictive for multiphysics.

But if you can live with these restriction, and work on only 1-2 physics, then other software could be quicker to set up your model (your boss, or your wife would be happier) but then forget the multiphysics ...

--
Good luck
Ivar
Hi It's not a question of luck, but with COMSOL we are back to fundamental physics, and many of us have left thisdomain dormant for many years, and forget to build a fully coherent model. In other FEM softwares, thiose I call "clickable engineering" you have only predefine choices, whch is very restrictive for multiphysics. But if you can live with these restriction, and work on only 1-2 physics, then other software could be quicker to set up your model (your boss, or your wife would be happier) but then forget the multiphysics ... -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 10.09.2010, 05:05 GMT-4
Hi,

I defnitely need the multiphysics capabilities of Comsol... So I will stick to it.

Have a nice day, Alois
Hi, I defnitely need the multiphysics capabilities of Comsol... So I will stick to it. Have a nice day, Alois

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.