[petsc-users] Unable to extract submatrix from DMComposite Mat if block size 1

2015-02-25 Thread Lawrence Mitchell
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, I have multi-field operators that have the same layout as given by the matrices created by DMComposite and would like to be able to switch between a MatNest representation (if I'm using fieldsplit PCs) or AIJ (if not). This works fine if the

Re: [petsc-users] DMNetworkGetEdgeRange() in parallel

2015-02-25 Thread Miguel Angel Salazar de Troya
I modified the DMNetwork example to include the new DM with the modified section. It has the same problems. Please find attached the code to this email. Thanks On Tue, Feb 24, 2015 at 6:49 PM, Matthew Knepley knep...@gmail.com wrote: On Tue, Feb 24, 2015 at 6:42 PM, Miguel Angel Salazar de

Re: [petsc-users] DMNetworkGetEdgeRange() in parallel

2015-02-25 Thread Matthew Knepley
On Wed, Feb 25, 2015 at 9:59 AM, Abhyankar, Shrirang G. abhy...@mcs.anl.gov wrote: Miguel, I'm a bit tied up today. I'll try to debug this issue tomorrow and get back to you. The problem is the way that DMNetwork is using the default section. When DMCreateGlobalVec() is called, it uses

Re: [petsc-users] DMNetworkGetEdgeRange() in parallel

2015-02-25 Thread Abhyankar, Shrirang G.
Miguel, I'm a bit tied up today. I'll try to debug this issue tomorrow and get back to you. Thanks, Shri From: Miguel Angel Salazar de Troya salazardetr...@gmail.commailto:salazardetr...@gmail.com Date: Wed, 25 Feb 2015 08:48:10 -0600 To: Matthew Knepley

Re: [petsc-users] MatMPIAIJSetPreallocation: nnz cannot be greater than row length

2015-02-25 Thread David Knezevic
Hi Dmitry, Thanks so much, that's great! I've updated the pull request now to include your patch: https://github.com/dknez/libmesh/commit/247cc12f7536a5f848fd5c63765d97af307d9fa7 We can update the code later, once MatReset() is available in PETSc. Regarding the convergence issues: I think the

Re: [petsc-users] Solving multiple linear systems with similar matrix sequentially

2015-02-25 Thread Mark Adams
The RAP is often more than 50% of PCSetUp, so this might not save much. Hee,hee in some of my recent runs of GAMG the RAP was less than 25% of the time. Thus skipping the other portions could really pay off.* This percentage is very problem dependant. 3D elasticity is higher, 2D

Re: [petsc-users] DMNetworkGetEdgeRange() in parallel

2015-02-25 Thread Abhyankar, Shrirang G.
Matt, Thanks for debugging. I'll try to fix this tomorrow. Shri From: Matthew Knepley knep...@gmail.commailto:knep...@gmail.com Date: Wed, 25 Feb 2015 10:12:43 -0600 To: Shri abhy...@mcs.anl.govmailto:abhy...@mcs.anl.gov Cc: Miguel Angel Salazar de Troya

Re: [petsc-users] DMNetworkGetEdgeRange() in parallel

2015-02-25 Thread Miguel Angel Salazar de Troya
Now it works, thanks a lot! Miguel On Wed, Feb 25, 2015 at 10:12 AM, Matthew Knepley knep...@gmail.com wrote: On Wed, Feb 25, 2015 at 9:59 AM, Abhyankar, Shrirang G. abhy...@mcs.anl.gov wrote: Miguel, I'm a bit tied up today. I'll try to debug this issue tomorrow and get back to you.

[petsc-users] about MATSOR

2015-02-25 Thread Sun, Hui
I want to do 3 steps of gauss seidel from a Mat A to another Mat B. Is there a way to do this? I mean, what I can think of is to get the column vectors of B by ierr = MatGetColumnVector(B,v,col);CHKERRQ(ierr); and apply Gauss seidel from A to v: ierr = MatSOR(A, v, 1,

Re: [petsc-users] about MATSOR

2015-02-25 Thread Barry Smith
Let me try to understand what you wish to do. You have a sequential matrix A and a matrix B and you wish to compute the (dense) matrix C where each column of C is obtained by running three iterations of SOR (using the matrix A) with the corresponding column of B as the right hand side for

Re: [petsc-users] Memory leak in PetscRandom?

2015-02-25 Thread Barry Smith
Thanks for the report. I ran the example with those options under Linux with valgrind and found no memory leaks, I cannot run valgrind on my Mac. I suspect the issue is related to some internal library memory problems on the Apple and is not in the PETSc library or that example. Barry

Re: [petsc-users] about MATSOR

2015-02-25 Thread Sun, Hui
Thank you, Barry. In fact, my matrix B is sparse. Is it possible to drop the terms less than a certain threshold from C, so that C can be sparse? Another question, there are pc_sor_its and pc_sor_lits in MatSOR. What is local its? Best, Hui From:

Re: [petsc-users] about MATSOR

2015-02-25 Thread Barry Smith
On Feb 25, 2015, at 3:02 PM, Sun, Hui hus...@ucsd.edu wrote: Thank you, Barry. In fact, my matrix B is sparse. Is it possible to drop the terms less than a certain threshold from C, so that C can be sparse? You can do that but it becomes much more complicated and expensive, especially

Re: [petsc-users] Memory leak in PetscRandom?

2015-02-25 Thread Jed Brown
Barry Smith bsm...@mcs.anl.gov writes: Thanks for the report. I ran the example with those options under Linux with valgrind and found no memory leaks, I cannot run valgrind on my Mac. When are you going to get a real operating system? In the mean time, several people have reported

Re: [petsc-users] Memory leak in PetscRandom?

2015-02-25 Thread Matthew Knepley
On Wed, Feb 25, 2015 at 4:09 PM, Jed Brown j...@jedbrown.org wrote: Barry Smith bsm...@mcs.anl.gov writes: Thanks for the report. I ran the example with those options under Linux with valgrind and found no memory leaks, I cannot run valgrind on my Mac. When are you going to get

Re: [petsc-users] Memory leak in PetscRandom?

2015-02-25 Thread Jed Brown
Matthew Knepley knep...@gmail.com writes: It works for me. I can't wait for Jed's suffering when a kid wants to watch PBS Kids on his custom Debian build. Touché, but in fact, PBS Kids plays great on my Linux box. signature.asc Description: PGP signature

Re: [petsc-users] about MATSOR

2015-02-25 Thread Sun, Hui
Thank you Barry. It is a step in forming my PC matrix for the schur complement. I think I will try something else. Best, Hui From: Barry Smith [bsm...@mcs.anl.gov] Sent: Wednesday, February 25, 2015 1:12 PM To: Sun, Hui Cc: petsc-users@mcs.anl.gov

Re: [petsc-users] about MATSOR

2015-02-25 Thread Sun, Hui
By the way, how do you add up two matrices? Assume A and B are of same size, both sparse and of type Matmpi. I want to perform this operation: C=A+B. What should I do? I haven't found anything related in the user manual. Best, Hui From: Sun, Hui

Re: [petsc-users] about MATSOR

2015-02-25 Thread Matthew Knepley
On Wed, Feb 25, 2015 at 6:36 PM, Sun, Hui hus...@ucsd.edu wrote: By the way, how do you add up two matrices? Assume A and B are of same size, both sparse and of type Matmpi. I want to perform this operation: C=A+B. What should I do? I haven't found anything related in the user manual.

Re: [petsc-users] Memory leak in PetscRandom?

2015-02-25 Thread Barry Smith
On Feb 25, 2015, at 4:09 PM, Jed Brown j...@jedbrown.org wrote: Barry Smith bsm...@mcs.anl.gov writes: Thanks for the report. I ran the example with those options under Linux with valgrind and found no memory leaks, I cannot run valgrind on my Mac. When are you going to get a

Re: [petsc-users] about MATSOR

2015-02-25 Thread Sun, Hui
Thank you Matt. Hui From: Matthew Knepley [knep...@gmail.com] Sent: Wednesday, February 25, 2015 5:00 PM To: Sun, Hui Cc: Barry Smith; petsc-users@mcs.anl.gov Subject: Re: [petsc-users] about MATSOR On Wed, Feb 25, 2015 at 6:36 PM, Sun, Hui