I was wondering what is, computationally speaking, the best way of counting the total number of DoFs in a model when dealing with elements of different kinds, especially SOLID and SHELLS that could actually be joined together. Those differ in the amount of DoFs per Node: SOLIDs having 3 and SHELLs having 6, and it's quite tricky to assess the correct amount of DoFs.
Having a .txt or .inp file of the actual model, I was thinking about iterating over each node and searching which elements it belongs to.
Is this the best possible way of getting this information in order to preallocate the Global Stiffness Matrix? Also, do FEA Solvers really preallocate the Global Stiffness Matrix?