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.

How To Find Specific Geometry Name/Identifiers in MATLAB with COMSOL

Please login with a confirmed email address before reporting spam

Hi,

I'm using COMSOL with MATLAB to build a model which can be altered based on inputs in the MATLAB script to change the geometry and applied voltages in COMSOL. I've been able to change the geometry as needed, however, I'm having trouble with setting the selection for terminals where the voltage would be applied. For example, normally in the COMSOL GUI you would select the terminal by selecting the relevant geometry in the display window. In this case, I need a way to get the "name/number" or identifier of the relevant edge of the electrodes I've created in the MATLAB so I can use that as an input to set my voltage terminal.

Thank you!


3 Replies Last Post 5 nov 2020, 07:22 GMT-5
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 4 years ago 27 lug 2020, 15:52 GMT-4

Hello Alisha,

This blog post addresses your question, I believe.

Best regards,

Jeff

-------------------
Jeff Hiller
Hello Alisha, [This blog post](https://www.comsol.com/blogs/manually-work-entity-numbers-selections) addresses your question, I believe. Best regards, Jeff

Please login with a confirmed email address before reporting spam

Posted: 4 years ago 27 ott 2020, 14:03 GMT-4

Hello Jeff,

Is it possible to go one step further and obtain the IDs/coordinates of mesh nodes on a certain geometric entity like an edge?

Thanks, Mohamed Abdelhamid

Hello Jeff, Is it possible to go one step further and obtain the IDs/coordinates of mesh nodes on a certain geometric entity like an edge? Thanks, Mohamed Abdelhamid

Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 4 years ago 5 nov 2020, 07:22 GMT-5
Updated: 4 years ago 8 nov 2020, 04:09 GMT-5

Hi

Use mphgetcoords to get coordinates if you know the entity number

Use mphselectbox or mphselectcoords to get the entity numbers if you know (something about) their coordinates.

If you need more info then please exactly what info you have and what you would like to get.

-------------------
Lars Gregersen
Comsol Denmark
Hi Use mphgetcoords to get coordinates if you know the entity number Use mphselectbox or mphselectcoords to get the entity numbers if you know (something about) their coordinates. If you need more info then please exactly what info you have and what you would like to get.

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.