This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

imposing boundary conditions on test functions

0 votes

Is there any chance to impose homogeneous dirichlet boundary conditions on test functions?

I know that fenics will automatically select these conditions if the solution is 0 on the boundary. However, my solution has non-homogeneous boundary conditions, but the formulation of my problem forces to satisfy a variational problems with test functions with the value 0 on the boundary.

I appreciate any help. thanks.

asked Mar 10, 2016 by merinopm FEniCS Novice (370 points)

1 Answer

0 votes

I may have misunderstood your question, but any Dirichlet condition (zero or some other number) will cause the test function to be zero at the boundary. This is because the row in the matrix corresponding to the test function is overwritten by an identity row (all zeros except for 1 on the diagonal) and then the Dirichlet value is put in the corresponding location in the right hand side vector. So, the treatment of the matrix is the same no matter what value you enter for the Dirichlet BC.

It helps to write down the method in terms of the matrices generated and realize that the TrialFunction corresponds to the columns while the TestFunction corresponds to the rows.

answered Mar 10, 2016 by Tormod Landet FEniCS User (5,130 points)
...