assembly of large matrices
- To: mathgroup at smc.vnet.net
- Subject: [mg53958] assembly of large matrices
- From: "dkl8" <dkl8 at walla.co.il>
- Date: Sat, 5 Feb 2005 03:15:27 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hello all , I wrote a 3D nonlinear finite element program with Mathematica . To solve the problem I need to create a large stiffness matrix (say 50,000x50,000) made by the assembly of all the elements stifnesses ( 24x24 stiffness matrix for each element ) . The assembly takes a long time . Does anyone have an idea how to reduce the assembly time ? Thank you , Doron . Here is my algorithm : calcKnew7 := Do[ Ktot7 = Ktot7old;(* a large zeros or sparse matrix *) Do[ Do[dRoofSub[p] = elemVec[[e, 2, p + 1]], {p, 0, 7}]; CalcFunc1;(* calculation of the stiffness keq1 of element e *) Do[ ith = (nLGlist[[e, 2, m]] - 1)*3 + 1; jth = (nLGlist[[e, 2, n]] - 1)*3 + 1; Ktot7[[Range[ith, ith + 2], Range[jth, jth + 2]]] += SubMatrix[keq1, {(m - 1)*3 + 1, (n - 1)*3 + 1}, {3, 3}]; , {m, 1, 8}, {n, 1, 8}];(* the assembly *) , {e, 1, ne}]; ];