-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
projecting with inhomogeneous boundary conditions #43
Comments
Interesting. A few things go wrong here and I don't think these things are very well documented.
The reason your code fails is, like you suggest, that one cannot project to a Dirichlet space with inhomogeneous boundary conditions. I think I could make that work quite easily, but I guess it has not come up until now because it has always been a better idea to project to the regular, non-restricted, spaces, since boundary conditions are not required for a projection. |
Ah, that makes so much sense. I am sorry for not figuring this out myself but what you say is very clear. I don't think there is anything for you to change, it's more like the user, me, needing to be clearer as to what I want to do. The P0 space is for my streamfunction and I was foolishly using this to build my space for the velocity, but even though the streamfunction has fixed Dirichlet boundary conditions, the velocity does not have the same. They do inherhet no-normal flow but that will come automatically from the streamfunction. Also, thanks for pointing out how to impose boundary conditions more generally, that will come in handy. I am happy to say that following your help, I do get that part of it running. Now to get this working with the time stepping. Cheers! |
I am having an odd problem and not sure what to make of it. Below is a samle code that produces the error, albeit in a round about way. The essence of it is that if I define qk as before to be the div and gradient, then afterwards I cannot compute qk to be the forward transform of qk. I realize this might be a bit odd but I wonder what's going on here? If I redefine qk then it seems to work but this seems less than idea and wonder what I am not understanding here. `# sample code
` |
qk is no longer a Function and cannot be used in the last forward call. qk is now an Expr instance. That's just the way regular Python assignments work. |
Thanks. I didn't realize that div(grad) was an expression and not a function. Now I know, and hopefully I won't forget anytime soon. |
I am trying to compute the gradient of a function in a polynomial by Fourier space. It seems that if I sent the Dirichlet boundary conditions to be zero then I can do the projection easy enough, as is shown below. However, if I pick non-homogeneous boundary conditions I get an error.
Is there a way of doing this projection with inhomogeneous boundary conditions or should I instead do a decomposition into a line and a function that does have zero boundary conditions?
`#error
`
The text was updated successfully, but these errors were encountered: