On Sat, 19 Jul 2014, walter kou wrote:

> Instead of solving Ax=b, where,  A is system.matrix; b is system.rhs, x is
> the solutions.
>
> I need to 1) assemble 2 system.rhs: b1 and b2;
>             2) solve A x1 =b1, A x2 =b2;
>             3) then obtain the final solution x = f(x1, x2);
>
> I wonder how to do the above job. Could I have 2 rhs, solve the two
> intermediate variables, and then obtain the final solution x? Or libmesh
> has other built-in function for this.

There's some functions for turning on preconditioner reuse that you'll
want to look up to speed up the solves.  But otherwise, no, you'll
want to just create rhs=b1, solve, clone (and then clear, unless you
suspect x1 will be a better initial guess than 0 for x2) the solution
vector, create rhs=b2, solve, and then evaluate f(my_clone,solution).
---
Roy

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to