Commit Graph

207 Commits

Author SHA1 Message Date
bb1d6bbb24 feat(python): Repaired python bindings
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
2025-11-25 14:08:58 -05:00
22b52abc30 Merge pull request #6 from tboudreaux/feature/weakRates
Added Weak Rates, KINSol, CVODE, Policy, and much more
2025-11-24 15:12:05 -05:00
b335bf7100 fix(LogicalReaclibReaction): Properly class reverse reactions
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
2025-11-24 14:57:14 -05:00
ce8717b248 feat(graphnet_sandbox): Added CLI
Added cli options for controling temperature, density, and Tmax
2025-11-24 14:55:17 -05:00
1e23c89f8e feat(CLI11): Added command line parsing library
Added a library for command line option parsing, CLI11.
2025-11-24 14:54:41 -05:00
22c0329de0 docs(docs): rebuilt docs 2025-11-24 09:08:28 -05:00
9fab4fbfae docs(ridfire)
Added more documentation, also moved all engine code into
gridfire::engine namespace to be more in line with other parts of teh
code base
2025-11-24 09:07:49 -05:00
15ed7f70b1 feat(json): added nlohmann JSON
Added header only json library for better logging
2025-11-24 09:06:34 -05:00
9f56ba0083 fix(error_solver): inherit the public GridFireError interface
added public so that public members and methods of GridFireError can be
used by all SolverError exceptions
2025-11-21 14:30:53 -05:00
3fa23778e8 refactor(exceptions): made header names consistent
All header names in the exceptions module now follow the same naming
scheme.
2025-11-21 14:28:45 -05:00
acc71ba12e refactor(exceptions): All exceptions are derived from GridFireError
Now all GridFire exceptions are derived from the base GridFireError,
this allows for more clean handling of various exception cases
2025-11-21 14:26:24 -05:00
442d4ed86c feat(KINSOL): Switch from Eigen to KINSOL
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.
2025-11-19 12:06:21 -05:00
f7fbc6c1da refactor(src): small changes 2025-11-19 07:42:10 -05:00
4d2f5888ec feat(DebugException): Simple exception for debug
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.
2025-11-19 07:41:42 -05:00
80a4e12324 docs(.gitignore): added json 2025-11-19 07:40:55 -05:00
80dba50330 perf(EigenFunctor): Jacobian Cachine
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
2025-11-19 07:17:57 -05:00
90629992d3 feat(trigger): min convergence failure bound
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
2025-11-19 07:17:13 -05:00
d5d767a21c refactor(misc): removed debugging output 2025-11-18 08:25:17 -05:00
05c49d8dcf refactor(src): small refactoring changes to clean up code prior to PR 2025-11-18 08:24:19 -05:00
92085dca4e feat(log_view): small web app to view fourdst logs 2025-11-18 08:23:04 -05:00
dfae8073bd log(CVODE_solver_strategy): Added new logging
Optional per step detailed logging has been enhanced to show the
timescales and status of each network species.
2025-11-18 08:16:33 -05:00
8b1b7c3034 feat(MultiscalePartitioningEngineView): New check for log abundance normalized flow
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.
2025-11-18 08:15:34 -05:00
47c446a0a2 fix(engine_multiscale): Eigen status 2025-11-15 09:08:24 -05:00
3f55676068 refactor(CVODE solver): log_step_diagnostic signature change
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)
2025-11-15 09:08:05 -05:00
b65626ca20 feat(NetworkJacobian): Rank caching, regularization, and CSV export
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
2025-11-15 09:05:41 -05:00
4a404f6e12 feat(diagnostics)
Improved CVODE step diagnostics to be able to save intermediate
jacobians and to be print which species are limiting the timestepping
2025-11-15 09:02:08 -05:00
b5d76e3728 feat(jacobian): Added regularization
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.
2025-11-14 18:49:29 -05:00
2ed629e0bf feat(Table): Added table class for simpler logging
We have built a small table class in addition to the Column class which
allows for logging in a bit more straightforward manner
2025-11-14 10:55:38 -05:00
5fd42db394 feat(priming): Priming now uses solver to initialize species abundances
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.
2025-11-14 10:55:03 -05:00
a9ef20f664 feat(policy network stack): Policies can now return the network stack
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.
2025-11-14 10:53:38 -05:00
9417b79a32 feat(Jacobian): Jacobian generation is now stateless.
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.
2025-11-14 10:51:40 -05:00
1500f863b6 fix(Reaction): resolved bug which prevented counting number of reactants and products properly
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.
2025-11-14 10:45:45 -05:00
3335898979 feat(reaction_contribution_dashboard): added small web app to explore reaction contributions over time
This is a static webpage which will view JSON files in a format which I use (and will build into GridFire) and let users investigate the contributions each reaction at each timestep makes to the overall abundance of each species. This is invaluable when debugging a newtowk

BREAKING CHANGE:
2025-11-12 16:57:24 -05:00
81cca35130 fix(MultiscalePartitioningEngineView): began work to call the QSE solver every timestep
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.
2025-11-12 16:54:12 -05:00
741a11d256 feat(EnginePartitioningTrigger): update trigger
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)
2025-11-10 13:05:24 -05:00
8be36b9ce0 refactor(assets): removed old reaclib database from assets 2025-11-10 10:40:43 -05:00
a7a4a30028 feat(Comoposition-Tracking): updated GridFire to use new, molar-abundance based, version of libcomposition (v2.0.6)
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.
2025-11-10 10:40:03 -05:00
534a44448b feat(policy): updateed policy system and added new reaction chains
Reacions chains now contain more information and are broken out in a more detailed fashion.
2025-11-06 09:18:23 -05:00
dbb6934fe6 docs(Doxygen): updated styling of inheritence to use dot for higher resolution 2025-11-06 09:17:01 -05:00
d7237e7367 docs(docs): rebuilt 2025-11-06 09:16:40 -05:00
ba306523d6 docs(docs): rebuilt 2025-11-05 18:38:07 -05:00
18d289da7e docs(policy): added doxygen docs to policy system 2025-11-05 18:37:31 -05:00
9fdbb57996 feat(policy): began addition of robust policy system
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
2025-11-05 12:48:08 -05:00
9bc6e9b0d4 feat(io): added ability to export the rate calculations of any engine to a python file
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
2025-11-05 09:21:52 -05:00
7364eaafbd test(sandbox): some work on sandbox tests 2025-11-04 14:04:54 -05:00
77e6a918a5 docs(docs): rebuilt docs 2025-11-04 14:04:26 -05:00
e87206a4a3 docs(readme): updated readme to v0.7.0-alpha 2025-11-04 14:03:46 -05:00
d7e9597643 fix(python/solver): fidxed any cast issue with set_callback and moved initialization of solver context to before set callback 2025-11-04 13:24:29 -05:00
72a3f5bf4c feat(triggers): added ConvergenceFailureTrigger
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.
2025-11-04 13:22:57 -05:00
7f19143ff6 docs(construction): documented current default construction behavior 2025-11-04 13:20:46 -05:00