On 10/12/21 10:33 AM, Masoud Ahmadi wrote:

I'm trying to use a Matrix-based solution for a general 3D FE elastic problem (just like example-8). In that example the authors used a linear scaler solution for calculating the stiffness matrix of each element; but, due to some reasons I want to use a matrix-based solution so that the stiffness matrix of each element can be calculated as follows:
K_cell = B^T . D . B,
where B matrix follows from the differential operator for strain calculation and D is the usual elasticity matrix for 3D isotropic problems. The size of the B and D matrices are 6X3 and 6X6 respectively. I defined these matrices as "vector" of "FullMatrix<double>" and try to do operate on them by FullMatrix operators as follows:
B[i].Tmmult(tmpMat,D);
tmpMat.mmult(BDB,B[j]);
and it works correctly; however, it works rather slowly.
My question is, is "FullMatrix" the most efficient and fast way in dealii to evaluate such like matrix calculations? Are there any alternatives?

Masoud,
it's difficult to say without seeing the actual code. As a general rule, it is impossible to tell for even good programmers where the "slow" parts of a code are unless one actually uses a profiling tool to measure each line of the code. So I would suggest that you figure out which line(s) is actually slow in your code, and then asking how that one part can be improved.

My best guess is that it is not actually the FullMatrix itself, but how you build the matrix. But as I said, it's not possible to say so without actual benchmarking.

Best
 W.

--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 [email protected]
                           www: http://www.math.colostate.edu/~bangerth/

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/3230d7f8-06b8-1e55-2ce2-a8ed05455402%40colostate.edu.

Reply via email to