On Thu, Oct 20, 2016 at 1:22 AM, Safin, Artur <[email protected]> wrote:
> Hi all, > > I would like to get your advice on how to set up an interface problem that > I get from domain decomposition. The particular issue that I am dealing > with is how to 'stack' two vectors on top of each other. > > I would like to set up a problem of type > > [ A B ] [ x ] = [ b ] > [ C D ] [ y ] [ c ] > > where x and y live on a subset of the global domain (the interface to be > exact, obtained with VecGetSubVector). I want to solve this system with > an iterative method. I already have the x and y vectors, but in order to > set up the system I believe I will need a vector that looks like v = [x; > y]. Is there a way to set up a vector like this? It would also be > beneficial if I could extract either the x or y component of the solution > vector back into the corresponding subvector. > > Also, just in general, I am curious as to how one would approach setting > up these kinds of problems. > You use http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatGetLocalSubMatrix.html http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecGetSubVector.html to put values directly into the subvectors and submatrices. This interacts well with MatNest, so it can be optimized after you get it working. Matt > Thanks, > > Artur > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener
