fix(GraphNetwork): working on loads of small bugs

Fized stoichiometry matrix initialization, added penames to reablib reactions, began work on LogicalReaction to sum the contributions of different fitting functions provided by reaclib
This commit is contained in:
2025-06-23 15:18:56 -04:00
parent 9f6e360b0f
commit dd03873bc9
31 changed files with 101449 additions and 19120 deletions

View File

@@ -5,7 +5,7 @@
#include <string>
#include <iostream>
#include <unordered_map>
#include "atomicSpecies.h"
#include "fourdst/composition/atomicSpecies.h"
#include "cppad/cppad.hpp"
@@ -32,6 +32,7 @@ namespace gridfire::reaclib {
class REACLIBReaction {
private:
std::string m_id; ///< Unique identifier for the reaction, generated by the Python script.
std::string_view m_peName; ///< Name of the reaction in (projectile, ejectile) notation (e.g. p(p, g)d)
int m_chapter; ///< Chapter number from the REACLIB database, defining the reaction structure.
std::vector<fourdst::atomic::Species> m_reactantNames; ///< Names of the reactant species involved in the reaction.
std::vector<fourdst::atomic::Species> m_productNames; ///< Names of the product species produced by the reaction.
@@ -56,6 +57,7 @@ namespace gridfire::reaclib {
*/
REACLIBReaction(
std::string id,
std::string_view peName,
int chapter,
std::vector<fourdst::atomic::Species> reactants,
std::vector<fourdst::atomic::Species> products,
@@ -64,6 +66,7 @@ namespace gridfire::reaclib {
RateFitSet sets,
bool reverse = false)
: m_id(std::move(id)),
m_peName(peName),
m_chapter(chapter),
m_reactantNames(std::move(reactants)),
m_productNames(std::move(products)),
@@ -87,6 +90,8 @@ namespace gridfire::reaclib {
[[nodiscard]] const std::string& id() const { return m_id; }
[[nodiscard]] std::string_view peName() const { return m_peName; }
[[nodiscard]] int chapter() const { return m_chapter; }
[[nodiscard]] const std::vector<fourdst::atomic::Species>& reactants() const { return m_reactantNames; }
@@ -99,8 +104,10 @@ namespace gridfire::reaclib {
[[nodiscard]] bool is_reverse() const { return m_reverse; }
[[nodiscard]] RateFitSet rateFits() const { return m_rateSets; }
friend std::ostream& operator<<(std::ostream& os, const REACLIBReaction& reaction) {
os << "REACLIBReaction(" << reaction.m_id << ", "
os << "REACLIBReaction(" << reaction.m_peName << ", "
<< "Chapter: " << reaction.m_chapter << ")";
return os;
}
@@ -234,6 +241,7 @@ namespace gridfire::reaclib {
inline bool operator!=(const REACLIBReactionSet& lhs, const REACLIBReactionSet& rhs) {
return !(lhs == rhs);
}
}
namespace std {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,14 +1,20 @@
required_headers = [
'reaclib.h',
'reactions.h',
'gridfire/reaclib.h',
'gridfire/reactions.h',
]
foreach h : required_headers
if not cpp.has_header(h, include_directories: include_directories('include'))
error('SERiF requires the header file ' + h + ' to be present in the assets/static/reaclib/include directory.')
error('GridFire requires the header file ' + h + ' to be present in the assets/static/reaclib/include/gridfire directory.')
endif
endforeach
reaclib_reactions_dep = declare_dependency(
include_directories: include_directories('include'),
)
message('✅ SERiF reaclib_reactions dependency declared')
message('✅ GridFire reaclib_reactions dependency declared')
to_install_headers = [
'include/gridfire/reaclib.h',
'include/gridfire/reactions.h',
]
install_headers(to_install_headers, subdir: 'gridfire/gridfire')