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.
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
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
RE: Large Stiffness Matrix
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..!!