diff --git a/ChemistryLib/PhreeqcKernel.cpp b/ChemistryLib/PhreeqcKernel.cpp index f2f77c8348dc51c5e7b3ee1d9ef991e5d129cb32..6f9f652b3a14527920a48737eea7bd19a1e0a5c5 100644 --- a/ChemistryLib/PhreeqcKernel.cpp +++ b/ChemistryLib/PhreeqcKernel.cpp @@ -184,6 +184,11 @@ void PhreeqcKernel::executeSpeciationCalculation(double const dt) callPhreeqc(process_solutions); } +static bool isHydrogen(std::string_view const element) +{ + return element == "H"; +} + void PhreeqcKernel::setAqueousSolutions( std::vector<GlobalVector*> const& process_solutions) { @@ -209,7 +214,7 @@ void PhreeqcKernel::setAqueousSolutions( auto& transport_process_solution = process_solutions[transport_process_id]; - auto& element_name = master_species->elt->name; + char const* const element_name = master_species->elt->name; auto const concentration = transport_process_solution->get(chemical_system_id); if (isHydrogen(element_name)) @@ -339,7 +344,7 @@ void PhreeqcKernel::updateNodalProcessSolutions( auto& transport_process_solution = process_solutions[transport_process_id]; - auto const& element_name = master_species->elt->name; + char const* const element_name = master_species->elt->name; if (isHydrogen(element_name)) { // Update hydrogen concentration by pH value. diff --git a/ChemistryLib/PhreeqcKernel.h b/ChemistryLib/PhreeqcKernel.h index 0f57f858d132b47f40b7152dab8e97e530092859..949ac830220b422dd05aa5f63e83359fe3903665 100644 --- a/ChemistryLib/PhreeqcKernel.h +++ b/ChemistryLib/PhreeqcKernel.h @@ -69,11 +69,6 @@ private: cxxISolution* getOrCreateInitialAqueousSolution( cxxSolution& aqueous_solution); - bool isHydrogen(char const* element) const - { - return strcmp(element, "H") == 0; - } - void setTimeStepSize(double const dt); void reset(std::size_t const chemical_system_id);