Re: [petsc-users] How can I do matrix addition with different nonzeros patterns correctly?

2017-03-03 Thread Fangbo Wang
I am doing analysis on wave propagation through a linear solid media using finite element method. The PDE from the system can be discretized to a system of linear equations. Newmark method is used to solve this problem with changing waves along time. Here, the A, B, C, D mean stiffness matrix,

Re: [petsc-users] Problems imposing boundary conditions

2017-03-03 Thread Maximilian Hartig
Yes Sander, your assessment is correct. I use DMPlex and specify the BC using DMLabel. I do however get this error also when running in serial. Thanks, Max > On 3 Mar 2017, at 22:14, Matthew Knepley wrote: > > On Fri, Mar 3, 2017 at 12:56 PM, Sander Arens

Re: [petsc-users] How can I do matrix addition with different nonzeros patterns correctly?

2017-03-03 Thread Barry Smith
> On Mar 3, 2017, at 3:31 PM, Fangbo Wang wrote: > > Hi, > > I am a little bit confused on how to appropriately do matrix addition with > different nonzeros patterns. > > Suppose I want to do D=2*A+3*B+4*C, A, B and C all have different nonzero > patterns. > I know I

[petsc-users] How can I do matrix addition with different nonzeros patterns correctly?

2017-03-03 Thread Fangbo Wang
Hi, I am a little bit confused on how to appropriately do matrix addition with different nonzeros patterns. Suppose I want to do D=2*A+3*B+4*C, A, B and C all have different nonzero patterns. I know I can use MatDuplicate, MatCopy, MatConvert to create a matrix D, which way is the right way?

Re: [petsc-users] Problems imposing boundary conditions

2017-03-03 Thread Matthew Knepley
On Fri, Mar 3, 2017 at 12:56 PM, Sander Arens wrote: > Max, > > I'm assuming you use DMPlex for your mesh? If so, did you only specify the > faces in the DMLabel (and not vertices or edges). Do you get this error > only in parallel? > > If so, I can confirm this bug. I

Re: [petsc-users] Problems imposing boundary conditions

2017-03-03 Thread Sander Arens
Max, I'm assuming you use DMPlex for your mesh? If so, did you only specify the faces in the DMLabel (and not vertices or edges). Do you get this error only in parallel? If so, I can confirm this bug. I submitted a pull request for this yesterday. On 3 March 2017 at 18:43, Lukas van de Wiel

Re: [petsc-users] Problems imposing boundary conditions

2017-03-03 Thread Lukas van de Wiel
You have apparently preallocated the non-zeroes of you matrix, and the room was insufficient to accommodate all your equations. What happened after you tried: MatSetOption(A, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE) Cheers Lukas On Fri, Mar 3, 2017 at 6:37 PM, Maximilian Hartig

[petsc-users] Problems imposing boundary conditions

2017-03-03 Thread Maximilian Hartig
Hello, I am working on a transient structural FEM code with PETSc. I managed to create a slow but functioning program with the use of petscFE and a TS solver. The code runs fine until I try to restrict movement in all three spatial directions for one face. I then get the error which is