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

SimulatorAccess for StokesMatrixFree #6247

Merged
merged 1 commit into from
Mar 4, 2025

Conversation

gassmoeller
Copy link
Member

Something that always bothered me about the StokesMatrixFree class was how liberally it used the pointer to simulator to access information it could have gotten from SimulatorAccess instead. This PR is a first step towards disentangling StokesMatrixFree from Simulator internals. Ultimately, I am thinking of making the solvers their independent plugin system as well. I am not sure if we fully get there, but at least with the current changes the code also looks more like a normal plugin.

This PR:

  • derives StokesMatrixFree from SimulatorAccess and Plugins::InterfaceBase, to give it read access via SimulatorAccess and align its functions more with how all other plugins look like.
  • changes the initialization of StokesMatrixFree to the order of functions we usually use (costructor -> initialize_simulator -> parse_parameters -> initialize).
  • replaces a lot of direct accesses to the simulator (sim. ...) with simulator_acces (this->get_...)

Ideally, no functionality should change.

@gassmoeller
Copy link
Member Author

@quangx and @tjhei this may affect your work on the GMG, but I think it is still worth it to make the code a bit cleaner and ultimately disentangle the solver specific code from the Simulator class.

Copy link
Member

@tjhei tjhei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is much nicer. Thanks.

@tjhei tjhei merged commit c2a18ca into geodynamics:main Mar 4, 2025
8 checks passed
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