Skip to content

Commit

Permalink
Squashed 'src/phast/PhreeqcRM/' changes from bfe6cff1..7f920f81
Browse files Browse the repository at this point in the history
7f920f81 Merge commit 'e372ef5c505daf93fcd156b46d541bdea9ab4b78'
e372ef5c Squashed 'src/' changes from ce8a68fa..8717ceaa
2233eb2e Merge pull request #176 from scharlton2/174-access-violation-with-380-16920-but-not-with-373-15968-usgs-website
2dc65f0e Added gfw check
fc847564 Merge pull request #175 from LimnoTech/master
e90c316c Rerun for latest release of phreeqcrm
8e69ef33 Merge branch 'usgs-coupled:master' into master
028fac72 Merge remote-tracking branch 'upstream/master'
3c39cc90 Make section titles consistent
37ae35bd Split YAML code into smaller groups
f539b859 Update plot at a single time step
b5d8792a Create new plot as a function of grid cell for a single time
9de25bef BMI notebook example improved markdown
d4fd7038 Update exchange plot
1a46984f Update formatting
34819d18 Plot exchange results
47aad2a9 Format comments to comply wit python line limits
7049ae8c Started adding markdown to ex11 notebook
bfe0340e Merge branch 'usgs-coupled:master' into master
797f8943 Add notes to YAML code cell
f2362945 Make two-dimensional arrays for molality results
70cab095 Add comments to Example 11

git-subtree-dir: src/phast/PhreeqcRM
git-subtree-split: 7f920f817d14db9dabc417719e862180fa736581
  • Loading branch information
Darth Vader committed Aug 22, 2024
1 parent aa17ca7 commit a141579
Show file tree
Hide file tree
Showing 2 changed files with 995 additions and 203 deletions.
42 changes: 36 additions & 6 deletions 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 a141579

Please # to comment.