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

Dirichlet boundary conditions which depend on solution

0 votes

Hey there,

How do I implement Dirichlet boundary conditions which are functions of the solution variables.

For example, if my PDE has a solution (u,v) and my B.C. is:

$\begin{equation}
v=u\quad \mathrm{on}\quad \Gamma
\end{equation}$

Then my code would look something like this:

#
v_bc = u
bc_v = DirichletBC(W.sub(1), v_bc, gamma)
#

But this gives me errors like:

[0]PETSC ERROR: Arguments are incompatible!
[0]PETSC ERROR: Local size 10201 not compatible with block size 5!

Any help would be much appreciated!

closed with the note: I realised that the reason why it won't work is because Fenics doesn't support nonlinear dirichlet bcs
asked Dec 10, 2015 by graham.benham FEniCS Novice (270 points)
closed Dec 10, 2015 by graham.benham
...