### Algebraic Boundary Constraints?

37

views

0

I have two PDEs that I would like to couple via an algebraic constraint on some set of nodes (the example below uses the boundary).

In this example, I am Poisson for two variables, s0 and s1 and I would like to set s1 = transform(s0) on the boundary. Thoughts?

In this example, I am Poisson for two variables, s0 and s1 and I would like to set s1 = transform(s0) on the boundary. Thoughts?

```
#!/bin/env python
from fenics import *
def transform(f):
return 20*f
def boundary(x):
return x[0] < DOLFIN_EPS or x[0] > 1.0 - DOLFIN_EPS
# Mesh and Space
mesh = UnitSquareMesh(32, 32)
scalar_fem = FiniteElement('Lagrange',mesh.ufl_cell(),1)
mixed_fem = MixedElement([scalar_fem,scalar_fem])
MixedSpace = FunctionSpace(mesh,mixed_fem)
(space0,space1) = MixedSpace.split()
(test0,test1) = TestFunctions(MixedSpace)
soln = Function(MixedSpace)
(s0,s1) = split(soln)
pde0=dot(grad(test0),grad(s0)) * dx
pde1=dot(grad(test1),grad(s1)) * dx
f0 = Expression('x[0]+x[1]', degree=1)
rhs = f0*test0*dx
# HELP: Want to constrain s1 = transform(s0) on boundary
solve(pde0+pde1-rhs==0,soln)
```

Community: FEniCS Project

### 1 Answer

1

I guess you would need to use a weak imposition of this constraint using Nitsche's method for instance
That works. I was hoping for something that is a little less of a kludge.

written
23 days ago by
csiefer

Please login to add an answer/comment or follow this question.