Skip to content
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

Merged
merged 7 commits into from
Apr 26, 2017
Merged

Conversation

pbauman
Copy link
Member

@pbauman pbauman commented Apr 24, 2017

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 before Simulation. (A forthcoming PR is going to refactor the GRINS main 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).

pbauman added 7 commits April 21, 2017 16:29
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.
@pbauman
Copy link
Member Author

pbauman commented Apr 25, 2017

Will merge this afternoon barring any complaints.

@pbauman pbauman mentioned this pull request Apr 25, 2017


GRINS::SimulationInitializer initializer;

GRINS::SimulationBuilder sim_builder;
Copy link
Member

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.

Copy link
Member Author

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.

@pbauman
Copy link
Member Author

pbauman commented Apr 26, 2017

Runner PR (#486) hides this away, so I'm going ahead and merging.

@pbauman pbauman merged commit a8abbb6 into grinsfem:master Apr 26, 2017
@pbauman pbauman deleted the factory-init-objects branch April 27, 2017 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants