Element-level stiffness matrix and displacement vectors

Hello everyone.

For a particular application regarding optimization procedures (SIMP method), I need the element-level stiffness matrix and displacement vectors to compute sensitivities for the design variables of my study. For each element from the mesh, I need to compute the product {u}^T [k] {u} where {u} is the displacement vector for the nodes in each element and [k] is the element stiffness matrix. All the other values (p and x) are known:

image

From the data I gathered here in the forum and the CCX documentation, I have the following alternatives:

  1. Use the already implemented *SENSITIVITY analysis.
  2. To get the global stiffness matrix, one can use *FREQUENCY with SOLVER=MATRIXSTORAGE.
  3. To get a local stiffness matrix, one can use *SUBSTRUCTURE GENERATE.
  4. Calculate outside CalculiX the stiffness matrix for each element.

The issue with the first point is that the current sensitivity approach does not support the calculation I need because x_e is a variable defined by me, and only coordinates for the nodes and orientations are supported.

For the second bullet, I have no idea how to reconstruct the local stiffness matrix for each element using the global matrix as a starting point. Does anybody know how to do it?

For the third point, I think I would need to create a substructure for each element in the mesh. Let’s say I’m going to optimize 100000 elements (which is not an absurd number), I would need 100000 substructure analysis just to start my optimization. That does not seem to be an efficient approach.

For the fourth approach, I would need to know how CCX calculates the stiffness matrix for each element (probably C3D20R and C3D10 would be enough). However, I am not sure how to get the displacement vector for the local coordinates in each element.

I would gladly appreciate any help with this problem I’m facing and thoughts about which way to proceed. Any suggestions are welcome.

Best regards,
Lucas.

Since CalculiX is open-source, maybe the easiest approach would be to modify the source code to include your variable in *SENSITIVITY procedure or to output those matrices/vectors that are calculated by the solver anyway.

https://github.com/search?q=repo%3ADhondtguido%2FCalculiX%20local%20stiffness%20matrix&type=code

2 Likes

For the second and fourth bullet , you can refer to the CalculiX function, mafillsmmain_se.c, which includes the calculation of local stiffness matrix gradient and assembly it from local to the global。If you want to define your own variable, please read the code in function sensi_coor.c。(Redirecting, This is a paper about the sensitivity analysis using CalculiX you can refer, and I am the second author responsible for modifying the code.)

1 Like