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.

Conditional Geometry

Please login with a confirmed email address before reporting spam

Does anyone know where to find a tutorial or an example on how to use If/Else statements to define conditional geometries in the model tree? I have read all about the new feature with version 4.4 however I can't find any tutorials of it. Thank you in advance for any help!

Richard

6 Replies Last Post 2017年4月11日 GMT-4 07:56
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2014年5月19日 GMT-4 16:15
Hello Richard,
The attached model may help. The physics are bogus, as you will see, but this file illustrates the use of geometry subsequences and if/else calls.
Best,
Jeff
Hello Richard, The attached model may help. The physics are bogus, as you will see, but this file illustrates the use of geometry subsequences and if/else calls. Best, Jeff


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2014年5月19日 GMT-4 17:04
Jeff,

Thank you for your quick response! Perhaps this is what you are trying to show me with the domino.mph file, but I am trying to define a geometry based on a conditional statement as explained in the help documentation which is shown in the attached image. If that's what you gave me sorry for not understanding it better (I'm quite new to COMSOL still). What would be awesome is a tutorial of sorts to understand how to use the feature. Again, thank you for your help!

Jeff, Thank you for your quick response! Perhaps this is what you are trying to show me with the domino.mph file, but I am trying to define a geometry based on a conditional statement as explained in the help documentation which is shown in the attached image. If that's what you gave me sorry for not understanding it better (I'm quite new to COMSOL still). What would be awesome is a tutorial of sorts to understand how to use the feature. Again, thank you for your help!


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2014年5月19日 GMT-4 17:05
Jeff,

Thank you for your quick response! Perhaps this is what you are trying to show me with the domino.mph file, but I am trying to define a geometry based on a conditional statement as explained in the help documentation which is shown in the attached image. If that's what you gave me sorry for not understanding it better (I'm quite new to COMSOL still). What would be awesome is a tutorial of sorts to understand how to use the feature. Again, thank you for your help!

Jeff, Thank you for your quick response! Perhaps this is what you are trying to show me with the domino.mph file, but I am trying to define a geometry based on a conditional statement as explained in the help documentation which is shown in the attached image. If that's what you gave me sorry for not understanding it better (I'm quite new to COMSOL still). What would be awesome is a tutorial of sorts to understand how to use the feature. Again, thank you for your help!

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2014年5月19日 GMT-4 17:39
Hello Richard,
The If calls are in the geometry subsequence called Domino, which you will find under the Global Definitions branch.
That subsequence is later called repeatedly in the Geometry 1 branch.
Jeff
Hello Richard, The If calls are in the geometry subsequence called Domino, which you will find under the Global Definitions branch. That subsequence is later called repeatedly in the Geometry 1 branch. Jeff

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2014年5月20日 GMT-4 09:01
Jeff,

That's exactly what I was looking for! Thank you very much for your help!

Richard
Jeff, That's exactly what I was looking for! Thank you very much for your help! Richard

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 2017年4月11日 GMT-4 07:56
Hi,
I am opening this subject again as I need to ask how to assign materials for the different geometry parts under the statements.
I have a difficulty assigning properly the materials as COMSOL only allows me to assign a material to the first if statement. Then the geometries under the rest 'else if' statements are assigned a material based on the first if automatically but not always in a right way. I need to be able to assign a material to each one of them myself but I can't find a way so far...I had some advices form COMSOL support team but it didn't seem to work.Any help would be much appreciated!

edit: I think I found a solution, based on the Domino model above. I will get back to this thread if I have any success to leave comments.
Hi, I am opening this subject again as I need to ask how to assign materials for the different geometry parts under the statements. I have a difficulty assigning properly the materials as COMSOL only allows me to assign a material to the first if statement. Then the geometries under the rest 'else if' statements are assigned a material based on the first if automatically but not always in a right way. I need to be able to assign a material to each one of them myself but I can't find a way so far...I had some advices form COMSOL support team but it didn't seem to work.Any help would be much appreciated! edit: I think I found a solution, based on the Domino model above. I will get back to this thread if I have any success to leave comments.

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.