-
Notifications
You must be signed in to change notification settings - Fork 39
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
Factory Initializer Objects #484
Conversation
We can't count on when the Initializer objects will be destroyed, so we can just have SimulationInitializer be a member of Simulation, we need to instantiate it in the main program and let it live for the duration of the program.
For all physics factories, except the reacting flows factory, the physics factory class is now header-only and all the instantiations of the physics factory have been moved to the new PhysicsFactoryInitializer class. The PhysicsFactoryInitializer is then constructed in SimulationInitializer.
I didn't make this one header only, as with the others, at this point because the collision with another branch in-progress would be pretty bad. So will do this temporarily and clean it up once the other branch (updating Antioch interface) is done.
This moves boundary condition-related factory object instantiation to the initializer object, which is then used in the SimulationInitializer. This is for prevention of symbol stripping during static linking.
Will merge this afternoon barring any complaints. |
|
||
|
||
GRINS::SimulationInitializer initializer; | ||
|
||
GRINS::SimulationBuilder sim_builder; |
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.
Could we have SimulationBuilder create a SimulationInitializer? Then we wouldn't need to change so much user code.
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.
My intent is for SimulationBuilder to go away after properly factorying out Solver, QoI, etc. (goal is to finish that before tomorrow morning). Also, the PR I'm working on right now will hide all this stuff from the user.
Runner PR (#486) hides this away, so I'm going ahead and merging. |
Ala libqueso/queso#508, this creates FactoryInitializer objects that statically instantiate the factory classes so they don't get stripped by static linking. I collected all of them into
SimulationInitializer
, which needs to be instantiated beforeSimulation
. (A forthcoming PR is going to refactor the GRINSmain
to just call a function which does all the setup and run to ease extension by users.) I believe this captures all "properly" factoried objects, which is confirmed by building with--enable-static --disable-shared
at configure time (I also confirmed we actually failed in this case before this PR). We should add a CIVET recipe for this build configuration (#469, #472).