Are these implicit bc's? they are unknowns but that is something else, isn't? the key issue is not solving these equations but extending a surface 2D function vertically. so if this does not work, then it goes back to the query I had a week or so ago for which you guys said that a hack could work;l i.e.: (i) iiint f(x,y) * h(x,y,z) dx dy dz = iint f(x,y) [int h(x,y,z) dz ] dx dy as that is the alternative. otherwise, we need f(x,y) as on the RHS of the above specified everywhere in the 3D domain. of course, the domain is extruded in the z-direction in regular fashion. (ii) the trick Floriane is now trying is solving d_zz f_3D(x,y,z) = 0 with f_3d is f(x,y) at the top and bottom as part of a larger system of water wave equations. Thanks! ________________________________________ From: firedrake-bounces@imperial.ac.uk <firedrake-bounces@imperial.ac.uk> on behalf of Floriane Gidel [RPG] <mmfg@leeds.ac.uk> Sent: Monday, April 25, 2016 11:21 AM To: firedrake@imperial.ac.uk Subject: Re: [firedrake] use of BCs for interior nodes 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 _______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake