Access to Global and Local Stiffness matrixes #1128
-
Hello everyone! c = Uᵀ K U = Σₑ uₑᵀ kₑ uₑTo do this, I need access to the global stiffness matrix and the degree of freedom of each element (dof).
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Hello everyone, solutions are found. Here is my code:
|
Beta Was this translation helpful? Give feedback.
-
For your information, I still want to manually calculate the compliance using the element stiffness matrix and the element displacement vector. However, my results aren’t correct. I suspect the problem might be related to the number of degrees of freedom. Any hints or suggestions to help resolve this would be greatly appreciated. Thank you!
|
Beta Was this translation helpful? Give feedback.
Your loop is wrong in two ways: First, this
gives you the global assembled stiffness matrix. The restriction of the assembled matrix to the dofs of a cell is NOT the local stiffness matrix. The local stiffness matrices are obtained BEFORE ASSEMBLY, i.e
Second, you are forgetting about the contributions from the Dirichlet dofs, which you can't. The complete cell dofs you can get as
That said, just use an integral like you did in your first post.