diff --git a/opm/models/discretization/common/tpfalinearizer.hh b/opm/models/discretization/common/tpfalinearizer.hh index 1995c1a555..9ad2541975 100644 --- a/opm/models/discretization/common/tpfalinearizer.hh +++ b/opm/models/discretization/common/tpfalinearizer.hh @@ -429,10 +429,10 @@ public: // increment indices and generate tag exportCount_ = exportIndex_ == idx ? ++exportCount_ : 0; exportIndex_ = idx; - tag = fmt::format("_{:03d}_{:02d}", exportIndex_, exportCount_); + tag = fmt::format(fmt::runtime("_{:03d}_{:02d}"), exportIndex_, exportCount_); - fmt::print("index = {:d}\n", exportIndex_); - fmt::print("count = {:d}\n", exportCount_); + fmt::print(fmt::runtime("index = {:d}\n"), exportIndex_); + fmt::print(fmt::runtime("count = {:d}\n"), exportCount_); Opm::exportSystem(jacobian_->istlMatrix(), residual_, export_sparsity, tag.c_str(), path); } diff --git a/opm/simulators/aquifers/BlackoilAquiferModel_impl.hpp b/opm/simulators/aquifers/BlackoilAquiferModel_impl.hpp index 57398a11ad..b873f2d726 100644 --- a/opm/simulators/aquifers/BlackoilAquiferModel_impl.hpp +++ b/opm/simulators/aquifers/BlackoilAquiferModel_impl.hpp @@ -297,8 +297,8 @@ createAnalyticAquiferPointer(const AquiferData& aqData, this->simulator_.vanguard().eclState().aquifer().connections(); if (! connections.hasAquiferConnections(aquiferID)) { - const auto msg = fmt::format("No valid connections for {} aquifer {}. " - "Aquifer {} will be ignored.", + const auto msg = fmt::format(fmt::runtime("No valid connections for {} aquifer {}. " + "Aquifer {} will be ignored."), aqType, aquiferID, aquiferID); OpmLog::warning(msg); diff --git a/opm/simulators/flow/BlackoilModelNldd.hpp b/opm/simulators/flow/BlackoilModelNldd.hpp index 36a528d166..35085ed8e9 100644 --- a/opm/simulators/flow/BlackoilModelNldd.hpp +++ b/opm/simulators/flow/BlackoilModelNldd.hpp @@ -400,7 +400,7 @@ public: const bool is_iorank = this->rank_ == 0; if (is_iorank) { - OpmLog::debug(fmt::format("Local solves finished. Converged for {}/{} domains. {} domains were skipped. {} domains did no work. {} total local Newton iterations.\n", + OpmLog::debug(fmt::format(fmt::runtime("Local solves finished. Converged for {}/{} domains. {} domains were skipped. {} domains did no work. {} total local Newton iterations.\n"), num_converged, num_domains, num_skipped, num_converged_already, num_local_newtons)); } auto total_local_solve_time = localSolveTimer.stop(); @@ -630,7 +630,7 @@ private: Scalar{0.2}, 1, oscillate, stagnate); if (oscillate) { damping_factor *= 0.85; - logger.debug(fmt::format("| Damping factor is now {}", damping_factor)); + logger.debug(fmt::format(fmt::runtime("| Damping factor is now {}"), damping_factor)); } } } while (!convreport.converged() && iter <= max_iter); diff --git a/opm/simulators/flow/BlackoilModel_impl.hpp b/opm/simulators/flow/BlackoilModel_impl.hpp index 4387db81c4..0629dda4be 100644 --- a/opm/simulators/flow/BlackoilModel_impl.hpp +++ b/opm/simulators/flow/BlackoilModel_impl.hpp @@ -473,7 +473,7 @@ solveJacobianSystem(BVector& x) times[solver] = perfTimer.stop(); perfTimer.reset(); if (terminal_output_) { - OpmLog::debug(fmt::format("Solver time {}: {}", solver, times[solver])); + OpmLog::debug(fmt::format(fmt::runtime("Solver time {}: {}"), solver, times[solver])); } } diff --git a/opm/simulators/flow/DamarisWriter.hpp b/opm/simulators/flow/DamarisWriter.hpp index fb618e7eea..5f23656fe0 100644 --- a/opm/simulators/flow/DamarisWriter.hpp +++ b/opm/simulators/flow/DamarisWriter.hpp @@ -225,7 +225,7 @@ public: if (wanted_vars_set_.count(name) || wanted_vars_set_.empty()) { const data::CellData& dataCol = damVar.second ; - OpmLog::debug(fmt::format("Name of Damaris Variable : ( rank:{}) name: {} ", rank_, name)); + OpmLog::debug(fmt::format(fmt::runtime("Name of Damaris Variable : ( rank:{}) name: {} "), rank_, name)); // Call damaris_set_position() for all available variables // There is an assumption that all variables are the same size, with the same offset. @@ -238,7 +238,7 @@ public: if (dataCol.data().size() >= static_cast::size_type>(this->numElements_)) { dam_err_ = DamarisOutput::write(name.c_str(), dataCol.data().data()) ; } else { - OpmLog::info(fmt::format("( rank:{}) The variable \"{}\" was found to be of a different size {} (not {}).", rank_, name, dataCol.data().size(), this->numElements_ )); + OpmLog::info(fmt::format(fmt::runtime("( rank:{}) The variable \"{}\" was found to be of a different size {} (not {})."), rank_, name, dataCol.data().size(), this->numElements_ )); } } catch (std::bad_variant_access const& ex) { @@ -246,7 +246,7 @@ public: if (dataCol.data().size() >= static_cast::size_type>(this->numElements_)) { dam_err_ = DamarisOutput::write(name.c_str(), dataCol.data().data()) ; } else { - OpmLog::info(fmt::format("( rank:{}) The variable \"{}\" was found to be of a different size {} (not {}).", rank_, name, dataCol.data().size(), this->numElements_ )); + OpmLog::info(fmt::format(fmt::runtime("( rank:{}) The variable \"{}\" was found to be of a different size {} (not {})."), rank_, name, dataCol.data().size(), this->numElements_ )); } } ++cell_data_written ; @@ -255,9 +255,9 @@ public: DamarisOutput::handleError(dam_err_, cc, "setPosition() and write() for available variables"); if (!cell_data_written) { - OpmLog::info(fmt::format("( rank:{}) No simulation data written to the Damaris server - check --damaris-limit-variables command line option (if used) has valid variable name(s) and that the Damaris XML file contains variable names that are available in your simulation.", rank_)); + OpmLog::info(fmt::format(fmt::runtime("( rank:{}) No simulation data written to the Damaris server - check --damaris-limit-variables command line option (if used) has valid variable name(s) and that the Damaris XML file contains variable names that are available in your simulation."), rank_)); } else { - OpmLog::debug(fmt::format("( rank:{}) {} Damaris Variables written to the Damaris servers", rank_, cell_data_written)); + OpmLog::debug(fmt::format(fmt::runtime("( rank:{}) {} Damaris Variables written to the Damaris servers"), rank_, cell_data_written)); } /* @@ -353,7 +353,7 @@ private: try { const bool hasPolyCells = geomData.polyhedralCellPresent() ; if ( hasPolyCells ) { - OpmLog::error(fmt::format("ERORR: rank {} The DUNE geometry grid has polyhedral elements - These elements are currently not supported.", rank_ )); + OpmLog::error(fmt::format(fmt::runtime("ERORR: rank {} The DUNE geometry grid has polyhedral elements - These elements are currently not supported."), rank_ )); } // This is the template XML model for x,y,z coordinates defined in initDamarisXmlFile.cpp which is used to diff --git a/opm/simulators/flow/NlddReporting.hpp b/opm/simulators/flow/NlddReporting.hpp index e874cb7009..a987ca3ee4 100644 --- a/opm/simulators/flow/NlddReporting.hpp +++ b/opm/simulators/flow/NlddReporting.hpp @@ -194,7 +194,7 @@ void writePartitions( } const auto nDigit = 1 + static_cast(std::floor(std::log10(comm.size()))); - auto partition_fname = odir / fmt::format("{1:0>{0}}", nDigit, rank); + auto partition_fname = odir / fmt::format(fmt::runtime("{1:0>{0}}"), nDigit, rank); std::ofstream pfile { partition_fname }; auto cell_index = 0; diff --git a/opm/simulators/flow/SimulatorFullyImplicitBlackoil.hpp b/opm/simulators/flow/SimulatorFullyImplicitBlackoil.hpp index cbd6a43e5e..86c029c2d4 100644 --- a/opm/simulators/flow/SimulatorFullyImplicitBlackoil.hpp +++ b/opm/simulators/flow/SimulatorFullyImplicitBlackoil.hpp @@ -305,8 +305,8 @@ public: modelParam_.newton_max_iter_ = tuning.NEWTMX; modelParam_.newton_min_iter_ = tuning.NEWTMN; if (terminalOutput_) { - const auto msg = fmt::format("Tuning values: " - "MB: {:.2e}, CNV: {:.2e}, NEWTMN: {}, NEWTMX: {}", + const auto msg = fmt::format(fmt::runtime("Tuning values: " + "MB: {:.2e}, CNV: {:.2e}, NEWTMN: {}, NEWTMX: {}"), tuning.TRGMBE, tuning.TRGCNV, tuning.NEWTMN, tuning.NEWTMX); OpmLog::debug(msg); if (tuning.TRGTTE_has_value) { diff --git a/opm/simulators/flow/SubDomain.hpp b/opm/simulators/flow/SubDomain.hpp index 78f925ff7f..53c12d894a 100644 --- a/opm/simulators/flow/SubDomain.hpp +++ b/opm/simulators/flow/SubDomain.hpp @@ -51,7 +51,7 @@ namespace Opm } else if (measure == "averagepressure") { return DomainOrderingMeasure::AveragePressure; } else { - throw std::runtime_error(fmt::format("Invalid domain ordering '{}' specified", measure)); + throw std::runtime_error(fmt::format(fmt::runtime("Invalid domain ordering '{}' specified"), measure)); } } diff --git a/opm/simulators/flow/TemperatureModel.hpp b/opm/simulators/flow/TemperatureModel.hpp index 879d67647d..761d0522b7 100644 --- a/opm/simulators/flow/TemperatureModel.hpp +++ b/opm/simulators/flow/TemperatureModel.hpp @@ -229,8 +229,10 @@ protected: solveAndUpdate(); } if (!is_converged) { - const auto msg = fmt::format("Temperature model (TEMP): Newton did not converge after {} iterations. \n" - "The Simulator will continue to the next step with an unconverged solution.",max_iter); + const auto msg = + fmt::format(fmt::runtime("Temperature model (TEMP): Newton did not converge after {} iterations. \n" + "The Simulator will continue to the next step with an unconverged solution."), + max_iter); OpmLog::debug(msg); } } @@ -293,13 +295,14 @@ protected: const bool tolerance_cnv_energy = relax? Parameters::Get>(): tolerance_cnv_energy_strict; - const auto msg = fmt::format("Temperature model (TEMP): Newton iter {}: " - "CNV(E): {:.1e}, EB: {:.1e}", + const auto msg = fmt::format(fmt::runtime("Temperature model (TEMP): Newton iter {}: " + "CNV(E): {:.1e}, EB: {:.1e}"), iter, maxNorm, sumNorm); OpmLog::debug(msg); if (maxNorm < tolerance_cnv_energy && sumNorm < tolerance_energy_balance) { - const auto msg2 = fmt::format("Temperature model (TEMP): Newton converged after {} iterations" - , iter); + const auto msg2 = + fmt::format(fmt::runtime("Temperature model (TEMP): Newton converged after {} iterations"), + iter); OpmLog::debug(msg2); return true; } diff --git a/opm/simulators/flow/rescoup/ReservoirCoupling.hpp b/opm/simulators/flow/rescoup/ReservoirCoupling.hpp index c2efb70ab8..b5599c3175 100644 --- a/opm/simulators/flow/rescoup/ReservoirCoupling.hpp +++ b/opm/simulators/flow/rescoup/ReservoirCoupling.hpp @@ -264,7 +264,7 @@ std::pair, std::size_t> serializeStrings(const std::vector size()) { OPM_THROW(std::runtime_error, - fmt::format("Requesting to copy too many elements. buffer has {} elements, while {} was requested.", + fmt::format(fmt::runtime("Requesting to copy too many elements. " + "buffer has {} elements, while {} was requested."), size(), numberOfElements)); } @@ -359,7 +360,8 @@ private: { if (size != m_numberOfElements) { OPM_THROW(std::invalid_argument, - fmt::format("Given buffer has {}, while we have {}.", size, m_numberOfElements)); + fmt::format(fmt::runtime("Given buffer has {}, while we have {}."), + size, m_numberOfElements)); } } diff --git a/opm/simulators/linalg/gpuistl/GpuOwnerOverlapCopy.hpp b/opm/simulators/linalg/gpuistl/GpuOwnerOverlapCopy.hpp index 2b084a3dcb..63eef81df1 100644 --- a/opm/simulators/linalg/gpuistl/GpuOwnerOverlapCopy.hpp +++ b/opm/simulators/linalg/gpuistl/GpuOwnerOverlapCopy.hpp @@ -122,13 +122,13 @@ makeGpuOwnerOverlapCopy(const OwnerOverlapCopyCommunicationType& cpuOwnerOverlap if (!mpiSupportsCudaAwareAtCompileTime || !mpiSupportsCudaAwareAtRunTime) { OPM_THROW(std::runtime_error, - fmt::format("The GPU-aware MPI support is not available. " + fmt::format(fmt::runtime("The GPU-aware MPI support is not available. " "CUDA aware support at compile time: {}, " "CUDA aware support at runtime: {}. " "Please check your MPI installation and the OPM configuration " "or run with --gpu-aware-mpi=false. If you are sure that your MPI " "implementation supports GPU aware MPI, you can disable this check " - "by setting --verify-gpu-aware-mpi=false.", + "by setting --verify-gpu-aware-mpi=false."), mpiSupportsCudaAwareAtCompileTime ? "yes" : "no", mpiSupportsCudaAwareAtRunTime ? "yes" : "no")); } diff --git a/opm/simulators/linalg/gpuistl/GpuSparseMatrix.hpp b/opm/simulators/linalg/gpuistl/GpuSparseMatrix.hpp index 9f47bf0c00..4b4b8e77aa 100644 --- a/opm/simulators/linalg/gpuistl/GpuSparseMatrix.hpp +++ b/opm/simulators/linalg/gpuistl/GpuSparseMatrix.hpp @@ -404,7 +404,7 @@ private: if constexpr (blockSizeCompileTime > 1) { return dispatchOnBlocksizeImpl(function); } else { - OPM_THROW(std::runtime_error, fmt::format("Unsupported block size: {}", m_blockSize)); + OPM_THROW(std::runtime_error, fmt::format(fmt::runtime("Unsupported block size: {}"), m_blockSize)); } } }; diff --git a/opm/simulators/linalg/gpuistl/GpuSparseMatrixGeneric.hpp b/opm/simulators/linalg/gpuistl/GpuSparseMatrixGeneric.hpp index 7ea25a6c25..e4ef9b2b73 100644 --- a/opm/simulators/linalg/gpuistl/GpuSparseMatrixGeneric.hpp +++ b/opm/simulators/linalg/gpuistl/GpuSparseMatrixGeneric.hpp @@ -347,7 +347,7 @@ private: if constexpr (blockSizeCompileTime > 1) { return dispatchOnBlocksizeImpl(function); } else { - OPM_THROW(std::runtime_error, fmt::format("Unsupported block size: {}", m_blockSize)); + OPM_THROW(std::runtime_error, fmt::format(fmt::runtime("Unsupported block size: {}"), m_blockSize)); } } }; diff --git a/opm/simulators/linalg/gpuistl/GpuVector.hpp b/opm/simulators/linalg/gpuistl/GpuVector.hpp index 75cb472286..65548d475a 100644 --- a/opm/simulators/linalg/gpuistl/GpuVector.hpp +++ b/opm/simulators/linalg/gpuistl/GpuVector.hpp @@ -233,8 +233,8 @@ public: // TODO: [perf] vector.dim() can be replaced by bvector.N() * BlockDimension if (detail::to_size_t(m_numberOfElements) != bvector.dim()) { OPM_THROW(std::runtime_error, - fmt::format("Given incompatible vector size. GpuVector has size {},\n however, the BlockVector " - "has has N() = {}, and dim() = {}.", + fmt::format(fmt::runtime("Given incompatible vector size. GpuVector has size {},\n" + "however, the BlockVector has has N() = {}, and dim() = {}."), m_numberOfElements, bvector.N(), bvector.dim())); diff --git a/opm/simulators/linalg/gpuistl/GpuView.hpp b/opm/simulators/linalg/gpuistl/GpuView.hpp index f24ab01e2a..79940acb5a 100644 --- a/opm/simulators/linalg/gpuistl/GpuView.hpp +++ b/opm/simulators/linalg/gpuistl/GpuView.hpp @@ -378,7 +378,7 @@ private: #else if (size != m_numberOfElements) { OPM_THROW(std::invalid_argument, - fmt::format("Given view has {}, while this View has {}.", size, m_numberOfElements)); + fmt::format(fmt::runtime("Given view has {}, while this View has {}."), size, m_numberOfElements)); } #endif } @@ -405,7 +405,7 @@ private: #else if (idx >= m_numberOfElements) { OPM_THROW(std::invalid_argument, - fmt::format("The index provided was not in the range [0, buffersize-1]")); + fmt::format(fmt::runtime("The index provided was not in the range [0, buffersize-1]"))); } #endif } diff --git a/opm/simulators/linalg/gpuistl/detail/cublas_safe_call.hpp b/opm/simulators/linalg/gpuistl/detail/cublas_safe_call.hpp index bc3c5c10af..db78d40e29 100644 --- a/opm/simulators/linalg/gpuistl/detail/cublas_safe_call.hpp +++ b/opm/simulators/linalg/gpuistl/detail/cublas_safe_call.hpp @@ -56,7 +56,7 @@ namespace CHECK_CUBLAS_ERROR_TYPE(code, CUBLAS_STATUS_NOT_SUPPORTED); CHECK_CUBLAS_ERROR_TYPE(code, CUBLAS_STATUS_LICENSE_ERROR); - return fmt::format("UNKNOWN CUBLAS ERROR {}.", code); + return fmt::format(fmt::runtime("UNKNOWN CUBLAS ERROR {}."), code); } #undef CHECK_CUBLAS_ERROR_TYPE @@ -85,10 +85,10 @@ getCublasErrorMessage(cublasStatus_t error, const std::string_view& functionName, size_t lineNumber) { - return fmt::format("cuBLAS expression did not execute correctly. Expression was: \n\n" + return fmt::format(fmt::runtime("cuBLAS expression did not execute correctly. Expression was: \n\n" " {}\n\n" "in function {}, in {}, at line {}.\n" - "CuBLAS error code was: {}\n", + "CuBLAS error code was: {}\n"), expression, functionName, filename, diff --git a/opm/simulators/linalg/gpuistl/detail/cusparse_safe_call.hpp b/opm/simulators/linalg/gpuistl/detail/cusparse_safe_call.hpp index 93670d5583..c81d9b9664 100644 --- a/opm/simulators/linalg/gpuistl/detail/cusparse_safe_call.hpp +++ b/opm/simulators/linalg/gpuistl/detail/cusparse_safe_call.hpp @@ -51,7 +51,7 @@ getCusparseErrorCodeToString(int code) CHECK_CUSPARSE_ERROR_TYPE(code, CUSPARSE_STATUS_ZERO_PIVOT); CHECK_CUSPARSE_ERROR_TYPE(code, CUSPARSE_STATUS_NOT_SUPPORTED); CHECK_CUSPARSE_ERROR_TYPE(code, CUSPARSE_STATUS_INSUFFICIENT_RESOURCES); - return fmt::format("UNKNOWN CUSPARSE ERROR {}.", code); + return fmt::format(fmt::runtime("UNKNOWN CUSPARSE ERROR {}."), code); } #undef CHECK_CUSPARSE_ERROR_TYPE @@ -77,9 +77,9 @@ getCusparseErrorMessage(cusparseStatus_t error, const std::string_view& functionName, size_t lineNumber) { - return fmt::format("cuSparse expression did not execute correctly. Expression was: \n\n" + return fmt::format(fmt::runtime("cuSparse expression did not execute correctly. Expression was: \n\n" " {}\n\nin function {}, in {}, at line {}\n" - "CuSparse error code was: {}\n", + "CuSparse error code was: {}\n"), expression, functionName, filename, diff --git a/opm/simulators/linalg/gpuistl/detail/gpu_safe_call.hpp b/opm/simulators/linalg/gpuistl/detail/gpu_safe_call.hpp index 0929852b2c..97c4015b02 100644 --- a/opm/simulators/linalg/gpuistl/detail/gpu_safe_call.hpp +++ b/opm/simulators/linalg/gpuistl/detail/gpu_safe_call.hpp @@ -48,10 +48,10 @@ getCudaErrorMessage(cudaError_t error, const std::string_view& functionName, size_t lineNumber) { - return fmt::format("GPU expression did not execute correctly. Expression was: \n" + return fmt::format(fmt::runtime("GPU expression did not execute correctly. Expression was: \n" " {}\n" "GPU error was {}\n" - "in function {}, in {}, at line {}\n", + "in function {}, in {}, at line {}\n"), expression, cudaGetErrorString(error), functionName, diff --git a/opm/simulators/linalg/gpuistl/detail/gpusparse_matrix_utilities.hpp b/opm/simulators/linalg/gpuistl/detail/gpusparse_matrix_utilities.hpp index df6bd455a5..5bb5e6b247 100644 --- a/opm/simulators/linalg/gpuistl/detail/gpusparse_matrix_utilities.hpp +++ b/opm/simulators/linalg/gpuistl/detail/gpusparse_matrix_utilities.hpp @@ -216,7 +216,8 @@ validateVectorMatrixSizes(size_t vectorSize, size_t matrixBlockSize, size_t matr const size_t expectedSize = matrixBlockSize * matrixColumns; if (vectorSize != expectedSize) { OPM_THROW(std::invalid_argument, - fmt::format("Size mismatch. Input vector has {} elements, while matrix expects {} elements.", + fmt::format(fmt::runtime("Size mismatch. Input vector has {} elements, " + "while matrix expects {} elements."), vectorSize, expectedSize)); } diff --git a/opm/simulators/linalg/gpuistl/detail/kernel_enums.hpp b/opm/simulators/linalg/gpuistl/detail/kernel_enums.hpp index 9c9bc1931e..e0acc2056c 100644 --- a/opm/simulators/linalg/gpuistl/detail/kernel_enums.hpp +++ b/opm/simulators/linalg/gpuistl/detail/kernel_enums.hpp @@ -41,11 +41,11 @@ namespace Opm::gpuistl { inline MatrixStorageMPScheme makeMatrixStorageMPScheme(int scheme) { if (!detail::isValidMatrixStorageMPScheme(scheme)) { OPM_THROW(std::invalid_argument, - fmt::format("Invalid matrix storage mixed precision scheme chosen: {}.\n" + fmt::format(fmt::runtime("Invalid matrix storage mixed precision scheme chosen: {}.\n" "Valid Schemes:\n" "\t0: DOUBLE_DIAG_DOUBLE_OFFDIAG\n" "\t1: FLOAT_DIAG_FLOAT_OFFDIAG\n" - "\t2: DOUBLE_DIAG_FLOAT_OFFDIAG", + "\t2: DOUBLE_DIAG_FLOAT_OFFDIAG"), scheme)); } return static_cast(scheme); diff --git a/opm/simulators/linalg/gpuistl/detail/safe_conversion.hpp b/opm/simulators/linalg/gpuistl/detail/safe_conversion.hpp index d30c0a7742..930231e272 100644 --- a/opm/simulators/linalg/gpuistl/detail/safe_conversion.hpp +++ b/opm/simulators/linalg/gpuistl/detail/safe_conversion.hpp @@ -65,7 +65,7 @@ to_int(std::size_t s) if (s > std::size_t(std::numeric_limits::max())) { OPM_THROW(std::invalid_argument, - fmt::format("Trying to convert {} to int, but it is out of range. Maximum possible int: {}. ", + fmt::format(fmt::runtime("Trying to convert {} to int, but it is out of range. Maximum possible int: {}. "), s, std::numeric_limits::max())); } @@ -100,7 +100,7 @@ to_size_t(int i) assert(i >= int(0)); #else if (i < int(0)) { - OPM_THROW(std::invalid_argument, fmt::format("Trying to convert the negative number {} to size_t.", i)); + OPM_THROW(std::invalid_argument, fmt::format(fmt::runtime("Trying to convert the negative number {} to size_t."), i)); } #endif diff --git a/opm/simulators/timestepping/AdaptiveTimeStepping_impl.hpp b/opm/simulators/timestepping/AdaptiveTimeStepping_impl.hpp index 98308274f4..cf0879f22c 100644 --- a/opm/simulators/timestepping/AdaptiveTimeStepping_impl.hpp +++ b/opm/simulators/timestepping/AdaptiveTimeStepping_impl.hpp @@ -916,7 +916,7 @@ checkTimeStepMaxRestartLimit_(const int restarts) const // many times, we have failed and throw an exception. if (restarts >= solverRestartMax_()) { const auto msg = fmt::format( - "Solver failed to converge after cutting timestep {} times.", restarts + fmt::runtime("Solver failed to converge after cutting timestep {} times."), restarts ); if (solverVerbose_()) { OpmLog::error(msg); @@ -936,7 +936,7 @@ checkTimeStepMinLimit_(const double new_time_step) const // If we have restarted (i.e. cut the timestep) too // much, we have failed and throw an exception. if (new_time_step < minTimeStep_()) { - auto msg = fmt::format("Solver failed to converge after cutting timestep to "); + std::string msg = "Solver failed to converge after cutting timestep to "; if (Parameters::Get()) { const UnitSystem& unit_system = solver_().model().simulator().vanguard().eclState().getDeckUnitSystem(); msg += fmt::format( @@ -967,7 +967,7 @@ chopTimeStep_(const double new_time_step) { setTimeStep_(new_time_step); if (solverVerbose_()) { - const auto msg = fmt::format("{}\nTimestep chopped to {} days\n", + const auto msg = fmt::format(fmt::runtime("{}\nTimestep chopped to {} days\n"), this->cause_of_failure_, unit::convert::to(this->substep_timer_.currentStepLength(), unit::day)); OpmLog::problem(msg); @@ -1026,8 +1026,8 @@ chopTimeStepOrCloseFailingWells_(const double new_time_step) wells_shut = true; if (solverVerbose_()) { const std::string msg = - fmt::format("\nProblematic well(s) were shut: {}" - "(retrying timestep)\n", + fmt::format(fmt::runtime("\nProblematic well(s) were shut: {}" + "(retrying timestep)\n"), fmt::join(shut_wells, " ")); OpmLog::problem(msg); } diff --git a/opm/simulators/wells/BlackoilWellModelNetwork_impl.hpp b/opm/simulators/wells/BlackoilWellModelNetwork_impl.hpp index cb6c3e2b37..4243471881 100644 --- a/opm/simulators/wells/BlackoilWellModelNetwork_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModelNetwork_impl.hpp @@ -79,9 +79,7 @@ doPreStepRebalance(DeferredLogger& deferred_logger) well_model_.simulator().vanguard().grid().comm()); if (!converged) { - const std::string msg = - fmt::format("Initial (pre-step) network balance did not converge."); - deferred_logger.warning(msg); + deferred_logger.warning("Initial (pre-step) network balance did not converge."); } } diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index f299590782..dfa1bf8bf6 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -676,7 +676,9 @@ namespace Opm { ecl_well_map, this->well_open_times_); } catch (const std::exception& e) { - const std::string msg = fmt::format("Exception during testing of well: {}. The well will not open.\n Exception message: {}", wellEcl.name(), e.what()); + const std::string msg = + fmt::format(fmt::runtime("Exception during testing of well: {}. The well will not open.\n" + "Exception message: {}"), wellEcl.name(), e.what()); deferred_logger.warning("WELL_TESTING_FAILED", msg); } } @@ -1003,7 +1005,7 @@ namespace Opm { : well_ecl.injectionControls(this->summaryState_).anyZeroRateConstraint(); if (any_zero_rate_constraint) { // Treat as shut, do not add to container. - local_deferredLogger.debug(fmt::format(" Well {} gets shut due to having zero rate constraint and disallowing crossflow ", well_ecl.name()) ); + local_deferredLogger.debug(fmt::format(fmt::runtime(" Well {} gets shut due to having zero rate constraint and disallowing crossflow "), well_ecl.name())); this->wellState().shutWell(w); this->well_close_times_.erase(well_name); this->well_open_times_.erase(well_name); @@ -1140,7 +1142,7 @@ namespace Opm { // It should be able to find in wells_ecl. if (it == this->wells_ecl_.end()) { OPM_DEFLOG_THROW(std::logic_error, - fmt::format("Could not find well {} in wells_ecl ", well_name), + fmt::format(fmt::runtime("Could not find well {} in wells_ecl"), well_name), deferred_logger); } @@ -1163,7 +1165,7 @@ namespace Opm { if constexpr (BlackoilWellModelGasLift::glift_debug) { if (gaslift_.terminalOutput()) { const std::string msg = - fmt::format("assemble() : iteration {}" , iterationIdx); + fmt::format(fmt::runtime("assemble() : iteration {}"), iterationIdx); gaslift_.gliftDebug(msg, local_deferredLogger); } }