On 15 Apr 2016, at 11:08, Tomasz Salwa [RPG] <mmtjs@leeds.ac.uk> wrote:
Dear Firedrakers,
As an intermediate part of fluid-structure interaction problem, I would like to solve Laplace equation (with zero Neumann boundary conditions) on a subdomain of the full domain. For that reason I define the step function that is 1 in the subdomain of interest and 0 elsewhere. Multiplying LHS of the weak form (with trial function) by the step function causes a solver error. How can I correct it? Code and error listing are below.
The problem is that you've knocked out a part of your operator so that it's: laplace 0 0 0 Particularly, it's zero on the diagonal outside the subdomain. To correct this, you'll need to define your own custom boundary condition class that inherits from DirichletBC that identifies the nodes that are outside the subdomain and impose strong conditions there. I think we discussed this when you visited imperial a while ago. That way you'll end up with: laplace 0 0 I with the identity on the diagonal outside the subdomain instead. As to your comment (how to write 0*v*dx more succinctly) use: L = Constant(0)*v*dx Thanks, Lawrence