pyclaw
pyclaw copied to clipboard
Add function space class.
The functionSpace class sits between State and Patch. A function space lives on a patch but also has a number of DOFs. It is intended to match the PETSc DMDA abstraction. This will allow us to reduce the number of DA's and Vecs we use, by reusing DA's from the main State object in the _register objects in SharpClaw.
It is also anticipated that this abstraction will be useful when implementing DG finite element methods.
@jedbrown please take a look and let me know if this is what you had in mind. I think there are still some improvements to be made in terms of not creating so many local vectors.
I am a bit confused now as to how this abstraction plays with the State
object. I figured that the FunctionSpace
object would always be present in a State
object rather than only being present in the PETSc version of the State
. It's more overhead I guess but it seems cleaner to me.
I figured that the FunctionSpace object would always be present in a State object rather than only being present in the PETSc version of the State.
That's right. Did you see https://github.com/clawpack/pyclaw/pull/477/files#diff-f5c0f62513f67848fc9cc6eb2b3f8446R10 ?
I'm doing more work on this, so don't bother spending much time on reviewing it until I've pushed more.
Ah, I see, I was confused by the variable naming.
Coverage increased (+0.24%) when pulling 93a8fdfa15a4afd517bc18db81eebb737c7e2e60 on ketch:function_space into 011422a2483581bbb9d0245e67a13b5cda142900 on clawpack:master.
Okay, it's much improved now and the tests are passing. I still feel like all this code is not as elegant as it could be. But I can't put my finger on how to improve it at the moment.