1

I need help for understanding the PETSc examples of finite element method with SNES nonlinear solver. Is there any good materials or sources to understand the examples? (I already read PETSc user manual, but there is no information which I need.)

I will make a code which includes rectangular geometry, with PetscFE and DMPlex (for unstructured mesh). The code will treat the heat transfer equation with non-linear heat sources.

I want to select boundary conditions with two dirichlet condition

  1. Upper and lower boundary on the rectangle.
  2. Two neumann condition (right and left boundary on the rectangle).

Example 12 of SNES, user should define:

quadratic_u_2d as exact solution (to improve the convergence of the solution)

f_0 (integrand of test function term (which is related with load vector 'f'))

f_bc_0 (boundary integrand of test function term (which is related with flux 'g')) (I think, this may be boundary condition)

f_1 (integrand of test function gradient term (which is related with u_x[d]))

f_bc_1 (boundary integrand of test function gradient term (it is zero, I think, the term is not defined during weak formation of governing equation))

g3 (integrand of test function gradient and basis function gradient term) (I think that this term is fixed as 1 in any case)

But there is no way to set each boundary condition individually. Please give me some advise for better undertanding.

Thanks for reading my question..

Muhammad Omer Aslam
  • 22,976
  • 9
  • 42
  • 68
서승진
  • 11
  • 1
  • please try to use formatting so that your question is presented is a nice manner which attracts the attention of the concerned users and defines/highlights our points – Muhammad Omer Aslam Jan 15 '18 at 19:42

1 Answers1

0

I use Petsc in fluid flow problems with FVM method and I set the boundary conditions by modifying the matrix A and its corresponding RHS values.

ztdep
  • 343
  • 1
  • 4
  • 17