GridFire can now support unity builds. This is useful for python
bindings. The main limitation is that openssl (a dependency of
libplugin) does not support unity builds. Therefore when building in a
unity build libplugin must be disabled. This is done with the
-Dunity-safe=ture flag at setup time
GridFire failed to compile on gcc and gnu stdlibc++ this has been
resolved. Further, the boost dependency has been removed since we no
longer use boost at all. This should dramatically simplify installation.
Finally we have added some build system checks to ensure that the
correct version of a C++ and fortran compiler are present on the system
Neutrino loss is essential for neutrino cooling. Started adding
framework to track this. Reaclib reactions use a simple heuristic where
electron capture reactions loss 100% of their energy to neutrinos
whereas beta decay reactions loose 50% of their energy to neutrinos
Building of the C API GridFire can now be used from fotran using the
gridfire_mod fortran module. This exposes the same, limited, set of
funcitonality that the C API does.
Python bindings have now been brought back up to feature pairity with
C++. Further, stubs have been added for all python features so that code
completion will work
Previously there was a bug where some reverse reactions were being
classed as forward reactions. This results in a failure of many
timesteps due to the reverse reactions very high molar flows
Previously QSE solving was done using Eigen. While this worked we were
limited in the ability to use previous iterations to speed up later
steps. We have switched to KINSOL, from SUNDIALS, for linear solving.
This has drastically speed up the process of solving for QSE abundances,
primarily because the jacobian matrix does not need to be generated
every single time time a QSE abundance is requested.
Sometimes it is useful to pause execution with an exception while
debugging (though bad practice in production code). This is an explicit
exception type dedicated to that purpose. Further we have included some
compile time checks to ensure that these do not get used in release
builds.
FOr QSE solving the Jacobian does not change meaninfully between steps.
We have introduced caching so that it does not need to be reevaluated
every step
Added a minimum value for the mean convergence failure which will never
trigger. This prevents situations where one or two failures begine a
trigger avalanche
We added one new check to the partitioning stage for
MultiscalePartitioningEngine view which, after group validation, prunes
any species only connected by reactions with a log(flow/mean involved
species abundance) less than -30. Currently this is a magic number and
will need to be adjusted. These pruned groups succsessfully prevent
light elements getting vacumed up into QSE groups due to their overall
weak couplings to the entire network. This is important else the
conditioning of the QSE systems falls apart.
Added a new overload of log_step_diagnostic to allow for more granular
control over what is displayed. Also made some small teaks to relative
tolerance (absolute tolerance has remained unchaged)
Comptuting the rank of a large matrix with QR factorization can be
expensive and the rank is often never needed. We have implimented a
caching system so that the rank is only computed when asked for, and
then only once. Further, the regularization method which was previously
in an anonomous namespace inside of a single translation unit has been
moved to the jacobian header and implimentation file. This allows all
parts of GridFire to access the same regularization method. Finally a
small CSV output method has been added which is useful for debugging
There are times when the jacobian matrix has infinities or nans. If
these cases correspond to species (rows or columns) which have
effectivley zero abundance (i.e. if Y(Cl-32) ~ 1e-310 and
(dY(H-2)/dt)/dY(Cl-32) is inf) then it is safe to regularize these
entries to 0. If this is not done then the solver will end up finding
NaN values for the molar abundances on subsequent steps. This has been
implimented through a small regularization function in the
CVODE_solver_strategy file.
Instead of a complex system of identifying dominate channels and
approximating abundances based on that, priming now simply ignites a
basic network at 1e7K for 1e-15s. This is an effective approach to prime
relevant species while being short enough to not change the abundance of
any fuel species.
Policies can now return the network stack which allows the caller more
control over settings and running a solver against various levels of the
stack. Further, policies can return the partition function used as well
as a vector of enums which describe the structure of the network stack.
Previously Jacobians were stored by engines and accessed through engine
accessors (e.g getJacobianMatrixEntry); however, this resulted in
desynced jacobian states. We have changed to a pattern of Engine creates
a jacobian and returns it to the caller. The caller can then do what
they will with it. Because of this the getJacobianMatrixEntry method has
been removed.
BREAKING CHANGE:
- There is no longer any getJacobianMatrixEntry method on
DynamicEngine classes
- the generateJacobian method signature has changed to return a
NetworkJacobian object. Internally this uses an Eigen Sparse Matrix to
store its data.
This bug was introduced when switching the internal tracking of products and reactants from a vector to a set. Initially we had done this to improve lookup performance. However, due to the uniquness of items in a set this broke counting methods. We have resolved this so that all old code will still work while maintaing the efficency gains by using an unordered map which stored species and counts. Further we have added countReactantOccurences and countProductOffurences methods to make this process more explicit and avalible to callers.
one major issue was that QSE solving was only running at each partition. This was creating effectivley infinite sources of partitioned species. Now we partition when engine updates are triggered, however, solveQSEAbundance is called every timestep. This has major performance implications and so has required a lot of optimization to make it even somewhat viable. For now construction is much slower. Time per iteration is still slower than it was before; however, it is tractable. There is also currently too much stiffness in the network. This is likeley a bug that was introduced in this refactoring which will be addressed soon.
Engine Partitioning trigger now properly throws on both increased convergence failures and a timestep collapse (timestep collapsing more than a factor of 1/100th the average value for the past 10 steps)
This entailed a major rewrite of the composition handling from each engine and engine view along with the solver and primer. The intent here is to let Compositions be constructed from the same extensive property which the solver tracks internally. This addressed C0 discontinuity issues in the tracked molar abundances of species which were introduced by repeadidly swaping from molar abundance space to mass fraction space and back. This also allowed for a simplification of the primeNetwork method. Specifically the mass borrowing system was dramatically simplified as molar abundances are extensive.
The policy system provides a way for users to ensure that they get a network with certain traits. For example being sure that the network they get has all of the proton proton reactions in its base reaction set. This is an extensible system which is intended to be used by researchers to build various determanistic network policies to make network results more reproducable
GridFire can now (to a very limited degree) approximate the abilities of pynucastro in so far as it can not just solve an engine but it can also export it to a python file. Currently only the rates are exported so no solver can yet be used (since things like the rest of the RHS and the jacobian are missing) but this is a step in that direction
added new trigger which throws on convergence failures. This also required adding a new "step" method for other triggers which gets called every step instead of every trigger throw. The ConvergenceFailureTrigger has sucsessgully let teh engine evolve to 10Gyr without any meaningful growth of convergence failures.
Mirroring what was done in fourdst (see fourdst/tree/v0.8.5) we have added a temporary patch to let python bindings work on mac while the meson-python folks resolve the duplicate rpath issue in the shared object file
Passing weak rate interpolator as an std::optional was resulting in use-after-free bugs due to std::optional making a copy of WeakRateInterpolator. This resulted in segfaults. Since we have the new construction semantics with flags this is no longer needed so the optional argument has been removed in favor of a simple const &