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? Best regards, 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 10:26:31 À : firedrake@imperial.ac.uk Objet : Re: [firedrake] use of BCs for interior nodes Dear Floriane, On 25/04/16 10:15, Floriane Gidel [RPG] wrote:
Dear all,
Do you have any tips concerning the two questions below ? Thank you and best regards,
I don't have an idea as to why in the CG2 case you don't get identical values everywhere. Although I note that you are solving an equation so you can't expect to get a solution that is closer than the solver tolerance (by default 1e-8) in the general case. As to transferring values from the top surface to the bottom. You can do that like so: 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] This will only work on extruded meshes (since there there is an easy identification of the "top" and "bottom" of the domain). Cheers, Lawrence