Re: [petsc-users] Question about DMDA BOUNDARY_CONDITION set

2017-04-04 Thread Barry Smith
> On Apr 4, 2017, at 1:24 AM, Wenbo Zhao wrote: > > Barry, > > Thanks. > > It is my fault. I should not mix the VecScatter and MatSetValues. > > 1. Matrix assemble > There are only two options matrix for case with rotation boundary. > The first is using

Re: [petsc-users] Question about DMDA BOUNDARY_CONDITION set

2017-04-04 Thread Wenbo Zhao
Barry, Thanks. It is my fault. I should not mix the VecScatter and MatSetValues. 1. Matrix assemble There are only two options matrix for case with rotation boundary. The first is using "MatSetoption(A,MAT_NEW_NONZERO_LOCATION_ERR,PETSC_FALSE)". The second is to create matrix by hand. Is it

Re: [petsc-users] Question about DMDA BOUNDARY_CONDITION set

2017-04-03 Thread Barry Smith
> On Apr 3, 2017, at 1:10 PM, Wenbo Zhao wrote: > > Barry, > Hi. I am sorry for too late to reply you. > I read the code you send to me which create a VecScatter for ghost points on > rotation boundary. > But I am still not clear to how to use it to assemble the

Re: [petsc-users] Question about DMDA BOUNDARY_CONDITION set

2017-04-03 Thread Wenbo Zhao
Barry, Hi. I am sorry for too late to reply you. I read the code you send to me which create a VecScatter for ghost points on rotation boundary. But I am still not clear to how to use it to assemble the matrix. I studied the example "$SLEPC_DIR/src/eps/examples/tutorials/ex19.c", which is a 3D

Re: [petsc-users] Question about DMDA BOUNDARY_CONDITION set

2017-03-22 Thread Barry Smith
In the git repository branch barry/add-dmda-rotate-boundary-conditions-example I have provided an example that does this. It uses DM_BOUNDARY_GHOSTED to reserve ghost locations along the physical boundaries in the local vector and then creates two VecScatter that fill the appropriate

Re: [petsc-users] Question about DMDA BOUNDARY_CONDITION set

2017-03-21 Thread Matthew Knepley
On Tue, Mar 21, 2017 at 1:46 PM, Wenbo Zhao wrote: > Matt, > > Thanks. > > I want to solve neutron diffusion equations using finite difference method > and PETSc. > This rotation boundary condition is very common in my cases. > Though the mesh consists of ~ 10 Miliion

Re: [petsc-users] Question about DMDA BOUNDARY_CONDITION set

2017-03-21 Thread Wenbo Zhao
Matt, Thanks. I want to solve neutron diffusion equations using finite difference method and PETSc. This rotation boundary condition is very common in my cases. Though the mesh consists of ~ 10 Miliion structured hexahedron cells, the mesh is simple and could be discribed by three vectors about

Re: [petsc-users] Question about DMDA BOUNDARY_CONDITION set

2017-03-20 Thread Matthew Knepley
On Mon, Mar 20, 2017 at 2:39 PM, Wenbo Zhao wrote: > Hi all. > > I have a mesh is like below > > 1 2 3 > 4 5 6 > 7 8 9 > > I use DACreate2d to create mesh partition. > > In my case, I have an rotation boundary condition. The whole mesh is like > below > > 9 8 7

[petsc-users] Question about DMDA BOUNDARY_CONDITION set

2017-03-20 Thread Wenbo Zhao
Hi all. I have a mesh is like below 1 2 3 4 5 6 7 8 9 I use DACreate2d to create mesh partition. In my case, I have an rotation boundary condition. The whole mesh is like below 9 8 7 3 6 9 6 5 4 2 5 8 3 2 1 1 4 7 7 4 1 1 2 3 8 5 2 4 5 6 9 6 3 7 8 9 It means that cell 2