Re: [deal.II] Deprecated function PETScWrappers::VectorBase::ratio()

2018-05-15 Thread Feimi Yu
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-

Re: [deal.II] Deprecated function PETScWrappers::VectorBase::ratio()

2018-05-14 Thread Wolfgang Bangerth
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,

Re: [deal.II] Deprecated function PETScWrappers::VectorBase::ratio()

2018-05-14 Thread Feimi Yu
Hi Wolfgang, 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. Anyway, I will write my own loop to avoid using ratio(). Thanks again! Feimi On Monday, May 14, 2018 at 10:23:12 AM UTC-4, Wolfgan

Re: [deal.II] Deprecated function PETScWrappers::VectorBase::ratio()

2018-05-14 Thread Wolfgang Bangerth
On 05/12/2018 12:02 PM, Feimi Yu wrote: I'm currently using the ratio function for PETSc vectors to compute vector inverse in my parallel code. However, it looks like that ratio() is deprecated. I know there is a potential floating point exception due to the undefined behavior when the denomina

[deal.II] Deprecated function PETScWrappers::VectorBase::ratio()

2018-05-11 Thread Feimi Yu
Hi, I'm currently using the ratio function for PETSc vectors to compute vector inverse in my parallel code. However, it looks like that ratio() is deprecated. I know there is a potential floating point exception due to the undefined behavior when the denominator vector contains zero (because P