68 auto N = model.redfunc.Tc.size();
71 Eigen::MatrixXd F(N, N); F.setZero();
72 std::vector<std::vector<DepartureTerms>> funcs(N);
73 for (
auto i = 0; i < N; ++i) { funcs[i].resize(N); }
76 for (
auto i = 0; i < N; ++i) {
77 for (
auto j = i; j < N; ++j) {
83 auto entry = jj[std::to_string(i)][std::to_string(j)];
86 auto dep = entry.at(
"departure");
87 auto BIP = entry.at(
"BIP");
88 F(i, j) = BIP.at(
"Fij");
97 auto get_reducing = [&](
const auto& deptype) {
98 auto red = model.redfunc;
99 auto Tc = red.Tc, vc = red.vc;
100 if (deptype ==
"invariant") {
102 mat phiT = mat::Zero(N, N), lambdaT = mat::Zero(N, N), phiV = mat::Zero(N, N), lambdaV = mat::Zero(N, N);
104 for (
auto i = 0; i < N; ++i) {
105 for (
auto j = i+1; j < N; ++j) {
107 auto entry = jj.at(std::to_string(i)).at(std::to_string(j));
109 auto BIP = entry.at(
"BIP");
111 phiT(i, j) = BIP.at(
"phiT");
112 phiT(j, i) = phiT(i, j);
113 lambdaT(i, j) = BIP.at(
"lambdaT");
114 lambdaT(j, i) = -lambdaT(i, j);
116 phiV(i, j) = BIP.at(
"phiV");
117 phiV(j, i) = phiV(i, j);
118 lambdaV(i, j) = BIP.at(
"lambdaV");
119 lambdaV(j, i) = -lambdaV(i, j);
126 mat betaT = mat::Zero(N, N), gammaT = mat::Zero(N, N), betaV = mat::Zero(N, N), gammaV = mat::Zero(N, N);
128 for (
auto i = 0; i < N; ++i) {
129 for (
auto j = i+1; j < N; ++j) {
131 auto entry = jj.at(std::to_string(i)).at(std::to_string(j));
132 auto BIP = entry.at(
"BIP");
134 betaT(i, j) = BIP.at(
"betaT");
135 betaT(j, i) = 1 / betaT(i, j);
136 betaV(i, j) = BIP.at(
"betaV");
137 betaV(j, i) = 1 / betaV(i, j);
138 gammaT(i, j) = BIP.at(
"gammaT"); gammaT(j, i) = gammaT(i, j);
139 gammaV(i, j) = BIP.at(
"gammaV"); gammaV(j, i) = gammaV(i, j);
145 std::string deptype = (jj.at(
"0").at(
"1").at(
"BIP").contains(
"type")) ? jj.at(
"0").at(
"1").at(
"BIP")[
"type"] :
"";
151 mfa.set_meta(jj.dump());
const std::variant< double, std::string > get_BIP(const std::size_t &i, const std::size_t &j, const std::string &key) const
Return a binary interaction parameter.