[petsc-users] VecGetSubVector

Gianluca Meneghello gianmail at gmail.com
Thu Jan 6 06:01:06 CST 2011


Dear Barry,

thanks a lot for your answer.

I tried to do some experiments with MatGetSubMatrix, but I guess I'm
doing something wrong as it looks like being painfully slow.

I changed approach and now I'm using the ASM preconditioner. What I'm
actually trying to do is to split the domain in different parts ---
like interior and boundaries --- and relax (solve) each one with a
different smoother (solver). In your opinion, is this the right
approach? So far it looks much faster than my previous approach of
extracting each submatrix.

Also, please let me ask you one more thing. When using ASM with
different subdomains on the same process, is the order in which the
domains are solved the same as the one in which they are stored in the
IS array passed to PCASMSetLocalSubdomains()? I would be interested in
controlling this in order to build a downstream marching smoother.

Looking at the references, I've noticed you have worked on multigrid.
What I'm trying to do is close to what is described in Diskin, Thomas,
Mineck, "Textbook Multigrid Efficiency for Leading Edge Stagnation",
in case you already know the paper.
http://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/20040081104_2004082284.pdf

Again, thanks a lot.

Gianluca

On 3 January 2011 17:43, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
>  Gianluca,
>
>    The expected use is with the VecScatter object. First you create a VecScatter object with VecScatterCreate() then each time you need the "subvector" you call VecScatterBegin() followed by VecScatterEnd() Note that usually the VecScatter object is retained and used many times.
>
>   Barry
>
>
>
> On Jan 3, 2011, at 5:22 AM, Gianluca Meneghello wrote:
>
>> Hi,
>>
>> I'm new to PETSc, so that this can be a very simple question:
>>
>> I'm looking for something like VecGetSubVector, which I've seen it
>> exists in the dev version but not in the released one.
>>
>> I need to write a smoother for a multigrid algorithm (something like a
>> block Gauss Seidel) which can be written in matlab as
>>
>> for j = 1:ny
>>  P = <some matrix indices as function of j>;
>>  du(P) = L(P,P) \ (  rhs(P) - L(P,:)*du + D2(P,P)*du(P) );
>> end
>>
>> where L is a matrix (in my case the linearized Navier Stokes).
>>
>> I was thinking about using IS for declaring P, so that D2(P,P) can be
>> obtained using MatGetSubMatrix. I would need the same for the vector
>> du.
>>
>> Is there a way to do that without using the developer version? (I
>> really don't feel like being "experienced with building, using and
>> debugging PETSc).
>>
>> Thanks in advance
>>
>> Gianluca
>
>


More information about the petsc-users mailing list