Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TPZMatRed::MultAdd implementation needs review #15

Open
thiagoquinelato opened this issue Sep 19, 2017 · 4 comments
Open

TPZMatRed::MultAdd implementation needs review #15

thiagoquinelato opened this issue Sep 19, 2017 · 4 comments

Comments

@thiagoquinelato
Copy link
Contributor

MultAdd implementations attempts to multiply matrices with vectors with incompatible dimensions (e.g., lines 507 and 518):

l. 507: fK01.Multiply(x,l_Res,0);

l. 518: fK11.Multiply(x,l_ResFinal,0);

Also, fSolver's usage drops const qualifier.

@philippedevloo
Copy link
Member

fK01 and fK11 have the same number of columns. This means the lines 507 and 518 are not incompatible. What this method computes is alpha *(K11 - K10 * K00^-1 * K01) x + beta y

@philippedevloo
Copy link
Member

I agreee that the solve method drops the const qualifier. I can't think of a way to work around it. After all, the solve method is usually direct and, if K00 is not decomposed yet, it will decompose K00. A second call to Solve will obviously not modify the matrix...

@orlandini
Copy link
Member

We've seen that the only moment when fIsReduced is checked is at the beginning of TPZMatRed::MultAdd, to decide whether the method should behave as alpha *(K11 - K10 * K00^-1 * K01) x + beta y or alpha *K x + beta y.

Would there be a problem if we were to invert K00 in TPZMatRed::SetReduced? This would eliminate the need to call the Solve method in TPZMatRed::MultAdd...

@philippedevloo
Copy link
Member

We could conceive a method Solve() const which generates a DebugStop() if the matrix is not decomposed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants