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.

Boolean function that is 1 inside a geometric entity and 0 outside

Logan Bishop-Van Horn

Please login with a confirmed email address before reporting spam

Does anyone know if there is a boolean function that is 1 inside a geometric entity and 0 outside which can be used in variable/expression definitions? I am looking for something like

inside_geom(x, y, z, geom) -> 1 if (x, y, z) is located inside geom, 0 otherwise


1 Reply Last Post 1 mar 2021, 05:18 GMT-5
Henrik Sönnerlind COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 4 years ago 1 mar 2021, 05:18 GMT-5

If you mean 'inside a geometric entity' as in 'located inside domain 17', then you can use the expression dom == 17. What 'dom' means depends on the context, so it can be a domain, boundary, or edge.

-------------------
Henrik Sönnerlind
COMSOL
If you mean 'inside a geometric entity' as in 'located inside domain 17', then you can use the expression dom == 17. What 'dom' means depends on the context, so it can be a domain, boundary, or edge.

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.