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 could I calculate the each element center of mass?

Please login with a confirmed email address before reporting spam

Hi!

I want to extract the value of each element center of mass.

it can be calculated using MATLAB, but I need it in COMSOL interface.

is it possible to extract the coordinate of center of mass in COMSOL?

not geometry !! each mesh element !

5 Replies Last Post 5 août 2010, 04:29 UTC−4
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 4 août 2010, 05:39 UTC−4
Hi

what about defining a integration coupling variable such that you get the CoG, you can also calculate the inertia tensor that way.

You then select the items you want to include and off you go

there are som tricks to use domain id via the bolean (dom==dest(dom)) and you define the destinatio items separately to get individual volumes, CoGs per item and not of all the selected items

--
Good luck
Ivar
Hi what about defining a integration coupling variable such that you get the CoG, you can also calculate the inertia tensor that way. You then select the items you want to include and off you go there are som tricks to use domain id via the bolean (dom==dest(dom)) and you define the destinatio items separately to get individual volumes, CoGs per item and not of all the selected items -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 4 août 2010, 06:34 UTC−4
thanks Ivar.

but I don't understand (dom==dest(dom)) expression.

What's that?

is it possible that expression in COMSOL? not Script?
thanks Ivar. but I don't understand (dom==dest(dom)) expression. What's that? is it possible that expression in COMSOL? not Script?

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 4 août 2010, 07:32 UTC−4
Hi

"dom" is the internal COMSOl variable equal to the domain id number (check the doc)
"dest()" is an internal COMSOL operator indicating that the integration coupling operator should use the destination domain (and not the default "source" domain where to get the information (again, check the doc)
"dest(dom))" is therefore the doman id of the "destination" part of the coupling integration variable operation
" == " is the bolean operation is equal resulting in an evaluation of 0 if false, 1 if true
therefore "(dom==dest(dom))" is equal to "1" if the source and destination domains are the same, i.e. have the same id, and is "0" elsewise

You must engage the "source" and "destination" lists/tabs of the integration coupling vaiable definition and select all destination domains of interest

Therefore, if you integrate over a domain the value "int1=(dom==dest(dom))*1" this would give you the volume of each domain (that is "int1" would have a different value, corresponding to the volume, for each separate domain).

As well as "mass_int1=(dom==dest(dom))*rho_smsld" (in V3.5a_smsld mode, or "mass_int1=(dom==dest(dom))*solid.rho" in V4 solid structural mode) would give you the total mass of each individual item

Knowing that the CoG is the integration over a domain of the vector "(x,y,z)*rho*dx*dy*dz" divided by the total mass of the domain (i.e. integration over the domain of "1*rho*dx*dy*dz") you should have everything to do the job, domain item by domain item (if you premultiply by the (dom==...), or as a global system.

try it out on a few cubes or spheres or circles of known radius, COMSOl is first of all a good math and geometry tool

--
Good luck
Ivar
Hi "dom" is the internal COMSOl variable equal to the domain id number (check the doc) "dest()" is an internal COMSOL operator indicating that the integration coupling operator should use the destination domain (and not the default "source" domain where to get the information (again, check the doc) "dest(dom))" is therefore the doman id of the "destination" part of the coupling integration variable operation " == " is the bolean operation is equal resulting in an evaluation of 0 if false, 1 if true therefore "(dom==dest(dom))" is equal to "1" if the source and destination domains are the same, i.e. have the same id, and is "0" elsewise You must engage the "source" and "destination" lists/tabs of the integration coupling vaiable definition and select all destination domains of interest Therefore, if you integrate over a domain the value "int1=(dom==dest(dom))*1" this would give you the volume of each domain (that is "int1" would have a different value, corresponding to the volume, for each separate domain). As well as "mass_int1=(dom==dest(dom))*rho_smsld" (in V3.5a_smsld mode, or "mass_int1=(dom==dest(dom))*solid.rho" in V4 solid structural mode) would give you the total mass of each individual item Knowing that the CoG is the integration over a domain of the vector "(x,y,z)*rho*dx*dy*dz" divided by the total mass of the domain (i.e. integration over the domain of "1*rho*dx*dy*dz") you should have everything to do the job, domain item by domain item (if you premultiply by the (dom==...), or as a global system. try it out on a few cubes or spheres or circles of known radius, COMSOl is first of all a good math and geometry tool -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 5 août 2010, 01:36 UTC−4
thanks! Ivar.

appreciate your answer.

but my question is how calculate center of element in COMSOL interface.

I think your answer is domain's CoG.

It is hard to extract CoG in COMSOL.


anyway,,, Thanks for trying to help.

have a nice day. Ivar.
thanks! Ivar. appreciate your answer. but my question is how calculate center of element in COMSOL interface. I think your answer is domain's CoG. It is hard to extract CoG in COMSOL. anyway,,, Thanks for trying to help. have a nice day. Ivar.

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 5 août 2010, 04:29 UTC−4
Hi

Indeed I was thinking of the physical centre or the CoG taking into account the density rho. But if you are looking for
the geometrical centre you use the integration over the volume with rho=1, no ?

With COMSOL you apply directly your integration eqautions on the geometry, it's not really complicated or ?

--
Good luck
Ivar
Hi Indeed I was thinking of the physical centre or the CoG taking into account the density rho. But if you are looking for the geometrical centre you use the integration over the volume with rho=1, no ? With COMSOL you apply directly your integration eqautions on the geometry, it's not really complicated or ? -- Good luck Ivar

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.