Commit 9d5132d1 authored by Renchao Lu's avatar Renchao Lu Committed by renchao.lu
Browse files

[CL] Unconstify mesh.

parent 6c329b10
......@@ -20,7 +20,7 @@ namespace ChemistryLib
namespace PhreeqcIOData
{
std::unique_ptr<AqueousSolution> createAqueousSolution(
BaseLib::ConfigTree const& config, MeshLib::Mesh const& mesh)
BaseLib::ConfigTree const& config, MeshLib::Mesh& mesh)
{
//! \ogs_file_param{prj__chemical_system__solution__temperature}
auto const temperature = config.getConfigParameter<double>("temperature");
......@@ -32,10 +32,7 @@ std::unique_ptr<AqueousSolution> createAqueousSolution(
auto const pe0 = config.getConfigParameter<double>("pe");
auto pe = MeshLib::getOrCreateMeshProperty<double>(
const_cast<MeshLib::Mesh&>(mesh),
"pe",
MeshLib::MeshItemType::IntegrationPoint,
1);
mesh, "pe", MeshLib::MeshItemType::IntegrationPoint, 1);
auto components = createSolutionComponents(config);
......
......@@ -29,6 +29,6 @@ namespace PhreeqcIOData
struct AqueousSolution;
std::unique_ptr<AqueousSolution> createAqueousSolution(
BaseLib::ConfigTree const& config, MeshLib::Mesh const& mesh);
BaseLib::ConfigTree const& config, MeshLib::Mesh& mesh);
} // namespace PhreeqcIOData
} // namespace ChemistryLib
......@@ -22,7 +22,7 @@ namespace ChemistryLib
namespace PhreeqcIOData
{
std::unique_ptr<ChemicalSystem> createChemicalSystem(
BaseLib::ConfigTree const& config, MeshLib::Mesh const& mesh)
BaseLib::ConfigTree const& config, MeshLib::Mesh& mesh)
{
// solution
auto aqueous_solution = createAqueousSolution(
......
......@@ -29,6 +29,6 @@ namespace PhreeqcIOData
struct ChemicalSystem;
std::unique_ptr<ChemicalSystem> createChemicalSystem(
BaseLib::ConfigTree const& config, MeshLib::Mesh const& mesh);
BaseLib::ConfigTree const& config, MeshLib::Mesh& mesh);
} // namespace PhreeqcIOData
} // namespace ChemistryLib
......@@ -20,8 +20,7 @@ namespace ChemistryLib
namespace PhreeqcIOData
{
std::vector<EquilibriumReactant> createEquilibriumReactants(
boost::optional<BaseLib::ConfigTree> const& config,
MeshLib::Mesh const& mesh)
boost::optional<BaseLib::ConfigTree> const& config, MeshLib::Mesh& mesh)
{
if (!config)
{
......@@ -49,10 +48,7 @@ std::vector<EquilibriumReactant> createEquilibriumReactants(
"saturation_index");
auto amount = MeshLib::getOrCreateMeshProperty<double>(
const_cast<MeshLib::Mesh&>(mesh),
name,
MeshLib::MeshItemType::IntegrationPoint,
1);
mesh, name, MeshLib::MeshItemType::IntegrationPoint, 1);
equilibrium_reactants.emplace_back(
std::move(name), amount, initial_amount, saturation_index);
......
......@@ -33,7 +33,6 @@ namespace PhreeqcIOData
struct EquilibriumReactant;
std::vector<EquilibriumReactant> createEquilibriumReactants(
boost::optional<BaseLib::ConfigTree> const& config,
MeshLib::Mesh const& mesh);
boost::optional<BaseLib::ConfigTree> const& config, MeshLib::Mesh& mesh);
} // namespace PhreeqcIOData
} // namespace ChemistryLib
......@@ -20,8 +20,7 @@ namespace ChemistryLib
namespace PhreeqcIOData
{
std::vector<KineticReactant> createKineticReactants(
boost::optional<BaseLib::ConfigTree> const& config,
MeshLib::Mesh const& mesh)
boost::optional<BaseLib::ConfigTree> const& config, MeshLib::Mesh& mesh)
{
if (!config)
{
......@@ -56,10 +55,7 @@ std::vector<KineticReactant> createKineticReactants(
reactant_config.getConfigParameter<bool>("fix_amount", false);
auto amount = MeshLib::getOrCreateMeshProperty<double>(
const_cast<MeshLib::Mesh&>(mesh),
name,
MeshLib::MeshItemType::IntegrationPoint,
1);
mesh, name, MeshLib::MeshItemType::IntegrationPoint, 1);
if (chemical_formula.empty() && fix_amount)
{
......
......@@ -33,7 +33,6 @@ namespace PhreeqcIOData
struct KineticReactant;
std::vector<KineticReactant> createKineticReactants(
boost::optional<BaseLib::ConfigTree> const& config,
MeshLib::Mesh const& mesh);
boost::optional<BaseLib::ConfigTree> const& config, MeshLib::Mesh& mesh);
} // namespace PhreeqcIOData
} // namespace ChemistryLib
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment