aspect
aspect copied to clipboard
Avoid string comparisons in spherical constant boundary temperature plugin
The 'spherical constant' boundary temperature and composition plugins currently does a lot of string comparisons when returning the boundary values, so many that they show up when profiling instantaneous models. The gain for the overall model is not huge, but it is a simple change that makes the plugin more similar to the way the box plugins are written already.
I also removed the minimal_composition
and maximal_composition
functions from the boundary composition plugin. I think they were copy-pasted from the temperature plugin, because such functions are not defined in the composition interface, and they are nowhere used.
@jdannberg I know you had looked at these plugins before, can you take a look at this?
can this wait until after 2.3?
This does not need to go into 2.3. I improved the documentation and error checks and fixed the tests. There is some awkward behavior in that several places expect this boundary plugin to work for both boundaries even for a full sphere that only has a single boundary. I restored the current behavior, but it looks a bit weird.
Ping?
This will have to wait until I am back from vacation in 2 weeks. Making things consistent with our other plugins will require more or less a rewrite of the whole plugin.
Enjoy your vacation, it's well deserved after the hackathon!
@gassmoeller Want to revive this one as well?
@gassmoeller Still interested in this? Or should we close the issue?
Thanks for reminding me (repeatedly over years :-)). Yes, I would still like to finish this PR. I pushed a new version that should address most comments by staying closer to the original implementation and also preserved legacy behavior (to assign the same value to all compositional fields if only one value is prescribed). This now also adds the functionality to prescribe different values to different compositional fields. From my point this is ready for another review, I just need to wait to update the tester results.
Thanks for the review. I accidentally force pushed an older version of this branch, and I dont have access to the new version right now. I will address this next week.
@jdannberg Thanks for the review. I added a test.
@bangerth: You requested changes and we cannot merge this PR until you accept the changes. Can you take a look if this is good enough now?