DMMG and DA

Christophe Picard picard2 at llnl.gov
Wed Jun 14 12:54:06 CDT 2006


Thank you Matt.
I thought about this approach, but when I compute the RHS of the equations, I 
want to be able to access the local value of the other variables. I believe I 
can do that using  DACreateLocalVector, and then copy the global value to the 
local vector. Is it actually creating a new vector or is it creating a 
pointer to the global vector (and the global data)?

Thanks
Christophe 


On Wednesday 14 June 2006 10:18 am, Matthew Knepley wrote:
> On 6/14/06, Christophe Picard <picard2 at llnl.gov> wrote:
> > Hello,
> >
> > I have been trying to used DMMG and DA in the following way.
> > I have a DA with several degree of freedom, and several of them have the
> > same
> > jacobian but different RHS (what I want to do is solve Ax1=b1(x1,x,2,x3),
> > Ax2=b2(x1,x2,x3)).
> > So how does DMMGsolve handle that?
>
> I am not sure I understand completely what you want, but I will start with
> the
> DA. DA objects only encode a data layout. All data resides in Vec and Mat
> objects. So, if you have several fields that you want to solve separately,
> then
> create a DA with 1 dof, and use several Vecs. Since the Jacobian is the
> same,
> you will have 1 Mat.
>
>   Matt
>
> Since x1,x2,x3 are DA variables, but I want to solve only x1 and x2 using
>
> > the
> > same Jacobian, I figured that I can have some kind of switch in the
> > definition of the RHS function that will make the selection, and calling
> > dmmgSolve several times, but by modifyng the switch trough DMMGSetUser
> > and DMMGGetUser before each call. But then where the output of the solve
> > operation is stored? The way I understand it now is that it is
> > overwritting
> > x1. Am I right?
> > Is there a way to solve x1 and x2 simultaneously, I mean by only 1 call
> > of dmmgSolve, and without solving x3?
> >
> > I hope I am not too confusing.
> >
> > Thank you,
> >
> > Christophe
> > ---




More information about the petsc-users mailing list