59 auto N = model.redfunc.Tc.size();
62 Eigen::MatrixXd F(N, N); F.setZero();
63 std::vector<std::vector<DepartureTerms>> funcs(N);
64 for (
auto i = 0; i < N; ++i) { funcs[i].resize(N); }
67 for (
auto i = 0; i < N; ++i) {
68 for (
auto j = i; j < N; ++j) {
74 auto entry = jj[std::to_string(i)][std::to_string(j)];
77 auto dep = entry.at(
"departure");
78 auto BIP = entry.at(
"BIP");
79 F(i, j) = BIP.at(
"Fij");
88 auto get_reducing = [&](
const auto& deptype) {
89 auto red = model.redfunc;
90 auto Tc = red.Tc, vc = red.vc;
91 if (deptype ==
"invariant") {
93 mat phiT = mat::Zero(N, N), lambdaT = mat::Zero(N, N), phiV = mat::Zero(N, N), lambdaV = mat::Zero(N, N);
95 for (
auto i = 0; i < N; ++i) {
96 for (
auto j = i+1; j < N; ++j) {
98 auto entry = jj.at(std::to_string(i)).at(std::to_string(j));
100 auto BIP = entry.at(
"BIP");
102 phiT(i, j) = BIP.at(
"phiT");
103 phiT(j, i) = phiT(i, j);
104 lambdaT(i, j) = BIP.at(
"lambdaT");
105 lambdaT(j, i) = -lambdaT(i, j);
107 phiV(i, j) = BIP.at(
"phiV");
108 phiV(j, i) = phiV(i, j);
109 lambdaV(i, j) = BIP.at(
"lambdaV");
110 lambdaV(j, i) = -lambdaV(i, j);
117 mat betaT = mat::Zero(N, N), gammaT = mat::Zero(N, N), betaV = mat::Zero(N, N), gammaV = mat::Zero(N, N);
119 for (
auto i = 0; i < N; ++i) {
120 for (
auto j = i+1; j < N; ++j) {
122 auto entry = jj.at(std::to_string(i)).at(std::to_string(j));
123 auto BIP = entry.at(
"BIP");
125 betaT(i, j) = BIP.at(
"betaT");
126 betaT(j, i) = 1 / betaT(i, j);
127 betaV(i, j) = BIP.at(
"betaV");
128 betaV(j, i) = 1 / betaV(i, j);
129 gammaT(i, j) = BIP.at(
"gammaT"); gammaT(j, i) = gammaT(i, j);
130 gammaV(i, j) = BIP.at(
"gammaV"); gammaV(j, i) = gammaV(i, j);
136 std::string deptype = (jj.at(
"0").at(
"1").at(
"BIP").contains(
"type")) ? jj.at(
"0").at(
"1").at(
"BIP")[
"type"] :
"";
142 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.