Hello. I would like to know if you can tell Firedrake to run the assembly over part of a mesh. For example, suppose I have a stiffness matrix (with variable coefficient) defined over a global mesh, but I want to do some domain decomposition where I solve on a sub-domain that may be changing with iteration. I don't want to assemble the entire matrix (then take a sub-matrix) because this can be inefficient. Is there a way to only assemble over a subset of elements, and solve using the corresponding sub-matrix? -Shawn
Dear Shawn, apologies for the slow response.
On 7 May 2019, at 15:32, Shawn W Walker <walker@lsu.edu> wrote:
Hello.
I would like to know if you can tell Firedrake to run the assembly over part of a mesh. For example, suppose I have a stiffness matrix (with variable coefficient) defined over a global mesh, but I want to do some domain decomposition where I solve on a sub-domain that may be changing with iteration. I don’t want to assemble the entire matrix (then take a sub-matrix) because this can be inefficient. Is there a way to only assemble over a subset of elements, and solve using the corresponding sub-matrix?
Right now this is not easily possible: we will always assemble the full thing. Assembly over subdomains is on the roadmap, and hopefully things will start appearing in the next 6 months. Can you describe the type of domain decomposition you want to do in a little more detail. It might be possible to do what you want right now with the PC Patch capability in PETSc. Thanks, Lawrence
Hello Lawrence. I need to have a bit more control over what happens, so I would rather avoid Petsc right now. Is there no assembly over sub-domains at all? I know FEniCS had something. Doesn't Firedrake have a tutorial on a fluid structure problem, where they use a marker function for the different subdomains? Well, I guess there you still assemble the whole thing. If you had this, then I could just redefine my subdomain during each iteration. What I need to be able to do is this: assemble a (coefficient weighted) stiffness matrix over a subdomain, or a subset of elements. I then need to extract the sub-matrix (of the overall matrix) that corresponds to that subset of elements, so that I can do a linear solve. Is there any way to extract a sub-mesh from the mesh, i.e. define a new mesh using only that subset of elements? If so, then I could probably hack it that way. -Shawn -----Original Message----- From: Lawrence Mitchell [mailto:wence@gmx.li] Sent: Friday, May 10, 2019 8:58 AM To: Shawn W Walker <walker@lsu.edu> Cc: firedrake <firedrake@imperial.ac.uk> Subject: Re: [firedrake] sub-matrix assembly Dear Shawn, apologies for the slow response.
On 7 May 2019, at 15:32, Shawn W Walker <walker@lsu.edu> wrote:
Hello.
I would like to know if you can tell Firedrake to run the assembly over part of a mesh. For example, suppose I have a stiffness matrix (with variable coefficient) defined over a global mesh, but I want to do some domain decomposition where I solve on a sub-domain that may be changing with iteration. I don’t want to assemble the entire matrix (then take a sub-matrix) because this can be inefficient. Is there a way to only assemble over a subset of elements, and solve using the corresponding sub-matrix?
Right now this is not easily possible: we will always assemble the full thing. Assembly over subdomains is on the roadmap, and hopefully things will start appearing in the next 6 months. Can you describe the type of domain decomposition you want to do in a little more detail. It might be possible to do what you want right now with the PC Patch capability in PETSc. Thanks, Lawrence
Hi Shawn,
On 10 May 2019, at 15:20, Shawn W Walker <walker@lsu.edu> wrote:
Hello Lawrence.
I need to have a bit more control over what happens, so I would rather avoid Petsc right now.
Is there no assembly over sub-domains at all? I know FEniCS had something. Doesn't Firedrake have a tutorial on a fluid structure problem, where they use a marker function for the different subdomains? Well, I guess there you still assemble the whole thing.
Yes, we use indicator functions to fake it right now.
If you had this, then I could just redefine my subdomain during each iteration.
What I need to be able to do is this: assemble a (coefficient weighted) stiffness matrix over a subdomain, or a subset of elements. I then need to extract the sub-matrix (of the overall matrix) that corresponds to that subset of elements, so that I can do a linear solve.
If you assemble the global matrix, you can extract the subset Dirichlet matricese as long as you can provide index sets that address the dofs. If you know which elements then numpy.unique(V.cell_node_map().values[elements, :]) is the local indices and you can do something like MatGetSubMatrices with some appropriate arguments. It's a little fiddly.
Is there any way to extract a sub-mesh from the mesh, i.e. define a new mesh using only that subset of elements? If so, then I could probably hack it that way.
At a very low level you can use DMPlexFilter on the `mesh._plex` object. If all works you can then make a new mesh out of the resulting DM with Mesh(dm). I do not know how easy this is. Lawrence
participants (2)
- 
                
                Lawrence Mitchell
- 
                
                Shawn W Walker