-
Notifications
You must be signed in to change notification settings - Fork 104
Fix Field3D::setBoundaryTo for FCI methods #3030
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
Conversation
Without this fix, boundary conditions set on yup/down fields are not applied when a boundary is copied from one field to another.
src/field/field3d.cxx
Outdated
| // Interpolate midpoint value in f3d | ||
| const BoutReal val = pnt.interpolate_sheath_o1(f3d); | ||
| // Set the same boundary value in this field | ||
| pnt.dirichlet_o2(*this, val); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should either take o2 twice, or o1 twice:
| pnt.dirichlet_o2(*this, val); | |
| pnt.dirichlet_o1(*this, val); |
I think o1 should be sufficient, as f3d and *this should be close. But I am not sure what is more stable ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The FA code also uses first order, so I have pushed a fixed based on that ...
src/field/field3d.cxx
Outdated
| pnt.dirichlet_o2(*this, val); | ||
| } | ||
| } | ||
| return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For hermes that might work, but should we not also copy the x-boundary conditions with FCI?
| return; |
|
@bendudson Are you ok with these changes? |
|
I just noticed #2962 is also open - is the other still needed with this one? |
bendudson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @dschwoerer ! The changes look good to me.
I think #2962 is not needed once this is merged.
Without this fix, boundary conditions set on yup/down fields are not applied when a boundary is copied from one field to another.
@dschwoerer This is needed in Hermes-3 with FCI so that this line correctly applies the sheath boundary conditions to the density field:
https://github.com/bendudson/hermes-3/blob/master/src/evolve_density.cxx#L217