geodynamics / aspect

A parallel, extensible finite element code to simulate convection in both 2D and 3D models.
https://aspect.geodynamics.org/
Other
224 stars 236 forks source link

convert ASPECT to a library that can be included in other programs #3448

Open tjhei opened 4 years ago

tjhei commented 4 years ago

As discussed with @bangerth, it would be useful to be able to run ASPECT as a shared library and convert the current code into a small binary that calls into ASPECT. This would make the code more modular and allow for cool new things (running ASPECT inside an outer optimization loop for example).

gassmoeller commented 4 years ago

I principally agree. What would be necessary steps to do this?

tjhei commented 4 years ago
  1. CMake logic to turn it into a shared lib, create a small binary (basically main.cc) and link it.
  2. Make sure shared lib loading of plugins and signals work.
  3. Figure out a way to pass information back and forth. Maybe some functions to run an individual time step? Alternatively, provide more signals.
  4. Write some tests that test the library aspect of ASPECT.
bangerth commented 4 months ago

We could also take the unit tests out of the executable.

tjhei commented 4 months ago

we should maybe tackle #5632 first