[petsc-users] DMPlex. Apply Dirichlet boundary condition

2018-10-16 Thread Josh L
Hi, My problem has an irregular domain and for the nodes I have to apply boundary condition, I only know their node number in nature ordering. How do I apply BC(zero out the corresponding entries in global Vec and Mat) after DMPlexDistribute when it is all in global ordering? If using DMLabel,

Re: [petsc-users] Increasing norm with finer mesh

2018-10-16 Thread Fande Kong
Use -ksp_view to confirm the options are actually set. Fande Sent from my iPhone > On Oct 16, 2018, at 7:40 PM, Ellen M. Price > wrote: > > Maybe a stupid suggestion, but sometimes I forget to call the > *SetFromOptions function on my object, and then get confused when > changing the

Re: [petsc-users] Increasing norm with finer mesh

2018-10-16 Thread Ellen M. Price
Maybe a stupid suggestion, but sometimes I forget to call the *SetFromOptions function on my object, and then get confused when changing the options has no effect. Just a thought from a fellow grad student. Ellen On 10/16/2018 09:36 PM, Matthew Knepley wrote: > On Tue, Oct 16, 2018 at 9:14 PM

Re: [petsc-users] Increasing norm with finer mesh

2018-10-16 Thread Matthew Knepley
On Tue, Oct 16, 2018 at 9:14 PM Weizhuo Wang wrote: > I just tried both, neither of them make a difference. I got exactly the > same curve with either combination. > I have a hard time believing you. If you make the residual tolerance much finer, your error will definitely change. I run tests

Re: [petsc-users] Increasing norm with finer mesh

2018-10-16 Thread Dave May
On Wed, 17 Oct 2018 at 03:15, Weizhuo Wang wrote: > I just tried both, neither of them make a difference. I got exactly the > same curve with either combination. > Try using right preconditioning. https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/KSPSetPCSide.html Use the

Re: [petsc-users] Increasing norm with finer mesh

2018-10-16 Thread Weizhuo Wang
I just tried both, neither of them make a difference. I got exactly the same curve with either combination. Thanks! Wang weizhuo On Tue, Oct 16, 2018 at 8:06 PM Matthew Knepley wrote: > On Tue, Oct 16, 2018 at 7:26 PM Weizhuo Wang > wrote: > >> Hello again! >> >> After some tweaking the code

Re: [petsc-users] Increasing norm with finer mesh

2018-10-16 Thread Matthew Knepley
On Tue, Oct 16, 2018 at 7:26 PM Weizhuo Wang wrote: > Hello again! > > After some tweaking the code is giving right answers now. However it start > to disagree with MATLAB results ('traditional' way using matrix inverse) > when the grid is larger than 100*100. My PhD advisor and I suspects that

Re: [petsc-users] Increasing norm with finer mesh

2018-10-16 Thread Weizhuo Wang
Hello again! After some tweaking the code is giving right answers now. However it start to disagree with MATLAB results ('traditional' way using matrix inverse) when the grid is larger than 100*100. My PhD advisor and I suspects that the default dimension of the Krylov subspace is 100 in the test

Re: [petsc-users] Gauss quadrature for triangle or tetrahedral element and Nature ordering

2018-10-16 Thread Matthew Knepley
On Tue, Oct 16, 2018 at 12:31 PM Josh L wrote: > Hi, > > Does anyone use PETSc to calculate the value determinant, basis function > and the derivative of basis function at Gauss integration point? > > For quadrilateral element, I use PetscDTGaussQuadrature to get the > location of integration

[petsc-users] Gauss quadrature for triangle or tetrahedral element and Nature ordering

2018-10-16 Thread Josh L
Hi, Does anyone use PETSc to calculate the value determinant, basis function and the derivative of basis function at Gauss integration point? For quadrilateral element, I use PetscDTGaussQuadrature to get the location of integration point, and then use DMPlexComputeCellGeometryFEM to get the

Re: [petsc-users] Fwd: Interpolation in staggered grid

2018-10-16 Thread Matthew Knepley
On Tue, Oct 16, 2018 at 3:57 AM Anton Popov wrote: > Hi Manuel, > > you might consider useful taking a look at this code > https://bitbucket.org/bkaus/lamem, which is a multi-DMDA staggered grid > implementation. > > Also, as Matt pointed out, there is a direct PETSc support for staggered >

Re: [petsc-users] Fwd: Interpolation in staggered grid

2018-10-16 Thread Anton Popov
Hi Manuel, you might consider useful taking a look at this code https://bitbucket.org/bkaus/lamem, which is a multi-DMDA staggered grid implementation. Also, as Matt pointed out, there is a direct PETSc support for staggered grids (DMSTAG), recently contributed by Patrick Sanan. Thanks,