Re: [firedrake] replacing indexed mixed coefficients
I think indexed is what is referred to as a modified terminal. Can you raise this as an issue and I’ll try to work out what we need to do. From: <firedrake-bounces@imperial.ac.uk> on behalf of "Cotter, Colin J" <colin.cotter@imperial.ac.uk> Date: Friday, 23 November 2018 at 09:20 To: firedrake <firedrake@imperial.ac.uk> Subject: [firedrake] replacing indexed mixed coefficients Dear Firedrake, In the Gusto equations rewrite project we are bumping into an issue with replacing components of mixed coefficients/test functions. The setup is that we want to write down a UFL form describing a mixed problem, and extract the subproblem for one of the components. The code that describes this is: from firedrake import * mesh = UnitSquareMesh(10,10) V = FunctionSpace(mesh,"CG",1) W = V * V w1, w2 = TestFunctions(W) u = Function(W) u1, u2 = split(u) F = (u1*w1 + u2*w2)*dx w = TestFunction(V) u0 = Function(V) F1 = replace(F, {w1:0}) F2 = replace(F1, {w2:w}) F3 = replace(F2, {u2,u0}) This does not work because w1 is not a terminal, it is an indexed mixed test function. I think what is happening is that the index is the terminal, but I don't really know what I am talking about. What is the solution to this? We have a workaround but I don't like it very much, which is to describe the equations in the mixed system individually, and then use replace to build the equivalent monolithic coupled system if we want to just apply implicit midpoint to the whole thing, but generating the individual equations from the monolithic coupled system would be much tidier. all the best --Colin
participants (1)
- 
                
                Ham, David A