Skip to content

Let SimulatorAccess store an observer pointer to Simulator.#6870

Merged
gassmoeller merged 3 commits intogeodynamics:mainfrom
bangerth:observer-pointer
Apr 2, 2026
Merged

Let SimulatorAccess store an observer pointer to Simulator.#6870
gassmoeller merged 3 commits intogeodynamics:mainfrom
bangerth:observer-pointer

Conversation

@bangerth
Copy link
Copy Markdown
Contributor

Right now, it stores a bare pointer. This is easily changed with the exception of one place that creates a plugin and where apparently one now needs to know the declaration of class Simulator to check a static assertion in class ObserverPointer (namely: Is Simulator really derived from EnableObserverPointer?).

This isn't going to solve the memory issue we talked about in the call today, but it's still worthwhile replacing bare pointers by smarter classes that help us track memory stuff. Let's see if anything breaks with this patch.

Copy link
Copy Markdown
Member

@gassmoeller gassmoeller left a comment

Choose a reason for hiding this comment

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

Looks like there is a header missing for deal.II 9.6. I dont really understand the errors for 9.7. Something in the particle property manager?

#include <aspect/particle/manager.h>

#include <aspect/utilities.h>
#include <aspect/simulator.h>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why is this now necessary?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

See above:

...with the exception of one place that creates a plugin and where apparently one now needs to know the declaration of class Simulator to check a static assertion in class ObserverPointer (namely: Is Simulator really derived from EnableObserverPointer?)

@bangerth bangerth force-pushed the observer-pointer branch 4 times, most recently from c6de428 to f924949 Compare March 31, 2026 21:04
@bangerth bangerth mentioned this pull request Mar 31, 2026
@bangerth
Copy link
Copy Markdown
Contributor Author

bangerth commented Apr 1, 2026

This now includes the test fix in #6923, but otherwise works. If anyone merges #6923, I can rebase. Or we can merge as is -- github will automatically sort out the history given that the commit in #6923 is the first commit on this branch.

Copy link
Copy Markdown
Member

@gassmoeller gassmoeller left a comment

Choose a reason for hiding this comment

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

👍

@gassmoeller gassmoeller merged commit b7d12ee into geodynamics:main Apr 2, 2026
9 checks passed
@bangerth bangerth deleted the observer-pointer branch April 2, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants