From 0a890b9981784b084e9d859cff799bc4be37ef72 Mon Sep 17 00:00:00 2001 From: Piet Jarmatz Date: Tue, 26 Nov 2024 04:41:40 +0100 Subject: [PATCH] Fixed thermostat applied on wrong number of cell layers --- coupling/configurations/ThermostatConfiguration.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/coupling/configurations/ThermostatConfiguration.h b/coupling/configurations/ThermostatConfiguration.h index f7da2f083..0870e01ff 100644 --- a/coupling/configurations/ThermostatConfiguration.h +++ b/coupling/configurations/ThermostatConfiguration.h @@ -34,14 +34,12 @@ class coupling::configurations::ThermostatConfiguration : public tarch::configur _type = onlyOutestLayer; } else if (value == "outerLayers") { _type = outerLayers; - int cellsTemp = 0; - tarch::configuration::ParseConfiguration::readIntOptional(cellsTemp, node, "number-layers"); - if (cellsTemp <= 0) { + tarch::configuration::ParseConfiguration::readIntMandatory(_cells, node, "number-layers"); + if (_cells < 0) { std::cout << "ERROR coupling::ThermostatConfiguration: Wrong number of cells to use!" << std::endl; _isValid = false; exit(EXIT_FAILURE); } - _cells = cellsTemp - 1; } else if (value == "all") { _type = all; } else if (value == "nowhere") {