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.

coordinates of geometry objects

Please login with a confirmed email address before reporting spam

Hi all!

How can I access the coordinates of geometric objects/domains for using in an expression?

Alternately: how can I use distance of a domain or primitive center from a plane in an expression?

Background: I'm trying to do a electrically steered phased patch array, in 3D. To get the phase shifts, I need to evaluate the distance of the patches from a virtual plane perpendicular to the intended direction of steering.

What I'd like:

arr1(1,1,1,1).coord evaluates to (x1,y1,z1) vector,
arr1(1,1,2,1).coord evaluates to (x2,y2,z2)vector, etc.

Since I built the geometry, I can of course just calculate the positions by hand (and will, for the time being), but as a matter of principle, I dislike doing things by hand that the computer has the means to do quicker.

PS: how can I, in general, access the properties for domains etc?

2 Replies Last Post 5 janv. 2014, 08:54 UTC−5
Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 5 janv. 2014, 08:41 UTC−5

Hi,

in most cases I build my geometries using parameters. This way I can use the parameters in any kind of calculations and I can also use them for parameter studies on the geometry.

May be this helps?

Cheers
Edgar

--
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Hi, in most cases I build my geometries using parameters. This way I can use the parameters in any kind of calculations and I can also use them for parameter studies on the geometry. May be this helps? Cheers Edgar -- Edgar J. Kaiser emPhys Physical Technology http://www.emphys.com

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 5 janv. 2014, 08:54 UTC−5
I did build it using parameters, it's just a matter of doing math with clear identifiers for each entity (relatively simple expression for the phase shift), vs doing math with a bunch of parameters with typo-prone signage (an ungodly mess of an expression that only makes sense while typing and later can just as well be used as a pink brain-noise generator).

I'm currently defining variables (in terms of the parameters) for each coordinate of every patch, altogether 24 variables just to make it read better. Point of the question was basically to avoid all that, especially since I could generate the individual patches just fine from a single copy and thus didn't need to type them each out.

Am I right in understanding that COMSOL itself doesn't handle vectors in expressions? I guess that's what the MATLAB link is for, but I've never touched the latter, and I have a deadline to meet :D
I did build it using parameters, it's just a matter of doing math with clear identifiers for each entity (relatively simple expression for the phase shift), vs doing math with a bunch of parameters with typo-prone signage (an ungodly mess of an expression that only makes sense while typing and later can just as well be used as a pink brain-noise generator). I'm currently defining variables (in terms of the parameters) for each coordinate of every patch, altogether 24 variables just to make it read better. Point of the question was basically to avoid all that, especially since I could generate the individual patches just fine from a single copy and thus didn't need to type them each out. Am I right in understanding that COMSOL itself doesn't handle vectors in expressions? I guess that's what the MATLAB link is for, but I've never touched the latter, and I have a deadline to meet :D

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.