Skip to content

Commit

Permalink
Merge commit 'a141579e6bd7ea7430bb07312ddb56649fb46829'
Browse files Browse the repository at this point in the history
  • Loading branch information
Darth Vader committed Aug 22, 2024
2 parents 536f6aa + a141579 commit a79990b
Show file tree
Hide file tree
Showing 2 changed files with 995 additions and 203 deletions.
42 changes: 36 additions & 6 deletions src/phast/PhreeqcRM/src/PhreeqcRM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,12 @@ PhreeqcRM::Concentrations2SolutionsH2O(int n, std::vector<double> &c)
int start = this->start_cell[n];
int end = this->end_cell[n];
#endif

if (gfw.size() == 0)
{
this->ErrorMessage("FindComponents must be called before this point, stopping.", true);
std::cerr << "ERROR: FindComponents must be called before this point, stopping." << std::endl;
throw PhreeqcRMStop();
}
for (j = start; j <= end; j++)
{
std::vector<double> d; // scratch space to convert from mass fraction to moles
Expand Down Expand Up @@ -1192,7 +1197,12 @@ PhreeqcRM::Concentrations2SolutionsNoH2O(int n, std::vector<double> &c)
int start = this->start_cell[n];
int end = this->end_cell[n];
#endif

if (gfw.size() == 0)
{
this->ErrorMessage("FindComponents must be called before this point, stopping.", true);
std::cerr << "ERROR: FindComponents must be called before this point, stopping." << std::endl;
throw PhreeqcRMStop();
}
for (j = start; j <= end; j++)
{
std::vector<double> d; // scratch space to convert from mass fraction to moles
Expand Down Expand Up @@ -1292,7 +1302,12 @@ PhreeqcRM::Concentrations2UtilityH2O(const std::vector<double> &c_in,
size_t ncomps = this->components.size();
size_t nsolns = c.size() / ncomps;
size_t nutil= this->nthreads + 1;

if (gfw.size() == 0)
{
this->ErrorMessage("FindComponents must be called before this point, stopping.", true);
std::cerr << "ERROR: FindComponents must be called before this point, stopping." << std::endl;
throw PhreeqcRMStop();
}
for (size_t i = 0; i < nsolns; i++)
{
std::vector<double> d; // scratch space to convert from mass fraction to moles
Expand Down Expand Up @@ -1368,7 +1383,12 @@ PhreeqcRM::Concentrations2UtilityNoH2O(const std::vector<double> &c_in,
size_t ncomps = this->components.size();
size_t nsolns = c.size() / ncomps;
size_t nutil= this->nthreads + 1;

if (gfw.size() == 0)
{
this->ErrorMessage("FindComponents must be called before this point, stopping.", true);
std::cerr << "ERROR: FindComponents must be called before this point, stopping." << std::endl;
throw PhreeqcRMStop();
}
for (size_t i = 0; i < nsolns; i++)
{
std::vector<double> d; // scratch space to convert from mass fraction to moles
Expand Down Expand Up @@ -1796,7 +1816,12 @@ PhreeqcRM::cxxSolution2concentrationH2O(cxxSolution * cxxsoln_ptr, std::vector<d
/* ---------------------------------------------------------------------- */
{
d.clear();

if (gfw.size() == 0)
{
this->ErrorMessage("FindComponents must be called before this point, stopping.", true);
std::cerr << "ERROR: FindComponents must be called before this point, stopping." << std::endl;
throw PhreeqcRMStop();
}
// Simplify totals
{
cxxNameDouble nd = cxxsoln_ptr->Get_totals().Simplify_redox();
Expand Down Expand Up @@ -1867,7 +1892,12 @@ PhreeqcRM::cxxSolution2concentrationNoH2O(cxxSolution * cxxsoln_ptr, std::vector
cxxNameDouble nd = cxxsoln_ptr->Get_totals().Simplify_redox();
cxxsoln_ptr->Set_totals(nd);
}

if (gfw.size() == 0)
{
this->ErrorMessage("FindComponents must be called before this point, stopping.", true);
std::cerr << "ERROR: FindComponents must be called before this point, stopping." << std::endl;
throw PhreeqcRMStop();
}
// convert units
switch (this->units_Solution)
{
Expand Down
Loading

0 comments on commit a79990b

Please # to comment.