dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #23477
Re: [Question #158688]: the inverse and elements of stiffness matrix on C++
Question #158688 on DOLFIN changed:
https://answers.launchpad.net/dolfin/+question/158688
Nguyen Van Dang gave more information on the question:
Dear Mr. James Avery,
Now I can change my problem to solving a linear system. There is no need for
the inverse matrix.
Thank you very much for your help!
Best regards
Dang
On Tue, May 24, 2011 at 1:41 PM, Nguyen Van Dang <
question158688@xxxxxxxxxxxxxxxxxxxxx> wrote:
> Your question #158688 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/158688
>
> Status: Answered => Open
>
> You are still having a problem:
> *Dear Mr. James Avery,*
> *In fact, I want to invert of the mass matrix. Can I find the inverse
> matrix
> indirectly by solving the linear system MX=I? (where I is the Matrix unit)
> Is this way better than using M.invert()? If yes, please tell me the way to
> get the matrix unit in Fenics?*
> *Thanks a lot.*
> *Dang
> *
> On Tue, May 24, 2011 at 11:01 AM, James Avery <
> question158688@xxxxxxxxxxxxxxxxxxxxx> wrote:
>
> > Your question #158688 on DOLFIN changed:
> > https://answers.launchpad.net/dolfin/+question/158688
> >
> > Status: Open => Answered
> >
> > James Avery proposed the following answer:
> > Are you certain that you really want to take the inverse of the matrix?
> >
> > The problem with doing that is that taking the inverse of a sparse
> > matrix does not result in a sparse matrix. While the sparse matrix uses
> > O(N) memory for N degrees of freedom, a dense one uses O(N^2), and so
> > you restrict yourself to very coarse meshes if you do take the inverse.
> >
> > Usually, you will instead want to apply a preconditioner (for example
> > SSOR) to the matrix to improve efficiency of solving linear systems, and
> > then solve each system Ax = b individually using a sparse linear solver.
> >
> > If you really, really want to take the inverse, you can use the
> > uBLASSparseMatrix class instead of the Matrix class. I.e.
> >
> > uBLASSparseMatrix T;
> > assemble(T,stiffness);
> > T.invert();
> >
> > Please see also my answer to the same question at the bottom of this
> > thread: https://answers.launchpad.net/dolfin/+question/158315
> >
> > --
> > If this answers your question, please go to the following page to let us
> > know that it is solved:
> >
> https://answers.launchpad.net/dolfin/+question/158688/+confirm?answer_id=0
> >
> > If you still need help, you can reply to this email or go to the
> > following page to enter your feedback:
> > https://answers.launchpad.net/dolfin/+question/158688
> >
> > You received this question notification because you asked the question.
> >
>
>
> --
> Nguyen Van Dang
>
> Home Tel: +84 7 92 21 36 28
> Another email: dang.1032170@xxxxxxxxxxxx
>
> You received this question notification because you asked the question.
>
--
Nguyen Van Dang
Home Tel: +84 7 92 21 36 28
Another email: dang.1032170@xxxxxxxxxxxx
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.