Physical location of basis functions #2354
-
Suppose I have a 2d DG function space with nodal basis. How can I get the global geometric location of the matrix DOFs? In this particular instance, I want to construct a sparse matrix that maps a DG vector to a continuous vector by averaging the overlapping DOFs of adjacent elements. Of course this can be done with FEM projecitons, but for the preconditioning concepts I'm working on I really need it in operator form and as sparse as possible. FWIW this has come up before as well for me; geometric information can be useful in developing preconditioners (which is a lot of what I work on), but it seems very hard to access this information? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 11 replies
-
For any space with a nodal basis, can't you just interpolate the spatial coordinates onto that basis? Something like
Then you can look at |
Beta Was this translation helpful? Give feedback.
-
In case anybody is interested, here is code that constructs sparse scipy CSR matrices to average across DG interfaces in vector form, as well as a projection onto the space of continuous functions in a discrete sense. Note, I have not accounted carefully for BCs here.
|
Beta Was this translation helpful? Give feedback.
-
The matrix action is available via the Projector class.
…________________________________
From: Ben Southworth ***@***.***>
Sent: 17 February 2022 16:44
To: firedrakeproject/firedrake ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [firedrakeproject/firedrake] Getting coordiantes of matrix DOFs (Discussion #2354)
Suppose I have a 2d DG function space with nodal basis. How can I get the global geometric location of the matrix DOFs?
In this particular instance, I want to construct a sparse matrix that maps a DG vector to a continuous vector by averaging the overlapping DOFs of adjacent elements. Of course this can be done with FEM projecitons, but for the preconditioning concepts I'm working on I really need it in operator form and as sparse as possible.
FWIW this has come up before as well for me; geometric information can be useful in developing preconditioners (which is a lot of what I work on), but it seems very hard to access this information?
Thanks!
—
Reply to this email directly, view it on GitHub<#2354>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABOSV4SN77MICFXXR4VW4H3U3UQW7ANCNFSM5OVHM2MA>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
For any space with a nodal basis, can't you just interpolate the spatial coordinates onto that basis? Something like
Then you can look at
xfunc.dat.data
andyfunc.dat.data
to get the coordinates. I don't know how robust that is, but I've done this before with CG spaces and gotten what I needed from it.