Castro icon indicating copy to clipboard operation
Castro copied to clipboard

Modularize the build system

Open maxpkatz opened this issue 5 years ago • 3 comments

One of the main difficulties in writing unit tests (e.g. issue #404) is that we have one monolithic build target in Make.Castro. If we modularized this so that individual components of Castro were built by specific make files, and the result combined at the end into one larger executable if the goal is to build Castro itself, it would be easier to write good unit tests.

One big stumbling block to this is that Castro itself is fairly monolithic at this time. So even though the individual Make.package files are modularized, it is not possible to build only the reactions module (say) without including all of the other machinery in Castro itself. This is also contributing to Castro.H being far too large. Perhaps what we can do to improve on this is to virtualize Castro and have the individual components be derived classes that can operate on this parent class. So, e.g., CastroReactions would be derived from Castro and so you could build just the reactions module and nothing else. Then it would be very easy to just call react_state() without worrying about other source terms, the advance, etc.

maxpkatz avatar Sep 20 '18 12:09 maxpkatz

I think one first step for this would be to break the main Castro_F.H into separate files for the different physics. I've been wanting to do that for a while.

zingale avatar Sep 20 '18 12:09 zingale

I've split off the hydro parts of the header into hydro/Castro_hydro.H and hydro/Castro_hydro_F.H. Note that I didn't create sub-classes for them, they're just treated as text files that get #include'd directly inside Castro.H and Castro_F.H respectively.

maxpkatz avatar Feb 25 '19 17:02 maxpkatz

we should make sure that all the *_F.H and .H headers in each Source directory match the contents of those directories.

zingale avatar Sep 26 '19 20:09 zingale