Stiffness Matrix

For developers writing C++, Fortran, Java, code who have questions or comments to make.

Moderators: silvia, selimgunay, Moderators

Post Reply
brag006
Posts: 173
Joined: Wed Feb 15, 2012 1:26 pm
Location: University of Auckland

Stiffness Matrix

Post by brag006 »

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.
yekose
Posts: 50
Joined: Thu May 15, 2008 5:46 am
Location: Turkey

Re: Stiffness Matrix

Post by yekose »

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.
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: Stiffness Matrix

Post by fmk »

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.
brag006
Posts: 173
Joined: Wed Feb 15, 2012 1:26 pm
Location: University of Auckland

Re: Stiffness Matrix

Post by brag006 »

Let's say for UmfPack will I find the coefficients under 'UmfpackGenLinSOE::addA'?
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: Stiffness Matrix

Post by fmk »

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.
brag006
Posts: 173
Joined: Wed Feb 15, 2012 1:26 pm
Location: University of Auckland

Re: Stiffness Matrix

Post by brag006 »

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?
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: Stiffness Matrix

Post by fmk »

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.
mhscott
Posts: 880
Joined: Tue Jul 06, 2004 3:38 pm
Location: Corvallis, Oregon USA
Contact:

Re: Stiffness Matrix

Post by mhscott »

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.
brag006
Posts: 173
Joined: Wed Feb 15, 2012 1:26 pm
Location: University of Auckland

Re: Stiffness Matrix

Post by brag006 »

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.
mhscott
Posts: 880
Joined: Tue Jul 06, 2004 3:38 pm
Location: Corvallis, Oregon USA
Contact:

Re: Stiffness Matrix

Post by mhscott »

Keep on bothering Frank, especially with good ideas like this!
Post Reply