-
Notifications
You must be signed in to change notification settings - Fork 191
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
Register initial magnetic field in EvolveGhValenciaDivClean with Charm. #6004
Register initial magnetic field in EvolveGhValenciaDivClean with Charm. #6004
Conversation
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.
Instead of doing this, switch the class to use the factory_creation
struct in the metavariables instead of the deprecated creatable_classes
feature. Look at how it's done for TimeStepper
, for example.
This was intentionally not using the factory creation. I think it should stay as-is. The factory creation struct is tedious when you know all the derived classes ahead of time. We've discussed that the creatable classes is not deprecated a long time ago and serves a distinct purpose from the factory class approach. There's a lot of code that intentionally doesn't use that and I think should stay that way. |
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.
Looks great! Thanks for doing this!
Who's "we"? I don't recall being involved in any such conversation. The code clearly marks it as a legacy interface. The |
This was discussed in either the Thursday or Monday call maybe 3-4 years ago. Definitely quite a while ago and you were present. My objection to removing the So if your suggestion is change the |
(Your time estimates are presumably off. This code was only added a bit over 3 years ago.) You can't explicitly instantiate a factory, and that's the only thing that is directly tied to the In any case, that's irrelevant for this PR, since there's no reason to use |
I talked about this with @wthrowe on Friday and the conclusion was that in this case moving the list of magnetic fields from the base class to |
f260932
to
7bb0213
Compare
Force-pushed since the previous version was just a one-liner that got removed anyway. Let me know if this is the idea you're asking for or if I should do something else. |
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.
Yes, that's what I had in mind. Tests need fixing, though.
@@ -68,8 +68,6 @@ class InitialMagneticField : public PUP::able { | |||
InitialMagneticField() = default; | |||
|
|||
public: | |||
using creatable_classes = tmpl::list<Poloidal, Toroidal>; |
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.
Remove the forward declarations from this file.
17ddbd8
to
da57872
Compare
register_classes_with_charm<grmhd::AnalyticData::MagnetizedTovStar>(); | ||
register_classes_with_charm<EquationsOfState::PolytropicFluid<true>>(); | ||
const std::unique_ptr<evolution::initial_data::InitialData> option_solution = | ||
TestHelpers::test_option_tag_factory_creation< | ||
evolution::initial_data::OptionTags::InitialData, |
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.
Don't change this so much. You've lost the test of the get_clone()
method and possibly the option tag (not sure if that one's important here). Just switch test_option_tag_factory_creation
to test_option_tag
and pass the metavariables.
@@ -44,10 +53,11 @@ struct PoloidalProxy : Poloidal { | |||
SPECTRE_TEST_CASE( | |||
"Unit.PointwiseFunctions.AnalyticData.GrMhd.InitialMagneticFields.Poloidal", | |||
"[Unit][PointwiseFunctions]") { | |||
register_derived_classes_with_charm<InitialMagneticField>(); | |||
register_factory_classes_with_charm<Metavariables>(); |
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.
[optional] I think the only change you need in this file is making this line register_classes_with_charm<InitialMagneticFields::Poloidal>();
. The version you've written isn't wrong, but it's a lot more verbose than necessary.
Same for Test_Toroidal.cpp
.
da57872
to
6b97730
Compare
OK, looks good. Squash. |
6b97730
to
bbe7e76
Compare
Proposed changes
Registers
InitialMagneticField
with Charm in EvolveGhValenciaDivClean. Necessary for evolving a magnetized TOV star with GH.Upgrade instructions
Code review checklist
make doc
to generate the documentation locally intoBUILD_DIR/docs/html
.Then open
index.html
.code review guide.
bugfix
ornew feature
if appropriate.Further comments