Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Posts: n/a
Babak
#1: Mar 23 '06
Hello everyone,
Babak schrieb:[color=blue]
> I'm working on some Finite Elements(FE) codes in C and now I
> encountered some problems in assembly stage. The main idea is that a
> large number of 3 by 3 elemental stiffness matrices are calculated and
> then they should mapped to specific elements in a very big and sparse
> global stiffness matrix. I think the preferred storage format for the
> sparse matrix is Compresses Row Storage (CRS) format because it is
> compatible with many different sparse solver packages. Now the problem
> is that I have no idea how to update and assemble "ia" (pointers to the
> begining of each row), "ja" (column indices) and "a" (nonzero values)
> arrays as each local stiffness matrix is calculated in the loop. Is it
> a better idea to first calculate all the elemental stiffness matrices
> and then assemble them in the global system once at the end or I should
> update these three arrays each time a local matrix is calculated? I
> think SPARSE function in MATLAB can do much of these works for me but I
http://bytes.com/topic/c/answers/472159-assembly-process-fe-finite-element-code-c 1/29/2011
Assembly Process for FE (Finite Element) code in C - C / C++ answers Page 2 of 6
> can't find any similar fuction in C. Since this is my first Finite
> Element program, any comments, algorithms or references on this issue
> will be a great help.[/color]
Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
Posts: n/a
Rouben Rostamian #3: Mar 24 '06
http://bytes.com/topic/c/answers/472159-assembly-process-fe-finite-element-code-c 1/29/2011
Assembly Process for FE (Finite Element) code in C - C / C++ answers Page 3 of 6
k = 0;
for (elemno=0; elemno<nelems; elemno++)
for (i=0; i<3; i++)
for (j=0; j<3; j++) {
Ti[k] = I;
Tj[k] = J;
Tx[k] = m[i][j];
k++;
}
--
Rouben Rostamian
http://bytes.com/topic/c/answers/472159-assembly-process-fe-finite-element-code-c 1/29/2011
Assembly Process for FE (Finite Element) code in C - C / C++ answers Page 4 of 6
Posts: n/a
Martin Joergensen #4: Mar 24 '06
http://bytes.com/topic/c/answers/472159-assembly-process-fe-finite-element-code-c 1/29/2011
Assembly Process for FE (Finite Element) code in C - C / C++ answers Page 5 of 6
/* row up */
}
if(unknowns[i+1][j] == 1) {
pfvector_a[++count] = koeffD[no];
pivector_j[count] = (i-1)*(nx-2) + (j-1);
/* row down */
}
}
}
--
---------------------------------------------------------------------------
Home of Martin Jørgensen - http://www.martinjoergensen.dk
Similar topics
python module for finite element program ( Python answers )
ASP.NET process identity does not have read permissions to the global assembly cache. ( ASP.NET answers )
At wits end dealing with "Assembly's manifest does not match assembly reference". Need help understanding
the process. ( C# / C Sharp answers )
http://bytes.com/topic/c/answers/472159-assembly-process-fe-finite-element-code-c 1/29/2011
Assembly Process for FE (Finite Element) code in C - C / C++ answers Page 6 of 6
ASP.NET process identity does not have read permissions to the global assembly cache ( ASP.NET answers )
Can application policy bind to latest version of assembly? ( .NET Framework answers )
http://bytes.com/topic/c/answers/472159-assembly-process-fe-finite-element-code-c 1/29/2011