[petsc-users] KSPPlugin

2013-05-15 Thread Hui Zhang
Hello, I just saw KSPPlugin on bitbucket. Very nice feature. When will it be available to us? Thanks!

[petsc-users] Mat local size zero

2013-05-03 Thread Hui Zhang
Hello, I'm implementing a coarse problem for a domain decomposition preconditioner. I use many processors to solve one subdomain and I want to pick one processor for each subdomain to solve the global coarse problem. So I need to set the local sizes of the coarse operator on the other processors

[petsc-users] VecGetArray and use it for VecCreateSeqWithArray

2013-04-24 Thread Hui Zhang
On Apr 24, 2013, at 6:21 PM, Matthew Knepley wrote: > On Wed, Apr 24, 2013 at 11:58 AM, Hui Zhang > wrote: > Vec u,v; > > VecCreateMPIAIJ(..,&u); > VecGetArray(u,&a); > > VecCreateSeqWithArray(...,a,&v); > > Is this safe? I want the VecSeq v to

[petsc-users] VecGetArray and use it for VecCreateSeqWithArray

2013-04-24 Thread Hui Zhang
On Apr 24, 2013, at 5:58 PM, Hui Zhang wrote: > Vec u,v; > > VecCreateMPIAIJ(..,&u); > VecGetArray(u,&a); > > VecCreateSeqWithArray(...,a,&v); > > Is this safe? I want the VecSeq v to read and write local array of u. > This is for VecScatterCrea

[petsc-users] VecGetArray and use it for VecCreateSeqWithArray

2013-04-24 Thread Hui Zhang
Vec u,v; VecCreateMPIAIJ(..,&u); VecGetArray(u,&a); VecCreateSeqWithArray(...,a,&v); Is this safe? I want the VecSeq v to read and write local array of u. This is for VecScatterCreate from a global Vec to the local Seq v, and then I hope that u get updated as well automatically. Thanks in a

[petsc-users] VecScatter from comm to subcomm: should I aggregate?

2013-04-21 Thread Hui Zhang
On Apr 19, 2013, at 5:15 PM, Hui Zhang wrote: > I'm doing something like gasm.c. I can construct one VecScatte from comm to > each subcomm. But I can also construct VecScatter's from comm to the > processors in subcomm. Which mode do you think is good? Why? Thanks for &g

[petsc-users] VecScatter from comm to subcomm: should I aggregate?

2013-04-19 Thread Hui Zhang
I'm doing something like gasm.c. I can construct one VecScatte from comm to each subcomm. But I can also construct VecScatter's from comm to the processors in subcomm. Which mode do you think is good? Why? Thanks for teaching me!

[petsc-users] Read PetscInt in binary file from Matlab

2013-04-17 Thread Hui Zhang
Is there something similar to the Matlab function PetscBinaryRead for PetscInt? The binary file is obtained by PetscIntView.

[petsc-users] VecGetOwnershipRanges

2013-04-16 Thread Hui Zhang
On Apr 16, 2013, at 5:48 PM, Satish Balay wrote: > On Tue, 16 Apr 2013, Hui Zhang wrote: > >> VecGetOwnershipRanges(Vec x,const PetscInt *ranges[]) >> >> From the html manual page, >> >> range -array of length size+1 with the start and end+1 for each proces

[petsc-users] VecGetOwnershipRanges

2013-04-16 Thread Hui Zhang
VecGetOwnershipRanges(Vec x,const PetscInt *ranges[])

[petsc-users] AOApplicationToPetscIS

2013-04-15 Thread Hui Zhang
On Apr 15, 2013, at 9:10 PM, Hui Zhang wrote: > > On Apr 15, 2013, at 5:55 PM, Matthew Knepley wrote: > >> On Mon, Apr 15, 2013 at 10:52 AM, Hui Zhang >> wrote: >> I'm implementing a domain decomposition preconditioner. The dof is ordered >> by myapp

[petsc-users] AOApplicationToPetscIS

2013-04-15 Thread Hui Zhang
On Apr 15, 2013, at 5:55 PM, Matthew Knepley wrote: > On Mon, Apr 15, 2013 at 10:52 AM, Hui Zhang > wrote: > I'm implementing a domain decomposition preconditioner. The dof is ordered > by myapp and using AO (and LocalToGlobalMapping for assembly) to map to petsc > orde

[petsc-users] AOApplicationToPetscIS

2013-04-15 Thread Hui Zhang
On Apr 15, 2013, at 5:55 PM, Matthew Knepley wrote: > On Mon, Apr 15, 2013 at 10:52 AM, Hui Zhang > wrote: > I'm implementing a domain decomposition preconditioner. The dof is ordered > by myapp and using AO (and LocalToGlobalMapping for assembly) to map to petsc > orde

[petsc-users] AOApplicationToPetscIS

2013-04-15 Thread Hui Zhang
I'm implementing a domain decomposition preconditioner. The dof is ordered by myapp and using AO (and LocalToGlobalMapping for assembly) to map to petsc ordering. The task I'm doing is building VecScatter's from subdomains to the global domain. So my program is Step 1. I can map subdomain p

[petsc-users] AOCreateBasic & AOCreateBasicIS

2013-04-15 Thread Hui Zhang
On Apr 15, 2013, at 5:26 PM, Jed Brown wrote: > Hui Zhang writes: > >> Maybe my question was unclear. From the manual >> >> http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/AO/AOCreateBasicIS.html#AOCreateBasicIS >> >> AOCreateBasicIS(IS i

[petsc-users] AOCreateBasic & AOCreateBasicIS

2013-04-15 Thread Hui Zhang
On Apr 15, 2013, at 5:11 PM, Matthew Knepley wrote: > On Mon, Apr 15, 2013 at 10:04 AM, Hui Zhang > wrote: > > On Apr 15, 2013, at 4:53 PM, Jed Brown wrote: > > > Hui Zhang writes: > > > >> Is the following correct? > >> > >> From my

[petsc-users] AOCreateBasic & AOCreateBasicIS

2013-04-15 Thread Hui Zhang
On Apr 15, 2013, at 4:53 PM, Jed Brown wrote: > Hui Zhang writes: > >> Is the following correct? >> >> From my understanding before, >> >> AOCreateBasic(MPI_Comm comm,PetscInt napp,const PetscInt myapp[],const >> PetscInt mypetsc[],AO *aoout) >

[petsc-users] AOCreateBasic & AOCreateBasicIS

2013-04-15 Thread Hui Zhang
Is the following correct?

[petsc-users] Assembly of local Mat's to a parallel Mat

2013-04-12 Thread Hui Zhang
On Apr 12, 2013, at 7:10 PM, Jed Brown wrote: > Hui Zhang writes: > >> On Apr 12, 2013, at 5:22 PM, Jed Brown wrote: >> >> I can understand this method. A further question: since Ai itself is shared >> by many processors, MatSetValues to A should be called by

[petsc-users] Assembly of local Mat's to a parallel Mat

2013-04-12 Thread Hui Zhang
On Apr 12, 2013, at 5:22 PM, Jed Brown wrote: > Hui Zhang writes: > >> Assembly it directly. I just found MatGetSubMatricesParallel. > > This is not a private implementation function so it's not a good place > to learn. It also doesn't do what you want.

[petsc-users] Assembly of local Mat's to a parallel Mat

2013-04-12 Thread Hui Zhang
On Apr 12, 2013, at 4:55 PM, Matthew Knepley wrote: > On Fri, Apr 12, 2013 at 9:44 AM, Hui Zhang > wrote: > Assembly of local Mat's to a parallel Mat formally defined by A = \sum_i Ri^T > Ai Ri. > > My Ai's are originally defined in sub-communicators. In Petsc

[petsc-users] Assembly of local Mat's to a parallel Mat

2013-04-12 Thread Hui Zhang
Assembly of local Mat's to a parallel Mat formally defined by A = \sum_i Ri^T Ai Ri. My Ai's are originally defined in sub-communicators. In Petsc, I was told before there are no counterpart of Ri that can promote the mat Ai to sup-communicator where A stays. (VecScatter can only acts on Vec

[petsc-users] csqrt

2013-02-28 Thread Hui Zhang
On Feb 28, 2013, at 9:04 PM, Satish Balay wrote: > On Thu, 28 Feb 2013, Barry Smith wrote: > >> >> On Feb 28, 2013, at 5:33 AM, Hui Zhang wrote: >> >>> My cluster has an old version of glibc 2.3.3, which can not give usual >>> principal value of

[petsc-users] csqrt

2013-02-28 Thread Hui Zhang
My cluster has an old version of glibc 2.3.3, which can not give usual principal value of square root. For example, it gives square root of -i as the value with negative real part. I 'grep' in the source tree of petsc and found csqrt in many places. Is this dangerous? Thank you!

[petsc-users] Scale the diagonal entries of a Mat

2013-02-23 Thread Hui Zhang
Sorry, I found the answer from the source code of Petsc. All the MatZero things are not for unassembled matrix. On Feb 23, 2013, at 2:43 PM, Hui Zhang wrote: > Should MatZeroRowsColumnsLocalIS also be done before MatAssembly? > > I used MatZeroRows one year ago. At that time, petsc

[petsc-users] Scale the diagonal entries of a Mat

2013-02-23 Thread Hui Zhang
you > should implement it the way I describe. There is no point assembling before > imposing boundary conditions.) > > On Feb 23, 2013 7:32 AM, "Jed Brown" wrote: > You should really use MatSetValuesLocal with ADD_VALUES *before* assembling. > > On Feb 23, 2013 7:

[petsc-users] Scale the diagonal entries of a Mat

2013-02-23 Thread Hui Zhang
Thanks for advices! Follow you. On Feb 23, 2013, at 2:32 PM, Jed Brown wrote: > You should really use MatSetValuesLocal with ADD_VALUES *before* assembling. > > On Feb 23, 2013 7:28 AM, "Hui Zhang" wrote: > > On Feb 23, 2013, at 1:37 PM, Matthew Knepley wrote: >

[petsc-users] Scale the diagonal entries of a Mat

2013-02-23 Thread Hui Zhang
On Feb 23, 2013, at 1:37 PM, Matthew Knepley wrote: > On Sat, Feb 23, 2013 at 7:35 AM, Hui Zhang > wrote: > > On Feb 23, 2013, at 1:32 PM, Matthew Knepley wrote: > > > On Sat, Feb 23, 2013 at 7:29 AM, Hui Zhang > > wrote: > > I want to implement diagonal

[petsc-users] Scale the diagonal entries of a Mat

2013-02-23 Thread Hui Zhang
b 23, 2013 6:29 AM, "Hui Zhang" wrote: > I want to implement diagonal penalty method for enforcing the Dirichlet > boundary conditions. That is, the diagonal entries corresponding to > Dirichlet boundary are going to be scaled by a large number. > > What is the easiest way to do this? Thanks!

[petsc-users] Scale the diagonal entries of a Mat

2013-02-23 Thread Hui Zhang
On Feb 23, 2013, at 1:32 PM, Matthew Knepley wrote: > On Sat, Feb 23, 2013 at 7:29 AM, Hui Zhang > wrote: > I want to implement diagonal penalty method for enforcing the Dirichlet > boundary conditions. That is, the diagonal entries corresponding to > Dirichlet boundary

[petsc-users] Scale the diagonal entries of a Mat

2013-02-23 Thread Hui Zhang
I want to implement diagonal penalty method for enforcing the Dirichlet boundary conditions. That is, the diagonal entries corresponding to Dirichlet boundary are going to be scaled by a large number. What is the easiest way to do this? Thanks!

[petsc-users] [mumps-users] MUMPS error

2013-02-23 Thread Hui Zhang
, paresh murthy wrote: > Hello Mike, > > I would guess, as perhaps others might as well, that it is trying to solve a > million x million dense matrix. > Are you sure you have removed the zeroes and given it a sparse matrix ? > > Paresh > > > From: Hui Zhang &

[petsc-users] MUMPS error

2013-02-23 Thread Hui Zhang
Error reported by MUMPS in numerical factorization phase: Cannot allocate required memory 70397575 megabytes The required memory is too large. Is that normal? I'm solving a Helmholtz equation on 100^3 mesh partitioned to 4^3 processors.

[petsc-users] MatGetLocalSubMatrix

2013-02-17 Thread Hui Zhang
> On Sun, Feb 17, 2013 at 6:56 AM, Hui Zhang > wrote: > I want to use MatGetLocalSubMatrix for assembly purpose. > > PetscErrorCode MatGetLocalSubMatrix(Mat mat,IS isrow,IS iscol,Mat *submat) > > I want to get a submat shared by some (not all) of the processes that s

[petsc-users] MatGetLocalSubMatrix

2013-02-17 Thread Hui Zhang
I want to use MatGetLocalSubMatrix for assembly purpose. PetscErrorCode MatGetLocalSubMatrix(Mat mat,IS isrow,IS iscol,Mat *submat) I want to get a submat shared by some (not all) of the processes that share the mat. Some questions. 1. Shall I create isrow and iscol shared by the processes

[petsc-users] Convergence is different with different processors

2013-02-16 Thread Hui Zhang

[petsc-users] VecView in AO to a binary file?

2013-02-16 Thread Hui Zhang
I have an AO that defines a global ordering. I want to write a Vec into a binary file in the global ordering defined by AO. How to do it? Thanks in advance!

[petsc-users] ((PetscObject)M)->comm

2013-02-16 Thread Hui Zhang
It works! Thank you! On Feb 16, 2013, at 3:25 PM, Matthew Knepley wrote: > PetscObjectComm((PetscObject) M)

[petsc-users] ((PetscObject)M)->comm

2013-02-16 Thread Hui Zhang
Why? When I try to use ((PetscObject)M)->comm in my function as follows, PetscErrorCode SetupDirectSolver(KSP *ksp, Mat M) { KSPCreate(((PetscObject)M)->comm,ksp); } I got error: dereferencing pointer to incomplete type

[petsc-users] VecDuplicate throwing error messages

2013-02-16 Thread Hui Zhang
Yes! Thank you! On Feb 16, 2013, at 12:46 PM, Matthew Knepley wrote: > On Sat, Feb 16, 2013 at 5:46 AM, Hui Zhang > wrote: > I updated petsc-dev just now with the last changeset: 26190:c5c1560f6126 > > I reconfigure and rebuild petsc. I modified > src/sys/threadcomm/exam

[petsc-users] VecDuplicate throwing error messages

2013-02-16 Thread Hui Zhang
I updated petsc-dev just now with the last changeset: 26190:c5c1560f6126 I reconfigure and rebuild petsc. I modified src/sys/threadcomm/examples/tutorials/ex4.c to include a VecDuplicate like the following ediff file (see behind, ! indicating the modifications). Then I got error messages (us

[petsc-users] No Matlab for complex numbers?

2013-02-16 Thread Hui Zhang
When I configure --with-matlab=1, I got Cannot use Matlab with complex numbers it is not coded for this capability Why not supporting this capability?

[petsc-users] can't find PETSC_i

2013-01-28 Thread Hui Zhang
http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/singleindex.html I can not find PETSC_i from the above link, is it renamed?

[petsc-users] DMDACreateSection

2013-01-22 Thread Hui Zhang
interface d.o.f. on faces, edges and vertices. On Jan 22, 2013, at 10:34 AM, Hui Zhang wrote: > Hi petsc-group, > > if I want to map a structured mesh onto processors by partition of mesh > **elements**, > can I use DMDACreate3d -> DMDACreateSection, then > DMDACreateLocal(Glo

[petsc-users] DMDACreateSection

2013-01-22 Thread Hui Zhang
Hi petsc-group, if I want to map a structured mesh onto processors by partition of mesh **elements**, can I use DMDACreate3d -> DMDACreateSection, then DMDACreateLocal(Global)Vector to give me the vector corresponding to my Q1-element d.o.f.? I ask because according to the manual, the usual us

[petsc-users] parallel Mat Mult a serial Vec or a serial Mat

2013-01-20 Thread Hui Zhang
On Jan 20, 2013, at 7:41 PM, Jed Brown wrote: > > On Sun, Jan 20, 2013 at 12:26 PM, Hui Zhang > wrote: > I think about the method and find it is not as convenient as allowing > inter-communicator operations. > > Supporting general mixed-communicator operations is a no

[petsc-users] parallel Mat Mult a serial Vec or a serial Mat

2013-01-20 Thread Hui Zhang
On Jan 20, 2013, at 5:28 PM, Jed Brown wrote: > On Sun, Jan 20, 2013 at 10:22 AM, Hui Zhang > wrote: > > On Jan 20, 2013, at 5:13 PM, Jed Brown wrote: > > > No, MatMult and MatMatMult require all objects to be on the same > > communicator. > > Thanks

[petsc-users] parallel Mat Mult a serial Vec or a serial Mat

2013-01-20 Thread Hui Zhang
to the sup-communicator without changing the parallel layout of the object? > > > On Sun, Jan 20, 2013 at 10:12 AM, Hui Zhang > wrote: > parallel Mat, multiplies a serial Vec or a serial Mat > > Is it supported directly? If yes, can the resulting Vec/Mat be serial or > parallel? > >

[petsc-users] parallel Mat Mult a serial Vec or a serial Mat

2013-01-20 Thread Hui Zhang
parallel Mat, multiplies a serial Vec or a serial Mat Is it supported directly? If yes, can the resulting Vec/Mat be serial or parallel?

[petsc-users] matptap

2012-05-30 Thread Hui Zhang
Is MatPtAP using only transpose but no complex conjugate?

[petsc-users] randomness from MATSOLVERPACKAGE

2012-05-30 Thread Hui Zhang
On May 30, 2012, at 5:55 PM, Satish Balay wrote: > On Wed, 30 May 2012, Hui Zhang wrote: > >> I suspect there are some randomness from external matsolverpackage. I use a >> parallel matrix >> as preconditioner, and the preconditioner is exactly LU factored, then

[petsc-users] randomness from MATSOLVERPACKAGE

2012-05-30 Thread Hui Zhang
On May 30, 2012, at 4:40 PM, Jed Brown wrote: > On Wed, May 30, 2012 at 9:37 AM, Hui Zhang > wrote: >> How is the matrix assembled? >> > In a deterministic way. > > Do you use ADD_VALUES with off-process entries? If so, the message order may >

[petsc-users] randomness from MATSOLVERPACKAGE

2012-05-30 Thread Hui Zhang
results are sensitive, you may be able to make it deterministic (with > extra work and choice of package), but you should probably reformulate the > problem > > On May 30, 2012 9:21 AM, "Hui Zhang" wrote: > > > I suspect there are some randomness from external m

[petsc-users] randomness from MATSOLVERPACKAGE

2012-05-30 Thread Hui Zhang
> I suspect there are some randomness from external matsolverpackage. I use a > parallel matrix > as preconditioner, and the preconditioner is exactly LU factored, then I saw > the KSP (gmres) > residuals are different from different runs. Besides, for sequential matrix, there is no such phenom

[petsc-users] randomness from MATSOLVERPACKAGE

2012-05-30 Thread Hui Zhang
I suspect there are some randomness from external matsolverpackage. I use a parallel matrix as preconditioner, and the preconditioner is exactly LU factored, then I saw the KSP (gmres) residuals are different from different runs. Is it true of randomness from matsolverpackage? Thanks a lot!

[petsc-users] Warning in PCCompositeAddPC

2012-05-29 Thread Hui Zhang
Hi, I also have these warnings although I'm using latest petsc-dev. > You can ignore these warnings about 'const' for char *. I believe this is > fixed in petsc-dev. > >Matt > > > Hi PETSc experts, > > > > When I used the following functions: > > > > ierr = PCCompositeAddPC(finepc,PCSHELL)

[petsc-users] PCComposite

2012-05-28 Thread Hui Zhang
On May 28, 2012, at 5:29 PM, Jed Brown wrote: > On Mon, May 28, 2012 at 10:25 AM, Hui Zhang > wrote: > But I'm not *changing* the operator. It is PCSetUp_Composite that call > PCSetOperators on sub pc > a second time-- he does not know that the sub pc has been set up bef

[petsc-users] PCComposite

2012-05-28 Thread Hui Zhang
On May 28, 2012, at 5:16 PM, Jed Brown wrote: > On Mon, May 28, 2012 at 9:40 AM, Hui Zhang > wrote: > > On May 28, 2012, at 3:42 PM, Jed Brown wrote: > >> On Mon, May 28, 2012 at 8:40 AM, Hui Zhang >> wrote: >> >> On May 28, 2012, at 3:20 PM, Jed Br

[petsc-users] PCComposite

2012-05-28 Thread Hui Zhang
On May 28, 2012, at 4:40 PM, Hui Zhang wrote: > > On May 28, 2012, at 3:42 PM, Jed Brown wrote: > >> On Mon, May 28, 2012 at 8:40 AM, Hui Zhang >> wrote: >> >> On May 28, 2012, at 3:20 PM, Jed Brown wrote: >> >>> On Mon, May 28, 2012 at 5:19

[petsc-users] PCComposite

2012-05-28 Thread Hui Zhang
On May 28, 2012, at 3:42 PM, Jed Brown wrote: > On Mon, May 28, 2012 at 8:40 AM, Hui Zhang > wrote: > > On May 28, 2012, at 3:20 PM, Jed Brown wrote: > >> On Mon, May 28, 2012 at 5:19 AM, Hui Zhang >> wrote: >> Sorry for repost the following question,

[petsc-users] PCComposite

2012-05-28 Thread Hui Zhang
On May 28, 2012, at 3:20 PM, Jed Brown wrote: > On Mon, May 28, 2012 at 5:19 AM, Hui Zhang > wrote: > Sorry for repost the following question, but after reading composite.c and > asm.c, > I can not understand. I observed that my subroutine for modifying > submatrices of

[petsc-users] MatSetValues: reorder the values

2012-05-27 Thread Hui Zhang
On May 27, 2012, at 8:58 PM, Mohammad Mirzadeh wrote: > > Of course, this new function sounds unnecessary because reordering v is > > equivalent to reordering > > idxm[] and idxn[]. But the second method seems not an easy task to me, is > > it? > > > > Why not use a single AO object to hol

[petsc-users] MatSetValues: reorder the values

2012-05-27 Thread Hui Zhang
; http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatSetValuesLocal.html? > > That routine might be close enough to what you need. > Dmitry. > > On Sun, May 27, 2012 at 4:01 AM, Hui Zhang > wrote: > Also, in the case that only a *subset* of v[] is used, the

[petsc-users] MatSetValues: reorder the values

2012-05-27 Thread Hui Zhang
ed. > Dmitry. > > On Sun, May 27, 2012 at 4:01 AM, Hui Zhang > wrote: > Also, in the case that only a *subset* of v[] is used, the new function > sounds easy to me. > > > >> >> Current MatSetValues is >> MatSetValues(Mat mat,PetscInt m,const P

[petsc-users] MatSetValues: reorder the values

2012-05-27 Thread Hui Zhang
Also, in the case that only a *subset* of v[] is used, the new function sounds easy to me. > Current MatSetValues is > MatSetValues(Mat mat,PetscInt m,const PetscInt idxm[],PetscInt n,const > PetscInt idxn[],const PetscScalar v[],InsertMode addv) > I want something like > MatSetValues(Mat mat,P

[petsc-users] MatSetValues: reorder the values

2012-05-27 Thread Hui Zhang
Current MatSetValues is MatSetValues(Mat mat,PetscInt m,const PetscInt idxm[],PetscInt n,const PetscInt idxn[],const PetscScalar v[],InsertMode addv) I want something like MatSetValues(Mat mat,PetscInt m,const PetscInt idxm[],PetscInt n,const PetscInt idxn[],const PetscScalar v[], const PetscInt

[petsc-users] Dense multiply Sparse

2012-05-25 Thread Hui Zhang
50% dense then store it in a dense format. It will be much faster > and the extra memory is minimal. Even 30% dense. > > Barry > > On May 14, 2012, at 5:13 AM, Hui Zhang wrote: > >> I have two matrices A and B stored in sparse format. While A is really >> spa

[petsc-users] PCGASMSetLocalSubdomains

2012-05-22 Thread Hui Zhang
Otherwise you are > essentially hacking > PCASM and using its internal subsolvers, which are only available after > PCSetUp(). Yes. Maybe I should follow your advice. Thanks again! > PCCOMPOSITE doesn't look like the right framework for this. > > Dmitry. > > On T

[petsc-users] PCGASMSetLocalSubdomains

2012-05-22 Thread Hui Zhang
rix mapping you are using > in your ModifySubMatrices(). > > Thanks. > Dmitry. > > On Mon, May 21, 2012 at 2:33 PM, Hui Zhang > wrote: > Hi, > > It might be unclear. The error here is that the submat[1] does have a (1,2) > entry, > but MatSetValues at (1

[petsc-users] PCGASMSetLocalSubdomains

2012-05-22 Thread Hui Zhang
Hi, I have got a new question. I'm now constructing a PCComposite from PCASM and another PCKSP (coarse problem). And construction of PCKSP needs to use the subksp's of PCASM. So I need to PCSetUp on the PCASM, right? But the KSP using PCComposite would setup PCASM again. How can I avoid twic

[petsc-users] PCGASMSetLocalSubdomains

2012-05-21 Thread Hui Zhang
Hi, It might be unclear. The error here is that the submat[1] does have a (1,2) entry, but MatSetValues at (1,2) gives an error message. GASM and ASM give the same error. Thanks! On May 21, 2012, at 9:11 PM, Hui Zhang wrote: > Sorry, I uses PCASMSetSortIndices for GASM. Now, I correct

[petsc-users] PCGASMSetLocalSubdomains

2012-05-21 Thread Hui Zhang
Sorry, I uses PCASMSetSortIndices for GASM. Now, I correct it and the output becomes the same as PCASM. See attached. On May 21, 2012, at 8:59 PM, Hui Zhang wrote: > Dmitry, > > finally, I am able to make a simple program and reproduce the error. Since I > had moved to > pe

[petsc-users] PCGASMSetLocalSubdomains

2012-05-21 Thread Hui Zhang
and something goes wrong in asm.c and gasm.c. Thanks! Hui > On Sun, May 20, 2012 at 5:06 AM, Hui Zhang > wrote: > I have the following MatView output: > > row 0: (0, -0.0351719 - 0.638814 i) (1, -0.517586 - 0.617823 i) (4, -0.517586 > - 0.617823 i) (1, -1.035

[petsc-users] PCGASMSetLocalSubdomains

2012-05-20 Thread Hui Zhang
On May 20, 2012, at 4:36 PM, Dmitry Karpeev wrote: > > > On Sun, May 20, 2012 at 5:06 AM, Hui Zhang > wrote: > I have the following MatView output: > > row 0: (0, -0.0351719 - 0.638814 i) (1, -0.517586 - 0.617823 i) (4, -0.517586 > - 0.617823 i) (1, -1.03517) (

[petsc-users] PCGASMSetLocalSubdomains

2012-05-20 Thread Hui Zhang
structures. As long > as you are careful, you should be okay, since you already effectively have > the same type of access to the submatrices through the Modify callback. > > Dmitry. > > On Fri, May 11, 2012 at 11:52 AM, Hui Zhang > wrote: > I just have a question abo

[petsc-users] PCGASMSetLocalSubdomains

2012-05-19 Thread Hui Zhang
If PCASMSetSortIndices is used to set false, i.e. DO NOT sort indices, is that true rows of submatrices are in the same order as the IS we passed to PCASMSetLocalSubdomains? Thanks!

[petsc-users] shortening digits from MatView

2012-05-16 Thread Hui Zhang
Is there any way to shorten the digits of outputs from MatView? The numbers are just too long to have a good look. Thanks!

[petsc-users] PCGASMSetLocalSubdomains

2012-05-16 Thread Hui Zhang
It's ok. I found the example program. On May 16, 2012, at 10:46 AM, Hui Zhang wrote: > > A question about PCASMGetSubKSP(), it says that we must call KSPSetUp() > before calling > PCASMGetSubKSP(). But what ksp should be SetUp, the ksp using PCASM or what? > > Thank

[petsc-users] PCGASMSetLocalSubdomains

2012-05-16 Thread Hui Zhang
A question about PCASMGetSubKSP(), it says that we must call KSPSetUp() before calling PCASMGetSubKSP(). But what ksp should be SetUp, the ksp using PCASM or what? Thanks! >> >> On Tue, May 15, 2012 at 10:30 AM, Hui Zhang >> wrote: >> thanks for reply! >&g

[petsc-users] Fwd: PCGASMSetLocalSubdomains

2012-05-15 Thread Hui Zhang
On May 15, 2012, at 6:28 PM, Jed Brown wrote: > On Tue, May 15, 2012 at 10:25 AM, Hui Zhang > wrote: > Yes, but I want to modify it a bit to just use the overlapping subdomains for > coarse basis. > I think my choice is more natural because we avoid factorization on the &g

[petsc-users] Fwd: PCGASMSetLocalSubdomains

2012-05-15 Thread Hui Zhang
On May 15, 2012, at 6:20 PM, Jed Brown wrote: > On Tue, May 15, 2012 at 10:11 AM, Hui Zhang > wrote: > Yes, see Mandel & Dorhamann' paper http://ccm.ucdenver.edu/reports/rep194.pdf > , > > BDDC needs to solve pinned Neumann problems to build the coarse space. T

[petsc-users] PCGASMSetLocalSubdomains

2012-05-15 Thread Hui Zhang
On May 15, 2012, at 6:12 PM, Jed Brown wrote: > On Tue, May 15, 2012 at 10:05 AM, Hui Zhang > wrote: > I am writing some modified ASM method. In construction of energy minimization > coarse basis, > I need to solve individual subdomain problems and not to sum them, just to

[petsc-users] Fwd: PCGASMSetLocalSubdomains

2012-05-15 Thread Hui Zhang
Begin forwarded message: > From: Hui Zhang > Date: May 15, 2012 6:11:10 PM GMT+02:00 > To: Dmitry Karpeev > Subject: Re: [petsc-users] PCGASMSetLocalSubdomains > > > On May 15, 2012, at 6:06 PM, Dmitry Karpeev wrote: > >> >> >> On Tue, May

[petsc-users] PCGASMSetLocalSubdomains

2012-05-15 Thread Hui Zhang
On May 15, 2012, at 5:42 PM, Dmitry Karpeev wrote: > > > On Tue, May 15, 2012 at 10:30 AM, Hui Zhang > wrote: > thanks for reply! > On May 15, 2012, at 5:19 PM, Dmitry Karpeev wrote: > >> >> >> On Tue, May 15, 2012 at 9:55 AM, Hui Zhang >> w

[petsc-users] Fwd: PCGASMSetLocalSubdomains

2012-05-15 Thread Hui Zhang
to petsc-user > thanks for reply! > On May 15, 2012, at 5:19 PM, Dmitry Karpeev wrote: > >> >> >> On Tue, May 15, 2012 at 9:55 AM, Hui Zhang >> wrote: >> Dmitry, >> >> thanks for remind. I have a new question about PCASM / PCGASM:

[petsc-users] PCGASMSetLocalSubdomains

2012-05-15 Thread Hui Zhang
omain output. > > Thanks. > Dmitry. > > On Tue, May 15, 2012 at 7:14 AM, Hui Zhang > wrote: > Dmitry, > > thanks for reply. I re-download the codes and tried it again and now it works > correctly! > > Everything seems ok. > > Thanks, > Hui >

[petsc-users] PCGASMSetLocalSubdomains

2012-05-15 Thread Hui Zhang
(reflecting some upcoming API > changes) > that should verify that. > > Let me know if it works for you. > Thanks. > Dmitry. > On Fri, May 11, 2012 at 12:31 PM, Hui Zhang > wrote: > Hi Dmitry, > > thanks for useful hints. Good day! > > Hui > > On

[petsc-users] Dense multiply Sparse

2012-05-14 Thread Hui Zhang
I have two matrices A and B stored in sparse format. While A is really sparse, B is relatively dense (say non-zeros entries about 50%). Now to multiply the two matrices, among A*B or (B^T * A^T)^T which is better, or no big difference ? Thanks!

[petsc-users] PCGASMSetLocalSubdomains

2012-05-11 Thread Hui Zhang
internal data structures. As long > as you are careful, you should be okay, since you already effectively have > the same type of access to the submatrices through the Modify callback. > > Dmitry. > > On Fri, May 11, 2012 at 11:52 AM, Hui Zhang > wrote: > I just have a

[petsc-users] PCGASMSetLocalSubdomains

2012-05-11 Thread Hui Zhang
wrote: > Hui, > There've been several changes to PCGASM ahead of the new release. > Let me go back and see if it affected the convergence problem. > Dmitry. > > On Thu, May 10, 2012 at 4:16 AM, Hui Zhang > wrote: > Hi Dmitry, > > is there any news about PCGASM?

[petsc-users] two-level Schwarz: PCMG or PCComposite

2012-05-11 Thread Hui Zhang
irstly applied, i.e. the order of applying PC's is the same as the order of PCCompositeAddPC ? > > On May 11, 2012, at 6:26 AM, Hui Zhang wrote: > >> I want to implement the two-level Schwarz method. Let us denote P as the >> one-level >> Schwarz projection a

[petsc-users] two-level Schwarz: PCMG or PCComposite

2012-05-11 Thread Hui Zhang
some corrections: > I want to implement the two-level Schwarz method. Let us denote P as the > one-level > Schwarz projection and P_0 as the coarse projection. If I want the hybrid > form of > preconditioned system as follows: > > (I-P_0) P (I-P_0) this should be I - (I-P_0)

[petsc-users] two-level Schwarz: PCMG or PCComposite

2012-05-11 Thread Hui Zhang
I want to implement the two-level Schwarz method. Let us denote P as the one-level Schwarz projection and P_0 as the coarse projection. If I want the hybrid form of preconditioned system as follows: (I-P_0) P (I-P_0) which is suitable: PCMG or PCComposite? It seems to me that PCCompo

[petsc-users] PCGASMSetLocalSubdomains

2012-05-10 Thread Hui Zhang
Hi Dmitry, is there any news about PCGASM? thanks, Hui On Feb 20, 2012, at 6:38 PM, Dmitry Karpeev wrote: > Okay, thanks. > I'll take a look. > > Dmitry. > > On Mon, Feb 20, 2012 at 11:30 AM, Hui Zhang > wrote: > For reference, my results are attached. > &

[petsc-users] error of AODestroy and ISLocalToGlobalMappingDestroy

2012-03-02 Thread Hui Zhang
> Hi, > > I got errors on a linux cluster from AODestroy and > ISLocalToGlobalMappingDestroy with > the petsc-dev hg version 882fc279ddfaa44915c56a5b227514ada881775d. And if I > run the > following test program with number of processes > 3, it hangs on. The linux > is using mpich2. > > #incl

[petsc-users] error of AODestroy and ISLocalToGlobalMappingDestroy

2012-03-02 Thread Hui Zhang
Hi, I got errors on a linux cluster from AODestroy and ISLocalToGlobalMappingDestroy with the petsc-dev hg version 882fc279ddfaa44915c56a5b227514ada881775d. And if I run the following test program with number of processes > 3, it hangs on. The linux is using mpich2. #include char help[]= "te

[petsc-users] how to pass complex scalar in command line

2012-02-23 Thread Hui Zhang
Ah.. thank you! I read it before but I forgot. On Feb 23, 2012, at 10:36 AM, Jose E. Roman wrote: > > El 23/02/2012, a las 10:31, Hui Zhang escribi?: > >> I know PetscOptionsGetScalar(), but do not know how to write the complex >> number >> in command line. I trie

[petsc-users] how to pass complex scalar in command line

2012-02-23 Thread Hui Zhang
I know PetscOptionsGetScalar(), but do not know how to write the complex number in command line. I tried to write it in some forms but all did not work. Say, the options is -acomplex. I tried -acomplex 1.0+1.0i, or -acomplex 1.0+1.0*i, or -acomplex 1.0+1.0*I ... no one works. thank you, Hui

[petsc-users] PCGASMSetLocalSubdomains

2012-02-20 Thread Hui Zhang
wrote: > > > On Mon, Feb 20, 2012 at 12:59 AM, Hui Zhang > wrote: > > On Feb 20, 2012, at 12:41 AM, Dmitry Karpeev wrote: > >> >> >> On Sun, Feb 19, 2012 at 3:08 PM, Hui Zhang >> wrote: >> I have a new problem: the results from ASM

[petsc-users] PCGASMSetLocalSubdomains

2012-02-20 Thread Hui Zhang
two runs. Then, do a replacement for ASM->GASM, make and run again like before. I saw different results from two runs. thank you, Hui On Feb 20, 2012, at 3:06 PM, Dmitry Karpeev wrote: > > > On Mon, Feb 20, 2012 at 12:59 AM, Hui Zhang > wrote: > > On Feb 20, 2012

  1   2   >