×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Large Stiffness Matrix

Large Stiffness Matrix

Large Stiffness Matrix

(OP)
Does any know how to handle very large arrays or matrices in VB6.0 (or any programming language).  I get a memory error when using arrays that are of several thousand terms. (ie 3000x3000).  This is for math calculations for stiffness matrix of steel structures.

I have seen suggestions to use an array of arrays.  In other words each row of the matrix would have an array.  This seems to be a good idea, but I don't know how to create additional arrays at runtime since the actual size of the matrix is unknown at design time.

Any ideas appreciated.

RE: Large Stiffness Matrix

ctmfab:

There are 3 ways to store the stiffness matrix:

1. The upper symmetric part.
2. The upper simi-band width
3. The non-zero profile (skyline) (Sparce matrix)

To give some idea for a 3000x3000
full            9,000,000
upper symmetric 4,501,500
upper Semi-band +/-75,000
Skyline         +/-60,000

Obviously, the dificulty of programming increases as the size decreases.
Fortunately, you may find numerical algorithms for Sparce matrices (multipication, Gauss reduction, etc) in the book of Numerical Recipes, some of the Fortran/C subroutines are online for free.

http://www.ul.cs.cmu.edu/webRoot/Books/Numerical_Recipes/bookf.html
 
In addition, to have the smallest semi-band or the lowest skiline you should number the nodes adequately. The algoritm of CutHill-McGee es very efficient to get best numbering of nodes.

CMFG

RE: Large Stiffness Matrix

Your problem seems to be a memory storage problem. You should try to use banded or skyline solution technique to see if there is any difference. I use Matlab, I use variable memory allocation. You can also do teh same in Fortran 90 as well as in C/C++. I also clear momory of many variables which are currently not in use. Your stiffness size of 3000x3000 seems to be not so large, I handle three times of this size in 126 MB ram. Try to increase your ram or use dual processor. I hope particular computer is not a concern here.

RE: Large Stiffness Matrix

yes, true....u need to create the matrix dynamically..in C++/C , use the "new" operator..It allocates memory in the heap (more than sufficient)..Say int *i = new int[2000]..Think it is a good option to write a 'Matrix' class that handles this..It could have a memeber variable like
int** m_p2DArray...A constructor cud look like this...:-->>>

Matrix(size_t Rows , size_t Cols):
      m_iRows(Rows), m_iCols(Cols), m_iNElements(Rows * Cols)
      {
         m_p2DArray = new T*[m_iRows] ;
         for (size_t iRowIndex = 0 ; iRowIndex < m_iRows ; iRowIndex++){
            m_p2DArray[iRowIndex] = new T[m_iCols] ;
            for (size_t iColIndex = 0 ; iColIndex < m_iCols ; iColIndex++){
               m_p2DArray[iRowIndex][iColIndex] = 0 ;
            }
         }
      }

try this ...it works...!! hope this is what u need..!!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources