Stiffness Matrix
Moderators: silvia, selimgunay, Moderators
Stiffness Matrix
Were can I print out the stiffness matrix of the structure im modelling. Im assuming its the "A" matrix in the LinearSOE subclasses. I just want to print it to screen or to a file but can't seem to be able to.
Re: Stiffness Matrix
Probably you are supposed to use "opserr << A" wherever your matrix will be returned but i am not sure i have tried this to print out element stiffness matrix of the mitc4 and it worked.
Re: Stiffness Matrix
it is A in the linear SOE classes .. A is not stored as a Matrix, so opserr << A will not work. you will have to determine the coefficients of A from the storage scheme used and write your own nesed for loops to spit out the answer.
Re: Stiffness Matrix
Let's say for UmfPack will I find the coefficients under 'UmfpackGenLinSOE::addA'?
Re: Stiffness Matrix
sort of .. if you can follow it, addA will show you where they go in the storage scheme .. a simpler storage scheme to get the data out would be bandGeneral.
Re: Stiffness Matrix
Been trying and still no luck. I printed out the 'm' matrix and that appears to be the elements stiffness matrix but i can't seem to figure out the 'A' vector which I print out at the end of addA(). Based on the numbers it obviously has something to do the stiffness matrix but just can't figure out how. Any help?
Re: Stiffness Matrix
i give in! .. i have added a method to the LinearSOE class to return in Matrix form the matrix A .. for ALL systems, but the FullGenLinSOE the system will return a 0 pointer .. so if you want to use the method, the SOE type must of course be a FullGenLinSOE. I have also added a tcl command, 'printA' which will spit out the Matrix returned from this new method. NOTE: the printA command can only be issued after an analyze command; it will invoke formTangent() on the integrator and spits out the result of theSOE->getA() .. so the output is either a transformed K matrix or some transformed combination of K, C and M. what the transformation is depends on the constraints and the constraint handler;
command:
printA <-file $fileName>
works with any revision >= 5596.
command:
printA <-file $fileName>
works with any revision >= 5596.
Re: Stiffness Matrix
Do either of you (Frank or brag006) care if I make the printA command return Tcl formatted output instead of a dump to standard output? This is an incredibly useful command, especially for instructional purposes ... before I've been having to monkey around to form K.
Re: Stiffness Matrix
Cheers for that. Sorry if I bothered you a lot about it.
That would be good Michael, that's kind of what I was using it for, to understand at a fundamental level what is happening in the analysis.
That would be good Michael, that's kind of what I was using it for, to understand at a fundamental level what is happening in the analysis.
Re: Stiffness Matrix
Keep on bothering Frank, especially with good ideas like this!