-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add a FDM partial operator with Dirichlet boundary conditions #200
Comments
Are you sure you mean "Dirichlet boundary conditions"? (i.e. the value of the derivative at the boundary is known). When we discussed this I thought you were talking about adding an extrapolation condition, e.g. ConstantExtrapolation to allow the derivative to be calculated from approximations of the function outside the domain? |
I think I mean Dirichlet boundary conditions, i.e. the value of the function at the boundary is known. When the value of the derivative is known we call this Neumann boundary condition (see BC examples). However, numerically the Dirichlet BC is often taken to be outside of the domain instead of in the last mesh point. This is what is called in gyselalib extrapolation rules, which are very specific to splines because they are used to interpolate. For FDM (of order 2) we only need one point outside of the domain of derivation, whose value we call Dirichlet BC. The boundary condition are however not part of the FDM operator but of the function. For instance : We have a physics problem where the heat equation has to be solved on a grid |
Suppose we want to find For me a Dirichlet boundary condition on the solution would be: An extrapolation operator would be The discretised laplacian does not contain the boundary condition, it works in the same way at all points |
Okay, let's take a step back. I have a parabolic PDE (technically it is not uniformly parabolic, because the coefficients are evolving in time, but it does not change my point) of the form Little mathematical parenthesis here to explain why the boundary condition will not come into play in the second equation, namely With this, I think I have everything for my problem. I want to implement a "partial derivative" operator that I will use to evaluate
Here is the tricky point. In the case of this operator,
The only time in the code I am seeing boundary conditions are for splines, and they are used to know what should the spline looks like near the boundary. The only time I'm seeing extrapolation conditions is to precise what we should take for the value of an interpolation when we are outside of the interpolation domain. And when I search in the code base for boundary condition I very often see things like that:
Just for you to know, mathematically speaking the first one is called a Dirichlet boundary condition and the second one is called an Neumann boundary condition. To conclude (otherwise I can continue to write indefinitely...) I think the main problem is that we try to use the same code object for different mathematical objects.
What I want to implement is the possibility to call the operator I hope this is clear enough ! And thank's for the reading... 😄 |
I understand Matthieu's point. In the future, we may use approaches beyond just semi-Lagrangian methods, so we need an infrastructure that can pass boundary conditions (BCs) in any form to the discretization scheme—whether it's FEM (Finite Element Method), FD (Finite Difference), or BSL (backward Semi-Lagrangian). From my experience in other projects, boundary information is often already encoded in the meshing file. For example: In 2D, an edge between two nodes may need to specify:
This doesn’t directly translate to standard BCs (like Robin or Dirichlet), because the same edge or node could enforce different conditions for different quantities. For instance: "inflow_static_potential" could mean:
Thus, different solvers (for kinetic part or poisson part) may interpret the same edge/node differently. Additionally, each solver might handle BCs in its own way. We might want to look at the codes that we want to couple in the future. Like the FEM code in garchingen, how do they tag the boundary conditions at different positions. |
I am not sure about it. Currently the |
Dirichlet boundary condition are the values of the solution of a PDE which are fixed on the boundary. I agree with Emily that if values outside the domain are used in a discrete operator, on ghost points for a FD stencil for example, they should not be called "boundary condition". For the future naming, I have another suggestion. The boundary condition is a constraint. "Closure condition" would actually only be appropriate, when this constraint leads to a closed system of equations. There are situations where this is not the case, e.g. one can find approximate solution using some norm minimization techniques even when the system of equations is underdetermined. So if we want to stay general, calling them "constraint" would be accurate. If they are exclusively used for interpolation and always lead to a closed system of equations, just calling them "interpolation type" or something like that would be the easiest one to understand. |
We may need to have a centred FDM operator of order two which can handle boundary conditions, starting with Dirichlet ones
The text was updated successfully, but these errors were encountered: