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