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 11.04.2017, 07:56 GMT-4
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 19.05.2014, 16:15 GMT-4
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 19.05.2014, 17:04 GMT-4
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 19.05.2014, 17:05 GMT-4
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 19.05.2014, 17:39 GMT-4
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 20.05.2014, 09:01 GMT-4
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: 8 years ago 11.04.2017, 07:56 GMT-4
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.