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 extract the stiffness Matrix for a certain element?

Masoud Ghorbani Moghaddam

Please login with a confirmed email address before reporting spam

Dear all,

Hi. I need to extract the stiffness Matrix for a certain element or node before assembling. The "mphmatrix" command gives me the results for whole geometry (After assembly). I wonder if there is any way for getting the matrix for certain elements? For example say that element number 2 or ... .

I appreciate your help,

Regards,
Masoud

8 Replies Last Post 25 mar 2016, 11:00 GMT-4
Masoud Ghorbani Moghaddam

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 30 ago 2011, 18:57 GMT-4

Any command in the API except the "mphmatrix"? Can I use mphmatrix for getting the results for any desired element or node?


Any command in the API except the "mphmatrix"? Can I use mphmatrix for getting the results for any desired element or node?

Masoud Ghorbani Moghaddam

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 31 ago 2011, 12:56 GMT-4

Does "NO Reply" mean that COMSOL does not have the ability of doing such a simple stuff?
I do not think so. So please help if you know.

May any of the "Moderator"s help me in this problem?

Thanks,
Does "NO Reply" mean that COMSOL does not have the ability of doing such a simple stuff? I do not think so. So please help if you know. May any of the "Moderator"s help me in this problem? Thanks,

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 21 nov 2011, 00:43 GMT-5
Hello.

I have same problem with you. But there is no way to extract the local matrix for element in a manual.
Did you solve this problem?

How about sharing this problem?
Hello. I have same problem with you. But there is no way to extract the local matrix for element in a manual. Did you solve this problem? How about sharing this problem?

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 21 nov 2011, 02:45 GMT-5
Hi

in COMSOL you do not access a Mesh element or a node, you access values from a geometric ELEMENT: a point, an edge, a surface, a domain, or a subset of the three last ones

You apply the physics to the geometric elements NOT to the mash, the latter is mapped onto the geometric Elements.
Just as you apply shape functions of higher order and not 2nd 3rd order mesh elements, as in "classical" FEM programmes. You need to get this methodology change into your habits, then COMSOL becomes far more easier to understand, at least that was my experience, coming from many years of "classical" major FEM programmes ;)

--
Good luck
Ivar
Hi in COMSOL you do not access a Mesh element or a node, you access values from a geometric ELEMENT: a point, an edge, a surface, a domain, or a subset of the three last ones You apply the physics to the geometric elements NOT to the mash, the latter is mapped onto the geometric Elements. Just as you apply shape functions of higher order and not 2nd 3rd order mesh elements, as in "classical" FEM programmes. You need to get this methodology change into your habits, then COMSOL becomes far more easier to understand, at least that was my experience, coming from many years of "classical" major FEM programmes ;) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 17 ott 2014, 01:16 GMT-4

Hi

in COMSOL you do not access a Mesh element or a node, you access values from a geometric ELEMENT: a point, an edge, a surface, a domain, or a subset of the three last ones

You apply the physics to the geometric elements NOT to the mash, the latter is mapped onto the geometric Elements.
Just as you apply shape functions of higher order and not 2nd 3rd order mesh elements, as in "classical" FEM programmes. You need to get this methodology change into your habits, then COMSOL becomes far more easier to understand, at least that was my experience, coming from many years of "classical" major FEM programmes ;)

--
Good luck
Ivar




Hi

I have a question regarding the stiffness Matrix derivation of the model. Suppose that dependent variables of the model are displacements (u v) and scalar potential (V); the command

str = mphmatrix(model,'sol1','Out',{'K','L'})

returns a 4659X4659 matrix for K.

How can I interpret the Global stiffness matrix and Load vector? I need to know which coefficient corresponds to which degree of freedom? In the other words, how is the order of the returned matrix for solution vector, Load vector and Stiffness matrix ? e.g. is the solution vector order like [u1,u2,u3,u4,......v1,v2,v3,v4,.......V1,V2,V3,...​] or [u1,v1,V1,u2,v2,V2,.......]

Any and all help is gratefully appreciated!

Alireza~
[QUOTE] Hi in COMSOL you do not access a Mesh element or a node, you access values from a geometric ELEMENT: a point, an edge, a surface, a domain, or a subset of the three last ones You apply the physics to the geometric elements NOT to the mash, the latter is mapped onto the geometric Elements. Just as you apply shape functions of higher order and not 2nd 3rd order mesh elements, as in "classical" FEM programmes. You need to get this methodology change into your habits, then COMSOL becomes far more easier to understand, at least that was my experience, coming from many years of "classical" major FEM programmes ;) -- Good luck Ivar [/QUOTE] Hi I have a question regarding the stiffness Matrix derivation of the model. Suppose that dependent variables of the model are displacements (u v) and scalar potential (V); the command str = mphmatrix(model,'sol1','Out',{'K','L'}) returns a 4659X4659 matrix for K. How can I interpret the Global stiffness matrix and Load vector? I need to know which coefficient corresponds to which degree of freedom? In the other words, how is the order of the returned matrix for solution vector, Load vector and Stiffness matrix ? e.g. is the solution vector order like [u1,u2,u3,u4,......v1,v2,v3,v4,.......V1,V2,V3,...​] or [u1,v1,V1,u2,v2,V2,.......] Any and all help is gratefully appreciated! Alireza~

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 8 giu 2015, 23:35 GMT-4
Hi, i encounter a problem, briefly, extracting Mass Damping Stiffness matrix from comsol as follows.
str = mphmatrix(model,'sol1','out',{'E','D','K','L','Null','Nullf','M','N','uscale'},'initmethod','init');
strc = mphmatrix(model,'sol1','out',{'Ec','Dc','Kc','Lc','Null','Nullf','M','N','uscale'},'initmethod','init');
However, E D K and L are not the desired ones, i want the matrix for the future computation in temporal discretion. And I find Null*E*Null' does not equal to Ec.
Could you express for me in details!
Thanks a lot!
Hi, i encounter a problem, briefly, extracting Mass Damping Stiffness matrix from comsol as follows. str = mphmatrix(model,'sol1','out',{'E','D','K','L','Null','Nullf','M','N','uscale'},'initmethod','init'); strc = mphmatrix(model,'sol1','out',{'Ec','Dc','Kc','Lc','Null','Nullf','M','N','uscale'},'initmethod','init'); However, E D K and L are not the desired ones, i want the matrix for the future computation in temporal discretion. And I find Null*E*Null' does not equal to Ec. Could you express for me in details! Thanks a lot!

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 17 mar 2016, 14:33 GMT-4

Hi

in COMSOL you do not access a Mesh element or a node, you access values from a geometric ELEMENT: a point, an edge, a surface, a domain, or a subset of the three last ones

You apply the physics to the geometric elements NOT to the mash, the latter is mapped onto the geometric Elements.
Just as you apply shape functions of higher order and not 2nd 3rd order mesh elements, as in "classical" FEM programmes. You need to get this methodology change into your habits, then COMSOL becomes far more easier to understand, at least that was my experience, coming from many years of "classical" major FEM programmes ;)

--
Good luck
Ivar


Ivar, suppose I pick the nodes that define one triangle of a triangle mesh. Is there a way to get the shape function matrix (N) and the displacement differentiation matrix (B) for that given set of nodes (that form an element)? Can COMSOL tell me what the element mass, stiffness, damping matrices would be defined on those nodes? We assume that we are using a defined material and same element type used in the global model (i.e. P1, P2, P3, etc.).
[QUOTE] Hi in COMSOL you do not access a Mesh element or a node, you access values from a geometric ELEMENT: a point, an edge, a surface, a domain, or a subset of the three last ones You apply the physics to the geometric elements NOT to the mash, the latter is mapped onto the geometric Elements. Just as you apply shape functions of higher order and not 2nd 3rd order mesh elements, as in "classical" FEM programmes. You need to get this methodology change into your habits, then COMSOL becomes far more easier to understand, at least that was my experience, coming from many years of "classical" major FEM programmes ;) -- Good luck Ivar [/QUOTE] Ivar, suppose I pick the nodes that define one triangle of a triangle mesh. Is there a way to get the shape function matrix (N) and the displacement differentiation matrix (B) for that given set of nodes (that form an element)? Can COMSOL tell me what the element mass, stiffness, damping matrices would be defined on those nodes? We assume that we are using a defined material and same element type used in the global model (i.e. P1, P2, P3, etc.).

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 25 mar 2016, 11:00 GMT-4
COMSOL creates the global matrices E, D, K from local element matrices E_i, D_i, K_i. Is there a way we can get these using livelink?
COMSOL creates the global matrices E, D, K from local element matrices E_i, D_i, K_i. Is there a way we can get these using livelink?

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.