Adding setTemperatureBC method to HeatTransfer that uses Domain#1551
Open
Adding setTemperatureBC method to HeatTransfer that uses Domain#1551
Conversation
kswartz92
commented
Mar 10, 2026
| }); | ||
| temp_bdr_coef_ = std::make_shared<mfem::FunctionCoefficient>(mfem_coefficient_function); | ||
| auto dof_list = domain.dof_list(&temperature_.space()); | ||
| bcs_.addEssential(dof_list, temp_bdr_coef_, temperature_.space(), 0); |
Contributor
Author
There was a problem hiding this comment.
I originally tried to write this line without providing the std::optional<int> component, but that caused the test to seg fault. If I provide the 0 the test passes, but I don't understand why I need to provide a component for a scalar field. Any ideas @btalamini @tupek2 ?
Collaborator
There was a problem hiding this comment.
I remember seeing this before. I think the path where you dont specify the int is just implemented wrong somewhere down in the depths. We should probably get rid of that option and force the component to always be passed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I was recently using smith::HeatTransfer and was frustrated by the lack of method to set essential bc's (temperature in this case) on a smith::Domain. I added a method to do so, but since the plan is to move away from the monolithic HeatTransfer class in heat_transfer.hpp in the near future, I did not want to break the interface by removing the old method in case others are still using it. I did switch the thermal statics patch test to the new essential bc method to make sure it works as expected.