From 61fd9758cd2d4539c90b13588df529a56c0bec57 Mon Sep 17 00:00:00 2001 From: Dmitri Naumov <github@naumov.de> Date: Sat, 2 Mar 2019 23:22:13 +0100 Subject: [PATCH] Don't repeat type name, use auto. clang-tidy modernize-use-auto check. --- .../DataView/DiagramView/DiagramList.cpp | 8 +++---- .../DataView/MeshLayerEditDialog.cpp | 2 +- .../DataExplorer/DataView/ProcessModel.cpp | 11 ++++------ .../VtkVis/VtkColorLookupTable.cpp | 3 +-- .../VtkImageDataToSurfacePointsFilter.cpp | 4 ++-- .../FileIO/GocadIO/GocadSGridReader.cpp | 9 ++++---- BaseLib/TimeInterval.cpp | 4 ++-- .../Fluid/Density/CreateFluidDensityModel.cpp | 22 +++++++++---------- .../FractureModels/CohesiveZoneModeI.cpp | 5 ++--- MaterialLib/MPL/CreateProperty.cpp | 6 ++--- MeshGeoToolsLib/CreateSearchLength.cpp | 2 +- .../HeatTransportBHE/BHE/BoreholeGeometry.cpp | 4 ++-- .../HeatTransportBHE/BHE/CreateBHE1U.cpp | 4 ++-- .../HeatTransportBHE/BHE/CreateBHECoaxial.cpp | 2 +- .../BHE/CreateFlowAndTemperatureControl.cpp | 10 ++++----- .../HeatTransportBHE/BHE/GroutParameters.cpp | 8 +++---- ProcessLib/HeatTransportBHE/BHE/Pipe.cpp | 6 ++--- .../BHE/RefrigerantProperties.cpp | 10 ++++----- ProcessLib/SurfaceFlux/SurfaceFluxData.h | 6 ++--- ...reateThermoMechanicalPhaseFieldProcess.cpp | 2 +- 20 files changed, 61 insertions(+), 67 deletions(-) diff --git a/Applications/DataExplorer/DataView/DiagramView/DiagramList.cpp b/Applications/DataExplorer/DataView/DiagramView/DiagramList.cpp index 13ae5de6028..30e968f8472 100644 --- a/Applications/DataExplorer/DataView/DiagramView/DiagramList.cpp +++ b/Applications/DataExplorer/DataView/DiagramView/DiagramList.cpp @@ -192,7 +192,7 @@ int DiagramList::readList(const QString &path, std::vector<DiagramList*> &lists) first_loop = false; } - float const numberOfSecs = + auto const numberOfSecs = static_cast<float>(startDate.secsTo(currentDate)); for (int i = 0; i < nLists; i++) { @@ -271,7 +271,7 @@ int DiagramList::readList(const SensorData* data, std::vector<DiagramList*> &lis { QDateTime const currentDate( getDateTime(BaseLib::int2date(time_steps[j]))); - float numberOfSecs = + auto numberOfSecs = static_cast<float>(startDate.secsTo(currentDate)); lists[i]->addNextPoint(numberOfSecs, (*time_series)[j]); } @@ -292,10 +292,10 @@ int DiagramList::readList(const SensorData* data, std::vector<DiagramList*> &lis void DiagramList::truncateToRange(QDateTime const& start, QDateTime const& end) { - float start_secs = static_cast<float>(_startDate.secsTo(start)); + auto start_secs = static_cast<float>(_startDate.secsTo(start)); if (start_secs < 0) start_secs = 0; - float end_secs = static_cast<float>(_startDate.secsTo(end)); + auto end_secs = static_cast<float>(_startDate.secsTo(end)); if (end_secs < start_secs) end_secs = _coords.back().first; diff --git a/Applications/DataExplorer/DataView/MeshLayerEditDialog.cpp b/Applications/DataExplorer/DataView/MeshLayerEditDialog.cpp index e53d6ba1050..ab62a314cb1 100644 --- a/Applications/DataExplorer/DataView/MeshLayerEditDialog.cpp +++ b/Applications/DataExplorer/DataView/MeshLayerEditDialog.cpp @@ -155,7 +155,7 @@ void MeshLayerEditDialog::createMeshToolSelection() _ogsMeshButton = new QRadioButton("Prisms", meshToolSelectionBox); QRadioButton* tetgenMeshButton = new QRadioButton("Tetrahedra", meshToolSelectionBox); tetgenMeshButton->setFixedWidth(150); - QLabel* minThicknessLabel = new QLabel(meshToolSelectionBox); + auto* minThicknessLabel = new QLabel(meshToolSelectionBox); minThicknessLabel->setText("Minimum thickness of layers:"); _minThicknessEdit = new QLineEdit(meshToolSelectionBox); _minThicknessEdit->setText("1.0"); diff --git a/Applications/DataExplorer/DataView/ProcessModel.cpp b/Applications/DataExplorer/DataView/ProcessModel.cpp index 300c45ab684..95c92e4a2e7 100644 --- a/Applications/DataExplorer/DataView/ProcessModel.cpp +++ b/Applications/DataExplorer/DataView/ProcessModel.cpp @@ -52,7 +52,7 @@ void ProcessModel::addConditionItem(DataHolderLib::FemCondition* cond, item_data << QString::fromStdString(cond->getParamName()) << QString::fromStdString(cond->getConditionClassStr()); - CondItem* cond_item = new CondItem(item_data, parent, cond); + auto* cond_item = new CondItem(item_data, parent, cond); parent->appendChild(cond_item); } @@ -85,8 +85,7 @@ ProcessVarItem* ProcessModel::addProcessVar(QString const& name) beginResetModel(); QList<QVariant> process_var_data; process_var_data << QVariant(name) << ""; - ProcessVarItem* process_var = - new ProcessVarItem(process_var_data, _rootItem); + auto* process_var = new ProcessVarItem(process_var_data, _rootItem); _rootItem->appendChild(process_var); endResetModel(); return process_var; @@ -97,8 +96,7 @@ ProcessVarItem* ProcessModel::getProcessVarItem(QString const& name) const int const n_children(_rootItem->childCount()); for (int i = 0; i < n_children; ++i) { - ProcessVarItem* item( - dynamic_cast<ProcessVarItem*>(_rootItem->child(i))); + auto* item(dynamic_cast<ProcessVarItem*>(_rootItem->child(i))); if (item != nullptr && item->getName() == name) return item; } @@ -159,8 +157,7 @@ void ProcessModel::clearModel() int const n_process_vars = _rootItem->childCount(); for (int i = n_process_vars; i >= 0; --i) { - ProcessVarItem* pv_item = - dynamic_cast<ProcessVarItem*>(_rootItem->child(i)); + auto* pv_item = dynamic_cast<ProcessVarItem*>(_rootItem->child(i)); removeProcessVariable(pv_item->getName()); } } diff --git a/Applications/DataExplorer/VtkVis/VtkColorLookupTable.cpp b/Applications/DataExplorer/VtkVis/VtkColorLookupTable.cpp index 2c7c43e23c1..d5ea3117ac0 100644 --- a/Applications/DataExplorer/VtkVis/VtkColorLookupTable.cpp +++ b/Applications/DataExplorer/VtkVis/VtkColorLookupTable.cpp @@ -29,8 +29,7 @@ VtkColorLookupTable::VtkColorLookupTable() = default; VtkColorLookupTable::~VtkColorLookupTable() { - for (std::map<double, unsigned char*>::const_iterator it = _dict.begin(); it != _dict.end(); - ++it) + for (auto it = _dict.begin(); it != _dict.end(); ++it) delete it->second; } diff --git a/Applications/DataExplorer/VtkVis/VtkImageDataToSurfacePointsFilter.cpp b/Applications/DataExplorer/VtkVis/VtkImageDataToSurfacePointsFilter.cpp index 2ef05a5c692..77d5bd233f3 100644 --- a/Applications/DataExplorer/VtkVis/VtkImageDataToSurfacePointsFilter.cpp +++ b/Applications/DataExplorer/VtkVis/VtkImageDataToSurfacePointsFilter.cpp @@ -66,7 +66,7 @@ int VtkImageDataToSurfacePointsFilter::RequestData( "RGB colours detected. Using only first channel for computation."); } - std::size_t const n_points = static_cast<std::size_t>(input->GetNumberOfPoints()); + auto const n_points = static_cast<std::size_t>(input->GetNumberOfPoints()); if (n_points == 0) { vtkDebugMacro("No data found!"); @@ -139,7 +139,7 @@ void VtkImageDataToSurfacePointsFilter::createPointSurface( MathLib::Point3d const& max_pnt, GeoLib::Raster const& raster) { - std::size_t const n_points(static_cast<std::size_t>(this->GetPointsPerPixel())); + auto const n_points(static_cast<std::size_t>(this->GetPointsPerPixel())); for (std::size_t i = 0; i < n_points; ++i) { double p[3]; diff --git a/Applications/FileIO/GocadIO/GocadSGridReader.cpp b/Applications/FileIO/GocadIO/GocadSGridReader.cpp index cb2bb9a03a2..5f8b7dd1384 100644 --- a/Applications/FileIO/GocadIO/GocadSGridReader.cpp +++ b/Applications/FileIO/GocadIO/GocadSGridReader.cpp @@ -308,7 +308,7 @@ void GocadSGridReader::parseFaceSet(std::string& line, std::istream& in) ++it; face_set_property._property_name += *it; ++it; - std::size_t const n_of_face_set_ids( + auto const n_of_face_set_ids( static_cast<std::size_t>(std::atoi(it->c_str()))); std::size_t face_set_id_cnt(0); @@ -323,10 +323,9 @@ void GocadSGridReader::parseFaceSet(std::string& line, std::istream& in) for (auto tok_it = tokens.begin(); tok_it != tokens.end();) { - std::size_t const id( - static_cast<std::size_t>(std::atoi(tok_it->c_str()))); + auto const id(static_cast<std::size_t>(std::atoi(tok_it->c_str()))); tok_it++; - std::size_t const face_indicator( + auto const face_indicator( static_cast<std::size_t>(std::atoi(tok_it->c_str()))); tok_it++; @@ -382,7 +381,7 @@ void GocadSGridReader::parseFaceSet(std::string& line, std::istream& in) Bitset readBits(std::ifstream& in, const std::size_t bits) { using block_t = Bitset::block_type; - std::size_t const bytes = static_cast<std::size_t>(std::ceil(bits / 8.)); + auto const bytes = static_cast<std::size_t>(std::ceil(bits / 8.)); std::size_t const blocks = bytes + 1 < sizeof(block_t) ? 1 : (bytes + 1) / sizeof(block_t); diff --git a/BaseLib/TimeInterval.cpp b/BaseLib/TimeInterval.cpp index 161f0585053..0c97d8fbe64 100644 --- a/BaseLib/TimeInterval.cpp +++ b/BaseLib/TimeInterval.cpp @@ -23,11 +23,11 @@ std::unique_ptr<TimeInterval> createTimeInterval( //! \ogs_file_param{prj__time_loop__processes__process__time_interval} auto const& time_interval_config = config.getConfigSubtree("time_interval"); - const double start_time = + const auto start_time = //! \ogs_file_param{prj__time_loop__processes__process__time_interval__start} time_interval_config.getConfigParameter<double>("start"); - const double end_time = + const auto end_time = //! \ogs_file_param{prj__time_loop__processes__process__time_interval__end} time_interval_config.getConfigParameter<double>("end"); diff --git a/MaterialLib/Fluid/Density/CreateFluidDensityModel.cpp b/MaterialLib/Fluid/Density/CreateFluidDensityModel.cpp index b603f09f306..7cec562ac27 100644 --- a/MaterialLib/Fluid/Density/CreateFluidDensityModel.cpp +++ b/MaterialLib/Fluid/Density/CreateFluidDensityModel.cpp @@ -78,14 +78,14 @@ static std::unique_ptr<FluidProperty> createLinearConcentrationDependentDensity( //! \ogs_file_param{material__fluid__density__type} config.checkConfigParameter("type", "ConcentrationDependent"); - const double reference_density = - //! \ogs_file_param{material__fluid__density__ConcentrationDependent__reference_density} + const auto reference_density = + //! \ogs_file_param{material__fluid__density__ConcentrationDependent__reference_density} config.getConfigParameter<double>("reference_density"); - const double reference_concentration = - //! \ogs_file_param{material__fluid__density__ConcentrationDependent__reference_concentration} + const auto reference_concentration = + //! \ogs_file_param{material__fluid__density__ConcentrationDependent__reference_concentration} config.getConfigParameter<double>("reference_concentration"); - const double fluid_density_difference_ratio = - //! \ogs_file_param{material__fluid__density__ConcentrationDependent__fluid_density_difference_ratio} + const auto fluid_density_difference_ratio = + //! \ogs_file_param{material__fluid__density__ConcentrationDependent__fluid_density_difference_ratio} config.getConfigParameter<double>("fluid_density_difference_ratio"); return std::make_unique<LinearConcentrationDependentDensity>( reference_density, @@ -99,20 +99,20 @@ createLinearConcentrationAndPressureDependentDensity( //! \ogs_file_param{material__fluid__density__type} config.checkConfigParameter("type", "ConcentrationAndPressureDependent"); - const double reference_density = + const auto reference_density = //! \ogs_file_param{material__fluid__density__ConcentrationAndPressureDependent__reference_density} config.getConfigParameter<double>("reference_density"); - const double reference_concentration = + const auto reference_concentration = //! \ogs_file_param{material__fluid__density__ConcentrationAndPressureDependent__reference_concentration} config.getConfigParameter<double>("reference_concentration"); - const double fluid_density_concentration_difference_ratio = + const auto fluid_density_concentration_difference_ratio = //! \ogs_file_param{material__fluid__density__ConcentrationAndPressureDependent__fluid_density_concentration_difference_ratio} config.getConfigParameter<double>( "fluid_density_concentration_difference_ratio"); - const double reference_pressure = + const auto reference_pressure = //! \ogs_file_param{material__fluid__density__ConcentrationAndPressureDependent__reference_pressure} config.getConfigParameter<double>("reference_pressure"); - const double fluid_density_pressure_difference_ratio = + const auto fluid_density_pressure_difference_ratio = //! \ogs_file_param{material__fluid__density__ConcentrationAndPressureDependent__fluid_density_pressure_difference_ratio} config.getConfigParameter<double>( "fluid_density_pressure_difference_ratio"); diff --git a/MaterialLib/FractureModels/CohesiveZoneModeI.cpp b/MaterialLib/FractureModels/CohesiveZoneModeI.cpp index efb029d3794..928b642b17d 100644 --- a/MaterialLib/FractureModels/CohesiveZoneModeI.cpp +++ b/MaterialLib/FractureModels/CohesiveZoneModeI.cpp @@ -58,9 +58,8 @@ void CohesiveZoneModeI<DisplacementDim>::computeConstitutiveRelation( assert(dynamic_cast<StateVariables<DisplacementDim> const*>( &material_state_variables) != nullptr); - StateVariables<DisplacementDim>& state = - static_cast<StateVariables<DisplacementDim> &>( - material_state_variables); + auto& state = + static_cast<StateVariables<DisplacementDim>&>(material_state_variables); //reset damage in each iteration state.setInitialConditions(); diff --git a/MaterialLib/MPL/CreateProperty.cpp b/MaterialLib/MPL/CreateProperty.cpp index 0bffdcaf5ed..4d456d88049 100644 --- a/MaterialLib/MPL/CreateProperty.cpp +++ b/MaterialLib/MPL/CreateProperty.cpp @@ -101,7 +101,7 @@ std::unique_ptr<MaterialPropertyLib::Property> createProperty( if (property_type == "Linear") { - double const reference_value = + auto const reference_value = //! \ogs_file_param{properties__property__LinearProperty__reference_value} config.getConfigParameter<double>("reference_value"); @@ -113,11 +113,11 @@ std::unique_ptr<MaterialPropertyLib::Property> createProperty( //! \ogs_file_param{properties__property__LinearProperty__independent_variable__variable_name} independent_variable_config.getConfigParameter<std::string>( "variable_name"); - double const reference_condition = + auto const reference_condition = //! \ogs_file_param{properties__property__LinearProperty__independent_variable__reference_condition} independent_variable_config.getConfigParameter<double>( "reference_condition"); - double const slope = + auto const slope = //! \ogs_file_param{properties__property__LinearProperty__independent_variable__slope} independent_variable_config.getConfigParameter<double>("slope"); diff --git a/MeshGeoToolsLib/CreateSearchLength.cpp b/MeshGeoToolsLib/CreateSearchLength.cpp index b0fd5581ccb..9830a9f22e4 100644 --- a/MeshGeoToolsLib/CreateSearchLength.cpp +++ b/MeshGeoToolsLib/CreateSearchLength.cpp @@ -36,7 +36,7 @@ std::unique_ptr<MeshGeoToolsLib::SearchLength> createSearchLengthAlgorithm( if (type == "fixed") { //! \ogs_file_param{prj__search_length_algorithm__fixed__value} - double const length = config->getConfigParameter<double>("value"); + auto const length = config->getConfigParameter<double>("value"); return std::make_unique<MeshGeoToolsLib::SearchLength>(length); } if (type == "heuristic") diff --git a/ProcessLib/HeatTransportBHE/BHE/BoreholeGeometry.cpp b/ProcessLib/HeatTransportBHE/BHE/BoreholeGeometry.cpp index 7ace92bbbcf..be5d2abe244 100644 --- a/ProcessLib/HeatTransportBHE/BHE/BoreholeGeometry.cpp +++ b/ProcessLib/HeatTransportBHE/BHE/BoreholeGeometry.cpp @@ -20,10 +20,10 @@ namespace BHE { BoreholeGeometry createBoreholeGeometry(BaseLib::ConfigTree const& config) { - const double borehole_length = + const auto borehole_length = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__borehole__length} config.getConfigParameter<double>("length"); - const double borehole_diameter = + const auto borehole_diameter = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__borehole__diameter} config.getConfigParameter<double>("diameter"); return {borehole_length, borehole_diameter}; diff --git a/ProcessLib/HeatTransportBHE/BHE/CreateBHE1U.cpp b/ProcessLib/HeatTransportBHE/BHE/CreateBHE1U.cpp index a16356f1e0f..0433679c0fe 100644 --- a/ProcessLib/HeatTransportBHE/BHE/CreateBHE1U.cpp +++ b/ProcessLib/HeatTransportBHE/BHE/CreateBHE1U.cpp @@ -35,10 +35,10 @@ BHE::BHE_1U createBHE1U( Pipe const outlet_pipe = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__outlet} createPipe(pipes_config.getConfigSubtree("outlet")); - const double pipe_distance = + const auto pipe_distance = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__distance_between_pipes} pipes_config.getConfigParameter<double>("distance_between_pipes"); - const double pipe_longitudinal_dispersion_length = + const auto pipe_longitudinal_dispersion_length = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__longitudinal_dispersion_length} pipes_config.getConfigParameter<double>( "longitudinal_dispersion_length"); diff --git a/ProcessLib/HeatTransportBHE/BHE/CreateBHECoaxial.cpp b/ProcessLib/HeatTransportBHE/BHE/CreateBHECoaxial.cpp index 32782649f17..8798f5c0006 100644 --- a/ProcessLib/HeatTransportBHE/BHE/CreateBHECoaxial.cpp +++ b/ProcessLib/HeatTransportBHE/BHE/CreateBHECoaxial.cpp @@ -43,7 +43,7 @@ parseBHECoaxialConfig( Pipe const inner_pipe = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__inner} createPipe(pipes_config.getConfigSubtree("inner")); - const double pipe_longitudinal_dispersion_length = + const auto pipe_longitudinal_dispersion_length = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__longitudinal_dispersion_length} pipes_config.getConfigParameter<double>( "longitudinal_dispersion_length"); diff --git a/ProcessLib/HeatTransportBHE/BHE/CreateFlowAndTemperatureControl.cpp b/ProcessLib/HeatTransportBHE/BHE/CreateFlowAndTemperatureControl.cpp index 80d1795e44a..9bdbea2c099 100644 --- a/ProcessLib/HeatTransportBHE/BHE/CreateFlowAndTemperatureControl.cpp +++ b/ProcessLib/HeatTransportBHE/BHE/CreateFlowAndTemperatureControl.cpp @@ -34,7 +34,7 @@ FlowAndTemperatureControl createFlowAndTemperatureControl( if (type == "TemperatureCurveConstantFlow") { //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__TemperatureCurveConstantFlow__flow_rate} - double const flow_rate = config.getConfigParameter<double>("flow_rate"); + auto const flow_rate = config.getConfigParameter<double>("flow_rate"); auto const& temperature_curve = *BaseLib::getOrError( curves, @@ -47,10 +47,10 @@ FlowAndTemperatureControl createFlowAndTemperatureControl( if (type == "FixedPowerConstantFlow") { //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__FixedPowerConstantFlow__power} - double const power = config.getConfigParameter<double>("power"); + auto const power = config.getConfigParameter<double>("power"); //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__FixedPowerConstantFlow__flow_rate} - double const flow_rate = config.getConfigParameter<double>("flow_rate"); + auto const flow_rate = config.getConfigParameter<double>("flow_rate"); return FixedPowerConstantFlow{flow_rate, power, refrigerant.specific_heat_capacity, refrigerant.density}; @@ -65,7 +65,7 @@ FlowAndTemperatureControl createFlowAndTemperatureControl( "Required flow rate curve not found."); //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__FixedPowerFlowCurve__power} - double const power = config.getConfigParameter<double>("power"); + auto const power = config.getConfigParameter<double>("power"); return FixedPowerFlowCurve{flow_rate_curve, power, refrigerant.specific_heat_capacity, @@ -81,7 +81,7 @@ FlowAndTemperatureControl createFlowAndTemperatureControl( "Required power curve not found."); //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__PowerCurveConstantFlow__flow_rate} - double const flow_rate = config.getConfigParameter<double>("flow_rate"); + auto const flow_rate = config.getConfigParameter<double>("flow_rate"); return PowerCurveConstantFlow{power_curve, flow_rate, refrigerant.specific_heat_capacity, diff --git a/ProcessLib/HeatTransportBHE/BHE/GroutParameters.cpp b/ProcessLib/HeatTransportBHE/BHE/GroutParameters.cpp index 36f6d79ef17..e220c795bba 100644 --- a/ProcessLib/HeatTransportBHE/BHE/GroutParameters.cpp +++ b/ProcessLib/HeatTransportBHE/BHE/GroutParameters.cpp @@ -20,16 +20,16 @@ namespace BHE { GroutParameters createGroutParameters(BaseLib::ConfigTree const& config) { - const double grout_density = + const auto grout_density = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__grout__density} config.getConfigParameter<double>("density"); - const double grout_porosity = + const auto grout_porosity = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__grout__porosity} config.getConfigParameter<double>("porosity"); - const double grout_heat_capacity = + const auto grout_heat_capacity = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__grout__heat_capacity} config.getConfigParameter<double>("heat_capacity"); - const double grout_thermal_conductivity = + const auto grout_thermal_conductivity = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__grout__thermal_conductivity} config.getConfigParameter<double>("thermal_conductivity"); return {grout_density, grout_porosity, grout_heat_capacity, diff --git a/ProcessLib/HeatTransportBHE/BHE/Pipe.cpp b/ProcessLib/HeatTransportBHE/BHE/Pipe.cpp index 854f96db4b7..301065b652b 100644 --- a/ProcessLib/HeatTransportBHE/BHE/Pipe.cpp +++ b/ProcessLib/HeatTransportBHE/BHE/Pipe.cpp @@ -21,11 +21,11 @@ namespace BHE Pipe createPipe(BaseLib::ConfigTree const& config) { //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__inlet__diameter} - const double diameter = config.getConfigParameter<double>("diameter"); - const double wall_thickness = + const auto diameter = config.getConfigParameter<double>("diameter"); + const auto wall_thickness = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__inlet__wall_thickness} config.getConfigParameter<double>("wall_thickness"); - const double wall_thermal_conductivity = + const auto wall_thermal_conductivity = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__inlet__wall_thermal_conductivity} config.getConfigParameter<double>("wall_thermal_conductivity"); return {diameter, wall_thickness, wall_thermal_conductivity}; diff --git a/ProcessLib/HeatTransportBHE/BHE/RefrigerantProperties.cpp b/ProcessLib/HeatTransportBHE/BHE/RefrigerantProperties.cpp index b338f548388..ac099fc41a9 100644 --- a/ProcessLib/HeatTransportBHE/BHE/RefrigerantProperties.cpp +++ b/ProcessLib/HeatTransportBHE/BHE/RefrigerantProperties.cpp @@ -21,19 +21,19 @@ namespace BHE RefrigerantProperties createRefrigerantProperties( BaseLib::ConfigTree const& config) { - double const refrigerant_density = + auto const refrigerant_density = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__refrigerant__density} config.getConfigParameter<double>("density"); - double const refrigerant_viscosity = + auto const refrigerant_viscosity = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__refrigerant__viscosity} config.getConfigParameter<double>("viscosity"); - double const refrigerant_heat_capacity = + auto const refrigerant_heat_capacity = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__refrigerant__specific_heat_capacity} config.getConfigParameter<double>("specific_heat_capacity"); - double const refrigerant_thermal_conductivity = + auto const refrigerant_thermal_conductivity = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__refrigerant__thermal_conductivity} config.getConfigParameter<double>("thermal_conductivity"); - double const refrigerant_reference_temperature = + auto const refrigerant_reference_temperature = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__refrigerant__reference_temperature} config.getConfigParameter<double>("reference_temperature"); return {refrigerant_viscosity, refrigerant_density, diff --git a/ProcessLib/SurfaceFlux/SurfaceFluxData.h b/ProcessLib/SurfaceFlux/SurfaceFluxData.h index 23d37e9670e..d2f5cdda226 100644 --- a/ProcessLib/SurfaceFlux/SurfaceFluxData.h +++ b/ProcessLib/SurfaceFlux/SurfaceFluxData.h @@ -54,14 +54,14 @@ struct SurfaceFluxData std::vector<std::unique_ptr<MeshLib::Mesh>> const& meshes, std::string const& output_directory) { - std::string mesh_name = + auto mesh_name = //! \ogs_file_param{prj__processes__process__calculatesurfaceflux__mesh} calculatesurfaceflux_config.getConfigParameter<std::string>("mesh"); - std::string surfaceflux_pv_name = + auto surfaceflux_pv_name = //! \ogs_file_param{prj__processes__process__calculatesurfaceflux__property_name} calculatesurfaceflux_config.getConfigParameter<std::string>( "property_name"); - std::string surfaceflux_out_fname = + auto surfaceflux_out_fname = //! \ogs_file_param{prj__processes__process__calculatesurfaceflux__output_mesh} calculatesurfaceflux_config.getConfigParameter<std::string>( "output_mesh"); diff --git a/ProcessLib/ThermoMechanicalPhaseField/CreateThermoMechanicalPhaseFieldProcess.cpp b/ProcessLib/ThermoMechanicalPhaseField/CreateThermoMechanicalPhaseFieldProcess.cpp index aef95905835..b51104304ab 100644 --- a/ProcessLib/ThermoMechanicalPhaseField/CreateThermoMechanicalPhaseFieldProcess.cpp +++ b/ProcessLib/ThermoMechanicalPhaseField/CreateThermoMechanicalPhaseFieldProcess.cpp @@ -187,7 +187,7 @@ std::unique_ptr<Process> createThermoMechanicalPhaseFieldProcess( DBUG("Use '%s' as residual thermal conductivity parameter.", residual_thermal_conductivity.name.c_str()); // Reference temperature - const double reference_temperature = + const auto reference_temperature = //! \ogs_file_param{prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__reference_temperature} config.getConfigParameter<double>("reference_temperature"); -- GitLab