Thanks for your patient instructions, and I have solved the former problems under your help. But I’m sorry to have to bother you again.
I could get the stiffness matrix with expected shape now, but the matrix elements are all zeros! I guess it’s most likely to go wrong in the material definition and term selection as well as term implementation steps. I have attached my code snippet together with the mesh used and a description file. Could you please help me check what’s wrong with my code snippet, especially my material definition part, and see if I have chosen the right terms to build equations?
Thanks!