Re: [petsc-users] gamg failure with petsc-dev

2014-08-06 Thread Mark Adams
Mark, should we provide some more flexible way to label fields? It will be more complicated than the present code and I think packing into interlaced format is faster anyway. I'm thinking this would entail reordering the matrix and inverting this permutation for the fine grid R P. This

Re: [petsc-users] efficiency of parallel convolution

2014-08-06 Thread Barry Smith
It is difficult to understand what you are doing here. What is dim? What is NX and NY? Is the length of inpx and inpw 256*256 ? Are you using a PETSc Mat like AIJ to apply the “fast convolution” or some custom MATSHELL? Is the “fast convolution” the same for each dim, i and j or is it

[petsc-users] (no subject)

2014-08-06 Thread Mark Adams
I am moving my code to have the DM create the matrix and am hitting this error in DMGetLocalToGlobalMapping: if (!dm-ops-getlocaltoglobalmapping) SETERRQ(PetscObjectComm((PetscObject)dm),PETSC_ERR_SUP,DM can not create LocalToGlobalMapping); This happens when I create the matrix like this:

[petsc-users] DMCreateMatrix error with Composite (no getlocaltoglobalmapping)

2014-08-06 Thread Mark Adams
adding a subject ... On Wed, Aug 6, 2014 at 12:00 PM, Mark Adams mfad...@lbl.gov wrote: I am moving my code to have the DM create the matrix and am hitting this error in DMGetLocalToGlobalMapping: if (!dm-ops-getlocaltoglobalmapping)

Re: [petsc-users] DMCreateMatrix error with Composite (no getlocaltoglobalmapping)

2014-08-06 Thread Mark Adams
It looks like DMShellCreate does not set dm-ops-getlocaltoglobalmapping, which is needed for DMCreateMatrix with a composite DM. I do set a global and local vector and a matrix. It looks like I could call DMShellSetLocalToGlobal. Should I be doing this? Seems low level and the kind of thing

Re: [petsc-users] efficiency of parallel convolution

2014-08-06 Thread LikunTan
Hi Barry, Thanks for your email. sorry i did not make it clear. Here is a more detailed one: int dim, i, j; int NDOF=3, NX=5, NY=5; for(dim=0; dimNDOF; dim++) { for(i=0; iNX; i++) { for(j=0; jNY; j++) { //compute inpx Set

Re: [petsc-users] DMCreateMatrix error with Composite (no getlocaltoglobalmapping)

2014-08-06 Thread Mark Adams
Now that I look at DMShellSetLocalToGlobal, I see that it sets the begin/end functions. But these are already set. It looks like DMShell's SetType must set something for dm-ops-getlocaltoglobalmapping for DMShell to be usable to get a matrix from a Composite DM. On Wed, Aug 6, 2014 at 2:34 PM,

[petsc-users] Pointwise max for matrices

2014-08-06 Thread Mathieu MORLIGHEM
Hello, I am trying to implement a Flux Correction Transport method for advection equations (e.g. http://www.mathematik.uni-dortmund.de/~kuzmin/linfct.pdf). One of the steps consists of calculating a matrix D which is such that d_ij = max{ 0 , -k_ij , -kJi } where k_ij are the components of a

Re: [petsc-users] DMCreateMatrix error with Composite (no getlocaltoglobalmapping)

2014-08-06 Thread Mark Adams
Jed, it looks like DM_DA creates its l2gmap in Setup, but DM_Shell does not. This seems to be causing errors when DM_Shell is used in DM_Composit and I make a matrix. I'm thinking I could add this construction to DM_Shell. DM_Shell does not have a Setup method (like DM_DA) but I could create

Re: [petsc-users] DMCreateMatrix error with Composite (no getlocaltoglobalmapping)

2014-08-06 Thread Mark Adams
I see there is a DM_Create_Shell that I can out this in. On Wed, Aug 6, 2014 at 6:31 PM, Mark Adams mfad...@lbl.gov wrote: Jed, it looks like DM_DA creates its l2gmap in Setup, but DM_Shell does not. This seems to be causing errors when DM_Shell is used in DM_Composit and I make a matrix.

Re: [petsc-users] Pointwise max for matrices

2014-08-06 Thread Jed Brown
Mathieu MORLIGHEM mathieu.morlig...@uci.edu writes: Hello, I am trying to implement a Flux Correction Transport method for advection equations (e.g. http://www.mathematik.uni-dortmund.de/~kuzmin/linfct.pdf). One of the steps consists of calculating a matrix D which is such that d_ij =

[petsc-users] Using DMPlex for Darcys law

2014-08-06 Thread Justin Chang
Hi, So in ex62 of SNES it solves the stokes equation with P2-P1 elements. I want to solve the darcy equation with P2-P1 elements in a similar fashion. The difference between stokes and darcy is that in the weak form of darcy, the velocity-velocity term is v*u whereas in stokes it's

[petsc-users] trying to solve a lot of ksp problems quickly

2014-08-06 Thread Francis Poulin
Hello, I am trying to figure out a faster way of doing in petsc4py and thought I would ask to see how this should be done in petsc. If I can figure that out then I think I can figure out how to translate it but I am having issues with the basic algorithm I should be using. I am solving a

Re: [petsc-users] Using DMPlex for Darcys law

2014-08-06 Thread Matthew Knepley
On Wed, Aug 6, 2014 at 5:55 PM, Justin Chang jychan...@gmail.com wrote: Hi, So in ex62 of SNES it solves the stokes equation with P2-P1 elements. I want to solve the darcy equation with P2-P1 elements in a similar fashion. The difference between stokes and darcy is that in the weak form of

Re: [petsc-users] trying to solve a lot of ksp problems quickly

2014-08-06 Thread Matthew Knepley
On Wed, Aug 6, 2014 at 6:50 PM, Francis Poulin fpou...@uwaterloo.ca wrote: Hello, I am trying to figure out a faster way of doing in petsc4py and thought I would ask to see how this should be done in petsc. If I can figure that out then I think I can figure out how to translate it but I am

Re: [petsc-users] trying to solve a lot of ksp problems quickly

2014-08-06 Thread Francis Poulin
Hello Matt, Thanks for the help. I had some some tests in Matlab using the two methods and because I am trying to compute the growth rates of a system that are very small, it seemed to be faster to find the inverse but I will try both and see what works best. Yes, my inexperience let me