Oh, yes. Sorry I did not say it clearly. What I did is using an identity vector whose elements are all ones and ratio that with the original lumped vector to get the inverse. Then I use it in the mmult(), which can take a diagonal vector.
Thanks! Feimi On Monday, May 14, 2018 at 7:47:16 PM UTC-4, Wolfgang Bangerth wrote: > > On 05/14/2018 11:52 PM, Feimi Yu wrote: > > > > Thank you for the detailed explanation! Actually what I want to do is to > evaluate > > the inverse of a lumped diagonal matrix to mimic the matrix inverse. > > I see. Since floating point division is *so much more expensive* than > floating > point multiplication, it is probably worth computing the inverse of the > diagonal elements once at the beginning, and then only multiplying > (instead of > dividing) by this vector repeatedly. This can be done with the scale() > function, which is not deprecated. > > Best > W. > > -- > ------------------------------------------------------------------------ > Wolfgang Bangerth email: [email protected] > <javascript:> > 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]. For more options, visit https://groups.google.com/d/optout.
