33{
34 const std::vector<Real> basis_m_good(6);
35 const std::vector<Real> eqm_m_good(8);
36 const std::vector<Real> kin_m_good(3);
37
38 try
39 {
41 FAIL() << "Missing expected exception.";
42 }
43 catch (const std::exception & e)
44 {
45 std::string msg(e.what());
46 ASSERT_TRUE(
47 msg.find(
48 "Ionic strength calculation: Number of basis species in mgd not equal to the size of "
49 "basis_species_molality") != std::string::npos)
50 << "Failed with unexpected error message: " << msg;
51 }
52
53 try
54 {
56 FAIL() << "Missing expected exception.";
57 }
58 catch (const std::exception & e)
59 {
60 std::string msg(e.what());
61 ASSERT_TRUE(msg.find("Ionic strength calculation: Number of equilibrium species in mgd not "
62 "equal to the size of "
63 "eqm_species_molality") != std::string::npos)
64 << "Failed with unexpected error message: " << msg;
65 }
66
67 try
68 {
70 FAIL() << "Missing expected exception.";
71 }
72 catch (const std::exception & e)
73 {
74 std::string msg(e.what());
75 ASSERT_TRUE(msg.find("Ionic strength calculation: Number of kinetic species in mgd not "
76 "equal to the size of "
77 "kin_species_molality") != std::string::npos)
78 << "Failed with unexpected error message: " << msg;
79 }
80
81 try
82 {
84 FAIL() << "Missing expected exception.";
85 }
86 catch (const std::exception & e)
87 {
88 std::string msg(e.what());
89 ASSERT_TRUE(msg.find("Stoichiometric ionic strength calculation: Number of basis species in "
90 "mgd not equal to the size of "
91 "basis_species_molality") != std::string::npos)
92 << "Failed with unexpected error message: " << msg;
93 }
94
95 try
96 {
98 FAIL() << "Missing expected exception.";
99 }
100 catch (const std::exception & e)
101 {
102 std::string msg(e.what());
103 ASSERT_TRUE(
104 msg.find(
105 "Stoichiometric ionic strength calculation: Number of equilibrium species in mgd not "
106 "equal to the size of "
107 "eqm_species_molality") != std::string::npos)
108 << "Failed with unexpected error message: " << msg;
109 }
110
111 try
112 {
114 FAIL() << "Missing expected exception.";
115 }
116 catch (const std::exception & e)
117 {
118 std::string msg(e.what());
119 ASSERT_TRUE(
120 msg.find("Stoichiometric ionic strength calculation: Number of kinetic species in mgd not "
121 "equal to the size of "
122 "kin_species_molality") != std::string::npos)
123 << "Failed with unexpected error message: " << msg;
124 }
125}
Real stoichiometricIonicStrength(const ModelGeochemicalDatabase &mgd, const std::vector< Real > &basis_species_molality, const std::vector< Real > &eqm_species_molality, const std::vector< Real > &kin_species_molality) const
Compute stoichiometric ionic strength.