From e821b4569f87f0c118a56559a9e73590e44f5622 Mon Sep 17 00:00:00 2001
From: Dmitri Naumov <github@naumov.de>
Date: Mon, 11 Jan 2021 19:10:01 +0100
Subject: [PATCH] Fix constness of arguments and variables.

Use const references where necessary.
---
 Applications/FileIO/TetGenInterface.cpp       |  2 +-
 Applications/FileIO/TetGenInterface.h         |  2 +-
 ...CreateBoundaryConditionsAlongPolylines.cpp |  4 ++--
 .../Utils/MeshEdit/swapNodeCoordinateAxes.cpp |  3 ++-
 .../PartitionMesh/NodeWiseMeshPartitioner.cpp |  2 +-
 ChemistryLib/PhreeqcIO.cpp                    |  2 +-
 ChemistryLib/PhreeqcIO.h                      |  2 +-
 .../CreateCohesiveZoneModeI.cpp               |  8 ++++----
 .../CreateLinearElasticIsotropic.cpp          |  4 ++--
 .../BoundaryElementsAlongPolyline.cpp         |  2 +-
 MeshGeoToolsLib/MeshNodesAlongSurface.cpp     |  2 +-
 .../ComponentTransportFEM.h                   |  2 +-
 ProcessLib/Output/Output.cpp                  |  2 +-
 .../PhaseField/CreatePhaseFieldProcess.cpp    | 12 ++++++------
 ProcessLib/PhaseField/PhaseFieldProcessData.h |  2 +-
 ProcessLib/Process.cpp                        |  2 +-
 ProcessLib/Process.h                          |  2 +-
 ProcessLib/ProcessVariable.cpp                |  2 +-
 ...reateRichardsComponentTransportProcess.cpp |  2 +-
 .../CreateSmallDeformationProcess.cpp         |  2 +-
 .../CreateSmallDeformationNonlocalProcess.cpp |  2 +-
 ...CreateThermalTwoPhaseFlowWithPPProcess.cpp |  8 ++++----
 .../ThermalTwoPhaseFlowWithPPLocalAssembler.h |  2 +-
 .../CreateThermoHydroMechanicsProcess.cpp     |  2 +-
 ...reateThermoMechanicalPhaseFieldProcess.cpp | 19 ++++++++++---------
 .../CreateThermoMechanicsProcess.cpp          | 16 ++++++++--------
 .../CreateTwoPhaseFlowWithPPProcess.cpp       |  2 +-
 .../CreateTwoPhaseFlowWithPrhoProcess.cpp     |  6 +++---
 28 files changed, 60 insertions(+), 58 deletions(-)

diff --git a/Applications/FileIO/TetGenInterface.cpp b/Applications/FileIO/TetGenInterface.cpp
index 09ff26c2ad0..133245369a1 100644
--- a/Applications/FileIO/TetGenInterface.cpp
+++ b/Applications/FileIO/TetGenInterface.cpp
@@ -293,7 +293,7 @@ bool TetGenInterface::readNodesFromStream (std::ifstream &ins,
     return false;
 }
 
-bool TetGenInterface::parseNodesFileHeader(std::string& line,
+bool TetGenInterface::parseNodesFileHeader(std::string const& line,
                                            std::size_t& n_nodes,
                                            std::size_t& dim,
                                            std::size_t& n_attributes,
diff --git a/Applications/FileIO/TetGenInterface.h b/Applications/FileIO/TetGenInterface.h
index 690fece898f..7b8eca28e52 100644
--- a/Applications/FileIO/TetGenInterface.h
+++ b/Applications/FileIO/TetGenInterface.h
@@ -122,7 +122,7 @@ private:
      * @param boundary_markers  have the nodes boundary information (output)
      * @return true, if the file header is read, false if the method detects an error
      */
-    static bool parseNodesFileHeader(std::string& line,
+    static bool parseNodesFileHeader(std::string const& line,
                                      std::size_t& n_nodes,
                                      std::size_t& dim,
                                      std::size_t& n_attributes,
diff --git a/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp b/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp
index a481b08ea1c..ed3682d203f 100644
--- a/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp
+++ b/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp
@@ -85,8 +85,8 @@ void writeLiquidFlowPointBC(std::ostream & bc_out, std::string const& pnt_name)
 // set on, geo_name is the name the geometry can be accessed with, out_fname is
 // the base file name the gli and bc as well as the gml file will be written to.
 void writeBCsAndGeometry(GeoLib::GEOObjects& geometry_sets,
-                         std::string& geo_name, std::string const& out_fname,
-                         std::string const& bc_type, bool write_gml)
+                         std::string const& geo_name, std::string const& out_fname,
+                         std::string const& bc_type, bool const write_gml)
 {
     if (write_gml) {
         INFO("write points to '{:s}.gml'.", geo_name);
diff --git a/Applications/Utils/MeshEdit/swapNodeCoordinateAxes.cpp b/Applications/Utils/MeshEdit/swapNodeCoordinateAxes.cpp
index 67f3ba7ecea..3fd895d738f 100644
--- a/Applications/Utils/MeshEdit/swapNodeCoordinateAxes.cpp
+++ b/Applications/Utils/MeshEdit/swapNodeCoordinateAxes.cpp
@@ -22,7 +22,8 @@
 #include "MeshLib/IO/readMeshFromFile.h"
 #include "MeshLib/IO/writeMeshToFile.h"
 
-static void swapNodeCoordinateAxes(MeshLib::Mesh &mesh, std::array<int, 3> const& new_axes_indices)
+static void swapNodeCoordinateAxes(MeshLib::Mesh const& mesh,
+                                   std::array<int, 3> const& new_axes_indices)
 {
     double new_coords[3] = {};
     for (MeshLib::Node* node : mesh.getNodes())
diff --git a/Applications/Utils/ModelPreparation/PartitionMesh/NodeWiseMeshPartitioner.cpp b/Applications/Utils/ModelPreparation/PartitionMesh/NodeWiseMeshPartitioner.cpp
index dea72ae4a19..1f62801d481 100644
--- a/Applications/Utils/ModelPreparation/PartitionMesh/NodeWiseMeshPartitioner.cpp
+++ b/Applications/Utils/ModelPreparation/PartitionMesh/NodeWiseMeshPartitioner.cpp
@@ -381,7 +381,7 @@ bool copyPropertyVector(
     MeshLib::Properties& partitioned_properties,
     std::vector<Partition> const& partitions,
     MeshLib::PropertyVector<T> const* const pv,
-    std::map<MeshLib::MeshItemType, std::size_t> const total_number_of_tuples)
+    std::map<MeshLib::MeshItemType, std::size_t> const& total_number_of_tuples)
 {
     if (pv == nullptr)
     {
diff --git a/ChemistryLib/PhreeqcIO.cpp b/ChemistryLib/PhreeqcIO.cpp
index 3155ed8c1fb..2cba14a7570 100644
--- a/ChemistryLib/PhreeqcIO.cpp
+++ b/ChemistryLib/PhreeqcIO.cpp
@@ -128,7 +128,7 @@ static double averageReactantMolality(
 }
 }  // namespace
 
-PhreeqcIO::PhreeqcIO(std::string const project_file_name,
+PhreeqcIO::PhreeqcIO(std::string const& project_file_name,
                      std::string&& database,
                      std::unique_ptr<ChemicalSystem>&& chemical_system,
                      std::vector<ReactionRate>&& reaction_rates,
diff --git a/ChemistryLib/PhreeqcIO.h b/ChemistryLib/PhreeqcIO.h
index 1e9d189ba94..be513a73635 100644
--- a/ChemistryLib/PhreeqcIO.h
+++ b/ChemistryLib/PhreeqcIO.h
@@ -34,7 +34,7 @@ struct UserPunch;
 class PhreeqcIO final : public ChemicalSolverInterface
 {
 public:
-    PhreeqcIO(std::string const project_file_name,
+    PhreeqcIO(std::string const& project_file_name,
               std::string&& database,
               std::unique_ptr<ChemicalSystem>&& chemical_system,
               std::vector<ReactionRate>&& reaction_rates,
diff --git a/MaterialLib/FractureModels/CreateCohesiveZoneModeI.cpp b/MaterialLib/FractureModels/CreateCohesiveZoneModeI.cpp
index ab2d8447293..2c74cfa633b 100644
--- a/MaterialLib/FractureModels/CreateCohesiveZoneModeI.cpp
+++ b/MaterialLib/FractureModels/CreateCohesiveZoneModeI.cpp
@@ -28,19 +28,19 @@ std::unique_ptr<FractureModelBase<DisplacementDim>> createCohesiveZoneModeI(
     config.checkConfigParameter("type", "CohesiveZoneModeI");
     DBUG("Create CohesiveZoneModeI material");
 
-    auto& Kn = ParameterLib::findParameter<double>(
+    auto const& Kn = ParameterLib::findParameter<double>(
         //! \ogs_file_param_special{material__fracture_model__CohesiveZoneModeI__normal_stiffness}
         config, "normal_stiffness", parameters, 1);
 
-    auto& Ks = ParameterLib::findParameter<double>(
+    auto const& Ks = ParameterLib::findParameter<double>(
         //! \ogs_file_param_special{material__fracture_model__CohesiveZoneModeI__shear_stiffness}
         config, "shear_stiffness", parameters, 1);
 
-    auto& Gc = ParameterLib::findParameter<double>(
+    auto const& Gc = ParameterLib::findParameter<double>(
         //! \ogs_file_param_special{material__fracture_model__CohesiveZoneModeI__fracture_toughness}
         config, "fracture_toughness", parameters, 1);
 
-    auto& t_np = ParameterLib::findParameter<double>(
+    auto const& t_np = ParameterLib::findParameter<double>(
         //! \ogs_file_param_special{material__fracture_model__CohesiveZoneModeI__peak_normal_traction}
         config, "peak_normal_traction", parameters, 1);
 
diff --git a/MaterialLib/FractureModels/CreateLinearElasticIsotropic.cpp b/MaterialLib/FractureModels/CreateLinearElasticIsotropic.cpp
index 7c78eb3b246..e420688ee43 100644
--- a/MaterialLib/FractureModels/CreateLinearElasticIsotropic.cpp
+++ b/MaterialLib/FractureModels/CreateLinearElasticIsotropic.cpp
@@ -27,11 +27,11 @@ createLinearElasticIsotropic(
     config.checkConfigParameter("type", "LinearElasticIsotropic");
     DBUG("Create LinearElasticIsotropic material");
 
-    auto& Kn = ParameterLib::findParameter<double>(
+    auto const& Kn = ParameterLib::findParameter<double>(
         //! \ogs_file_param_special{material__fracture_model__LinearElasticIsotropic__normal_stiffness}
         config, "normal_stiffness", parameters, 1);
 
-    auto& Ks = ParameterLib::findParameter<double>(
+    auto const& Ks = ParameterLib::findParameter<double>(
         //! \ogs_file_param_special{material__fracture_model__LinearElasticIsotropic__shear_stiffness}
         config, "shear_stiffness", parameters, 1);
 
diff --git a/MeshGeoToolsLib/BoundaryElementsAlongPolyline.cpp b/MeshGeoToolsLib/BoundaryElementsAlongPolyline.cpp
index 7e984d237be..6c5b3362d73 100644
--- a/MeshGeoToolsLib/BoundaryElementsAlongPolyline.cpp
+++ b/MeshGeoToolsLib/BoundaryElementsAlongPolyline.cpp
@@ -32,7 +32,7 @@ BoundaryElementsAlongPolyline::BoundaryElementsAlongPolyline(
     auto node_ids_on_poly = mshNodeSearcher.getMeshNodeIDs(ply);
     MeshLib::ElementSearch es(_mesh);
     es.searchByNodeIDs(node_ids_on_poly);
-    auto& ele_ids_near_ply = es.getSearchedElementIDs();
+    auto const& ele_ids_near_ply = es.getSearchedElementIDs();
 
     // check all edges of the elements near the polyline
     for (auto ele_id : ele_ids_near_ply)
diff --git a/MeshGeoToolsLib/MeshNodesAlongSurface.cpp b/MeshGeoToolsLib/MeshNodesAlongSurface.cpp
index 46ffd36be01..bafc4c25486 100644
--- a/MeshGeoToolsLib/MeshNodesAlongSurface.cpp
+++ b/MeshGeoToolsLib/MeshNodesAlongSurface.cpp
@@ -28,7 +28,7 @@ MeshNodesAlongSurface::MeshNodesAlongSurface(MeshLib::Mesh const& mesh,
                                              SearchAllNodes search_all_nodes)
     : _mesh(mesh), _sfc(sfc)
 {
-    auto& mesh_nodes = _mesh.getNodes();
+    auto const& mesh_nodes = _mesh.getNodes();
     const std::size_t n_nodes(search_all_nodes == SearchAllNodes::Yes
                                   ? _mesh.getNumberOfNodes()
                                   : _mesh.getNumberOfBaseNodes());
diff --git a/ProcessLib/ComponentTransport/ComponentTransportFEM.h b/ProcessLib/ComponentTransport/ComponentTransportFEM.h
index b117cab6280..f6ef6990f21 100644
--- a/ProcessLib/ComponentTransport/ComponentTransportFEM.h
+++ b/ProcessLib/ComponentTransport/ComponentTransportFEM.h
@@ -185,7 +185,7 @@ public:
         bool is_axially_symmetric,
         unsigned const integration_order,
         ComponentTransportProcessData const& process_data,
-        std::vector<std::reference_wrapper<ProcessVariable>>
+        std::vector<std::reference_wrapper<ProcessVariable>> const&
             transport_process_variables)
         : _element(element),
           _process_data(process_data),
diff --git a/ProcessLib/Output/Output.cpp b/ProcessLib/Output/Output.cpp
index 82719102170..8c56b48edcc 100644
--- a/ProcessLib/Output/Output.cpp
+++ b/ProcessLib/Output/Output.cpp
@@ -302,7 +302,7 @@ void Output::doOutputAlways(Process const& process,
         return;
     }
 
-    auto output_bulk_mesh = [&](MeshLib::Mesh& mesh) {
+    auto output_bulk_mesh = [&](MeshLib::Mesh const& mesh) {
         MeshLib::IO::PVDFile* pvd_file = nullptr;
         if (_output_file_type == ProcessLib::OutputType::vtk)
         {
diff --git a/ProcessLib/PhaseField/CreatePhaseFieldProcess.cpp b/ProcessLib/PhaseField/CreatePhaseFieldProcess.cpp
index 398b7b81378..98c4f8d0a72 100644
--- a/ProcessLib/PhaseField/CreatePhaseFieldProcess.cpp
+++ b/ProcessLib/PhaseField/CreatePhaseFieldProcess.cpp
@@ -112,42 +112,42 @@ std::unique_ptr<Process> createPhaseFieldProcess(
         config.getConfigSubtree("phasefield_parameters");
 
     // Residual stiffness
-    auto& residual_stiffness = ParameterLib::findParameter<double>(
+    auto const& residual_stiffness = ParameterLib::findParameter<double>(
         phasefield_parameters_config,
         //! \ogs_file_param_special{prj__processes__process__PHASE_FIELD__phasefield_parameters__residual_stiffness}
         "residual_stiffness", parameters, 1);
     DBUG("Use '{:s}' as residual stiffness.", residual_stiffness.name);
 
     // Crack resistance
-    auto& crack_resistance = ParameterLib::findParameter<double>(
+    auto const& crack_resistance = ParameterLib::findParameter<double>(
         phasefield_parameters_config,
         //! \ogs_file_param_special{prj__processes__process__PHASE_FIELD__phasefield_parameters__crack_resistance}
         "crack_resistance", parameters, 1);
     DBUG("Use '{:s}' as crack resistance.", crack_resistance.name);
 
     // Crack length scale
-    auto& crack_length_scale = ParameterLib::findParameter<double>(
+    auto const& crack_length_scale = ParameterLib::findParameter<double>(
         phasefield_parameters_config,
         //! \ogs_file_param_special{prj__processes__process__PHASE_FIELD__phasefield_parameters__crack_length_scale}
         "crack_length_scale", parameters, 1);
     DBUG("Use '{:s}' as crack length scale.", crack_length_scale.name);
 
     // Kinetic coefficient
-    auto& kinetic_coefficient = ParameterLib::findParameter<double>(
+    auto const& kinetic_coefficient = ParameterLib::findParameter<double>(
         phasefield_parameters_config,
         //! \ogs_file_param_special{prj__processes__process__PHASE_FIELD__phasefield_parameters__kinetic_coefficient}
         "kinetic_coefficient", parameters, 1);
     DBUG("Use '{:s}' as kinetic coefficient.", kinetic_coefficient.name);
 
     // Solid density
-    auto& solid_density = ParameterLib::findParameter<double>(
+    auto const& solid_density = ParameterLib::findParameter<double>(
         config,
         //! \ogs_file_param_special{prj__processes__process__PHASE_FIELD__solid_density}
         "solid_density", parameters, 1);
     DBUG("Use '{:s}' as solid density parameter.", solid_density.name);
 
     // History field
-    auto& history_field = ParameterLib::findParameter<double>(
+    auto const& history_field = ParameterLib::findParameter<double>(
         phasefield_parameters_config,
         //! \ogs_file_param_special{prj__processes__process__PHASE_FIELD__phasefield_parameters__history_field}
         "history_field", parameters, 1);
diff --git a/ProcessLib/PhaseField/PhaseFieldProcessData.h b/ProcessLib/PhaseField/PhaseFieldProcessData.h
index 6dc06f20979..c7354455923 100644
--- a/ProcessLib/PhaseField/PhaseFieldProcessData.h
+++ b/ProcessLib/PhaseField/PhaseFieldProcessData.h
@@ -43,7 +43,7 @@ struct PhaseFieldProcessData
     ParameterLib::Parameter<double> const& crack_length_scale;
     ParameterLib::Parameter<double> const& kinetic_coefficient;
     ParameterLib::Parameter<double> const& solid_density;
-    ParameterLib::Parameter<double>& history_field;
+    ParameterLib::Parameter<double> const& history_field;
     Eigen::Matrix<double, DisplacementDim, 1> const specific_body_force;
     bool propagating_crack = false;
     bool crack_pressure = false;
diff --git a/ProcessLib/Process.cpp b/ProcessLib/Process.cpp
index 051b311a24e..60f58a75a6b 100644
--- a/ProcessLib/Process.cpp
+++ b/ProcessLib/Process.cpp
@@ -110,7 +110,7 @@ void Process::initialize()
 
 void Process::setInitialConditions(
     std::vector<GlobalVector*>& process_solutions,
-    std::vector<GlobalVector*>& process_solutions_prev,
+    std::vector<GlobalVector*> const& process_solutions_prev,
     double const t,
     int const process_id)
 {
diff --git a/ProcessLib/Process.h b/ProcessLib/Process.h
index 66e97859f8b..c8026db328e 100644
--- a/ProcessLib/Process.h
+++ b/ProcessLib/Process.h
@@ -84,7 +84,7 @@ public:
 
     void setInitialConditions(
         std::vector<GlobalVector*>& process_solutions,
-        std::vector<GlobalVector*>& process_solutions_prev,
+        std::vector<GlobalVector*> const& process_solutions_prev,
         double const t,
         int const process_id);
 
diff --git a/ProcessLib/ProcessVariable.cpp b/ProcessLib/ProcessVariable.cpp
index 22ca5a108db..bb59622fcfc 100644
--- a/ProcessLib/ProcessVariable.cpp
+++ b/ProcessLib/ProcessVariable.cpp
@@ -331,7 +331,7 @@ std::vector<std::unique_ptr<SourceTerm>> ProcessVariable::createSourceTerms(
     std::vector<std::unique_ptr<SourceTerm>> source_terms;
 
     transform(cbegin(_source_term_configs), cend(_source_term_configs),
-              back_inserter(source_terms), [&](auto& config) {
+              back_inserter(source_terms), [&](auto const& config) {
                   return createSourceTerm(config, dof_table, config.mesh,
                                           variable_id, integration_order,
                                           _shapefunction_order, parameters);
diff --git a/ProcessLib/RichardsComponentTransport/CreateRichardsComponentTransportProcess.cpp b/ProcessLib/RichardsComponentTransport/CreateRichardsComponentTransportProcess.cpp
index be71fead25d..719f557ea86 100644
--- a/ProcessLib/RichardsComponentTransport/CreateRichardsComponentTransportProcess.cpp
+++ b/ProcessLib/RichardsComponentTransport/CreateRichardsComponentTransportProcess.cpp
@@ -86,7 +86,7 @@ std::unique_ptr<Process> createRichardsComponentTransportProcess(
         MaterialLib::Fluid::createFluidProperties(fluid_config);
 
     // Parameter for the density of the fluid.
-    auto& fluid_reference_density = ParameterLib::findParameter<double>(
+    auto const& fluid_reference_density = ParameterLib::findParameter<double>(
         config,
         //! \ogs_file_param_special{prj__processes__process__RichardsComponentTransport__fluid_reference_density}
         "fluid_reference_density", parameters, 1, &mesh);
diff --git a/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.cpp b/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.cpp
index 43d5bfcbd1c..c8fb2d2d88e 100644
--- a/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.cpp
+++ b/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.cpp
@@ -72,7 +72,7 @@ std::unique_ptr<Process> createSmallDeformationProcess(
             parameters, local_coordinate_system, config);
 
     // Solid density
-    auto& solid_density = ParameterLib::findParameter<double>(
+    auto const& solid_density = ParameterLib::findParameter<double>(
         config,
         //! \ogs_file_param_special{prj__processes__process__SMALL_DEFORMATION__solid_density}
         "solid_density", parameters, 1, &mesh);
diff --git a/ProcessLib/SmallDeformationNonlocal/CreateSmallDeformationNonlocalProcess.cpp b/ProcessLib/SmallDeformationNonlocal/CreateSmallDeformationNonlocalProcess.cpp
index b37a6a43085..e80230eb01d 100644
--- a/ProcessLib/SmallDeformationNonlocal/CreateSmallDeformationNonlocalProcess.cpp
+++ b/ProcessLib/SmallDeformationNonlocal/CreateSmallDeformationNonlocalProcess.cpp
@@ -72,7 +72,7 @@ std::unique_ptr<Process> createSmallDeformationNonlocalProcess(
             parameters, local_coordinate_system, config);
 
     // Solid density
-    auto& solid_density = ParameterLib::findParameter<double>(
+    auto const& solid_density = ParameterLib::findParameter<double>(
         config,
         //! \ogs_file_param_special{prj__processes__process__SMALL_DEFORMATION_NONLOCAL__solid_density}
         "solid_density", parameters, 1, &mesh);
diff --git a/ProcessLib/ThermalTwoPhaseFlowWithPP/CreateThermalTwoPhaseFlowWithPPProcess.cpp b/ProcessLib/ThermalTwoPhaseFlowWithPP/CreateThermalTwoPhaseFlowWithPPProcess.cpp
index 441d6b92874..8ad8fca48f7 100644
--- a/ProcessLib/ThermalTwoPhaseFlowWithPP/CreateThermalTwoPhaseFlowWithPPProcess.cpp
+++ b/ProcessLib/ThermalTwoPhaseFlowWithPP/CreateThermalTwoPhaseFlowWithPPProcess.cpp
@@ -74,25 +74,25 @@ std::unique_ptr<Process> createThermalTwoPhaseFlowWithPPProcess(
     //! \ogs_file_param{prj__processes__process__TWOPHASE_FLOW_THERMAL__mass_lumping}
     auto mass_lumping = config.getConfigParameter<bool>("mass_lumping");
     // diffusion coeff
-    auto& diff_coeff_b = ParameterLib::findParameter<double>(
+    auto const& diff_coeff_b = ParameterLib::findParameter<double>(
         config,
         //! \ogs_file_param_special{prj__processes__process__TWOPHASE_FLOW_THERMAL__diffusion_coeff_component_b}
         "diffusion_coeff_component_b", parameters, 1, &mesh);
-    auto& diff_coeff_a = ParameterLib::findParameter<double>(
+    auto const& diff_coeff_a = ParameterLib::findParameter<double>(
         config,
         //! \ogs_file_param_special{prj__processes__process__TWOPHASE_FLOW_THERMAL__diffusion_coeff_component_a}
         "diffusion_coeff_component_a", parameters, 1, &mesh);
 
     // Parameter for the density of the solid.
 
-    auto& density_solid = ParameterLib::findParameter<double>(
+    auto const& density_solid = ParameterLib::findParameter<double>(
         config,
         //! \ogs_file_param_special{prj__processes__process__TWOPHASE_FLOW_THERMAL__density_solid}
         "density_solid", parameters, 1, &mesh);
     DBUG("Use '{:s}' as density_solid parameter.", density_solid.name);
 
     // Parameter for the latent heat of evaporation.
-    auto& latent_heat_evaporation = ParameterLib::findParameter<double>(
+    auto const& latent_heat_evaporation = ParameterLib::findParameter<double>(
         config,
         //! \ogs_file_param_special{prj__processes__process__TWOPHASE_FLOW_THERMAL__latent_heat_evaporation}
         "latent_heat_evaporation", parameters, 1, &mesh);
diff --git a/ProcessLib/ThermalTwoPhaseFlowWithPP/ThermalTwoPhaseFlowWithPPLocalAssembler.h b/ProcessLib/ThermalTwoPhaseFlowWithPP/ThermalTwoPhaseFlowWithPPLocalAssembler.h
index dd17d244375..25e058e3b2d 100644
--- a/ProcessLib/ThermalTwoPhaseFlowWithPP/ThermalTwoPhaseFlowWithPPLocalAssembler.h
+++ b/ProcessLib/ThermalTwoPhaseFlowWithPP/ThermalTwoPhaseFlowWithPPLocalAssembler.h
@@ -33,7 +33,7 @@ struct IntegrationPointData final
 {
     explicit IntegrationPointData(
         NodalRowVectorType const& N_, GlobalDimNodalMatrixType const& dNdx_,
-        ThermalTwoPhaseFlowWithPPMaterialProperties& material_property_,
+        ThermalTwoPhaseFlowWithPPMaterialProperties const& material_property_,
         double const& integration_weight_, NodalMatrixType const mass_operator_,
         NodalMatrixType const diffusion_operator_)
         : N(N_),
diff --git a/ProcessLib/ThermoHydroMechanics/CreateThermoHydroMechanicsProcess.cpp b/ProcessLib/ThermoHydroMechanics/CreateThermoHydroMechanicsProcess.cpp
index 125f109bd32..0cf615647a2 100644
--- a/ProcessLib/ThermoHydroMechanics/CreateThermoHydroMechanicsProcess.cpp
+++ b/ProcessLib/ThermoHydroMechanics/CreateThermoHydroMechanicsProcess.cpp
@@ -129,7 +129,7 @@ std::unique_ptr<Process> createThermoHydroMechanicsProcess(
             parameters, local_coordinate_system, config);
 
     // reference temperature
-    auto& reference_temperature = ParameterLib::findParameter<double>(
+    auto const& reference_temperature = ParameterLib::findParameter<double>(
         config,
         //! \ogs_file_param_special{prj__processes__process__THERMO_HYDRO_MECHANICS__reference_temperature}
         "reference_temperature", parameters, 1, &mesh);
diff --git a/ProcessLib/ThermoMechanicalPhaseField/CreateThermoMechanicalPhaseFieldProcess.cpp b/ProcessLib/ThermoMechanicalPhaseField/CreateThermoMechanicalPhaseFieldProcess.cpp
index 9abdc346699..fb8fd5db6c7 100644
--- a/ProcessLib/ThermoMechanicalPhaseField/CreateThermoMechanicalPhaseFieldProcess.cpp
+++ b/ProcessLib/ThermoMechanicalPhaseField/CreateThermoMechanicalPhaseFieldProcess.cpp
@@ -128,42 +128,42 @@ std::unique_ptr<Process> createThermoMechanicalPhaseFieldProcess(
         config.getConfigSubtree("thermal_parameters");
 
     // Residual stiffness
-    auto& residual_stiffness = ParameterLib::findParameter<double>(
+    auto const& residual_stiffness = ParameterLib::findParameter<double>(
         phasefield_parameters_config,
         //! \ogs_file_param_special{prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__phasefield_parameters__residual_stiffness}
         "residual_stiffness", parameters, 1, &mesh);
     DBUG("Use '{:s}' as residual stiffness.", residual_stiffness.name);
 
     // Crack resistance
-    auto& crack_resistance = ParameterLib::findParameter<double>(
+    auto const& crack_resistance = ParameterLib::findParameter<double>(
         phasefield_parameters_config,
         //! \ogs_file_param_special{prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__phasefield_parameters__crack_resistance}
         "crack_resistance", parameters, 1, &mesh);
     DBUG("Use '{:s}' as crack resistance.", crack_resistance.name);
 
     // Crack length scale
-    auto& crack_length_scale = ParameterLib::findParameter<double>(
+    auto const& crack_length_scale = ParameterLib::findParameter<double>(
         phasefield_parameters_config,
         //! \ogs_file_param_special{prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__phasefield_parameters__crack_length_scale}
         "crack_length_scale", parameters, 1, &mesh);
     DBUG("Use '{:s}' as crack length scale.", crack_length_scale.name);
 
     // Kinetic coefficient
-    auto& kinetic_coefficient = ParameterLib::findParameter<double>(
+    auto const& kinetic_coefficient = ParameterLib::findParameter<double>(
         phasefield_parameters_config,
         //! \ogs_file_param_special{prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__phasefield_parameters__kinetic_coefficient}
         "kinetic_coefficient", parameters, 1, &mesh);
     DBUG("Use '{:s}' as kinetic coefficient.", kinetic_coefficient.name);
 
     // Solid density
-    auto& solid_density = ParameterLib::findParameter<double>(
+    auto const& solid_density = ParameterLib::findParameter<double>(
         config,
         //! \ogs_file_param_special{prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__reference_solid_density}
         "solid_density", parameters, 1, &mesh);
     DBUG("Use '{:s}' as solid density parameter.", solid_density.name);
 
     // Linear thermal expansion coefficient
-    auto& linear_thermal_expansion_coefficient = ParameterLib::findParameter<
+    auto const& linear_thermal_expansion_coefficient = ParameterLib::findParameter<
         double>(
         thermal_parameters_config,
         //! \ogs_file_param_special{prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__thermal_parameters__linear_thermal_expansion_coefficient}
@@ -172,21 +172,22 @@ std::unique_ptr<Process> createThermoMechanicalPhaseFieldProcess(
          linear_thermal_expansion_coefficient.name);
 
     // Specific heat capacity
-    auto& specific_heat_capacity = ParameterLib::findParameter<double>(
+    auto const& specific_heat_capacity = ParameterLib::findParameter<double>(
         thermal_parameters_config,
         //! \ogs_file_param_special{prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__thermal_parameters__specific_heat_capacity}
         "specific_heat_capacity", parameters, 1, &mesh);
     DBUG("Use '{:s}' as specific heat capacity.", specific_heat_capacity.name);
 
     // Thermal conductivity
-    auto& thermal_conductivity = ParameterLib::findParameter<double>(
+    auto const& thermal_conductivity = ParameterLib::findParameter<double>(
         thermal_parameters_config,
         //! \ogs_file_param_special{prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__thermal_parameters__thermal_conductivity}
         "thermal_conductivity", parameters, 1, &mesh);
     DBUG("Use '{:s}' as thermal conductivity parameter.",
          thermal_conductivity.name);
     // Residual thermal conductivity
-    auto& residual_thermal_conductivity = ParameterLib::findParameter<double>(
+    auto const& residual_thermal_conductivity = ParameterLib::findParameter<
+        double>(
         thermal_parameters_config,
         //! \ogs_file_param_special{prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__thermal_parameters__residual_thermal_conductivity}
         "residual_thermal_conductivity", parameters, 1, &mesh);
diff --git a/ProcessLib/ThermoMechanics/CreateThermoMechanicsProcess.cpp b/ProcessLib/ThermoMechanics/CreateThermoMechanicsProcess.cpp
index 0bc065a17f0..16844323e01 100644
--- a/ProcessLib/ThermoMechanics/CreateThermoMechanicsProcess.cpp
+++ b/ProcessLib/ThermoMechanics/CreateThermoMechanicsProcess.cpp
@@ -119,7 +119,7 @@ std::unique_ptr<Process> createThermoMechanicsProcess(
             parameters, local_coordinate_system, config);
 
     // Reference solid density
-    auto& reference_solid_density = ParameterLib::findParameter<double>(
+    auto const& reference_solid_density = ParameterLib::findParameter<double>(
         config,
         //! \ogs_file_param_special{prj__processes__process__THERMO_MECHANICS__reference_solid_density}
         "reference_solid_density", parameters, 1, &mesh);
@@ -127,22 +127,22 @@ std::unique_ptr<Process> createThermoMechanicsProcess(
          reference_solid_density.name);
 
     // Linear thermal expansion coefficient
-    auto& linear_thermal_expansion_coefficient = ParameterLib::findParameter<
-        double>(
-        config,
-        //! \ogs_file_param_special{prj__processes__process__THERMO_MECHANICS__linear_thermal_expansion_coefficient}
-        "linear_thermal_expansion_coefficient", parameters, 1, &mesh);
+    auto const& linear_thermal_expansion_coefficient =
+        ParameterLib::findParameter<double>(
+            config,
+            //! \ogs_file_param_special{prj__processes__process__THERMO_MECHANICS__linear_thermal_expansion_coefficient}
+            "linear_thermal_expansion_coefficient", parameters, 1, &mesh);
     DBUG("Use '{:s}' as linear thermal expansion coefficient.",
          linear_thermal_expansion_coefficient.name);
     // Specific heat capacity
-    auto& specific_heat_capacity = ParameterLib::findParameter<double>(
+    auto const& specific_heat_capacity = ParameterLib::findParameter<double>(
         config,
         //! \ogs_file_param_special{prj__processes__process__THERMO_MECHANICS__specific_heat_capacity}
         "specific_heat_capacity", parameters, 1, &mesh);
     DBUG("Use '{:s}' as specific heat capacity parameter.",
          specific_heat_capacity.name);
     // Thermal conductivity // TODO To be changed as tensor input.
-    auto& thermal_conductivity = ParameterLib::findParameter<double>(
+    auto const& thermal_conductivity = ParameterLib::findParameter<double>(
         config,
         //! \ogs_file_param_special{prj__processes__process__THERMO_MECHANICS__thermal_conductivity}
         "thermal_conductivity", parameters, 1, &mesh);
diff --git a/ProcessLib/TwoPhaseFlowWithPP/CreateTwoPhaseFlowWithPPProcess.cpp b/ProcessLib/TwoPhaseFlowWithPP/CreateTwoPhaseFlowWithPPProcess.cpp
index 3e1e78e9614..0fdf26e5abf 100644
--- a/ProcessLib/TwoPhaseFlowWithPP/CreateTwoPhaseFlowWithPPProcess.cpp
+++ b/ProcessLib/TwoPhaseFlowWithPP/CreateTwoPhaseFlowWithPPProcess.cpp
@@ -71,7 +71,7 @@ std::unique_ptr<Process> createTwoPhaseFlowWithPPProcess(
     //! \ogs_file_param{prj__processes__process__TWOPHASE_FLOW_PP__mass_lumping}
     auto const mass_lumping = config.getConfigParameter<bool>("mass_lumping");
 
-    auto& temperature = ParameterLib::findParameter<double>(
+    auto const& temperature = ParameterLib::findParameter<double>(
         config,
         //! \ogs_file_param_special{prj__processes__process__TWOPHASE_FLOW_PP__temperature}
         "temperature", parameters, 1, &mesh);
diff --git a/ProcessLib/TwoPhaseFlowWithPrho/CreateTwoPhaseFlowWithPrhoProcess.cpp b/ProcessLib/TwoPhaseFlowWithPrho/CreateTwoPhaseFlowWithPrhoProcess.cpp
index 9929b5bba1a..d81a8219d55 100644
--- a/ProcessLib/TwoPhaseFlowWithPrho/CreateTwoPhaseFlowWithPrhoProcess.cpp
+++ b/ProcessLib/TwoPhaseFlowWithPrho/CreateTwoPhaseFlowWithPrhoProcess.cpp
@@ -68,15 +68,15 @@ std::unique_ptr<Process> createTwoPhaseFlowWithPrhoProcess(
     //! \ogs_file_param{prj__processes__process__TWOPHASE_FLOW_PRHO__mass_lumping}
     auto const mass_lumping = config.getConfigParameter<bool>("mass_lumping");
     // diffusion coeff
-    auto& diff_coeff_b = ParameterLib::findParameter<double>(
+    auto const& diff_coeff_b = ParameterLib::findParameter<double>(
         config,
         //! \ogs_file_param_special{prj__processes__process__TWOPHASE_FLOW_PRHO__diffusion_coeff_component_b}
         "diffusion_coeff_component_b", parameters, 1, &mesh);
-    auto& diff_coeff_a = ParameterLib::findParameter<double>(
+    auto const& diff_coeff_a = ParameterLib::findParameter<double>(
         config,
         //! \ogs_file_param_special{prj__processes__process__TWOPHASE_FLOW_PRHO__diffusion_coeff_component_a}
         "diffusion_coeff_component_a", parameters, 1, &mesh);
-    auto& temperature = ParameterLib::findParameter<double>(
+    auto const& temperature = ParameterLib::findParameter<double>(
         config,
         //! \ogs_file_param_special{prj__processes__process__TWOPHASE_FLOW_PRHO__temperature}
         "temperature", parameters, 1, &mesh);
-- 
GitLab