Skip to content

Commit

Permalink
Additional enum instrumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
langmm committed Sep 5, 2024
1 parent 34f88ae commit 2dc327c
Show file tree
Hide file tree
Showing 10 changed files with 222 additions and 29 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ foreach(suffix rate_constants conditions)
"${ENUM_SRC_REGEX}" --src-regex --dst-type=c --dst=${ENUM_DST}
--dst-maps=${ENUM_MAP} --dst-maps-header=${ENUM_MAP_H}
--dst-global=${ENUM_GLOBAL}
--enum-name-global=MODULE
--root-include-dir=${CMAKE_CURRENT_SOURCE_DIR}/include
--include-file-maps=${ENUM_UTILS}
--prefix-by-split=${suffix} --overwrite # --verbose
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindSUNDIALS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ if (SUNDIALS_INCLUDE_DIR)
CVODE_DIRECT_INCLUDE_DIR
NVECTOR_INCLUDE_DIR
KINSOL_INCLUDE_DIR)
if(NOT ${${x}} STREQUAL "NOTFOUND")
if(NOT ${${x}} STREQUAL "${x}-NOTFOUND")
list(APPEND SUNDIALS_INCLUDE_DIRS ${${x}})
endif()
endforeach()
Expand Down
15 changes: 15 additions & 0 deletions include/enums/enums.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
#pragma once

#include "enums/enums_conditions.hpp"
#include "enums/enums_rate_constants.hpp"

enum EMPTY_ENUM {};
enum MODULE {
MODULE_NONE ,
MODULE_PR ,
MODULE_PS ,
MODULE_RedoxReg ,
MODULE_FI ,
MODULE_RuACT ,
MODULE_XanCycle ,
MODULE_SUCS ,
MODULE_BF ,
MODULE_RROEA ,
MODULE_MAX ,
};
18 changes: 18 additions & 0 deletions include/enums/enums_conditions.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

enum PR_conditions {
PR_conditions_NONE ,
PR_GCEA , //!< Glycerate in chloroplast; derived based on V113
PR_GCA , //!< Derived from radioactive labelling experiment; assume equal concenatration inside and outshide chloroplast
PR_PGCA , //!< Phosphoglycolate in chloroplast derived based on the Km112; orignal value is : 0.0029;
Expand All @@ -11,9 +12,11 @@ enum PR_conditions {
PR_HPRc , //!< HydroxylPyruvate; derived from equation 123;
PR_GCEAc , //!< Glycerate in cytosol; assume at equilibrium with GCEA initially.
PR_RuBP , //!< RuBP concentration
PR_conditions_MAX ,
};

enum PS_conditions {
PS_conditions_NONE ,
PS_RuBP ,
PS_PGA ,
PS_DPGA ,
Expand All @@ -26,17 +29,21 @@ enum PS_conditions {
PS_ATP ,
PS_HexP ,
PS_PenP ,
PS_conditions_MAX ,
};

enum RedoxReg_conditions {
RedoxReg_conditions_NONE ,
RedoxReg_ThioRatio ,
RedoxReg_FBPase ,
RedoxReg_SBPase ,
RedoxReg_PRK ,
RedoxReg_ATPase ,
RedoxReg_conditions_MAX ,
};

enum FI_conditions {
FI_conditions_NONE ,
FI_A , //!< The concentration of excitons in the peripheral antenna
FI_U , //!< The concentration fo excitons in the core antenna
FI_P680ePheo , //!< The concentration of the P680Pheo
Expand All @@ -59,23 +66,29 @@ enum FI_conditions {
FI_QAQB2n , //!< The concentration of [QAQB2-]
FI_QAnQB2n , //!< The concentration of [QA-QB2-]
FI_PQn , //!< The concentration of reduced PQ, i.e. PQH2;
FI_conditions_MAX ,
};

enum RuACT_conditions {
RuACT_conditions_NONE ,
RuACT_ER , //!< The concentration of inactive ER
RuACT_Eaf , //!< The total concentration of E, EC, AND ECM
RuACT_ECMR , //!< The concentration of ECMR
RuACT_RuBP , //!< The concentration of ECMR
RuACT_conditions_MAX ,
};

enum XanCycle_conditions {
XanCycle_conditions_NONE ,
XanCycle_Vx , //!< * 0.37
XanCycle_Ax , //!< * 0.37
XanCycle_Zx , //!< * 0.37
XanCycle_ABA ,
XanCycle_conditions_MAX ,
};

enum SUCS_conditions {
SUCS_conditions_NONE ,
SUCS_T3Pc ,
SUCS_FBPc ,
SUCS_HexPc ,
Expand All @@ -84,9 +97,11 @@ enum SUCS_conditions {
SUCS_SUCP ,
SUCS_SUC ,
SUCS_PGAc ,
SUCS_conditions_MAX ,
};

enum BF_conditions {
BF_conditions_NONE ,
BF_ISPHr , //!< The reduced ion sulfer protein (ISPH)
BF_cytc1 , //!< The oxidized state of cytc1
BF_ISPo , //!< The oxidized ion sulfer protein (ISP)
Expand Down Expand Up @@ -116,12 +131,15 @@ enum BF_conditions {
BF_PHs , //!< The PH value of the stroma
BF_PHl , //!< The PH value of the lumen
BF_NADPH , //!< The NADPH concentration in stroma, Unit: mmol l-1;
BF_conditions_MAX ,
};

enum RROEA_conditions {
RROEA_conditions_NONE ,
RROEA_MDH , //!< The initial concentration of actove MDH
RROEA_Thio , //!< The initial concentration of reduced thioredoxin
RROEA_Fd , //!< The initial concentration of reduced ferrodoxin
RROEA_RuACT , //!< The initial concentration of active Rubisco activase
RROEA_conditions_MAX ,
};

18 changes: 18 additions & 0 deletions include/enums/enums_rate_constants.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

enum RuACT_rate_constants {
RuACT_rate_constants_NONE ,
RuACT_k1 , //!< The rate constant of the activation of the Rubisco bound with RuBP. This step is associated with the ARubisco theVars->activase content or activity;
RuACT_kn1 , //!< The rate constant of E inactivation by binding of RuBP;
RuACT_km1 , //!< The michaelis menton constant for RuBP with E.
Expand All @@ -15,16 +16,20 @@ enum RuACT_rate_constants {
RuACT_C , //!< mM
RuACT_O , //!< mM
RuACT_M ,
RuACT_rate_constants_MAX ,
};

enum RedoxReg_rate_constants {
RedoxReg_rate_constants_NONE ,
RedoxReg_Fd_Thio_ET ,
RedoxReg_ThioT ,
RedoxReg_Thio_Oxidation ,
RedoxReg_Thion0 , //!< This is a wild guess
RedoxReg_rate_constants_MAX ,
};

enum PR_rate_constants {
PR_rate_constants_NONE ,
PR_V111 , //!< Reaction 111: RUBP+O2<-->PGlycolate + PGA
PR_V112 , //!< Reaction 112: PGlycolate-->Pi+Glycolate;
PR_V113 , //!< Reaction 113: Gcea+ATP<-->ADP + PGA
Expand Down Expand Up @@ -82,9 +87,11 @@ enum PR_rate_constants {
PR_Vf_T121 , //!< VfactorT used with GRNT & Tp > 25
PR_Vf_T122 , //!< VfactorT used with GRNT & Tp > 25
PR_Vf_T112 , //!< VfactorT used with GRNT & Tp > 25
PR_rate_constants_MAX ,
};

enum BF_rate_constants {
BF_rate_constants_NONE ,
BF_K1 , //!< The rate constant for formation of ISP.QH2 complex; unit: per second
BF_K2 , //!< The rate constant for ISP.QH2-->QH(semi) + ISPH(red) ; unit: per second
BF_K3 , //!< The rate constant for QH. + cytbL --> Q + cytbL- + H+ Unit: s-1
Expand Down Expand Up @@ -132,9 +139,11 @@ enum BF_rate_constants {
BF_k12 , //!< The total concentration of buffer in lumen; unit: mmol per liter
BF_k23 , //!< The total number of P700; unit: micromole m-2 leaf area
BF_k30 , //!< The total concentration of NADPH in stroma; 1 is an guessed value;
BF_rate_constants_MAX ,
};

enum RROEA_rate_constants {
RROEA_rate_constants_NONE ,
RROEA_ke2GAPDH , //!< The rate constant of electron transfer to GAPDH. From literature.
RROEA_ke2MDH , //!< The rate constant of electront transfer to MDH, this rate is totally ASSUMED.
RROEA_ke2FBPase , //!< The rate constant of electron transfer from thioredoxin to FBPase.
Expand Down Expand Up @@ -171,9 +180,11 @@ enum RROEA_rate_constants {
RROEA_FdT , //!< Not used with RROEA_EPS
RROEA_ThioT ,
RROEA_RuACTT ,
RROEA_rate_constants_MAX ,
};

enum SUCS_rate_constants {
SUCS_rate_constants_NONE ,
SUCS_V51 , //!< DHAP+GAP --FBP; default 0.5
SUCS_V52 , //!< FBP --F6P + Pi
SUCS_V55 , //!< G1P+UTP --OPOP+UDPG
Expand Down Expand Up @@ -225,16 +236,20 @@ enum SUCS_rate_constants {
SUCS_KE59 ,
SUCS_KE61 ,
SUCS_Km621 ,
SUCS_rate_constants_MAX ,
};

enum XanCycle_rate_constants {
XanCycle_rate_constants_NONE ,
XanCycle_kva , //!< Ruth Frommolt et a; 2001; Planta
XanCycle_kaz , //!< Ruth Frommolt et a; 2001; Planta
XanCycle_kza , //!< Ruth Frommolt et a; 2001; Planta
XanCycle_kav , //!< Ruth Frommolt et a; 2001; Planta. This is not given in the paper. Therefore, teh value is really an educated guess.
XanCycle_rate_constants_MAX ,
};

enum FI_rate_constants {
FI_rate_constants_NONE ,
FI_kA_d , //!< The rate constant of heat dissipation from peripheral antenna Lazar (1999), 0.25~1 *10^(9)
FI_kA_f , //!< The rate constant of fluorescence emission from peripheral antenna Lazar 1999, with a lifetime of 5 ns at closed reaction center
FI_kA_U , //!< The rate constant of exciton transfer from periphral antenna to core antenna Reference needed, a guess
Expand All @@ -258,9 +273,11 @@ enum FI_rate_constants {
FI_k_pq_oxy , //!< The rate constant of the PQH2 oxidation Lazar (1999),50~500
FI_QBt , //!< The total concentration of Qb site;
FI_PQT , //!< The total concentration of PQ;
FI_rate_constants_MAX ,
};

enum PS_rate_constants {
PS_rate_constants_NONE ,
PS_CP , //!< Global constant for the total phosphate
PS_CA , //!< Global constant for the total adenylates
PS_CN , //!< Global constant for the cytosolic Phosphate concentration;
Expand Down Expand Up @@ -373,5 +390,6 @@ enum PS_rate_constants {
PS_Vf_T9 , //!< VfactorT used with GRNT & Tp > 25
PS_Vf_T13 , //!< VfactorT used with GRNT & Tp > 25
PS_Vf_T23 , //!< VfactorT used with GRNT & Tp > 25
PS_rate_constants_MAX ,
};

11 changes: 8 additions & 3 deletions include/enums/enums_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ const std::map<const T, const std::string>& get_enum_map() {
return out;
}

template<typename T>
MODULE get_enum_module() {
return MODULE_NONE;
}

namespace ePhotosynthesis {
namespace utils {

Expand All @@ -44,8 +49,8 @@ namespace ePhotosynthesis {
}

template<typename Tenum, typename Tval>
void readEnumFile(const std::string &filename,
std::map<Tenum, Tval> &map) {
std::map<Tenum, Tval> readEnumFile(const std::string &filename) {
std::map<Tenum, Tval> map;
std::vector<std::string> tempVec;
std::string comment = "#";
std::string input;
Expand All @@ -67,7 +72,7 @@ namespace ePhotosynthesis {
count++;
map.insert(std::pair<Tenum, Tval>(key, val));
}

return map;
}

template<typename T1>
Expand Down
27 changes: 27 additions & 0 deletions src/enums/enums_conditions_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ const std::map<const PR_conditions, const std::string>& PR_conditions_map() {
template<> const std::map<const PR_conditions, const std::string>& get_enum_map<enum PR_conditions>() {
return PR_conditions_map();
};
template<> MODULE get_enum_module<enum PR_conditions>() {
return MODULE_PR;
}

const std::map<const PS_conditions, const std::string>& PS_conditions_map() {
static const std::map<const PS_conditions, const std::string> map {
Expand All @@ -42,6 +45,9 @@ const std::map<const PS_conditions, const std::string>& PS_conditions_map() {
template<> const std::map<const PS_conditions, const std::string>& get_enum_map<enum PS_conditions>() {
return PS_conditions_map();
};
template<> MODULE get_enum_module<enum PS_conditions>() {
return MODULE_PS;
}

const std::map<const RedoxReg_conditions, const std::string>& RedoxReg_conditions_map() {
static const std::map<const RedoxReg_conditions, const std::string> map {
Expand All @@ -56,6 +62,9 @@ const std::map<const RedoxReg_conditions, const std::string>& RedoxReg_condition
template<> const std::map<const RedoxReg_conditions, const std::string>& get_enum_map<enum RedoxReg_conditions>() {
return RedoxReg_conditions_map();
};
template<> MODULE get_enum_module<enum RedoxReg_conditions>() {
return MODULE_RedoxReg;
}

const std::map<const FI_conditions, const std::string>& FI_conditions_map() {
static const std::map<const FI_conditions, const std::string> map {
Expand Down Expand Up @@ -87,6 +96,9 @@ const std::map<const FI_conditions, const std::string>& FI_conditions_map() {
template<> const std::map<const FI_conditions, const std::string>& get_enum_map<enum FI_conditions>() {
return FI_conditions_map();
};
template<> MODULE get_enum_module<enum FI_conditions>() {
return MODULE_FI;
}

const std::map<const RuACT_conditions, const std::string>& RuACT_conditions_map() {
static const std::map<const RuACT_conditions, const std::string> map {
Expand All @@ -100,6 +112,9 @@ const std::map<const RuACT_conditions, const std::string>& RuACT_conditions_map(
template<> const std::map<const RuACT_conditions, const std::string>& get_enum_map<enum RuACT_conditions>() {
return RuACT_conditions_map();
};
template<> MODULE get_enum_module<enum RuACT_conditions>() {
return MODULE_RuACT;
}

const std::map<const XanCycle_conditions, const std::string>& XanCycle_conditions_map() {
static const std::map<const XanCycle_conditions, const std::string> map {
Expand All @@ -113,6 +128,9 @@ const std::map<const XanCycle_conditions, const std::string>& XanCycle_condition
template<> const std::map<const XanCycle_conditions, const std::string>& get_enum_map<enum XanCycle_conditions>() {
return XanCycle_conditions_map();
};
template<> MODULE get_enum_module<enum XanCycle_conditions>() {
return MODULE_XanCycle;
}

const std::map<const SUCS_conditions, const std::string>& SUCS_conditions_map() {
static const std::map<const SUCS_conditions, const std::string> map {
Expand All @@ -130,6 +148,9 @@ const std::map<const SUCS_conditions, const std::string>& SUCS_conditions_map()
template<> const std::map<const SUCS_conditions, const std::string>& get_enum_map<enum SUCS_conditions>() {
return SUCS_conditions_map();
};
template<> MODULE get_enum_module<enum SUCS_conditions>() {
return MODULE_SUCS;
}

const std::map<const BF_conditions, const std::string>& BF_conditions_map() {
static const std::map<const BF_conditions, const std::string> map {
Expand Down Expand Up @@ -168,6 +189,9 @@ const std::map<const BF_conditions, const std::string>& BF_conditions_map() {
template<> const std::map<const BF_conditions, const std::string>& get_enum_map<enum BF_conditions>() {
return BF_conditions_map();
};
template<> MODULE get_enum_module<enum BF_conditions>() {
return MODULE_BF;
}

const std::map<const RROEA_conditions, const std::string>& RROEA_conditions_map() {
static const std::map<const RROEA_conditions, const std::string> map {
Expand All @@ -181,4 +205,7 @@ const std::map<const RROEA_conditions, const std::string>& RROEA_conditions_map(
template<> const std::map<const RROEA_conditions, const std::string>& get_enum_map<enum RROEA_conditions>() {
return RROEA_conditions_map();
};
template<> MODULE get_enum_module<enum RROEA_conditions>() {
return MODULE_RROEA;
}

Loading

0 comments on commit 2dc327c

Please sign in to comment.