Ok, thanks. So I assume there is no way to solve the equation with implicit BCs ? Floriane ________________________________________ De : firedrake-bounces@imperial.ac.uk <firedrake-bounces@imperial.ac.uk> de la part de Lawrence Mitchell <lawrence.mitchell@imperial.ac.uk> Envoyé : lundi 25 avril 2016 11:09:14 À : firedrake@imperial.ac.uk Objet : Re: [firedrake] use of BCs for interior nodes On 25/04/16 11:04, Floriane Gidel [RPG] wrote:
Dear Lawrence,
Thank you for your answer. Do you think we can use this tip while solving an equation for f ? I mean, we solve an equation for f which updates only its top surface values, and we need the bottom values to be updated at the same time (with the same values as the top surface), because other equations must be solved simultaneously, using the top and bottom values of f. So basically my question is: if I use what you suggest:
f = Function(V)
# The nodes topologically at the bottom of the domain: bottom = V.bottom_nodes() # Sim at the top top = V.top_nodes() # Copy from top nodes into bottom nodes f.dat.data_with_halos[bottom] = f.dat.data_with_halos[top]
and then define boundary conditions:
bc_top = DirichletBC(V ,f, 'top') bc_bottom = DirichletBC(V, f, 'bottom')
to solve : solve(f_equation==0, f, bcs=[bc_top,bc_bottom])
will it update and apply the boundary conditions while f is updated, or will it use the previous values of f as boundary conditions?
It will use the previous boundary values. In fact, it's somewhat worse than this. The boundary lifting operator we use assumes that the boundary conditions are explicit to the equation you're solving. Here you have implicit boundary conditions and so we're mathematically doing the wrong thing, so I would not expect this to work at all! Cheers, Lawrence