Dear all, I went back to the problem with one disk because I realized it only converges when initialized with the exact solution (in which case I made a test of convergence that confirmed convergence to the exact solution). When I initialise it with u=0 both in the plane and disk, then the solver diverges (DIVERGED_MAX_IT). My solver is defined as follows: V = V_p*V_d u = Function(V) u_d, u_p = split(u) v_d, v_p = TestFunction(V) a = dot(grad(u_p),grad(v_p))*I_p*dx + dot(grad(u_d),grad(v_d))*I_d*dx + (u_d('+')-u_p('+'))*(v_d('+')-v_p('+'))*4*avg(I_d)*avg(I_p)*dS solve(a==0, u, bcs=[bc_left, bc_right, bc_disk_only, bc_plane_only]) where bc_disk_only and bc_plane_only force nodes of V.sub(0) to be zeros in the plane and nodes of V.sub(1) to be zeros in the disk, respectively, and are defined as in Tomasz fluid/structure code, using continuous indicators I_cg_d and I_cg_p (while I_d and I_p are discontinuous). The solver above only converges when u_d and u_p are initialized with the exact analytical solution, or when I replace I_d and I_p in the first two integrals by their continuous forms I_cg_d and I_cg_p (but then the obtained solution is wrong). This is quite a simple equation so I don't know what I'm doing wrong. Does anyone understand what's wrong ? Many thanks, Floriane ________________________________ De : firedrake-bounces@imperial.ac.uk <firedrake-bounces@imperial.ac.uk> de la part de Ham, David A <david.ham@imperial.ac.uk> Envoyé : lundi 29 octobre 2018 17:26 À : firedrake Objet : Re: [firedrake] local discontinuity Dear Floriane, Any of those will work to define the problem. I suggest the first is the most scalable solution. Failing to converge can happen for many reasons. You might have a bug which makes your problem ill-posed. Or you might have made the system less well-conditioned by introducing aa second disk. Are you using a direct solver? (I would strongly suggest you do, both because it’s probably faster in 2D and because it’s essentially guaranteed to succeed if your problem is well-posed). Regards, David From: <firedrake-bounces@imperial.ac.uk> on behalf of "Floriane Gidel [RPG]" <mmfg@leeds.ac.uk> Reply-To: firedrake <firedrake@imperial.ac.uk> Date: Monday, 29 October 2018 at 17:11 To: firedrake <firedrake@imperial.ac.uk> Subject: Re: [firedrake] local discontinuity Dear all, I'd like to extend the problem, below to k disks (k>=1) in one plane. As a reminder, the objective is to solve the Laplace equation in each disk and in the plane, with a discontinuous condition on the jump at the disks interfaces. The case with k=1 works when I solve a WF on a mixed function space with one component being V_d (disk) and the other one being V_p (plane). The Heaviside indicators I_d and I_p in the disk and in the plane enable integration on the disk/plane interface with 4*avg(I_d)*avg(I_p)*dS. I tried various ways to extend the case k=1 to k>1. For simplification; let's assume k=2 (ie 2 disks); - 1st way: I solve the same problem as in the case k=1, except that now my disk indicator function is nonzero in both disks (same with the BCs). - 2nd way: I define my mixed system as Vd*Vd*Vp (2disks, one plane), with an indicator function for each disk, and one for the plane. - 3rd way: I define my mixed system as Vd*Vp where Vd is a VectorFunctionSpace of dim k, and Vp is of dim 1. The disk indicator functions are defined on a VectorFunctionSpace as well; I have tried the 3 methods and none of them converged. Should one of these methods work or should I solve my problem differently ? Many thanks, Floriane ________________________________ De : firedrake-bounces@imperial.ac.uk <firedrake-bounces@imperial.ac.uk> de la part de Ham, David A <david.ham@imperial.ac.uk> Envoyé : vendredi 5 octobre 2018 15:56 À : firedrake Objet : Re: [firedrake] local discontinuity Dear Floriane, I think you can do this in a manner analogous to the way that Thomasz did fluid-structure interaction. We define a mixed function space with two continuous components: (V_d, V_p). We’re going to use the first component for the solution in the disk and the second component for the solution outside the disk. We further define two DG0 functions I_d and I_p such that I_d is 1 inside the disk and 0 outside, and I_p = 1 – I_d. You can now write the Laplace equation for the two parts using essentially normal Firedrake code except that you multiply the test function by the appropriate indicator function. This ensures that you only actually assemble integral contributions on the correct part of the domain. Now we just need the surface integral over the facets on the edge of the disk. Observe that this is the only place in the domain where both indicator functions are positive. You can write your jump integrals using the *dS measure. You can restrict the intervals to the relevant edges by multiplying the integrand by 4*avg(I_p)*avg(I_d). If W = V_d * V_p and u_d, u_p = TrialFunctions(W) then you can write the jump as: avg(u_d) – avg(u_p) The avg is mathematically unnecessary and does nothing, however in UFL all terminals that appear in dS integrals have to be restricted (you could just as well write u_d(‘+’) – u_p(‘+’)). Finally, when you come to the solve, you need to ensure that all the V_d nodes outside the disk are eliminated, and all the V_p nodes inside the disk too. You do this using the same DirichletBC subclassing trick which is in https://www.firedrakeproject.org/demos/linear_fluid_structure_interaction.py... Linear mixed fluid-structure interaction system ...<https://www.firedrakeproject.org/demos/linear_fluid_structure_interaction.py.html> www.firedrakeproject.org Linear mixed fluid-structure interaction system¶. This tutorial demonstrates the use of subdomain functionality and show how to describe a system consisting of multiple materials in Firedrake. Linear mixed fluid-structure interaction system ...<https://www.firedrakeproject.org/demos/linear_fluid_structure_interaction.py.html> www.firedrakeproject.org Linear mixed fluid-structure interaction system¶. This tutorial demonstrates the use of subdomain functionality and show how to describe a system consisting of multiple materials in Firedrake. I realise that is slightly involved, but it should work and the syntax will be fairly clean once you have done it. Feel free to ask for clarifications. Regards, David From: <firedrake-bounces@imperial.ac.uk> on behalf of "Floriane Gidel [RPG]" <mmfg@leeds.ac.uk> Reply-To: firedrake <firedrake@imperial.ac.uk> Date: Friday, 5 October 2018 at 15:33 To: firedrake <firedrake@imperial.ac.uk> Subject: [firedrake] local discontinuity Dear Firedrakers, I would like to solve equations in a domain made of two subdomains: - a disk, inside which test functions are continuous (Omega_d) - a plane around the disk, in which test functions are continuous (Omega_p) However, I would like the test functions to be discontinuous across the interface Gamma between the disk and the surrounding plane. This is to solve Laplace equation in each domain, augmented by a dynamic boundary condition on the jump between the two domains, that is Delta u = 0 in Omega_d Delta u = 0 in Omega_p partial_t [u] = ... on Gamma, where [u]= u(+)-u(-) is the jump Is there a way to define a functionspace on the full mesh, with continuous basis functions in each subdomain but discontinuous across the interface ? Or is there any better way to solve this kind of system ? Thank you for your help, Floriane