diff --git a/Applications/ApplicationsLib/ProjectData.cpp b/Applications/ApplicationsLib/ProjectData.cpp index c9a5ae178338d9efb86c65258a7731ed35b256fd..c009113176ae20d715076da2265683546b0900b3 100644 --- a/Applications/ApplicationsLib/ProjectData.cpp +++ b/Applications/ApplicationsLib/ProjectData.cpp @@ -120,7 +120,7 @@ namespace { void readGeometry(std::string const& fname, GeoLib::GEOObjects& geo_objects) { - DBUG("Reading geometry file '%s'.", fname.c_str()); + DBUG("Reading geometry file '{:s}'.", fname.c_str()); GeoLib::IO::BoostXmlGmlInterface gml_reader(geo_objects); gml_reader.readFile(fname); } @@ -131,13 +131,13 @@ std::unique_ptr<MeshLib::Mesh> readSingleMesh( { std::string const mesh_file = BaseLib::copyPathToFileName( mesh_config_parameter.getValue<std::string>(), project_directory); - DBUG("Reading mesh file '%s'.", mesh_file.c_str()); + DBUG("Reading mesh file '{:s}'.", mesh_file.c_str()); auto mesh = std::unique_ptr<MeshLib::Mesh>( MeshLib::IO::readMeshFromFile(mesh_file)); if (!mesh) { - OGS_FATAL("Could not read mesh from '%s' file. No mesh added.", + OGS_FATAL("Could not read mesh from '{:s}' file. No mesh added.", mesh_file.c_str()); } @@ -230,8 +230,8 @@ boost::optional<ParameterLib::CoordinateSystem> parseLocalCoordinateSystem( if (dimension != 2 && dimension != 3) { OGS_FATAL( - "Basis vector parameter '%s' must have two or three components, " - "but it has %d.", + "Basis vector parameter '{:s}' must have two or three components, " + "but it has {:d}.", basis_vector_0.name.c_str(), dimension); } @@ -316,7 +316,7 @@ ProjectData::ProjectData(BaseLib::ConfigTree const& project_config, if (!_local_coordinate_system) { OGS_FATAL( - "The parameter '%s' is using the local coordinate system " + "The parameter '{:s}' is using the local coordinate system " "but no local coordinate system was provided.", parameter->name.c_str()); } @@ -379,7 +379,7 @@ void ProjectData::parseProcessVariables( _parameters}; if (!names.insert(pv.getName()).second) { - OGS_FATAL("A process variable with name `%s' already exists.", + OGS_FATAL("A process variable with name `{:s}' already exists.", pv.getName().c_str()); } @@ -404,7 +404,7 @@ std::vector<std::string> ProjectData::parseParameters( ParameterLib::createParameter(parameter_config, _mesh_vec, _curves); if (!names.insert(p->name).second) { - OGS_FATAL("A parameter with name `%s' already exists.", + OGS_FATAL("A parameter with name `{:s}' already exists.", p->name.c_str()); } @@ -468,7 +468,7 @@ void ProjectData::parseMedia( it != end(m_id)) { OGS_FATAL( - "Could not parse material ID's from '%s'. Please " + "Could not parse material ID's from '{:s}'. Please " "separate multiple material ID's by comma only. " "Invalid character: '%c'", m_id.c_str(), *it); @@ -482,7 +482,7 @@ void ProjectData::parseMedia( { OGS_FATAL( "Multiple media were specified for the same material id " - "'%d'. " + "'{:d}'. " "Keep in mind, that if no material id is specified, it is " "assumed to be 0 by default.", id); @@ -770,7 +770,7 @@ void ProjectData::parseProcesses(BaseLib::ConfigTree const& processes_config, default: OGS_FATAL( "SMALL_DEFORMATION_NONLOCAL process does not support " - "given dimension %d", + "given dimension {:d}", _mesh_vec[0]->getDimension()); } } @@ -956,7 +956,7 @@ void ProjectData::parseProcesses(BaseLib::ConfigTree const& processes_config, else #endif { - OGS_FATAL("Unknown process type: %s", type.c_str()); + OGS_FATAL("Unknown process type: {:s}", type.c_str()); } if (BaseLib::containsIf( @@ -965,7 +965,7 @@ void ProjectData::parseProcesses(BaseLib::ConfigTree const& processes_config, return p->name == name; })) { - OGS_FATAL("The process name '%s' is not unique.", name.c_str()); + OGS_FATAL("The process name '{:s}' is not unique.", name.c_str()); } _processes.push_back(std::move(process)); } diff --git a/Applications/ApplicationsLib/TestDefinition.cpp b/Applications/ApplicationsLib/TestDefinition.cpp index 36586d543e4851f4cca99f748e2068a3b53c9e45..a7fcdc14147b184f1f0c4b680d27648dfa70c52f 100644 --- a/Applications/ApplicationsLib/TestDefinition.cpp +++ b/Applications/ApplicationsLib/TestDefinition.cpp @@ -35,19 +35,20 @@ bool isConvertibleToDouble(std::string const& s) } catch (...) { - OGS_FATAL("The given string '%s' is not convertible to double.", + OGS_FATAL("The given string '{:s}' is not convertible to double.", s.c_str()); } if (pos != s.size()) { OGS_FATAL( - "Only %d characters were used for double conversion of string '%s'", + "Only {:d} characters were used for double conversion of string " + "'{:s}'", pos, s.c_str()); } if (std::isnan(value)) { - OGS_FATAL("The given string '%s' results in a NaN value.", s.c_str()); + OGS_FATAL("The given string '{:s}' results in a NaN value.", s.c_str()); } return true; } @@ -67,7 +68,7 @@ std::string findVtkdiff() std::getenv("VTKDIFF_EXE")) { std::string const vtkdiff_exe{vtkdiff_exe_environment_variable}; - DBUG("VTKDIFF_EXE set to %s.", vtkdiff_exe.c_str()); + DBUG("VTKDIFF_EXE set to {:s}.", vtkdiff_exe.c_str()); // // Sanity checks. @@ -79,7 +80,7 @@ std::string findVtkdiff() { OGS_FATAL( "The VTKDIFF_EXE environment variable does not point to " - "'vtkdiff'. VTKDIFF_EXE='%s'", + "'vtkdiff'. VTKDIFF_EXE='{:s}'", vtkdiff_exe.c_str()); } } @@ -88,7 +89,7 @@ std::string findVtkdiff() { OGS_FATAL( "The VTKDIFF_EXE points to a non-existing file. " - "VTKDIFF_EXE='%s'", + "VTKDIFF_EXE='{:s}'", vtkdiff_exe.c_str()); } } @@ -110,8 +111,9 @@ std::string findVtkdiff() return vtkdiff_exe; } WARN( - "Calling %s from the VTKDIFF_EXE environment variable didn't work " - "as expected. Return value was %d.", + "Calling {:s} from the VTKDIFF_EXE environment variable didn't " + "work " + "as expected. Return value was {:d}.", vtkdiff_exe.c_str(), return_value); } @@ -160,7 +162,7 @@ TestDefinition::TestDefinition(BaseLib::ConfigTree const& config_tree, std::string const& field_name = //! \ogs_file_param{prj__test_definition__vtkdiff__field} vtkdiff_config.getConfigParameter<std::string>("field"); - DBUG("vtkdiff will compare field '%s'.", field_name.c_str()); + DBUG("vtkdiff will compare field '{:s}'.", field_name.c_str()); #ifdef USE_PETSC int rank; @@ -192,7 +194,7 @@ TestDefinition::TestDefinition(BaseLib::ConfigTree const& config_tree, !isConvertibleToDouble(absolute_tolerance)) { OGS_FATAL( - "The absolute tolerance value '%s' is not convertible to " + "The absolute tolerance value '{:s}' is not convertible to " "double.", absolute_tolerance.c_str()); } @@ -207,7 +209,7 @@ TestDefinition::TestDefinition(BaseLib::ConfigTree const& config_tree, !isConvertibleToDouble(relative_tolerance)) { OGS_FATAL( - "The relative tolerance value '%s' is not convertible to " + "The relative tolerance value '{:s}' is not convertible to " "double.", relative_tolerance.c_str()); } @@ -222,7 +224,7 @@ TestDefinition::TestDefinition(BaseLib::ConfigTree const& config_tree, safeString(field_name) + " " + safeString(reference_filename) + " " + safeString(output_filename) + " " + absolute_tolerance_parameter + " " + relative_tolerance_parameter; - INFO("Will run '%s'", command_line.c_str()); + INFO("Will run '{:s}'", command_line.c_str()); _command_lines.emplace_back(std::move(command_line)); } } @@ -236,7 +238,7 @@ bool TestDefinition::runTests() const int const return_value = std::system(command_line.c_str()); if (return_value != 0) { - WARN("Return value %d was returned by '%s'.", + WARN("Return value {:d} was returned by '{:s}'.", return_value, command_line.c_str()); } return return_value; diff --git a/Applications/CLI/ogs.cpp b/Applications/CLI/ogs.cpp index a77d5d08599b35023ed74a3c445c214264380b15..582f0befc3bc1b69d9f07f51d9dd558ce5a7035f 100644 --- a/Applications/CLI/ogs.cpp +++ b/Applications/CLI/ogs.cpp @@ -126,8 +126,8 @@ int main(int argc, char* argv[]) ApplicationsLib::LogogSetup logog_setup; logog_setup.setLevel(log_level_arg.getValue()); - INFO("This is OpenGeoSys-6 version %s.", - GitInfoLib::GitInfo::ogs_version.c_str()); + INFO("This is OpenGeoSys-6 version {:s}.", + GitInfoLib::GitInfo::ogs_version); #ifndef _WIN32 // On windows this command line option is not present. // Enable floating point exceptions @@ -151,7 +151,7 @@ int main(int argc, char* argv[]) { auto const start_time = std::chrono::system_clock::now(); auto const time_str = BaseLib::formatDate(start_time); - INFO("OGS started on %s.", time_str.c_str()); + INFO("OGS started on {:s}.", time_str); } std::unique_ptr<ApplicationsLib::TestDefinition> test_definition; @@ -242,7 +242,7 @@ int main(int argc, char* argv[]) if (isInsituConfigured) InSituLib::Finalize(); #endif - INFO("[time] Execution took %g s.", run_time.elapsed()); + INFO("[time] Execution took {:g} s.", run_time.elapsed()); #if defined(USE_PETSC) controller->Finalize(1); @@ -264,7 +264,7 @@ int main(int argc, char* argv[]) { auto const end_time = std::chrono::system_clock::now(); auto const time_str = BaseLib::formatDate(end_time); - INFO("OGS terminated on %s.", time_str.c_str()); + INFO("OGS terminated on {:s}.", time_str); } if (ogs_status == EXIT_FAILURE) diff --git a/Applications/DataExplorer/DataView/DiagramView/DiagramList.cpp b/Applications/DataExplorer/DataView/DiagramView/DiagramList.cpp index a0a06e9706f9323bca455e6e6af4ee31e0844eb0..4ca3bbd21df8f2e86b792644c3e19c8f5f22691c 100644 --- a/Applications/DataExplorer/DataView/DiagramView/DiagramList.cpp +++ b/Applications/DataExplorer/DataView/DiagramView/DiagramList.cpp @@ -220,7 +220,8 @@ int DiagramList::readList(const QString &path, std::vector<DiagramList*> &lists) } else { - WARN("DiagramList::readList(): Unexpected format in line %d.", line_count); + WARN("DiagramList::readList(): Unexpected format in line {:d}.", + line_count); file.close(); return 0; } diff --git a/Applications/DataExplorer/DataView/DirectConditionGenerator.cpp b/Applications/DataExplorer/DataView/DirectConditionGenerator.cpp index ed8c2625e27c312624156f223481b4f07e0d58c8..1607922052d4c29860da79d867a7ebcace70e1e7 100644 --- a/Applications/DataExplorer/DataView/DirectConditionGenerator.cpp +++ b/Applications/DataExplorer/DataView/DirectConditionGenerator.cpp @@ -104,7 +104,7 @@ const std::vector< std::pair<std::size_t,double> >& DirectConditionGenerator::di } catch (std::runtime_error const& e) { - WARN("%s", e.what()); + WARN("{:s}", e.what()); return _direct_values; } diff --git a/Applications/DataExplorer/DataView/GEOModels.cpp b/Applications/DataExplorer/DataView/GEOModels.cpp index 216c36d92040efe87cbb1be7cb575f068e03479a..77dca677f6b3963899bdcc00e501ca9a1b5d8b74 100644 --- a/Applications/DataExplorer/DataView/GEOModels.cpp +++ b/Applications/DataExplorer/DataView/GEOModels.cpp @@ -70,7 +70,7 @@ void GEOModels::updateGeometry(const std::string &geo_name) } } else - ERR("GEOModels::updateGeometry() - Geometry '%s' not found.", + ERR("GEOModels::updateGeometry() - Geometry '{:s}' not found.", geo_name.c_str()); } @@ -250,7 +250,7 @@ void GEOModels::addNameForElement(std::string const& geometry_name, _geo_objects.getSurfaceVecObj(geometry_name)->setNameForElement(id, new_name); } else - ERR("GEOModels::addNameForElement() - Unknown GEOTYPE %s.", + ERR("GEOModels::addNameForElement() - Unknown GEOTYPE {:s}.", GeoLib::convertGeoTypeToString(object_type).c_str()); } @@ -290,6 +290,6 @@ void GEOModels::addNameForObjectPoints(const std::string &geometry_name, } } else - ERR("GEOModels::addNameForObjectPoints() - Unknown GEOTYPE %s.", + ERR("GEOModels::addNameForObjectPoints() - Unknown GEOTYPE {:s}.", GeoLib::convertGeoTypeToString(object_type).c_str()); } diff --git a/Applications/DataExplorer/DataView/GeoTreeModel.cpp b/Applications/DataExplorer/DataView/GeoTreeModel.cpp index 59433d3097fc2b8a4fe1308920cdbefd447598d4..f22a2418fb290fc335e8861b872a75616f802f9c 100644 --- a/Applications/DataExplorer/DataView/GeoTreeModel.cpp +++ b/Applications/DataExplorer/DataView/GeoTreeModel.cpp @@ -78,8 +78,8 @@ void GeoTreeModel::addPointList(QString geoName, GeoLib::PointVec const& pointVe ->setData(4, QString::fromStdString(pnt->first))); } - INFO("Geometry '%s' built. %d points added.", geoName.toStdString().c_str(), - nPoints); + INFO("Geometry '{:s}' built. {:d} points added.", + geoName.toStdString().c_str(), nPoints); endResetModel(); } @@ -101,7 +101,7 @@ void GeoTreeModel::addPolylineList(QString geoName, GeoLib::PolylineVec const& p if (geo == nullptr) { ERR("GeoTreeModel::addPolylineList(): No corresponding geometry for " - "'%s' found.", + "'{:s}' found.", geoName.toStdString().c_str()); return; } @@ -182,7 +182,7 @@ void GeoTreeModel::addChildren(GeoObjectListItem* plyList, ->setData(1, QString::fromStdString(pnt->first))); } - INFO("%d polylines added.", end_index - start_index); + INFO("{:d} polylines added.", end_index - start_index); } void GeoTreeModel::addSurfaceList(QString geoName, GeoLib::SurfaceVec const& surfaceVec) @@ -202,7 +202,7 @@ void GeoTreeModel::addSurfaceList(QString geoName, GeoLib::SurfaceVec const& sur if (geo == nullptr) { ERR("GeoTreeModel::addSurfaceList(): No corresponding geometry for " - "'%s' found.", + "'{:s}' found.", geoName.toStdString().c_str()); return; } @@ -297,7 +297,7 @@ void GeoTreeModel::addChildren(GeoObjectListItem* sfcList, ->setData(1, QString::fromStdString(pnt->first))); } - INFO("%d surfaces added.", end_index - start_index); + INFO("{:d} surfaces added.", end_index - start_index); } void GeoTreeModel::renameGeometry(std::string const& old_name, @@ -316,7 +316,7 @@ void GeoTreeModel::renameGeometry(std::string const& old_name, { if (new_name == tree_item_entry->data(0).toString().toStdString()) { - INFO("Found tree_item_entry with name '%s'.", new_name.c_str()); + INFO("Found tree_item_entry with name '{:s}'.", new_name.c_str()); } } } diff --git a/Applications/DataExplorer/DataView/MeshLayerEditDialog.cpp b/Applications/DataExplorer/DataView/MeshLayerEditDialog.cpp index 97d8213c0097e389cd7ba699cd4e7754e4f06694..f147ec266babc82c2dc669c123517be8f941ccd6 100644 --- a/Applications/DataExplorer/DataView/MeshLayerEditDialog.cpp +++ b/Applications/DataExplorer/DataView/MeshLayerEditDialog.cpp @@ -209,7 +209,7 @@ MeshLib::Mesh* MeshLayerEditDialog::createPrismMesh() auto const rasters = FileIO::readRasters(raster_paths); if (rasters && mapper.createLayers(*_msh, *rasters, minimum_thickness)) { - INFO("Mesh construction time: %d ms.", myTimer0.elapsed()); + INFO("Mesh construction time: {:d} ms.", myTimer0.elapsed()); return mapper.getMesh("SubsurfaceMesh").release(); } return nullptr; @@ -220,7 +220,7 @@ MeshLib::Mesh* MeshLayerEditDialog::createPrismMesh() { layer_thickness.push_back(this->_edits[i]->text().toFloat()); } - INFO("Mesh construction time: %d ms.", myTimer0.elapsed()); + INFO("Mesh construction time: {:d} ms.", myTimer0.elapsed()); return MeshLib::MeshLayerMapper::createStaticLayers(*_msh, layer_thickness); } @@ -279,7 +279,7 @@ MeshLib::Mesh* MeshLayerEditDialog::createTetMesh() FileIO::TetGenInterface tetgen_interface; tetgen_interface.writeTetGenSmesh(filename.toStdString(), *tg_mesh, tg_attr); } - INFO("Mesh construction time: %d ms.", myTimer0.elapsed()); + INFO("Mesh construction time: {:d} ms.", myTimer0.elapsed()); return tg_mesh; } diff --git a/Applications/DataExplorer/DataView/MeshModel.cpp b/Applications/DataExplorer/DataView/MeshModel.cpp index 095a4a7921157daf6ababb88229da31f1d02a763..6aeaf947a437cc74b3b7f2a0cf1d4836274bdc51 100644 --- a/Applications/DataExplorer/DataView/MeshModel.cpp +++ b/Applications/DataExplorer/DataView/MeshModel.cpp @@ -65,7 +65,7 @@ void MeshModel::addMeshObject(const MeshLib::Mesh* mesh) { beginResetModel(); - INFO("name: %s", mesh->getName().c_str()); + INFO("name: {:s}", mesh->getName().c_str()); QVariant const display_name (QString::fromStdString(mesh->getName())); QList<QVariant> meshData; meshData << display_name << "" << ""; @@ -115,7 +115,8 @@ const MeshLib::Mesh* MeshModel::getMesh(const std::string &name) const } } - INFO("MeshModel::getMesh(): No entry found with name \"%s\".", name.c_str()); + INFO("MeshModel::getMesh(): No entry found with name \"{:s}\".", + name.c_str()); return nullptr; } @@ -148,7 +149,8 @@ bool MeshModel::removeMesh(const std::string &name) } } - INFO("MeshModel::removeMesh(): No entry found with name \"%s\".", name.c_str()); + INFO("MeshModel::removeMesh(): No entry found with name \"{:s}\".", + name.c_str()); return false; } @@ -214,6 +216,7 @@ vtkUnstructuredGridAlgorithm* MeshModel::vtkSource(const std::string &name) cons } } - INFO("MeshModel::vtkSource(): No entry found with name \"%s\".", name.c_str()); + INFO("MeshModel::vtkSource(): No entry found with name \"{:s}\".", + name.c_str()); return nullptr; } diff --git a/Applications/DataExplorer/VtkVis/VtkAddFilterDialog.cpp b/Applications/DataExplorer/VtkVis/VtkAddFilterDialog.cpp index 5f5a2b4663332691625a32e71052106290ddcb74..6a39bc2d8cd63bcb6eb6d9ded30d0422450ae92b 100644 --- a/Applications/DataExplorer/VtkVis/VtkAddFilterDialog.cpp +++ b/Applications/DataExplorer/VtkVis/VtkAddFilterDialog.cpp @@ -113,7 +113,8 @@ void VtkAddFilterDialog::on_buttonBox_accepted() } else { - ERR("VtkFilterFactory cannot create %s.", filterName.toStdString().c_str()); + ERR("VtkFilterFactory cannot create {:s}.", + filterName.toStdString().c_str()); return; } } diff --git a/Applications/DataExplorer/VtkVis/VtkAlgorithmProperties.cpp b/Applications/DataExplorer/VtkVis/VtkAlgorithmProperties.cpp index 0eed0599ed8a75eeda32821410daa9a81857b277..30641b492d636ac72305bd1c87d62d21ecda881d 100644 --- a/Applications/DataExplorer/VtkVis/VtkAlgorithmProperties.cpp +++ b/Applications/DataExplorer/VtkVis/VtkAlgorithmProperties.cpp @@ -111,7 +111,7 @@ QVariant VtkAlgorithmProperties::GetUserProperty(QString name) const return this->_algorithmUserProperties->value(name); } - ERR("Not a valid property: %s", name.toStdString().c_str()); + ERR("Not a valid property: {:s}", name.toStdString().c_str()); return QVariant(); } @@ -122,7 +122,7 @@ QList<QVariant> VtkAlgorithmProperties::GetUserVectorProperty(QString name) cons return this->_algorithmUserVectorProperties->value(name); } - ERR("Not a valid property: %s", name.toStdString().c_str()); + ERR("Not a valid property: {:s}", name.toStdString().c_str()); return QList<QVariant>(); } diff --git a/Applications/DataExplorer/VtkVis/VtkColorLookupTable.cpp b/Applications/DataExplorer/VtkVis/VtkColorLookupTable.cpp index 2f8d0b92295480cad5122081c70812bd3850e9c0..00e7535337dd741238d9c4a799e44f7e2a29cf71 100644 --- a/Applications/DataExplorer/VtkVis/VtkColorLookupTable.cpp +++ b/Applications/DataExplorer/VtkVis/VtkColorLookupTable.cpp @@ -149,7 +149,7 @@ void VtkColorLookupTable::writeToFile(const std::string &filename) } strout << " done." << std::endl; - INFO("%s", strout.str().c_str()); + INFO("{:s}", strout.str().c_str()); out.close(); } diff --git a/Applications/DataExplorer/VtkVis/VtkCustomInteractorStyle.cpp b/Applications/DataExplorer/VtkVis/VtkCustomInteractorStyle.cpp index 5df35939a7f8bcab0c7ebd0166cdffb9aab8c1d7..0b0ebbb79621d2445dabd29e03006117be748714 100644 --- a/Applications/DataExplorer/VtkVis/VtkCustomInteractorStyle.cpp +++ b/Applications/DataExplorer/VtkVis/VtkCustomInteractorStyle.cpp @@ -154,11 +154,12 @@ void VtkCustomInteractorStyle::OnLeftButtonDown() picker->Pick(pos[0], pos[1], 0, this->GetDefaultRenderer()); double* worldPosition = picker->GetPickPosition(); - INFO("Cell id is: %d", picker->GetCellId()); + INFO("Cell id is: {:d}", picker->GetCellId()); if(picker->GetCellId() != -1) { - INFO("Pick position is: %f %f %f", worldPosition[0], worldPosition[1], worldPosition[2]); + INFO("Pick position is: {:f} {:f} {:f}", worldPosition[0], + worldPosition[1], worldPosition[2]); vtkSmartPointer<vtkIdTypeArray> ids = vtkSmartPointer<vtkIdTypeArray>::New(); @@ -186,8 +187,10 @@ void VtkCustomInteractorStyle::OnLeftButtonDown() vtkSmartPointer<vtkUnstructuredGrid>::New(); selected->ShallowCopy(extractSelection->GetOutput()); - INFO("There are %d points in the selection.", selected->GetNumberOfPoints()); - INFO("There are %d cells in the selection.", selected->GetNumberOfCells()); + INFO("There are {:d} points in the selection.", + selected->GetNumberOfPoints()); + INFO("There are {:d} cells in the selection.", + selected->GetNumberOfCells()); // check if the underlying object is a mesh and if so, send a signal to the element model for display of information about the picked element. vtkAlgorithm* data_set = picker->GetActor()->GetMapper()->GetInputConnection(0, 0)->GetProducer()->GetInputConnection(0,0)->GetProducer(); @@ -243,7 +246,7 @@ void VtkCustomInteractorStyle::OnRightButtonDown() picker->Pick(pos[0], pos[1], 0, this->GetDefaultRenderer()); double* worldPosition = picker->GetPickPosition(); - INFO("Cell id is: %d", picker->GetCellId()); + INFO("Cell id is: {:d}", picker->GetCellId()); if(picker->GetCellId() != -1) { diff --git a/Applications/DataExplorer/VtkVis/VtkPickCallback.cpp b/Applications/DataExplorer/VtkVis/VtkPickCallback.cpp index 52591cc297cc75941ee9c5e0ff31def8e8bc1756..983cefe1f47e2ee8ceed97ee913401cafcf4d20d 100644 --- a/Applications/DataExplorer/VtkVis/VtkPickCallback.cpp +++ b/Applications/DataExplorer/VtkVis/VtkPickCallback.cpp @@ -43,8 +43,8 @@ void VtkPickCallback::Execute(vtkObject* caller, } double* pos = picker->GetPickPosition(); - INFO("Picked cell id is: %d", picker->GetCellId()); - INFO("Picked position is: %f %f %f", pos[0], pos[1], pos[2]); + INFO("Picked cell id is: {:d}", picker->GetCellId()); + INFO("Picked position is: {:f} {:f} {:f}", pos[0], pos[1], pos[2]); } } diff --git a/Applications/DataExplorer/VtkVis/VtkRaster.cpp b/Applications/DataExplorer/VtkVis/VtkRaster.cpp index 5fc5154019f1ce1c17640515fbaae81f6fabe6e6..52bf15f7f8bbdcf45518c5d2172b602b2bfa7502 100644 --- a/Applications/DataExplorer/VtkVis/VtkRaster.cpp +++ b/Applications/DataExplorer/VtkVis/VtkRaster.cpp @@ -143,7 +143,10 @@ vtkImageAlgorithm* VtkRaster::loadImageFromTIFF(const std::string& fileName, ++nImages; } while (TIFFReadDirectory(tiff)); if (nImages > 1) - INFO("VtkRaster::loadImageFromTIFF() - File contains %d images. This method is not tested for this case.", nImages); + INFO( + "VtkRaster::loadImageFromTIFF() - File contains {:d} " + "images. This method is not tested for this case.", + nImages); // get image size TIFFGetField(tiff, TIFFTAG_IMAGEWIDTH, &imgWidth); @@ -340,7 +343,7 @@ bool VtkRaster::readWorldFile(std::string const& filename, std::ifstream in(world_file.c_str()); if (!in.is_open()) { - ERR("VtkRaster::readWorldFile(): Could not open file %s.", + ERR("VtkRaster::readWorldFile(): Could not open file {:s}.", filename.c_str()); return false; } @@ -365,8 +368,8 @@ bool VtkRaster::readWorldFile(std::string const& filename, double const delta_y = BaseLib::str2number<double>(line); if (delta_x != -delta_y) WARN( - "Anisotropic pixel size detected (%f vs %f). An isotropic " - "spacing of %f is assumed, be aware results may be wrong.", + "Anisotropic pixel size detected ({:f} vs {:f}). An isotropic " + "spacing of {:f} is assumed, be aware results may be wrong.", delta_x, delta_y, delta_x); // x-translation if (!std::getline(in, line)) diff --git a/Applications/DataExplorer/VtkVis/VtkStationSource.cpp b/Applications/DataExplorer/VtkVis/VtkStationSource.cpp index c6bd9b1bdb3b02ac9e626c4d458bfb92c74afe96..0324a0ba4f722d8ff9ff03a22102c5df4a3f793e 100644 --- a/Applications/DataExplorer/VtkVis/VtkStationSource.cpp +++ b/Applications/DataExplorer/VtkVis/VtkStationSource.cpp @@ -235,7 +235,7 @@ std::size_t VtkStationSource::GetIndexByName( std::string const& name ) } vtkIdType new_index = (_id_map.empty()) ? 0 : (max_key+1); - INFO("Key '%s' has been assigned index %d.", name.c_str(), new_index); + INFO("Key '{:s}' has been assigned index {:d}.", name.c_str(), new_index); _id_map.insert(std::pair<std::string, vtkIdType>(name, new_index)); return new_index; } diff --git a/Applications/DataExplorer/VtkVis/VtkVisPipeline.cpp b/Applications/DataExplorer/VtkVis/VtkVisPipeline.cpp index c80a3aaa6d7f2ab7fb18dc85f601383a956eac54..ff323044c9fff31a15ee3ceeb3deb3f02cde652d 100644 --- a/Applications/DataExplorer/VtkVis/VtkVisPipeline.cpp +++ b/Applications/DataExplorer/VtkVis/VtkVisPipeline.cpp @@ -178,7 +178,7 @@ void VtkVisPipeline::loadFromFile(QString filename) #ifndef NDEBUG QTime myTimer; myTimer.start(); - INFO("VTK Read: %s.", filename.toStdString().c_str()); + INFO("VTK Read: {:s}.", filename.toStdString().c_str()); #endif if (filename.size() > 0) @@ -244,7 +244,7 @@ void VtkVisPipeline::loadFromFile(QString filename) } #ifndef NDEBUG - INFO("%d ms", myTimer.elapsed()); + INFO("{:d} ms", myTimer.elapsed()); #endif } @@ -467,14 +467,14 @@ void VtkVisPipeline::listArrays(vtkDataSet* dataSet) if (dataSet) { vtkPointData* pointData = dataSet->GetPointData(); - INFO(" #point data arrays: %d", pointData->GetNumberOfArrays()); + INFO(" #point data arrays: {:d}", pointData->GetNumberOfArrays()); for (int i = 0; i < pointData->GetNumberOfArrays(); i++) - INFO(" Name: %s", pointData->GetArrayName(i)); + INFO(" Name: {:s}", pointData->GetArrayName(i)); vtkCellData* cellData = dataSet->GetCellData(); - INFO(" #cell data arrays: %d", cellData->GetNumberOfArrays()); + INFO(" #cell data arrays: {:d}", cellData->GetNumberOfArrays()); for (int i = 0; i < cellData->GetNumberOfArrays(); i++) - INFO(" Name: %s", cellData->GetArrayName(i)); + INFO(" Name: {:s}", cellData->GetArrayName(i)); } else ERR("VtkVisPipeline::listArrays(): not a valid vtkDataSet."); diff --git a/Applications/DataExplorer/main.cpp b/Applications/DataExplorer/main.cpp index 6d1fddafb698fa01e4373dec0e3d16c11f5f150d..72502fe0a4640ec629789ce98aebea0c77fdc8eb 100644 --- a/Applications/DataExplorer/main.cpp +++ b/Applications/DataExplorer/main.cpp @@ -31,10 +31,6 @@ int main(int argc, char* argv[]) auto myOutputWindow = vtkSmartPointer<VtkConsoleOutputWindow>::New(); vtkOutputWindow::SetInstance(myOutputWindow); - LOGOG_INITIALIZE(); - auto* logogCout = new logog::Cout; - auto* formatter = new BaseLib::LogogSimpleFormatter; - logogCout->SetFormatter(*formatter); QApplication a(argc, argv); QApplication::setApplicationName("OpenGeoSys - Data Explorer"); QApplication::setApplicationVersion(QString::fromStdString( @@ -51,9 +47,6 @@ int main(int argc, char* argv[]) } w->show(); int returncode = QApplication::exec(); - delete formatter; - delete logogCout; - LOGOG_SHUTDOWN(); #ifdef VTKFBXCONVERTER_FOUND DestroySdkObjects(lSdkManager, true); #endif diff --git a/Applications/DataExplorer/mainwindow.cpp b/Applications/DataExplorer/mainwindow.cpp index 85dac3b2392347d8c67bda5eaa6387c261cd146a..d609239d3910c049e457edf29c28613c8812c8c5 100644 --- a/Applications/DataExplorer/mainwindow.cpp +++ b/Applications/DataExplorer/mainwindow.cpp @@ -593,7 +593,7 @@ void MainWindow::loadFile(ImportFileType::type t, const QString &fileName) std::unique_ptr<MeshLib::Mesh> mesh( MeshLib::IO::readMeshFromFile(fileName.toStdString())); #ifndef NDEBUG - INFO("Mesh loading time: %d ms.", myTimer0.elapsed()); + INFO("Mesh loading time: {:d} ms.", myTimer0.elapsed()); myTimer1.start(); #endif if (mesh) @@ -605,7 +605,7 @@ void MainWindow::loadFile(ImportFileType::type t, const QString &fileName) OGSError::box("Failed to load mesh file."); } #ifndef NDEBUG - INFO("Mesh model setup time: %d ms.", myTimer1.elapsed()); + INFO("Mesh model setup time: {:d} ms.", myTimer1.elapsed()); #endif } @@ -1130,7 +1130,7 @@ void MainWindow::callGMSH(std::vector<std::string> & selectedGeometries, remove_command = "del "; #endif remove_command += fileName.toStdString(); - INFO("remove command: %s", remove_command.c_str()); + INFO("remove command: {:s}", remove_command.c_str()); auto const return_value = system(remove_command.c_str()); if (return_value != 0) { diff --git a/Applications/DataHolderLib/Color.cpp b/Applications/DataHolderLib/Color.cpp index 1ee19e5581f101c6f383c6cb343ef2396d711b8b..7feeba80fa3dceba2f1ef1202d242baa2f736142 100644 --- a/Applications/DataHolderLib/Color.cpp +++ b/Applications/DataHolderLib/Color.cpp @@ -36,7 +36,7 @@ Color getColor(const std::string& id, std::map<std::string, Color>& colors) if (it == end(colors)) { - WARN("Key '%s' not found in color lookup table.", id.c_str()); + WARN("Key '{:s}' not found in color lookup table.", id.c_str()); it = colors.insert({id, getRandomColor()}).first; } diff --git a/Applications/FileIO/AsciiRasterInterface.cpp b/Applications/FileIO/AsciiRasterInterface.cpp index be8b8eda679c069545d51fb77b369a4937f06f94..7dbf9aff0e226e188092f8333c4b644f517dd4b5 100644 --- a/Applications/FileIO/AsciiRasterInterface.cpp +++ b/Applications/FileIO/AsciiRasterInterface.cpp @@ -44,7 +44,8 @@ GeoLib::Raster* AsciiRasterInterface::getRasterFromASCFile(std::string const& fn std::ifstream in(fname.c_str()); if (!in.is_open()) { - WARN("Raster::getRasterFromASCFile(): Could not open file %s.", fname.c_str()); + WARN("Raster::getRasterFromASCFile(): Could not open file {:s}.", + fname.c_str()); return nullptr; } @@ -68,7 +69,7 @@ GeoLib::Raster* AsciiRasterInterface::getRasterFromASCFile(std::string const& fn delete [] values; return raster; } - WARN("Raster::getRasterFromASCFile(): Could not read header of file %s", + WARN("Raster::getRasterFromASCFile(): Could not read header of file {:s}", fname.c_str()); return nullptr; } @@ -159,7 +160,8 @@ GeoLib::Raster* AsciiRasterInterface::getRasterFromSurferFile(std::string const& std::ifstream in(fname.c_str()); if (!in.is_open()) { - ERR("Raster::getRasterFromSurferFile() - Could not open file %s", fname.c_str()); + ERR("Raster::getRasterFromSurferFile() - Could not open file {:s}", + fname.c_str()); return nullptr; } @@ -191,7 +193,7 @@ GeoLib::Raster* AsciiRasterInterface::getRasterFromSurferFile(std::string const& delete [] values; return raster; } - ERR("Raster::getRasterFromASCFile() - could not read header of file %s", + ERR("Raster::getRasterFromASCFile() - could not read header of file {:s}", fname.c_str()); return nullptr; } diff --git a/Applications/FileIO/CsvInterface.cpp b/Applications/FileIO/CsvInterface.cpp index 92c8c20f57997f1771c517a2c6a84eb76b29dbf4..f81125650e504b117f9c49a1a0459d334119e868 100644 --- a/Applications/FileIO/CsvInterface.cpp +++ b/Applications/FileIO/CsvInterface.cpp @@ -29,7 +29,7 @@ std::vector<std::string> CsvInterface::getColumnNames(std::string const& fname, if (!in.is_open()) { - ERR("CsvInterface::readPoints(): Could not open file %s.", + ERR("CsvInterface::readPoints(): Could not open file {:s}.", fname.c_str()); return std::vector<std::string>(); } @@ -65,7 +65,8 @@ int CsvInterface::readPoints(std::string const& fname, char delim, std::ifstream in(fname.c_str()); if (!in.is_open()) { - ERR ("CsvInterface::readPoints(): Could not open file %s.", fname.c_str()); + ERR("CsvInterface::readPoints(): Could not open file {:s}.", + fname.c_str()); return -1; } @@ -82,7 +83,9 @@ int CsvInterface::readPoints(std::string const& fname, char delim, if (fields.size() < 3) { - ERR ("Line %d contains not enough columns of data. Skipping line...", line_count); + ERR("Line {:d} contains not enough columns of data. Skipping " + "line...", + line_count); error_count++; continue; } @@ -94,7 +97,8 @@ int CsvInterface::readPoints(std::string const& fname, char delim, point[2] = std::stod(*(++it)); points.push_back(new GeoLib::Point(point[0], point[1], point[2])); } catch (const std::invalid_argument&) { - ERR ("Error converting data to coordinates in line %d.", line_count); + ERR("Error converting data to coordinates in line {:d}.", + line_count); } } return error_count; @@ -110,7 +114,8 @@ int CsvInterface::readPoints(std::string const& fname, char delim, std::array<std::string, 3> const column_names = {{x_column_name, y_column_name, z_column_name}}; if (!in.is_open()) { - ERR ("CsvInterface::readPoints(): Could not open file %s.", fname.c_str()); + ERR("CsvInterface::readPoints(): Could not open file {:s}.", + fname.c_str()); return -1; } @@ -126,7 +131,7 @@ int CsvInterface::readPoints(std::string const& fname, char delim, { if (column_idx[i] == std::numeric_limits<std::size_t>::max()) { - ERR("Column '%s' not found in file header.", + ERR("Column '{:s}' not found in file header.", column_names[i].c_str()); return -1; } @@ -144,7 +149,8 @@ int CsvInterface::readPoints(std::string const& fname, char delim, std::ifstream in(fname.c_str()); if (!in.is_open()) { - ERR ("CsvInterface::readPoints(): Could not open file %s.", fname.c_str()); + ERR("CsvInterface::readPoints(): Could not open file {:s}.", + fname.c_str()); return -1; } @@ -181,7 +187,9 @@ int CsvInterface::readPoints(std::ifstream &in, char delim, if (fields.size() < column_idx[order[2]]+1) { - ERR ("Line %d contains not enough columns of data. Skipping line...", line_count); + ERR("Line {:d} contains not enough columns of data. Skipping " + "line...", + line_count); error_count++; continue; } @@ -197,7 +205,8 @@ int CsvInterface::readPoints(std::ifstream &in, char delim, point[order[2]] = (column_idx[1] == column_idx[2]) ? 0 : std::stod(*it); points.push_back(new GeoLib::Point(point[0], point[1], point[2])); } catch (const std::invalid_argument&) { - ERR ("Error converting data to coordinates in line %d.", line_count); + ERR("Error converting data to coordinates in line {:d}.", + line_count); error_count++; } } diff --git a/Applications/FileIO/CsvInterface.h b/Applications/FileIO/CsvInterface.h index 1e7f42c4b8895ae29e62f32a1328166830f63ae9..069942d74aef039ab48ae0cb04191c424aa3ab57 100644 --- a/Applications/FileIO/CsvInterface.h +++ b/Applications/FileIO/CsvInterface.h @@ -74,7 +74,9 @@ public: std::size_t const vec_size (getVectorSize(0)); if (vec_size != vec.size()) { - ERR ("Vector size does not match existing data (should be %d).", vec_size); + ERR("Vector size does not match existing data (should be " + "{:d}).", + vec_size); return false; } } @@ -153,7 +155,8 @@ public: { std::ifstream in(fname.c_str()); if (!in.is_open()) { - ERR ("CsvInterface::readColumn(): Could not open file %s.", fname.c_str()); + ERR("CsvInterface::readColumn(): Could not open file {:s}.", + fname.c_str()); return -1; } @@ -162,7 +165,7 @@ public: std::size_t const column_idx = CsvInterface::findColumn(line, delim, column_name); if (column_idx == std::numeric_limits<std::size_t>::max()) { - ERR("Column '%s' not found in file header.", column_name.c_str()); + ERR("Column '{:s}' not found in file header.", column_name.c_str()); return -1; } return readColumn<T>(in, delim, data_array, column_idx); @@ -175,7 +178,8 @@ public: { std::ifstream in(fname.c_str()); if (!in.is_open()) { - ERR ("CsvInterface::readColumn(): Could not open file %s.", fname.c_str()); + ERR("CsvInterface::readColumn(): Could not open file {:s}.", + fname.c_str()); return -1; } return readColumn<T>(in, delim, data_array, column_idx); @@ -204,7 +208,9 @@ private: if (fields.size() < column_idx+1) { - ERR ("Line %d contains not enough columns of data. Skipping line...", line_count); + ERR("Line {:d} contains not enough columns of data. Skipping " + "line...", + line_count); error_count++; continue; } @@ -215,7 +221,7 @@ private: T value; if (!(stream >> value)) { - ERR("Error reading value in line %d.", line_count); + ERR("Error reading value in line {:d}.", line_count); error_count++; continue; } diff --git a/Applications/FileIO/FEFLOW/FEFLOWGeoInterface.cpp b/Applications/FileIO/FEFLOW/FEFLOWGeoInterface.cpp index 74e267e18f96b004b017744011799cb5429f587f..9c5174961fcab355aaedb207ebc2767680ad6caf 100644 --- a/Applications/FileIO/FEFLOW/FEFLOWGeoInterface.cpp +++ b/Applications/FileIO/FEFLOW/FEFLOWGeoInterface.cpp @@ -34,7 +34,7 @@ void FEFLOWGeoInterface::readFEFLOWFile(const std::string& filename, std::ifstream in(filename.c_str()); if (!in) { - ERR("FEFLOWGeoInterface::readFEFLOWFile(): Could not open file %s.", + ERR("FEFLOWGeoInterface::readFEFLOWFile(): Could not open file {:s}.", filename.c_str()); return; } diff --git a/Applications/FileIO/FEFLOW/FEFLOWMeshInterface.cpp b/Applications/FileIO/FEFLOW/FEFLOWMeshInterface.cpp index 3c34c3d6d5274ce3ea6619f45e458bbf7cb34a6c..273c94078a3ae8c674e436c85dbc4db5bd66dd9c 100644 --- a/Applications/FileIO/FEFLOW/FEFLOWMeshInterface.cpp +++ b/Applications/FileIO/FEFLOW/FEFLOWMeshInterface.cpp @@ -33,7 +33,7 @@ MeshLib::Mesh* FEFLOWMeshInterface::readFEFLOWFile(const std::string& filename) std::ifstream in(filename.c_str()); if (!in) { - ERR("FEFLOWMeshInterface::readFEFLOWFile(): Could not open file %s.", + ERR("FEFLOWMeshInterface::readFEFLOWFile(): Could not open file {:s}.", filename.c_str()); return nullptr; } @@ -131,7 +131,7 @@ MeshLib::Mesh* FEFLOWMeshInterface::readFEFLOWFile(const std::string& filename) if (eleType == MeshLib::MeshElemType::INVALID) { ERR("FEFLOWInterface::readFEFLOWFile(): Unsupported element " - "type with the number of node = %d and dim = %d", + "type with the number of node = {:d} and dim = {:d}", fem_dim.n_nodes_of_element, fem_class.dimension); std::for_each(vec_nodes.begin(), vec_nodes.end(), [](MeshLib::Node* nod) @@ -276,7 +276,7 @@ void FEFLOWMeshInterface::readNodeCoordinates( // read the line containing the coordinates as string if (!std::getline(in, line_string)) { - ERR("Could not read the node '%u'.", k); + ERR("Could not read the node '{:d}'.", k); for (auto* n : vec_nodes) { delete n; @@ -290,7 +290,7 @@ void FEFLOWMeshInterface::readNodeCoordinates( { if (!(line_stream >> (*vec_nodes[k])[i])) { - ERR("Could not parse coordinate %u of node '%u'.", i, k); + ERR("Could not parse coordinate {:d} of node '{:d}'.", i, k); for (auto* n : vec_nodes) { delete n; @@ -299,7 +299,7 @@ void FEFLOWMeshInterface::readNodeCoordinates( } if (!(line_stream >> dummy_char) && i < 2) // read comma { - ERR("Could not parse node '%u'.", k); + ERR("Could not parse node '{:d}'.", k); for (auto* n : vec_nodes) { delete n; @@ -691,7 +691,7 @@ void FEFLOWMeshInterface::readELEMENTALSETS( set_name = line_string.substr(0, pos); ids = line_string.substr(pos + 1); } - INFO("Found an element group - %s", set_name.data()); + INFO("Found an element group - {:s}", set_name.data()); str_idList += compressSpaces(ids); } else diff --git a/Applications/FileIO/GMSInterface.cpp b/Applications/FileIO/GMSInterface.cpp index cd947748391db321a9216086b35c0a27bf377032..cb9a9e165fab5ea2feab00f88c135f0dc6d411b5 100644 --- a/Applications/FileIO/GMSInterface.cpp +++ b/Applications/FileIO/GMSInterface.cpp @@ -50,7 +50,7 @@ int GMSInterface::readBoreholesFromGMS(std::vector<GeoLib::Point*>* boreholes, std::ifstream in(filename.c_str()); if (!in.is_open()) { - ERR("GMSInterface::readBoreholeFromGMS(): Could not open file %s.", + ERR("GMSInterface::readBoreholeFromGMS(): Could not open file {:s}.", filename.c_str()); return 0; } @@ -92,7 +92,7 @@ int GMSInterface::readBoreholesFromGMS(std::vector<GeoLib::Point*>* boreholes, else WARN( "GMSInterface::readBoreholeFromGMS(): Skipped layer " - "'%s' in borehole '%s' because of thickness 0.0.", + "'{:s}' in borehole '{:s}' because of thickness 0.0.", sName.c_str(), cName.c_str()); } else // add new borehole @@ -186,7 +186,7 @@ MeshLib::Mesh* GMSInterface::readGMS3DMMesh(const std::string& filename) std::ifstream in(filename.c_str()); if (!in.is_open()) { - ERR("GMSInterface::readGMS3DMMesh(): Could not open file %s.", + ERR("GMSInterface::readGMS3DMMesh(): Could not open file {:s}.", filename.c_str()); return nullptr; } @@ -282,7 +282,7 @@ MeshLib::Mesh* GMSInterface::readGMS3DMMesh(const std::string& filename) else // default { WARN( - "GMSInterface::readGMS3DMMesh() - Element type '%s' not " + "GMSInterface::readGMS3DMMesh() - Element type '{:s}' not " "recognised.", element_id.c_str()); return nullptr; diff --git a/Applications/FileIO/Gmsh/GMSHAdaptiveMeshDensity.cpp b/Applications/FileIO/Gmsh/GMSHAdaptiveMeshDensity.cpp index bd9a3dbcccc47c9084617317ecf3348df058aaa9..4e5e43dbe54be306bd2684558a737d2824c6358b 100644 --- a/Applications/FileIO/Gmsh/GMSHAdaptiveMeshDensity.cpp +++ b/Applications/FileIO/Gmsh/GMSHAdaptiveMeshDensity.cpp @@ -86,7 +86,10 @@ void GMSHAdaptiveMeshDensity::addPoints(std::vector<GeoLib::Point const*> const& { // *** QuadTree - insert points const std::size_t n_pnts(pnts.size()); - DBUG("GMSHAdaptiveMeshDensity::addPoints(): Inserting %d points into quadtree.", n_pnts); + DBUG( + "GMSHAdaptiveMeshDensity::addPoints(): Inserting {:d} points into " + "quadtree.", + n_pnts); for (std::size_t k(0); k < n_pnts; k++) { _quad_tree->addPoint(pnts[k]); diff --git a/Applications/FileIO/Gmsh/GMSHInterface.cpp b/Applications/FileIO/Gmsh/GMSHInterface.cpp index e3dcd13cebadb4617b9b1ca0b9e50a5ad6e4cd2e..a2a8c3126f3ecec814ed0835ff03f03908be0328 100644 --- a/Applications/FileIO/Gmsh/GMSHInterface.cpp +++ b/Applications/FileIO/Gmsh/GMSHInterface.cpp @@ -150,12 +150,12 @@ int GMSHInterface::writeGMSHInputFile(std::ostream& out) } DBUG( "GMSHInterface::writeGMSHInputFile(): Computed topological hierarchy - " - "detected %d polygons.", + "detected {:d} polygons.", _polygon_tree_list.size()); GeoLib::createPolygonTrees<GMSH::GMSHPolygonTree>(_polygon_tree_list); DBUG( "GMSHInterface::writeGMSHInputFile(): Computed topological hierarchy - " - "calculated %d polygon trees.", + "calculated {:d} polygon trees.", _polygon_tree_list.size()); // *** Mark in each polygon tree the segments shared by two polygons. diff --git a/Applications/FileIO/Gmsh/GmshReader.cpp b/Applications/FileIO/Gmsh/GmshReader.cpp index 41b6398e1654adbe38a39817db689d0cc2ed65ee..8d415c5e8d473da07a8739a95ea0c6c7f3b66b30 100644 --- a/Applications/FileIO/Gmsh/GmshReader.cpp +++ b/Applications/FileIO/Gmsh/GmshReader.cpp @@ -39,7 +39,7 @@ bool isGMSHMeshFile(const std::string& fname) std::ifstream input(fname.c_str()); if (!input) { - ERR("isGMSHMeshFile(): Could not open file %s.", fname.c_str()); + ERR("isGMSHMeshFile(): Could not open file {:s}.", fname.c_str()); return false; } @@ -50,7 +50,7 @@ bool isGMSHMeshFile(const std::string& fname) std::string version; getline(input, version); getline(input, version); - INFO("isGMSHMeshFile(): Found GMSH mesh file version: %s.", + INFO("isGMSHMeshFile(): Found GMSH mesh file version: {:s}.", version.c_str()); input.close(); return true; @@ -156,7 +156,7 @@ std::pair<MeshLib::Element*, int> readElement( in >> dummy; // skip rest of line break; default: - WARN("readGMSHMesh(): Unknown element type %d.", type); + WARN("readGMSHMesh(): Unknown element type {:d}.", type); break; } return std::make_pair(nullptr, -1); @@ -168,7 +168,7 @@ MeshLib::Mesh* readGMSHMesh(std::string const& fname) std::ifstream in(fname.c_str(), std::ios::in); if (!in.is_open()) { - WARN ("readGMSHMesh() - Could not open file %s.", fname.c_str()); + WARN("readGMSHMesh() - Could not open file {:s}.", fname.c_str()); return nullptr; } @@ -183,7 +183,8 @@ MeshLib::Mesh* readGMSHMesh(std::string const& fname) getline(in, line); // version-number file-type data-size if (line.substr(0, 3) != "2.2") { - WARN("Wrong gmsh file format version '%s'.", line.substr(0,3).c_str()); + WARN("Wrong gmsh file format version '{:s}'.", + line.substr(0, 3).c_str()); return nullptr; } @@ -281,8 +282,8 @@ MeshLib::Mesh* readGMSHMesh(std::string const& fname) MeshLib::ElementValueModification::condense(*mesh); INFO("\t... finished."); - INFO("Nr. Nodes: %d.", nodes.size()); - INFO("Nr. Elements: %d.", elements.size()); + INFO("Nr. Nodes: {:d}.", nodes.size()); + INFO("Nr. Elements: {:d}.", elements.size()); return mesh; } diff --git a/Applications/FileIO/GocadIO/CoordinateSystem.cpp b/Applications/FileIO/GocadIO/CoordinateSystem.cpp index 2bdfe1e2834a2390486803e15b188d9e97f800f0..b314c28ee5dad00d381ce31aa1d493f95451c40b 100644 --- a/Applications/FileIO/GocadIO/CoordinateSystem.cpp +++ b/Applications/FileIO/GocadIO/CoordinateSystem.cpp @@ -7,13 +7,13 @@ * http://www.opengeosys.org/LICENSE.txt */ -#include <iostream> +#include "CoordinateSystem.h" -#include <logog/include/logog.hpp> -#include <boost/tokenizer.hpp> #include <boost/algorithm/string/trim.hpp> +#include <boost/tokenizer.hpp> +#include <iostream> -#include "CoordinateSystem.h" +#include "BaseLib/Logging.h" namespace FileIO { @@ -100,7 +100,8 @@ bool CoordinateSystem::parse(std::istream& in) return true; } else - WARN("CoordinateSystem::parse() - Unknown keyword found: %s", line.c_str()); + WARN("CoordinateSystem::parse() - Unknown keyword found: {:s}", + line.c_str()); } ERR ("Error: Unexpected end of file."); return false; diff --git a/Applications/FileIO/GocadIO/GenerateFaceSetMeshes.cpp b/Applications/FileIO/GocadIO/GenerateFaceSetMeshes.cpp index 77ca064e968ba2929187c20ffc248777ff21db7d..f69ae0feed64334434a3c2e761c6592c876aad43 100644 --- a/Applications/FileIO/GocadIO/GenerateFaceSetMeshes.cpp +++ b/Applications/FileIO/GocadIO/GenerateFaceSetMeshes.cpp @@ -26,12 +26,12 @@ void generateFaceSets(GocadSGridReader const& reader, std::string const& path) { continue; } - INFO("Face set mesh created. #nodes: %d, #elements: %d", + INFO("Face set mesh created. #nodes: {:d}, #elements: {:d}", face_set->getNumberOfNodes(), face_set->getNumberOfElements()); std::string const mesh_out_fname(path + face_set->getName() + ".vtu"); - INFO("Writing face set mesh to '%s'.", mesh_out_fname.c_str()); + INFO("Writing face set mesh to '{:s}'.", mesh_out_fname.c_str()); MeshLib::IO::writeMeshToFile(*face_set, mesh_out_fname); } } diff --git a/Applications/FileIO/GocadIO/GocadAsciiReader.cpp b/Applications/FileIO/GocadIO/GocadAsciiReader.cpp index 9a74dcff8dd0f8d0065fc55027552acf366ea787..7dc709fcf57007b824f2fe42a55cba1704e4963d 100644 --- a/Applications/FileIO/GocadIO/GocadAsciiReader.cpp +++ b/Applications/FileIO/GocadIO/GocadAsciiReader.cpp @@ -9,12 +9,11 @@ #include "GocadAsciiReader.h" -#include <logog/include/logog.hpp> - #include <iosfwd> #include "Applications/FileIO/GocadIO/CoordinateSystem.h" #include "BaseLib/FileTools.h" +#include "BaseLib/Logging.h" #include "BaseLib/StringTools.h" #include "MeshLib/Elements/Line.h" #include "MeshLib/Elements/Tri.h" @@ -90,7 +89,7 @@ bool skipToEND(std::ifstream& in) return true; } } - ERR("%s", eof_error.c_str()); + ERR("{:s}", eof_error.c_str()); return false; } @@ -151,7 +150,7 @@ bool parseHeader(std::ifstream& in, std::string& mesh_name) } // ignore all other header parameters } - ERR("%s", eof_error.c_str()); + ERR("{:s}", eof_error.c_str()); return false; } @@ -167,7 +166,7 @@ bool parsePropertyClass(std::ifstream& in) return true; } } - ERR("%s", eof_error.c_str()); + ERR("{:s}", eof_error.c_str()); return false; } @@ -221,8 +220,8 @@ bool parseProperties(std::ifstream& in, if (names.size() != prop_size.size()) { - ERR("Error: Number of PROPERTY-names (%d) does not match " - "number of ESIZES (%d)", + ERR("Error: Number of PROPERTY-names ({:d}) does not match " + "number of ESIZES ({:d})", names.size(), prop_size.size()); return false; } @@ -238,7 +237,7 @@ bool parseProperties(std::ifstream& in, // Remember current position in case the properties black ends now. pos = in.tellg(); } - ERR("%s", eof_error.c_str()); + ERR("{:s}", eof_error.c_str()); return false; } @@ -284,7 +283,7 @@ bool parseNodes(std::ifstream& in, if (!(line.substr(0, 4) == "VRTX" || line.substr(0, 5) == "PVRTX" || line.substr(0, 4) == "ATOM")) { - WARN("GocadAsciiReader::parseNodes() - Unknown keyword found: %s", + WARN("GocadAsciiReader::parseNodes() - Unknown keyword found: {:s}", line.c_str()); continue; } @@ -322,7 +321,7 @@ bool parseNodes(std::ifstream& in, node_id_map[nodes.back()->getID()] = nodes.size() - 1; pos = in.tellg(); } - ERR("%s", eof_error.c_str()); + ERR("{:s}", eof_error.c_str()); return false; } @@ -361,8 +360,8 @@ bool parseLineSegments(std::ifstream& in, auto const it = node_id_map.find(data[i]); if (it == node_id_map.end() || it->second >= nodes.size()) { - ERR("Error: Node ID (%d) out of range (0, %d).", data[i], - nodes.back()->getID()); + ERR("Error: Node ID ({:d}) out of range (0, {:d}).", + data[i], nodes.back()->getID()); return false; } elem_nodes[i] = nodes[it->second]; @@ -377,7 +376,7 @@ bool parseLineSegments(std::ifstream& in, } pos = in.tellg(); } - ERR("%s", eof_error.c_str()); + ERR("{:s}", eof_error.c_str()); return false; } @@ -410,10 +409,10 @@ bool parseLine(std::ifstream& in, { return true; } - WARN("GocadAsciiReader::parseLine() - Unknown keyword found: %s", + WARN("GocadAsciiReader::parseLine() - Unknown keyword found: {:s}", line.c_str()); } - ERR("%s", eof_error.c_str()); + ERR("{:s}", eof_error.c_str()); return false; } @@ -452,8 +451,8 @@ bool parseElements(std::ifstream& in, auto const it = node_id_map.find(data[i]); if (it == node_id_map.end() || it->second >= nodes.size()) { - ERR("Error: Node ID (%d) out of range (0, %d).", data[i], - nodes.back()->getID()); + ERR("Error: Node ID ({:d}) out of range (0, {:d}).", + data[i], nodes.back()->getID()); return false; } elem_nodes[i] = nodes[it->second]; @@ -468,7 +467,7 @@ bool parseElements(std::ifstream& in, } pos = in.tellg(); } - ERR("%s", eof_error.c_str()); + ERR("{:s}", eof_error.c_str()); return false; } @@ -511,11 +510,13 @@ bool parseSurface(std::ifstream& in, } else { - WARN("GocadAsciiReader::parseSurface() - Unknown keyword found: %s", - line.c_str()); + WARN( + "GocadAsciiReader::parseSurface() - Unknown keyword found: " + "{:s}", + line.c_str()); } } - ERR("%s", eof_error.c_str()); + ERR("{:s}", eof_error.c_str()); return false; } @@ -528,7 +529,7 @@ MeshLib::Mesh* createMesh(std::ifstream& in, DataType type, std::vector<MeshLib::Node*> nodes; std::vector<MeshLib::Element*> elems; std::map<std::size_t, std::size_t> node_id_map; - INFO("Parsing %s %s.", dataType2ShortString(type).c_str(), + INFO("Parsing {:s} {:s}.", dataType2ShortString(type).c_str(), mesh_name.c_str()); bool return_val; return_val = parser(in, nodes, elems, node_id_map, mesh_prop); @@ -537,7 +538,7 @@ MeshLib::Mesh* createMesh(std::ifstream& in, DataType type, { return new MeshLib::Mesh(mesh_name, nodes, elems, mesh_prop); } - ERR("Error parsing %s %s.", dataType2ShortString(type).c_str(), + ERR("Error parsing {:s} {:s}.", dataType2ShortString(type).c_str(), mesh_name.c_str()); clearData(nodes, elems); return nullptr; @@ -605,11 +606,11 @@ MeshLib::Mesh* readData(std::ifstream& in, } else { - WARN("GocadAsciiReader::readData() - Unknown keyword found: %s", + WARN("GocadAsciiReader::readData() - Unknown keyword found: {:s}", line.c_str()); } } - ERR("%s", eof_error.c_str()); + ERR("{:s}", eof_error.c_str()); return nullptr; } @@ -620,7 +621,7 @@ bool readFile(std::string const& file_name, std::ifstream in(file_name.c_str()); if (!in.is_open()) { - ERR("GocadAsciiReader::readFile(): Could not open file %s.", + ERR("GocadAsciiReader::readFile(): Could not open file {:s}.", file_name.c_str()); return false; } @@ -638,7 +639,8 @@ bool readFile(std::string const& file_name, { if (!skipToEND(in)) { - ERR("Parsing of type %s is not implemented. Skipping section.", + ERR("Parsing of type {:s} is not implemented. Skipping " + "section.", dataType2String(type).c_str()); return false; } diff --git a/Applications/FileIO/GocadIO/GocadNode.h b/Applications/FileIO/GocadIO/GocadNode.h index 993f57d7f94e6e204c06fc6e3202075f2bd92b04..556495ae386d450b1600db6d4fb2ab1d126697af 100644 --- a/Applications/FileIO/GocadIO/GocadNode.h +++ b/Applications/FileIO/GocadIO/GocadNode.h @@ -60,8 +60,9 @@ public: FaceDirection::W); break; default: - OGS_FATAL("GocadNode::setFaceSet(): unknown face indicator %d.", - face_indicator); + OGS_FATAL( + "GocadNode::setFaceSet(): unknown face indicator {:d}.", + face_indicator); } } @@ -93,7 +94,8 @@ public: if (it == _face_directions.end()) { OGS_FATAL( - "GocadNode %d: Could not found face indicator for face set %d", + "GocadNode {:d}: Could not found face indicator for face set " + "{:d}", _id, face_set_number); } return it->second; diff --git a/Applications/FileIO/GocadIO/GocadSGridReader.cpp b/Applications/FileIO/GocadIO/GocadSGridReader.cpp index f3a38a70163c7c2129f7b0c3df622887c9cc364e..e36974c3748bf1178dd5de33d336fd9b8a6ddf6f 100644 --- a/Applications/FileIO/GocadIO/GocadSGridReader.cpp +++ b/Applications/FileIO/GocadIO/GocadSGridReader.cpp @@ -38,7 +38,7 @@ GocadSGridReader::GocadSGridReader(std::string const& fname) std::ifstream in(_fname.c_str()); if (!in) { - ERR("Could not open '%s'.", _fname.c_str()); + ERR("Could not open '{:s}'.", _fname.c_str()); in.close(); return; } @@ -108,7 +108,7 @@ GocadSGridReader::GocadSGridReader(std::string const& fname) std::size_t bit_length = std::atoi(it->c_str()); if (regions.size() != bit_length) { - ERR("%d regions read but %d expected.\n", regions.size(), + ERR("{:d} regions read but {:d} expected.\n", regions.size(), bit_length); throw std::runtime_error( "Number of read regions differs from expected.\n"); @@ -131,20 +131,20 @@ GocadSGridReader::GocadSGridReader(std::string const& fname) regions_ss << regions.size() << " regions read:\n"; std::copy(regions.begin(), regions.end(), std::ostream_iterator<Gocad::Region>(regions_ss, "\t")); - DBUG("%s", regions_ss.str().c_str()); + DBUG("{:s}", regions_ss.str().c_str()); std::stringstream layers_ss; layers_ss << layers.size() << " layers read:\n"; std::copy(layers.begin(), layers.end(), std::ostream_iterator<Gocad::Layer>(layers_ss, "\n")); - DBUG("%s", layers_ss.str().c_str()); + DBUG("{:s}", layers_ss.str().c_str()); std::stringstream properties_ss; properties_ss << "meta data for " << _property_meta_data_vecs.size() << " properties read:\n"; std::copy(_property_meta_data_vecs.begin(), _property_meta_data_vecs.end(), std::ostream_iterator<Gocad::Property>(properties_ss, "\n")); - DBUG("%s", properties_ss.str().c_str()); + DBUG("{:s}", properties_ss.str().c_str()); #endif // if not done already read the points @@ -204,14 +204,14 @@ void GocadSGridReader::addGocadPropertiesToMesh(MeshLib::Mesh& mesh) const continue; } - DBUG("Adding Gocad property '%s' with %d values.", name.c_str(), + DBUG("Adding Gocad property '{:s}' with {:d} values.", name.c_str(), prop->_property_data.size()); auto pv = MeshLib::getOrCreateMeshProperty<double>( mesh, name, MeshLib::MeshItemType::Cell, 1); if (pv == nullptr) { - ERR("Could not create mesh property '%s'.", name.c_str()); + ERR("Could not create mesh property '{:s}'.", name.c_str()); continue; } @@ -262,9 +262,11 @@ void GocadSGridReader::parseDims(std::string const& line) std::stringstream ssz(*it, std::stringstream::in | std::stringstream::out); ssz >> z_dim; _index_calculator = Gocad::IndexCalculator(x_dim, y_dim, z_dim); - DBUG("x_dim = %d, y_dim = %d, z_dim = %d => #nodes = %d, #cells = %d", - x_dim, y_dim, z_dim, _index_calculator._n_nodes, - _index_calculator._n_cells); + DBUG( + "x_dim = {:d}, y_dim = {:d}, z_dim = {:d} => #nodes = {:d}, #cells = " + "{:d}", + x_dim, y_dim, z_dim, _index_calculator._n_nodes, + _index_calculator._n_cells); } void GocadSGridReader::parseFileName(std::string const& line, @@ -302,7 +304,7 @@ void GocadSGridReader::parseFaceSet(std::string& line, std::istream& in) // Check first word is FACE_SET if (*it != std::string("FACE_SET")) { - ERR("Expected FACE_SET keyword but '%s' found.", it->c_str()); + ERR("Expected FACE_SET keyword but '{:s}' found.", it->c_str()); throw std::runtime_error( "In GocadSGridReader::parseFaceSet() expected FACE_SET keyword not " "found."); @@ -333,7 +335,8 @@ void GocadSGridReader::parseFaceSet(std::string& line, std::istream& in) if (id >= _index_calculator._n_nodes) { - ERR("Face set id %d is greater than the number of nodes (%d).", + ERR("Face set id {:d} is greater than the number of nodes " + "({:d}).", id, _index_calculator._n_nodes); } else @@ -343,11 +346,11 @@ void GocadSGridReader::parseFaceSet(std::string& line, std::istream& in) std::array<std::size_t, 3> const c( _index_calculator.getCoordsForID(id)); if (c[0] >= _index_calculator._x_dim - 1) - ERR("****** i coord %d to big for id %d.", c[0], id); + ERR("****** i coord {:d} to big for id {:d}.", c[0], id); if (c[1] >= _index_calculator._y_dim - 1) - ERR("****** j coord %d to big for id %d.", c[1], id); + ERR("****** j coord {:d} to big for id {:d}.", c[1], id); if (c[2] >= _index_calculator._z_dim - 1) - ERR("****** k coord %d to big for id %d.", c[2], id); + ERR("****** k coord {:d} to big for id {:d}.", c[2], id); std::size_t const cell_id( _index_calculator.getCellIdx(c[0], c[1], c[2])); face_set_property._property_data[cell_id] = @@ -359,8 +362,8 @@ void GocadSGridReader::parseFaceSet(std::string& line, std::istream& in) if (face_set_id_cnt != n_of_face_set_ids) { - ERR("Expected %d number of face set ids, read %d.", n_of_face_set_ids, - face_set_id_cnt); + ERR("Expected {:d} number of face set ids, read {:d}.", + n_of_face_set_ids, face_set_id_cnt); throw std::runtime_error( "Expected number of face set points does not match number of read " "points."); @@ -400,7 +403,7 @@ void GocadSGridReader::readNodesBinary() std::ifstream in(_pnts_fname.c_str(), std::ios::binary); if (!in) { - ERR("Could not open points file '%s'.", _pnts_fname.c_str()); + ERR("Could not open points file '{:s}'.", _pnts_fname.c_str()); throw std::runtime_error("Could not open points file."); } @@ -432,7 +435,8 @@ void GocadSGridReader::readNodesBinary() k++; } if (k != n * 3 && !in.eof()) - ERR("Read different number of points. Expected %d floats, got %d.\n", + ERR("Read different number of points. Expected {:d} floats, got " + "{:d}.\n", n * 3, k); } @@ -441,7 +445,7 @@ void GocadSGridReader::mapRegionFlagsToCellProperties( { DBUG( "GocadSGridReader::mapRegionFlagsToCellProperties region_flags.size: " - "%d", + "{:d}", rf.size()); Gocad::Property region_flags; @@ -491,14 +495,14 @@ void GocadSGridReader::readElementPropertiesBinary() std::string const& fname(prop_it->_property_data_fname); if (prop_it->_property_data_fname.empty()) { - WARN("Empty filename for property %s.", + WARN("Empty filename for property {:s}.", prop_it->_property_name.c_str()); continue; } std::vector<float> float_properties = BaseLib::readBinaryArray<float>(fname, _index_calculator._n_cells); DBUG( - "GocadSGridReader::readElementPropertiesBinary(): Read %d float " + "GocadSGridReader::readElementPropertiesBinary(): Read {:d} float " "properties from binary file.", _index_calculator._n_cells); @@ -512,7 +516,7 @@ void GocadSGridReader::readElementPropertiesBinary() prop_it->_property_data.begin()); if (prop_it->_property_data.empty()) { - ERR("Reading of element properties file '%s' failed.", + ERR("Reading of element properties file '{:s}' failed.", fname.c_str()); } } @@ -525,7 +529,7 @@ std::vector<Bitset> GocadSGridReader::readRegionFlagsBinary() const std::ifstream in(_region_flags_fname.c_str()); if (!in) { - ERR("readRegionFlagsBinary(): Could not open file '%s' for input.\n", + ERR("readRegionFlagsBinary(): Could not open file '{:s}' for input.\n", _region_flags_fname.c_str()); in.close(); return result; @@ -540,7 +544,8 @@ std::vector<Bitset> GocadSGridReader::readRegionFlagsBinary() const result[k++] = readBits(in, regions.size()); } if (k != n && !in.eof()) - ERR("Read different number of values. Expected %d, got %d.\n", n, k); + ERR("Read different number of values. Expected {:d}, got {:d}.\n", n, + k); return result; } @@ -580,7 +585,7 @@ void GocadSGridReader::readSplitInformation() std::ifstream in(_fname.c_str()); if (!in) { - ERR("Could not open '%s'.", _fname.c_str()); + ERR("Could not open '{:s}'.", _fname.c_str()); in.close(); return; } @@ -820,7 +825,7 @@ void GocadSGridReader::addFaceSetQuad( *_nodes[_index_calculator({c[0], c[1] + 1, c[2]})]); break; default: - ERR("Could not create face for node with id %d.", id); + ERR("Could not create face for node with id {:d}.", id); } std::copy(begin(quad_nodes), end(quad_nodes), back_inserter(face_set_nodes)); diff --git a/Applications/FileIO/GocadIO/GocadSGridReader.h b/Applications/FileIO/GocadIO/GocadSGridReader.h index 62d1245d2c065edbaac0704f004218e90060ed29..abef20ff1a5d6be801693569562a5ad1ef1f8a4b 100644 --- a/Applications/FileIO/GocadIO/GocadSGridReader.h +++ b/Applications/FileIO/GocadIO/GocadSGridReader.h @@ -9,22 +9,20 @@ #pragma once +#include <spdlog/spdlog.h> + +#include <boost/dynamic_bitset.hpp> #include <cstddef> #include <limits> #include <numeric> #include <string> #include <vector> -#include <boost/dynamic_bitset.hpp> - -#include <logog/include/logog.hpp> - -#include "MeshLib/Elements/Element.h" - #include "CoordinateSystem.h" #include "GocadNode.h" #include "IndexCalculator.h" #include "Layer.h" +#include "MeshLib/Elements/Element.h" #include "Property.h" #include "Region.h" diff --git a/Applications/FileIO/GocadIO/IndexCalculator.h b/Applications/FileIO/GocadIO/IndexCalculator.h index 5b4140d34dd22ff0d8152ddef473496afcf5c715..d663b2b368e213b820a283b8da48c0a0cec1da7b 100644 --- a/Applications/FileIO/GocadIO/IndexCalculator.h +++ b/Applications/FileIO/GocadIO/IndexCalculator.h @@ -9,13 +9,13 @@ #pragma once +#include <spdlog/spdlog.h> + #include <array> #include <cstddef> #include <limits> #include <numeric> -#include <logog/include/logog.hpp> - namespace FileIO { namespace Gocad @@ -61,8 +61,8 @@ public: { ERR("GocadSGridReader::IndexCalculator::getCellIdx(): At least " "one grid coordinate to big."); - ERR("\t Given: (%d, %d, %d), max allowed cell grid coords: " - "(%d, %d, %d).", + ERR("\t Given: ({:d}, {:d}, {:d}), max allowed cell grid coords: " + "({:d}, {:d}, {:d}).", u, v, w, _x_dim - 1, _y_dim - 1, _z_dim - 1); return std::numeric_limits<std::size_t>::max(); } diff --git a/Applications/FileIO/GocadIO/Layer.cpp b/Applications/FileIO/GocadIO/Layer.cpp index e17e31730302736f2d42a1341ab1a6bc7c53769e..8ebed256ecb537b3082093c60ca27589d535101c 100644 --- a/Applications/FileIO/GocadIO/Layer.cpp +++ b/Applications/FileIO/GocadIO/Layer.cpp @@ -7,13 +7,13 @@ * http://www.opengeosys.org/LICENSE.txt */ +#include "Layer.h" + #include <algorithm> #include <iterator> #include <sstream> -#include <logog/include/logog.hpp> - -#include "Layer.h" +#include "BaseLib/Logging.h" namespace FileIO { @@ -35,7 +35,7 @@ Layer parseLayer(std::string const& line, std::vector<Gocad::Region> const& regi // Check first word is MODEL_LAYER. if (*it != std::string("MODEL_LAYER")) { - ERR("Expected MODEL_LAYER keyword but '%s' found.\n", it->c_str()); + ERR("Expected MODEL_LAYER keyword but '{:s}' found.\n", it->c_str()); throw std::runtime_error( "In parseRegion() expected MODEL_LAYER keyword not found.\n"); } diff --git a/Applications/FileIO/GocadIO/Layer.h b/Applications/FileIO/GocadIO/Layer.h index cf3b166fbb0663355a150982fbe9a58ce7544a14..2979d93c438a4e5dbc781578ca121c27de45bb74 100644 --- a/Applications/FileIO/GocadIO/Layer.h +++ b/Applications/FileIO/GocadIO/Layer.h @@ -9,6 +9,7 @@ #pragma once +#include <algorithm> #include <string> #include <vector> diff --git a/Applications/FileIO/GocadIO/Property.cpp b/Applications/FileIO/GocadIO/Property.cpp index f6e47450b050b017fbc969f7dca87dd9695d6300..7a24c0d5dda715151c32dcf8faba80b4dab807d3 100644 --- a/Applications/FileIO/GocadIO/Property.cpp +++ b/Applications/FileIO/GocadIO/Property.cpp @@ -39,7 +39,7 @@ Property parseGocadPropertyMetaData(std::string& line, std::istream& in, // PROPERTY id "property_name" if (*tok_it != "PROPERTY") { - ERR("Expected PROPERTY keyword but '%s' found.", tok_it->c_str()); + ERR("Expected PROPERTY keyword but '{:s}' found.", tok_it->c_str()); throw std::runtime_error( "In parseGocadPropertyMetaData() expected PROPERTY keyword not " "found."); @@ -115,7 +115,7 @@ Property parseGocadPropertyMetaData(std::string& line, std::istream& in, tok_it++; if (*tok_it != "QUANTITY" && *tok_it != "ENUM") { - ERR("Expected keywords QUANTITY or ENUM, but found '%s'.", + ERR("Expected keywords QUANTITY or ENUM, but found '{:s}'.", tok_it->c_str()); throw std::runtime_error( "parseGocadPropertyMetaData(): Expected keywords QUANTITY " diff --git a/Applications/FileIO/GocadIO/Property.h b/Applications/FileIO/GocadIO/Property.h index c3c45ce37da77b09cf3a8303f0f97867e6f7d69f..ad65f327c61838ea074f3ba11e5d25a23f4a7428 100644 --- a/Applications/FileIO/GocadIO/Property.h +++ b/Applications/FileIO/GocadIO/Property.h @@ -12,7 +12,7 @@ #include <cstddef> #include <string> -#include <logog/include/logog.hpp> +#include "BaseLib/Logging.h" namespace FileIO { @@ -32,7 +32,7 @@ struct Property final { if (_property_id != std::stoul(id_string)) { - ERR("Expected property id %d but found %d.", + ERR("Expected property id {:d} but found {:d}.", _property_id, std::stoul(id_string)); return false; diff --git a/Applications/FileIO/GocadIO/Region.cpp b/Applications/FileIO/GocadIO/Region.cpp index 59631d28210e96c8a5e3dc4577ea0ee86875cabc..cbddb750865b972320d7c5ed620c8cc4b4da911a 100644 --- a/Applications/FileIO/GocadIO/Region.cpp +++ b/Applications/FileIO/GocadIO/Region.cpp @@ -7,12 +7,12 @@ * http://www.opengeosys.org/LICENSE.txt */ +#include "Region.h" + #include <iterator> #include <sstream> -#include <logog/include/logog.hpp> - -#include "Region.h" +#include "BaseLib/Logging.h" namespace FileIO { @@ -31,7 +31,7 @@ Region parseRegion(std::string const& line) // Check first word is REGION or MODEL_REGION. if (*it != std::string("REGION") && *it != std::string("MODEL_REGION")) { - ERR("Expected REGION or MODEL_REGION keyword but '%s' found.\n", + ERR("Expected REGION or MODEL_REGION keyword but '{:s}' found.\n", it->c_str()); throw std::runtime_error( "In parseRegion() expected REGION or MODEL_REGION keyword not " diff --git a/Applications/FileIO/Legacy/OGSIOVer4.cpp b/Applications/FileIO/Legacy/OGSIOVer4.cpp index a896e9e91a7208b9de8c1f544a42f94eee609f92..16022edd32a8e81e1da589b97ce9280f905fe88e 100644 --- a/Applications/FileIO/Legacy/OGSIOVer4.cpp +++ b/Applications/FileIO/Legacy/OGSIOVer4.cpp @@ -101,7 +101,10 @@ std::string readPoints(std::istream &in, std::vector<GeoLib::Point*>* pnt_vec, std::size_t id_pos (line.find("$ID")); if (id_pos != std::string::npos) - WARN("readPoints(): found tag $ID - please use tag $NAME for reading point names in point %d.", cnt); + WARN( + "readPoints(): found tag $ID - please use tag $NAME for " + "reading point names in point {:d}.", + cnt); cnt++; } getline(in, line); @@ -120,7 +123,8 @@ void readPolylinePointVector(const std::string &fname, // open file std::ifstream in((path + fname).c_str()); if (!in) { - WARN("readPolylinePointVector(): error opening stream from %s", fname.c_str()); + WARN("readPolylinePointVector(): error opening stream from {:s}", + fname.c_str()); errors.push_back ("[readPolylinePointVector] error opening stream from " + fname); return; } @@ -410,7 +414,10 @@ std::string readSurface(std::istream& in, } else { - WARN("readSurface(): cannot create surface %s from polyline %d since polyline is not closed.", name.c_str(), ply_id); + WARN( + "readSurface(): cannot create surface {:s} from polyline " + "{:d} since polyline is not closed.", + name.c_str(), ply_id); } } } @@ -481,10 +488,10 @@ bool readGLIFileV4(const std::string& fname, std::vector<std::string>& errors, std::string const& gmsh_path) { - INFO("GeoLib::readGLIFile(): open stream from file %s.", fname.c_str()); + INFO("GeoLib::readGLIFile(): open stream from file {:s}.", fname.c_str()); std::ifstream in(fname.c_str()); if (!in) { - WARN("GeoLib::readGLIFile(): could not open file %s.", fname.c_str()); + WARN("GeoLib::readGLIFile(): could not open file {:s}.", fname.c_str()); errors.push_back("[readGLIFileV4] error opening stream from " + fname); return false; } @@ -505,7 +512,7 @@ bool readGLIFileV4(const std::string& fname, auto pnt_vec = std::make_unique<std::vector<GeoLib::Point*>>(); INFO("GeoLib::readGLIFile(): read points from stream."); tag = readPoints(in, pnt_vec.get(), zero_based_idx, pnt_id_names_map.get()); - INFO("GeoLib::readGLIFile(): \t ok, %d points read.", pnt_vec->size()); + INFO("GeoLib::readGLIFile(): \t ok, {:d} points read.", pnt_vec->size()); unique_name = BaseLib::extractBaseName(fname); if (!pnt_vec->empty()) @@ -530,7 +537,8 @@ bool readGLIFileV4(const std::string& fname, tag = readPolylines(in, ply_vec.get(), *ply_names, *geo_pnt_vec, zero_based_idx, geo.getPointVecObj(unique_name)->getIDMap(), path, errors); - INFO("GeoLib::readGLIFile(): \t ok, %d polylines read.", ply_vec->size()); + INFO("GeoLib::readGLIFile(): \t ok, {:d} polylines read.", + ply_vec->size()); } else INFO("GeoLib::readGLIFile(): tag #POLYLINE not found."); @@ -560,7 +568,8 @@ bool readGLIFileV4(const std::string& fname, readSurfaces(in, *sfc_vec, *sfc_names, *geo.getPolylineVec(unique_name), ply_names_copy, point_vec, path, errors, geo, unique_name, gmsh_path); - INFO("GeoLib::readGLIFile(): \tok, %d surfaces read.", sfc_vec->size()); + INFO("GeoLib::readGLIFile(): \tok, {:d} surfaces read.", + sfc_vec->size()); } else { @@ -611,7 +620,8 @@ void writeGLIFileV4 (const std::string& fname, std::ofstream os (fname.c_str()); if (pnts) { const std::size_t n_pnts(pnts->size()); - INFO("GeoLib::writeGLIFileV4(): writing %d points to file %s.", n_pnts, fname.c_str()); + INFO("GeoLib::writeGLIFileV4(): writing {:d} points to file {:s}.", + n_pnts, fname.c_str()); os << "#POINTS" << "\n"; os.precision(std::numeric_limits<double>::digits10); for (std::size_t k(0); k < n_pnts; k++) { @@ -628,8 +638,8 @@ void writeGLIFileV4 (const std::string& fname, if (plys_vec) { const std::vector<GeoLib::Polyline*>* plys (plys_vec->getVector()); - INFO("GeoLib::writeGLIFileV4(): %d polylines to file %s.", - plys->size (), fname.c_str()); + INFO("GeoLib::writeGLIFileV4(): {:d} polylines to file {:s}.", + plys->size(), fname.c_str()); for (auto ply : *plys) { os << "#POLYLINE" << "\n"; @@ -691,7 +701,7 @@ void writeAllDataToGLIFileV4 (const std::string& fname, const GeoLib::GEOObjects } } - INFO("GeoLib::writeAllDataToGLIFileV4(): wrote %d points.", pnts_offset); + INFO("GeoLib::writeAllDataToGLIFileV4(): wrote {:d} points.", pnts_offset); // writing all stations std::vector<std::string> stn_names; diff --git a/Applications/FileIO/Legacy/createSurface.cpp b/Applications/FileIO/Legacy/createSurface.cpp index c720c5e6079877ad7ab23fbb0e9f3df75047f2e1..ff5b4f858dbeaab535d20ccddf070987c5637645 100644 --- a/Applications/FileIO/Legacy/createSurface.cpp +++ b/Applications/FileIO/Legacy/createSurface.cpp @@ -95,8 +95,8 @@ bool createSurface(GeoLib::Polyline const& ply, int const gmsh_return_value = std::system(gmsh_command.c_str()); if (gmsh_return_value != 0) { - WARN("Call to '%s' returned non-zero value %d.", gmsh_command.c_str(), - gmsh_return_value); + WARN("Call to '{:s}' returned non-zero value {:d}.", + gmsh_command.c_str(), gmsh_return_value); } auto surface_mesh = FileIO::GMSH::readGMSHMesh(msh_file.string()); diff --git a/Applications/FileIO/PetrelInterface.cpp b/Applications/FileIO/PetrelInterface.cpp index 685052b3f42520842633a8b9c82c948655c5c619..89007cf36bf450c61738395042bbf7a57752b0e3 100644 --- a/Applications/FileIO/PetrelInterface.cpp +++ b/Applications/FileIO/PetrelInterface.cpp @@ -45,8 +45,10 @@ PetrelInterface::PetrelInterface(std::list<std::string> &sfc_fnames, in.close(); } else - WARN("PetrelInterface::PetrelInterface(): \tCould not open file %s.", - it->c_str()); + WARN( + "PetrelInterface::PetrelInterface(): \tCould not open file " + "{:s}.", + it->c_str()); } for (std::list<std::string>::const_iterator it(well_path_fnames.begin()); it @@ -61,7 +63,10 @@ PetrelInterface::PetrelInterface(std::list<std::string> &sfc_fnames, in.close(); } else - WARN("PetrelInterface::PetrelInterface(): \tCould not open well path file %s.", it->c_str()); + WARN( + "PetrelInterface::PetrelInterface(): \tCould not open well " + "path file {:s}.", + it->c_str()); } // store data in GEOObject @@ -122,7 +127,7 @@ void PetrelInterface::readPetrelSurface(std::istream &in) } else WARN( "PetrelInterface::readPetrelSurface(): problem reading petrel " - "points from line\n'%s'.", + "points from line\n'{:s}'.", line.c_str()); } @@ -141,7 +146,8 @@ void PetrelInterface::readPetrelWellTrace(std::istream &in) std::list<std::string> str_list(BaseLib::splitString(line, ' ')); std::list<std::string>::const_iterator it(str_list.begin()); while (it != str_list.end()) { - INFO("PetrelInterface::readPetrelWellTrace(): well name: %s.", it->c_str()); + INFO("PetrelInterface::readPetrelWellTrace(): well name: {:s}.", + it->c_str()); ++it; } @@ -151,7 +157,10 @@ void PetrelInterface::readPetrelWellTrace(std::istream &in) str_list = BaseLib::splitString(line, ' '); it = str_list.begin(); while (it != str_list.end()) { - INFO("PetrelInterface::readPetrelWellTrace(): well head x coord: %s.", it->c_str()); + INFO( + "PetrelInterface::readPetrelWellTrace(): well head x coord: " + "{:s}.", + it->c_str()); ++it; } it = (str_list.end())--; @@ -165,7 +174,10 @@ void PetrelInterface::readPetrelWellTrace(std::istream &in) str_list = BaseLib::splitString(line, ' '); it = str_list.begin(); while (it != str_list.end()) { - INFO("PetrelInterface::readPetrelWellTrace(): well head y coord: %s.", it->c_str()); + INFO( + "PetrelInterface::readPetrelWellTrace(): well head y coord: " + "{:s}.", + it->c_str()); ++it; } it = (str_list.end())--; @@ -178,14 +190,15 @@ void PetrelInterface::readPetrelWellTrace(std::istream &in) str_list = BaseLib::splitString(line, ' '); it = str_list.begin(); while (it != str_list.end()) { - INFO("PetrelInterface::readPetrelWellTrace(): well kb entry: %s.", it->c_str()); + INFO("PetrelInterface::readPetrelWellTrace(): well kb entry: {:s}.", + it->c_str()); ++it; } it = (str_list.end())--; --it; double well_kb(strtod((*it).c_str(), &buf)); - INFO("PetrelInterface::readPetrelWellTrace(): %f, %f, %f.", + INFO("PetrelInterface::readPetrelWellTrace(): {:f}, {:f}, {:f}.", well_head_x, well_head_y, well_kb); @@ -218,7 +231,10 @@ void PetrelInterface::readPetrelWellTraceData(std::istream &in) std::list<std::string> str_list = BaseLib::splitString(line, ' '); auto it = str_list.begin(); while (it != str_list.end()) { - INFO("PetrelInterface::readPetrelWellTraceData(): column information: %s.", it->c_str()); + INFO( + "PetrelInterface::readPetrelWellTraceData(): column information: " + "{:s}.", + it->c_str()); ++it; } diff --git a/Applications/FileIO/SHPInterface.cpp b/Applications/FileIO/SHPInterface.cpp index 88bbd0341c7c9e0a471d52faa024cc172e2d4b4c..0cccda5eeb41732b44a3459a7fd397d86b3da617 100644 --- a/Applications/FileIO/SHPInterface.cpp +++ b/Applications/FileIO/SHPInterface.cpp @@ -294,7 +294,7 @@ bool SHPInterface::write2dMeshToSHP(const std::string &file_name, const MeshLib: } } DBFClose(hDBF); - INFO("Shape export of 2D mesh '%s' finished.", mesh.getName().c_str()); + INFO("Shape export of 2D mesh '{:s}' finished.", mesh.getName().c_str()); return true; } diff --git a/Applications/FileIO/SWMM/SWMMInterface.cpp b/Applications/FileIO/SWMM/SWMMInterface.cpp index 6fd25330cf6e0662bd052cd4e5b33ebe32017862..d5eb64e5368e89d14ffe124a6f2f5a51460e2e3c 100644 --- a/Applications/FileIO/SWMM/SWMMInterface.cpp +++ b/Applications/FileIO/SWMM/SWMMInterface.cpp @@ -129,14 +129,16 @@ bool SwmmInterface::isSwmmInputFile(std::string const& inp_file_name) { if (!boost::iequals(BaseLib::getFileExtension(inp_file_name), "inp")) { - ERR ("SWMMInterface: %s is not a SWMM input file.", inp_file_name.c_str()); + ERR("SWMMInterface: {:s} is not a SWMM input file.", + inp_file_name.c_str()); return false; } std::ifstream in ( inp_file_name.c_str() ); if (!in.is_open()) { - ERR ("SWMMInterface: Could not open input file %s.", inp_file_name.c_str()); + ERR("SWMMInterface: Could not open input file {:s}.", + inp_file_name.c_str()); return false; } @@ -159,8 +161,8 @@ bool SwmmInterface::isSwmmInputFile(std::string const& inp_file_name) header_found = true; else { - INFO ("SWMMInterface: input file type %s not recognised.", - BaseLib::getFileExtension(inp_file_name).c_str()); + INFO("SWMMInterface: input file type {:s} not recognised.", + BaseLib::getFileExtension(inp_file_name).c_str()); return false; } } @@ -289,7 +291,9 @@ bool SwmmInterface::addPointElevation(std::ifstream &in, auto const it = name_id_map.find(current_name); if (it == name_id_map.end()) { - ERR ("SwmmInterface::addPointElevation(): Name %s not found in coordinates map.", current_name.c_str()); + ERR("SwmmInterface::addPointElevation(): Name {:s} not found in " + "coordinates map.", + current_name.c_str()); return false; } std::size_t const id = it->second; @@ -323,7 +327,9 @@ bool SwmmInterface::readLinksAsPolylines(std::ifstream &in, auto const i_it = point_names.find(inlet); if (i_it == point_names.end()) { - ERR ("SwmmInterface::readLineElements(): Inlet node %s not found in coordinates map.", inlet.c_str()); + ERR("SwmmInterface::readLineElements(): Inlet node {:s} not found " + "in coordinates map.", + inlet.c_str()); return false; } @@ -331,7 +337,9 @@ bool SwmmInterface::readLinksAsPolylines(std::ifstream &in, auto const o_it = point_names.find(outlet); if (o_it == point_names.end()) { - ERR ("SwmmInterface::readLineElements(): Outlet node %s not found in coordinates map.", outlet.c_str()); + ERR("SwmmInterface::readLineElements(): Outlet node {:s} not found " + "in coordinates map.", + outlet.c_str()); return false; } GeoLib::Polyline* ply = new GeoLib::Polyline(points); @@ -363,7 +371,8 @@ bool SwmmInterface::convertSwmmInputToGeometry(std::string const& inp_file_name, std::ifstream in ( inp_file_name.c_str() ); if (!in.is_open()) { - ERR ("SWMMInterface: Could not open input file %s.", inp_file_name.c_str()); + ERR("SWMMInterface: Could not open input file {:s}.", + inp_file_name.c_str()); return false; } @@ -518,7 +527,9 @@ bool SwmmInterface::readNodeData(std::ifstream &in, std::vector<MeshLib::Node*> auto const it = name_id_map.find(current_name); if (it == name_id_map.end()) { - ERR ("SwmmInterface::readNodeData(): Name %s not found in coordinates map.", current_name.c_str()); + ERR("SwmmInterface::readNodeData(): Name {:s} not found in " + "coordinates map.", + current_name.c_str()); return false; } std::size_t const id = it->second; @@ -556,7 +567,9 @@ bool SwmmInterface::readLineElements(std::ifstream &in, std::vector<MeshLib::Ele auto const i_it = name_id_map.find(inlet); if (i_it == name_id_map.end()) { - ERR ("SwmmInterface::readLineElements(): Inlet node %s not found in coordinates map.", inlet.c_str()); + ERR("SwmmInterface::readLineElements(): Inlet node {:s} not found " + "in coordinates map.", + inlet.c_str()); return false; } @@ -564,7 +577,9 @@ bool SwmmInterface::readLineElements(std::ifstream &in, std::vector<MeshLib::Ele auto const o_it = name_id_map.find(outlet); if (o_it == name_id_map.end()) { - ERR ("SwmmInterface::readLineElements(): Outlet node %s not found in coordinates map.", outlet.c_str()); + ERR("SwmmInterface::readLineElements(): Outlet node {:s} not found " + "in coordinates map.", + outlet.c_str()); return false; } @@ -607,7 +622,7 @@ bool SwmmInterface::readSubcatchments(std::ifstream &in, std::map< std::string, } if (sc.rain_gauge == std::numeric_limits<std::size_t>::max()) { - ERR("Rain gauge for subcatchment '%s' not found.", + ERR("Rain gauge for subcatchment '{:s}' not found.", split_str[0].c_str()); return false; } @@ -615,7 +630,7 @@ bool SwmmInterface::readSubcatchments(std::ifstream &in, std::map< std::string, auto const it = name_id_map.find(split_str[2]); if (it == name_id_map.end()) { - ERR("Outlet node for subcatchment '%s' not found.", + ERR("Outlet node for subcatchment '{:s}' not found.", split_str[0].c_str()); return false; } @@ -642,7 +657,8 @@ bool SwmmInterface::readSwmmInputToLineMesh() std::ifstream in ( inp_file_name.c_str() ); if (!in.is_open()) { - ERR ("SWMMInterface: Could not open input file %s.", inp_file_name.c_str()); + ERR("SWMMInterface: Could not open input file {:s}.", + inp_file_name.c_str()); return false; } @@ -830,7 +846,8 @@ bool SwmmInterface::matchSubcatchmentsWithPolygons(std::vector<GeoLib::Polyline* } if (found == false) { - ERR("No match in subcatcments for outline '%s'.", names[i].c_str()); + ERR("No match in subcatcments for outline '{:s}'.", + names[i].c_str()); return false; } } @@ -965,13 +982,17 @@ bool SwmmInterface::addResultsToMesh(MeshLib::Mesh &mesh, SwmmObject const swmm_ if (swmm_type == SwmmObject::NODE && data.size() != mesh.getNumberOfNodes()) { - ERR ("Number of mesh nodes (%d) does not match length of array (%d).", mesh.getNumberOfNodes(), data.size()); + ERR("Number of mesh nodes ({:d}) does not match length of array " + "({:d}).", + mesh.getNumberOfNodes(), data.size()); return false; } if (swmm_type == SwmmObject::LINK && data.size() != mesh.getNumberOfElements()) { - ERR ("Number of mesh elements (%d) does not match length of array (%d).", mesh.getNumberOfElements(), data.size()); + ERR("Number of mesh elements ({:d}) does not match length of array " + "({:d}).", + mesh.getNumberOfElements(), data.size()); return false; } @@ -982,7 +1003,7 @@ bool SwmmInterface::addResultsToMesh(MeshLib::Mesh &mesh, SwmmObject const swmm_ MeshLib::getOrCreateMeshProperty<double>(mesh, vec_name, item_type, 1); if (!prop) { - ERR("Error fetching array '%s'.", vec_name.c_str()); + ERR("Error fetching array '{:s}'.", vec_name.c_str()); return false; } std::copy(data.cbegin(), data.cend(), prop->begin()); @@ -998,7 +1019,8 @@ std::vector<double> SwmmInterface::getArrayAtTimeStep(SwmmObject obj_type, std:: if (time_step >= SWMM_Nperiods) { - ERR ("Time step %d not available, file contains only %d periods.", time_step, SWMM_Nperiods); + ERR("Time step {:d} not available, file contains only {:d} periods.", + time_step, SWMM_Nperiods); return data; } @@ -1044,7 +1066,7 @@ std::vector<double> SwmmInterface::getArrayAtTimeStep(SwmmObject obj_type, std:: return data; } - INFO("Fetching '%s'-data for time step %d...", + INFO("Fetching '{:s}'-data for time step {:d}...", getArrayName(obj_type, var_idx, SWMM_Npolluts).c_str(), time_step); for (std::size_t i=0; i<n_objects; ++i) @@ -1201,7 +1223,7 @@ bool SwmmInterface::addRainGaugeTimeSeriesLocations(std::ifstream &in) for (auto const& stn : _rain_gauges) if (stn.second.empty()) - WARN("No associated time series found for rain gauge '%s'.", + WARN("No associated time series found for rain gauge '{:s}'.", stn.first.getName().c_str()); return true; } @@ -1311,8 +1333,8 @@ bool SwmmInterface::writeCsvForTimestep(std::string const& file_name, SwmmObject bool SwmmInterface::writeCsvForObject(std::string const& file_name, SwmmObject obj_type, std::size_t obj_idx) const { FileIO::CsvInterface csv; - INFO("Writing data for %s %d.", swmmObjectTypeToString(obj_type).c_str(), - obj_idx); + INFO("Writing data for {:s} {:d}.", + swmmObjectTypeToString(obj_type).c_str(), obj_idx); csv.addIndexVectorForWriting(getNumberOfTimeSteps()); std::size_t const n_params (getNumberOfParameters(obj_type)); for (std::size_t i=0; i<n_params; ++i) diff --git a/Applications/FileIO/TetGenInterface.cpp b/Applications/FileIO/TetGenInterface.cpp index ac5df95aa66c1b29fcc996973e703340d2c80210..b79fd08ad6475a1b5e0bd3673d7f0f6c159a1177 100644 --- a/Applications/FileIO/TetGenInterface.cpp +++ b/Applications/FileIO/TetGenInterface.cpp @@ -42,7 +42,8 @@ bool TetGenInterface::readTetGenGeometry (std::string const& geo_fname, if (!poly_stream) { - ERR ("TetGenInterface::readTetGenGeometry() failed to open %s", geo_fname.c_str()); + ERR("TetGenInterface::readTetGenGeometry() failed to open {:s}", + geo_fname.c_str()); return false; } std::string ext (BaseLib::getFileExtension(geo_fname)); @@ -137,7 +138,7 @@ bool TetGenInterface::parseSmeshFacets(std::ifstream &input, getline (input, line); if (input.fail()) { - ERR("TetGenInterface::parseFacets(): Error reading facet %d.", k); + ERR("TetGenInterface::parseFacets(): Error reading facet {:d}.", k); return false; } @@ -178,7 +179,9 @@ bool TetGenInterface::parseSmeshFacets(std::ifstream &input, } else { - ERR("TetGenInterface::parseFacets(): Error reading points for facet %d.", k); + ERR("TetGenInterface::parseFacets(): Error reading points for " + "facet {:d}.", + k); return false; } ++k; @@ -196,7 +199,10 @@ bool TetGenInterface::parseSmeshFacets(std::ifstream &input, return true; } - ERR ("TetGenInterface::parseFacets(): Number of expected total triangles (%d) does not match number of found triangles (%d).", surfaces.size(), nTotalTriangles); + ERR("TetGenInterface::parseFacets(): Number of expected total triangles " + "({:d}) does not match number of found triangles ({:d}).", + surfaces.size(), + nTotalTriangles); return false; } @@ -209,9 +215,11 @@ MeshLib::Mesh* TetGenInterface::readTetGenMesh (std::string const& nodes_fname, if (!ins_nodes || !ins_ele) { if (!ins_nodes) - ERR ("TetGenInterface::readTetGenMesh failed to open %s", nodes_fname.c_str()); + ERR("TetGenInterface::readTetGenMesh failed to open {:s}", + nodes_fname.c_str()); if (!ins_ele) - ERR ("TetGenInterface::readTetGenMesh failed to open %s", ele_fname.c_str()); + ERR("TetGenInterface::readTetGenMesh failed to open {:s}", + ele_fname.c_str()); return nullptr; } @@ -332,7 +340,7 @@ bool TetGenInterface::parseNodes(std::ifstream &ins, std::getline(ins, line); if (ins.fail()) { - ERR("TetGenInterface::parseNodes(): Error reading node %d.", k); + ERR("TetGenInterface::parseNodes(): Error reading node {:d}.", k); return false; } @@ -353,7 +361,8 @@ bool TetGenInterface::parseNodes(std::ifstream &ins, _zero_based_idx = true; } } else { - ERR("TetGenInterface::parseNodes(): Error reading ID of node %d.", k); + ERR("TetGenInterface::parseNodes(): Error reading ID of node {:d}.", + k); return false; } // read coordinates @@ -371,7 +380,10 @@ bool TetGenInterface::parseNodes(std::ifstream &ins, } else { - ERR("TetGenInterface::parseNodes(): error reading coordinate %d of node %d.", i, k); + ERR("TetGenInterface::parseNodes(): error reading coordinate " + "{:d} of node {:d}.", + i, + k); return false; } } @@ -484,7 +496,9 @@ bool TetGenInterface::parseElements(std::ifstream& ins, getline (ins, line); if (ins.fail()) { - ERR("TetGenInterface::parseElements(): Error reading tetrahedron %d.", k); + ERR("TetGenInterface::parseElements(): Error reading tetrahedron " + "{:d}.", + k); return false; } @@ -500,7 +514,9 @@ bool TetGenInterface::parseElements(std::ifstream& ins, if (pos_beg == std::string::npos || pos_end == std::string::npos) { - ERR("TetGenInterface::parseElements(): Error reading id of tetrahedron %d.", k); + ERR("TetGenInterface::parseElements(): Error reading id of " + "tetrahedron {:d}.", + k); return false; } @@ -519,7 +535,10 @@ bool TetGenInterface::parseElements(std::ifstream& ins, } else { - ERR("TetGenInterface::parseElements(): Error reading node %d of tetrahedron %d.", i, k); + ERR("TetGenInterface::parseElements(): Error reading node {:d} " + "of tetrahedron {:d}.", + i, + k); return false; } } @@ -539,7 +558,9 @@ bool TetGenInterface::parseElements(std::ifstream& ins, } else { - ERR("TetGenInterface::parseElements(): Error reading region attribute of tetrahedron %d.", k); + ERR("TetGenInterface::parseElements(): Error reading region " + "attribute of tetrahedron {:d}.", + k); return false; } } @@ -566,11 +587,12 @@ bool TetGenInterface::writeTetGenSmesh(const std::string &file_name, if (points==nullptr) { - ERR ("Geometry %s not found.", geo_name.c_str()); + ERR("Geometry {:s} not found.", geo_name.c_str()); return false; } if (surfaces==nullptr) - WARN ("No surfaces found for geometry %s. Writing points only.", geo_name.c_str()); + WARN("No surfaces found for geometry {:s}. Writing points only.", + geo_name.c_str()); std::ofstream out( file_name.c_str(), std::ios::out ); out.precision(std::numeric_limits<double>::digits10); @@ -620,7 +642,11 @@ bool TetGenInterface::writeTetGenSmesh(const std::string &file_name, << " " << 10 * attribute_points[i].getID() << "\n"; } } - INFO ("TetGenInterface::writeTetGenSmesh() - %d points and %d surfaces successfully written.", nPoints, nSurfaces); + INFO( + "TetGenInterface::writeTetGenSmesh() - {:d} points and {:d} surfaces " + "successfully written.", + nPoints, + nSurfaces); out.close(); return true; } @@ -676,7 +702,11 @@ bool TetGenInterface::writeTetGenSmesh(const std::string &file_name, } } - INFO ("TetGenInterface::writeTetGenPoly() - %d points and %d surfaces successfully written.", nPoints, mesh.getNumberOfElements()); + INFO( + "TetGenInterface::writeTetGenPoly() - {:d} points and {:d} surfaces " + "successfully written.", + nPoints, + mesh.getNumberOfElements()); out.close(); return true; } diff --git a/Applications/FileIO/XmlIO/Qt/XmlLutReader.h b/Applications/FileIO/XmlIO/Qt/XmlLutReader.h index 2988812c97faf1acf3d4ac9e36bd62fbf481a8fb..fbc0c90bd5ee6557914c6eed48e588d7dce271fd 100644 --- a/Applications/FileIO/XmlIO/Qt/XmlLutReader.h +++ b/Applications/FileIO/XmlIO/Qt/XmlLutReader.h @@ -36,7 +36,7 @@ public: QFile file(fileName); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { - ERR("XmlLutReader::readFromFile(): Can't open xml-file {s}.", + ERR("XmlLutReader::readFromFile(): Can't open xml-file {:s}.", fileName.toStdString()); return false; } diff --git a/Applications/FileIO/XmlIO/Qt/XmlNumInterface.cpp b/Applications/FileIO/XmlIO/Qt/XmlNumInterface.cpp index 5e19b5d3e173fa4fe095ec1845195e75184b4ef2..e6e2776e8f27af18c35c6c049847a971fe67ef09 100644 --- a/Applications/FileIO/XmlIO/Qt/XmlNumInterface.cpp +++ b/Applications/FileIO/XmlIO/Qt/XmlNumInterface.cpp @@ -50,7 +50,7 @@ int XmlNumInterface::readFile(QString const& fileName) if (num_node.nodeName().compare("Type") == 0) { std::string const solver_type = num_node.toElement().text().toStdString(); - INFO("Non-linear solver type: %s.", solver_type.c_str()); + INFO("Non-linear solver type: {:s}.", solver_type.c_str()); } else if (num_node.nodeName().compare("LinearSolver") == 0) { @@ -91,7 +91,8 @@ void XmlNumInterface::readLinearSolverConfiguration(QDomElement const& lin_root) } linear_solver_node = linear_solver_node.nextSiblingElement(); } - INFO("Using %s-library with solver %s and %s preconditioner.", library.c_str(), lin_solver_type.c_str(), precond_type.c_str()); + INFO("Using {:s}-library with solver {:s} and {:s} preconditioner.", + library.c_str(), lin_solver_type.c_str(), precond_type.c_str()); } @@ -114,7 +115,8 @@ void XmlNumInterface::readIterationScheme(QDomElement const& iteration_root) iteration_node = iteration_node.nextSiblingElement(); } - INFO("Doing a maximum of %d iterations at fixed step size of %f", max_iterations, fixed_step_size); + INFO("Doing a maximum of {:d} iterations at fixed step size of {:f}", + max_iterations, fixed_step_size); } void XmlNumInterface::readConvergenceCriteria(QDomElement const& convergence_root) @@ -136,7 +138,8 @@ void XmlNumInterface::readConvergenceCriteria(QDomElement const& convergence_roo conv_node = conv_node.nextSiblingElement(); } - INFO("Convergence reached when error below %f using %s.", error_threshold, error_method.c_str()); + INFO("Convergence reached when error below {:f} using {:s}.", + error_threshold, error_method.c_str()); } bool XmlNumInterface::write() diff --git a/Applications/FileIO/XmlIO/Qt/XmlPrjInterface.cpp b/Applications/FileIO/XmlIO/Qt/XmlPrjInterface.cpp index 82785dd254820b42d6db617bfc670d3ebf29d370..3495d40d8482a67327c52c2ffc064aefe2c83ceb 100644 --- a/Applications/FileIO/XmlIO/Qt/XmlPrjInterface.cpp +++ b/Applications/FileIO/XmlIO/Qt/XmlPrjInterface.cpp @@ -119,14 +119,14 @@ int XmlPrjInterface::readFile(const QString& fileName) } if (meshes_node.nodeName() != "mesh") { - ERR("Expected an XML element node named 'mesh' got '{s}'.", + ERR("Expected an XML element node named 'mesh' got '{:s}'.", meshes_node.nodeName().toStdString()); return 0; } if (meshes_node.childNodes().count() != 1) { ERR("Expected an XML element node named 'mesh' to contain " - "exactly one child node but it has %d children.", + "exactly one child node but it has {:d} children.", meshes_node.childNodes().count()); return 0; } @@ -389,7 +389,7 @@ bool XmlPrjInterface::write() geo_tag.appendChild(filename_text); } else - ERR("XmlGmlInterface::writeFile(): Error writing gml-file '%s'.", + ERR("XmlGmlInterface::writeFile(): Error writing gml-file '{:s}'.", name.c_str()); } @@ -412,7 +412,7 @@ bool XmlPrjInterface::write() stn_tag.appendChild(filename_text); } else - ERR("XmlStnInterface::writeFile(): Error writing stn-file '%s'.", + ERR("XmlStnInterface::writeFile(): Error writing stn-file '{:s}'.", name.c_str()); } diff --git a/Applications/InSituLib/Adaptor.cpp b/Applications/InSituLib/Adaptor.cpp index 5e0669d1ac114b8814244180bee27dd218567d8d..8e487cc9fcd7f06b7967f90e0ca2409a33db9281 100644 --- a/Applications/InSituLib/Adaptor.cpp +++ b/Applications/InSituLib/Adaptor.cpp @@ -40,7 +40,7 @@ void Initialize(BaseLib::ConfigTree const& scripts_config, { //! \ogs_file_param{prj__insitu__scripts__script__name} auto scriptName = script_config.getConfigParameter<std::string>("name"); - INFO("Initializing in-situ script: %s", scriptName.c_str()); + INFO("Initializing in-situ script: {:s}", scriptName.c_str()); std::stringstream ss; ss << path << scriptName; vtkNew<vtkCPPythonScriptPipeline> pipeline; @@ -73,8 +73,8 @@ void CoProcess(MeshLib::Mesh const& mesh, double const time, } if (Processor->RequestDataDescription(dataDescription.GetPointer()) != 0) { - INFO("Start InSitu process: timestep #%d (t=%g, last=%d)", timeStep, - time, lastTimeStep); + INFO("Start InSitu process: timestep #{:d} (t={:g}, last={:d})", + timeStep, time, lastTimeStep); vtkNew<MeshLib::VtkMappedMeshSource> vtkSource; vtkSource->SetMesh(&mesh); vtkSource->Update(); diff --git a/Applications/Utils/FileConverter/ConvertSHPToGLI.cpp b/Applications/Utils/FileConverter/ConvertSHPToGLI.cpp index b639f432ac6265ec59df1e108da32e5f728a4409..24b456997eb53acf39bb1579d97e5bf1bc71ccf9 100644 --- a/Applications/Utils/FileConverter/ConvertSHPToGLI.cpp +++ b/Applications/Utils/FileConverter/ConvertSHPToGLI.cpp @@ -39,7 +39,7 @@ void convertPoints (DBFHandle dbf_handle, bool station) { int n_records (DBFGetRecordCount (dbf_handle)); - INFO("Reading %d records.", n_records); + INFO("Reading {:d} records.", n_records); auto points = std::make_unique<std::vector<GeoLib::Point*>>(); points->reserve (n_records); @@ -147,7 +147,7 @@ void printFieldInformationTable(DBFHandle const& dbf_handle, std::size_t n_field } delete[] field_name; out << "************************************************" << std::endl; - INFO("%s", out.str().c_str()); + INFO("{:s}", out.str().c_str()); } int main (int argc, char* argv[]) @@ -183,17 +183,17 @@ int main (int argc, char* argv[]) nullptr /*padfMinBound*/, nullptr /*padfMinBound*/); if ((shape_type - 1) % 10 == 0) - INFO("Shape file contains %d points.", number_of_elements); + INFO("Shape file contains {:d} points.", number_of_elements); if ( ((shape_type - 3) % 10 == 0 || (shape_type - 5) % 10 == 0)) { - ERR("Shape file contains %d polylines.", number_of_elements); + ERR("Shape file contains {:d} polylines.", number_of_elements); ERR("This programm only handles only files containing points."); SHPClose(hSHP); return EXIT_SUCCESS; } SHPClose(hSHP); } else { - ERR("Could not open shapefile %s.", fname.c_str()); + ERR("Could not open shapefile {:s}.", fname.c_str()); } DBFHandle dbf_handle = DBFOpen(fname.c_str(),"rb"); @@ -253,7 +253,7 @@ int main (int argc, char* argv[]) fname += ".gml"; } - INFO("Writing to %s.", fname.c_str()); + INFO("Writing to {:s}.", fname.c_str()); convertPoints(dbf_handle, fname, x_id, diff --git a/Applications/Utils/FileConverter/FEFLOW2OGS.cpp b/Applications/Utils/FileConverter/FEFLOW2OGS.cpp index d9bc214fe493074c8da969ddc555d9aa4fc73e0c..1f9bb55937ff4d7ae8ca1f1ec436bd5b283a45b4 100644 --- a/Applications/Utils/FileConverter/FEFLOW2OGS.cpp +++ b/Applications/Utils/FileConverter/FEFLOW2OGS.cpp @@ -67,7 +67,7 @@ int main (int argc, char* argv[]) cmd.parse(argc, argv); // *** read mesh - INFO("Reading %s.", feflow_mesh_arg.getValue().c_str()); + INFO("Reading {:s}.", feflow_mesh_arg.getValue().c_str()); #ifndef WIN32 BaseLib::MemWatch mem_watch; unsigned long mem_without_mesh (mem_watch.getVirtMemUsage()); @@ -79,18 +79,21 @@ int main (int argc, char* argv[]) feflowIO.readFEFLOWFile(feflow_mesh_arg.getValue())); if (mesh == nullptr) { - INFO("Could not read mesh from %s.", feflow_mesh_arg.getValue().c_str()); + INFO("Could not read mesh from {:s}.", + feflow_mesh_arg.getValue().c_str()); return EXIT_FAILURE; } #ifndef WIN32 unsigned long mem_with_mesh (mem_watch.getVirtMemUsage()); - INFO("Mem for mesh: %i MB", (mem_with_mesh - mem_without_mesh)/(1024*1024)); + INFO("Mem for mesh: {:i} MB", + (mem_with_mesh - mem_without_mesh) / (1024 * 1024)); #endif - INFO("Time for reading: %f seconds.", run_time.elapsed()); - INFO("Read %d nodes and %d elements.", mesh->getNumberOfNodes(), mesh->getNumberOfElements()); + INFO("Time for reading: {:f} seconds.", run_time.elapsed()); + INFO("Read {:d} nodes and {:d} elements.", mesh->getNumberOfNodes(), + mesh->getNumberOfElements()); std::string ogs_mesh_fname(ogs_mesh_arg.getValue()); - INFO("Writing %s.", ogs_mesh_fname.c_str()); + INFO("Writing {:s}.", ogs_mesh_fname.c_str()); MeshLib::IO::writeMeshToFile(*mesh, ogs_mesh_fname); INFO("\tDone."); return EXIT_SUCCESS; diff --git a/Applications/Utils/FileConverter/GMSH2OGS.cpp b/Applications/Utils/FileConverter/GMSH2OGS.cpp index 3dd943250bb4e4837773d2ad430cdd57cc353d4c..be9f1276f3c9257b6320091d1903ad20c68d1811 100644 --- a/Applications/Utils/FileConverter/GMSH2OGS.cpp +++ b/Applications/Utils/FileConverter/GMSH2OGS.cpp @@ -81,7 +81,7 @@ int main (int argc, char* argv[]) cmd.parse(argc, argv); // *** read mesh - INFO("Reading %s.", gmsh_mesh_arg.getValue().c_str()); + INFO("Reading {:s}.", gmsh_mesh_arg.getValue().c_str()); #ifndef WIN32 BaseLib::MemWatch mem_watch; unsigned long mem_without_mesh (mem_watch.getVirtMemUsage()); @@ -92,16 +92,18 @@ int main (int argc, char* argv[]) FileIO::GMSH::readGMSHMesh(gmsh_mesh_arg.getValue())); if (mesh == nullptr) { - INFO("Could not read mesh from %s.", gmsh_mesh_arg.getValue().c_str()); + INFO("Could not read mesh from {:s}.", + gmsh_mesh_arg.getValue().c_str()); return -1; } #ifndef WIN32 - INFO("Mem for mesh: %i MB", + INFO("Mem for mesh: {:i} MB", (mem_watch.getVirtMemUsage() - mem_without_mesh) / (1024 * 1024)); #endif - INFO("Time for reading: %f seconds.", run_time.elapsed()); - INFO("Read %d nodes and %d elements.", mesh->getNumberOfNodes(), mesh->getNumberOfElements()); + INFO("Time for reading: {:f} seconds.", run_time.elapsed()); + INFO("Read {:d} nodes and {:d} elements.", mesh->getNumberOfNodes(), + mesh->getNumberOfElements()); // *** remove line elements on request if (exclude_lines_arg.getValue()) { @@ -109,7 +111,8 @@ int main (int argc, char* argv[]) ex.searchByElementType(MeshLib::MeshElemType::LINE); auto m = MeshLib::removeElements(*mesh, ex.getSearchedElementIDs(), mesh->getName()+"-withoutLines"); if (m != nullptr) { - INFO("Removed %d lines.", mesh->getNumberOfElements() - m->getNumberOfElements()); + INFO("Removed {:d} lines.", + mesh->getNumberOfElements() - m->getNumberOfElements()); std::swap(m, mesh); delete m; } else { @@ -129,11 +132,14 @@ int main (int argc, char* argv[]) auto const minPt(aabb.getMinPoint()); auto const maxPt(aabb.getMaxPoint()); INFO("Node coordinates:"); - INFO("\tx [%g, %g] (extent %g)", minPt[0], maxPt[0], maxPt[0] - minPt[0]); - INFO("\ty [%g, %g] (extent %g)", minPt[1], maxPt[1], maxPt[1] - minPt[1]); - INFO("\tz [%g, %g] (extent %g)", minPt[2], maxPt[2], maxPt[2] - minPt[2]); - - INFO("Edge length: [%g, %g]", mesh->getMinEdgeLength(), + INFO("\tx [{:g}, {:g}] (extent {:g})", minPt[0], maxPt[0], + maxPt[0] - minPt[0]); + INFO("\ty [{:g}, {:g}] (extent {:g})", minPt[1], maxPt[1], + maxPt[1] - minPt[1]); + INFO("\tz [{:g}, {:g}] (extent {:g})", minPt[2], maxPt[2], + maxPt[2] - minPt[2]); + + INFO("Edge length: [{:g}, {:g}]", mesh->getMinEdgeLength(), mesh->getMaxEdgeLength()); // Element information diff --git a/Applications/Utils/FileConverter/GocadSGridReader.cpp b/Applications/Utils/FileConverter/GocadSGridReader.cpp index 340d200841b716955392fbba29618f30cff79d4b..5c8197056b5abbd008b7d1069a1cb7a6592fd8d8 100644 --- a/Applications/Utils/FileConverter/GocadSGridReader.cpp +++ b/Applications/Utils/FileConverter/GocadSGridReader.cpp @@ -7,18 +7,18 @@ * http://www.opengeosys.org/LICENSE.txt */ +#include "Applications/FileIO/GocadIO/GocadSGridReader.h" + +#include <spdlog/spdlog.h> +#include <tclap/CmdLine.h> + #include <fstream> #include <sstream> #include <string> -#include <logog/include/logog.hpp> -#include <tclap/CmdLine.h> - -#include "Applications/ApplicationsLib/LogogSetup.h" #include "Applications/FileIO/GocadIO/GenerateFaceSetMeshes.h" -#include "Applications/FileIO/GocadIO/GocadSGridReader.h" -#include "InfoLib/GitInfo.h" #include "BaseLib/FileTools.h" +#include "InfoLib/GitInfo.h" #include "MeshLib/Elements/Element.h" #include "MeshLib/IO/writeMeshToFile.h" #include "MeshLib/Mesh.h" @@ -26,8 +26,6 @@ int main(int argc, char* argv[]) { - ApplicationsLib::LogogSetup logog_setup; - TCLAP::CmdLine cmd( "Reads a Gocad stratigraphic grid file (file ending sg) and writes the " "data in the vtk unstructured grid file format. The documentation is " @@ -77,7 +75,7 @@ int main(int argc, char* argv[]) auto property_names(mesh->getProperties().getPropertyVectorNames()); for (auto const& property_name : property_names) { - INFO("- %s (#values: %d)", property_name.c_str(), + INFO("- {:s} (#values: {:d})", property_name.c_str(), mesh->getProperties() .getPropertyVector<double>(property_name) ->size()); @@ -88,10 +86,11 @@ int main(int argc, char* argv[]) mesh->getProperties() .getPropertyVector<double>(property_name) ->cend())); - INFO("\tvalues in range [%e, %e].", *(bounds.first), *(bounds.second)); + INFO("\tvalues in range [{:e}, {:e}].", *(bounds.first), + *(bounds.second)); } - INFO("Writing mesh to '%s'.", mesh_output_arg.getValue().c_str()); + INFO("Writing mesh to '{:s}'.", mesh_output_arg.getValue().c_str()); MeshLib::IO::writeMeshToFile(*mesh, mesh_output_arg.getValue()); return 0; diff --git a/Applications/Utils/FileConverter/GocadTSurfaceReader.cpp b/Applications/Utils/FileConverter/GocadTSurfaceReader.cpp index f86f6804872246d1d53b8b6f96d81d63668d147b..e402dbfd5dc48ead7241f72c21e798f9502006f1 100644 --- a/Applications/Utils/FileConverter/GocadTSurfaceReader.cpp +++ b/Applications/Utils/FileConverter/GocadTSurfaceReader.cpp @@ -12,7 +12,6 @@ #include "InfoLib/GitInfo.h" #include "MeshLib/Mesh.h" #include "MeshLib/IO/VtkIO/VtuInterface.h" -#include "Applications/ApplicationsLib/LogogSetup.h" #include "Applications/FileIO/GocadIO/GocadAsciiReader.h" std::string getDelim(std::string const& str) @@ -24,8 +23,6 @@ std::string getDelim(std::string const& str) int main(int argc, char* argv[]) { - ApplicationsLib::LogogSetup logog_setup; - TCLAP::CmdLine cmd( "Reads Gocad ascii files (*.ts, *.pl, *.mx) and writes TSurf- and PLine" "data into one or more VTU unstructured grids.\n\n" @@ -86,7 +83,7 @@ int main(int argc, char* argv[]) ERR("Error reading file."); return 1; } - INFO("%d meshes found.", meshes.size()); + INFO("{:d} meshes found.", meshes.size()); std::string const dir = output_arg.getValue(); bool const write_binary = write_binary_arg.getValue(); std::string const delim = getDelim(dir); @@ -96,7 +93,7 @@ int main(int argc, char* argv[]) { continue; } - INFO("Writing mesh \"%s\"", mesh->getName().c_str()); + INFO("Writing mesh \"{:s}\"", mesh->getName().c_str()); int data_mode = (write_binary) ? 2 : 0; bool compressed = (write_binary); MeshLib::IO::VtuInterface vtu(mesh.get(), data_mode, compressed); diff --git a/Applications/Utils/FileConverter/Mesh2Raster.cpp b/Applications/Utils/FileConverter/Mesh2Raster.cpp index dfc04a8e0104df0e77dcaa2abb4d46ee092ea6f6..b74d64d0cea320c736339318e1e4e43ee1279513 100644 --- a/Applications/Utils/FileConverter/Mesh2Raster.cpp +++ b/Applications/Utils/FileConverter/Mesh2Raster.cpp @@ -13,7 +13,6 @@ #include <tclap/CmdLine.h> -#include "Applications/ApplicationsLib/LogogSetup.h" #include "InfoLib/GitInfo.h" #include "GeoLib/AABB.h" #include "MeshLib/IO/readMeshFromFile.h" @@ -24,8 +23,6 @@ int main(int argc, char* argv[]) { - ApplicationsLib::LogogSetup logog_setup; - TCLAP::CmdLine cmd( "Mesh to raster converter.\n" "Rasterises a 2D mesh, pixel values are set to the elevation of a " @@ -67,7 +64,7 @@ int main(int argc, char* argv[]) double const cellsize = (cell_arg.isSet()) ? cell_arg.getValue() : mesh->getMinEdgeLength(); - INFO("Cellsize set to %f", cellsize); + INFO("Cellsize set to {:f}", cellsize); std::vector<MeshLib::Node*> const& nodes_vec(mesh->getNodes()); GeoLib::AABB const bounding_box(nodes_vec.begin(), nodes_vec.end()); @@ -88,7 +85,7 @@ int main(int argc, char* argv[]) out << std::fixed << "cellsize " << cellsize << "\n"; out << "NODATA_value " << "-9999\n"; - INFO("Writing raster with %d x %d pixels.", n_cols, n_rows); + INFO("Writing raster with {:d} x {:d} pixels.", n_cols, n_rows); MeshLib::MeshElementGrid const grid(*mesh); double const max_edge(mesh->getMaxEdgeLength() + cellsize); @@ -153,6 +150,6 @@ int main(int argc, char* argv[]) out << "\n"; } out.close(); - INFO("Result written to %s", output_arg.getValue().c_str()); + INFO("Result written to {:s}", output_arg.getValue().c_str()); return 0; } diff --git a/Applications/Utils/FileConverter/Mesh2Shape.cpp b/Applications/Utils/FileConverter/Mesh2Shape.cpp index 199a61d6f42923735f17d6436646f290bf66a7a8..a7b268dc6596618222088c8414cf2882ddf9106a 100644 --- a/Applications/Utils/FileConverter/Mesh2Shape.cpp +++ b/Applications/Utils/FileConverter/Mesh2Shape.cpp @@ -9,7 +9,6 @@ #include <tclap/CmdLine.h> -#include "Applications/ApplicationsLib/LogogSetup.h" #include "Applications/FileIO/SHPInterface.h" #include "InfoLib/GitInfo.h" #include "MeshLib/IO/readMeshFromFile.h" @@ -17,8 +16,6 @@ int main(int argc, char* argv[]) { - ApplicationsLib::LogogSetup logog_setup; - TCLAP::CmdLine cmd( "Converts 2D mesh file into shapfile such that each element is " "represented by a polygon. Cell attributes are transferred onto shape " diff --git a/Applications/Utils/FileConverter/NetCdfConverter.cpp b/Applications/Utils/FileConverter/NetCdfConverter.cpp index fc60a166cf42c5207a5d8ef4af72d34064a8d706..0138a229b3fec105cff9a751474ca0e5632cd121 100644 --- a/Applications/Utils/FileConverter/NetCdfConverter.cpp +++ b/Applications/Utils/FileConverter/NetCdfConverter.cpp @@ -49,7 +49,7 @@ static void showErrorMessage(std::size_t const error_id, } else if (error_id == 1) { - ERR("Index not valid. Valid indices are in [0,%d].", max); + ERR("Index not valid. Valid indices are in [0,{:d}].", max); } else if (error_id == 2) { @@ -446,7 +446,8 @@ static bool assignDimParams(NcVar const& var, if (arg_dim_time.getValue() >= n_dims || arg_dim1.getValue() >= n_dims || arg_dim2.getValue() >= n_dims || arg_dim3.getValue() >= n_dims) { - ERR("Maximum allowed dimension for variable \"%s\" is %d.", var.getName().c_str(), n_dims-1); + ERR("Maximum allowed dimension for variable \"{:s}\" is {:d}.", + var.getName().c_str(), n_dims - 1); return false; } @@ -675,7 +676,8 @@ int main(int argc, char* argv[]) NcVar const& var = dataset.getVar(var_name); if (var.isNull()) { - ERR("Variable \"%s\" not found in file.", arg_varname.getValue().c_str()); + ERR("Variable \"{:s}\" not found in file.", + arg_varname.getValue().c_str()); return EXIT_FAILURE; } diff --git a/Applications/Utils/FileConverter/OGS2VTK.cpp b/Applications/Utils/FileConverter/OGS2VTK.cpp index 4554f99aaa12514525a64a5be499acc5b009c69e..0114a77572405c171b97f7730d7d75054435319d 100644 --- a/Applications/Utils/FileConverter/OGS2VTK.cpp +++ b/Applications/Utils/FileConverter/OGS2VTK.cpp @@ -58,7 +58,7 @@ int main (int argc, char* argv[]) { return EXIT_FAILURE; } - INFO("Mesh read: %d nodes, %d elements.", mesh->getNumberOfNodes(), + INFO("Mesh read: {:d} nodes, {:d} elements.", mesh->getNumberOfNodes(), mesh->getNumberOfElements()); auto const data_mode = diff --git a/Applications/Utils/FileConverter/TIN2VTK.cpp b/Applications/Utils/FileConverter/TIN2VTK.cpp index 09d7a153705e79f1894892f16f3540e5b74f2533..5bebac4de37f394e0fa0d7f2f81d0e542adf4021 100644 --- a/Applications/Utils/FileConverter/TIN2VTK.cpp +++ b/Applications/Utils/FileConverter/TIN2VTK.cpp @@ -64,12 +64,13 @@ int main (int argc, char* argv[]) { return EXIT_FAILURE; } - INFO("TIN read: %d points, %d triangles", point_vec.size(), + INFO("TIN read: {:d} points, {:d} triangles", point_vec.size(), sfc->getNumberOfTriangles()); INFO("converting to mesh data"); std::unique_ptr<MeshLib::Mesh> mesh(MeshLib::convertSurfaceToMesh(*sfc, BaseLib::extractBaseNameWithoutExtension(tinFileName), std::numeric_limits<double>::epsilon())); - INFO("Mesh created: %d nodes, %d elements.", mesh->getNumberOfNodes(), mesh->getNumberOfElements()); + INFO("Mesh created: {:d} nodes, {:d} elements.", mesh->getNumberOfNodes(), + mesh->getNumberOfElements()); INFO("Write it into VTU"); MeshLib::IO::VtuInterface writer(mesh.get()); diff --git a/Applications/Utils/FileConverter/TecPlotTools.cpp b/Applications/Utils/FileConverter/TecPlotTools.cpp index c3f91655202571ba8244f61c8f63df053e40bbf3..f32cb12f4be51d67ff0bf5a969ea4c2ca2214861 100644 --- a/Applications/Utils/FileConverter/TecPlotTools.cpp +++ b/Applications/Utils/FileConverter/TecPlotTools.cpp @@ -112,7 +112,8 @@ bool dataCountError(std::string const& name, { if (current != total) { - ERR("Data rows found do not fit specified dimensions for section '%s'.", + ERR("Data rows found do not fit specified dimensions for section " + "'{:s}'.", name.c_str()); return true; } @@ -163,7 +164,7 @@ void writeTecPlotSection(std::ofstream& out, val_count = 0; val_total = 0; - INFO("Writing section #%i", write_count); + INFO("Writing section #{:i}", write_count); out.close(); out.open(base_name + std::to_string(write_count++) + extension); } @@ -208,7 +209,7 @@ int writeDataToMesh(std::string const& file_name, vec_names[i], MeshLib::MeshItemType::Cell, 1); if (!prop) { - ERR("Error creating array '%s'.", vec_names[i].c_str()); + ERR("Error creating array '{:s}'.", vec_names[i].c_str()); return -5; } prop->reserve(scalars[i].size()); @@ -219,7 +220,7 @@ int writeDataToMesh(std::string const& file_name, std::string const base_name(file_name.substr(0, delim_pos + 1)); std::string const extension(file_name.substr(delim_pos, std::string::npos)); - INFO("Writing section #%i", write_count); + INFO("Writing section #{:i}", write_count); MeshLib::IO::VtuInterface vtu(mesh.get()); vtu.writeToFile(base_name + std::to_string(write_count++) + extension); return 0; @@ -292,7 +293,7 @@ int splitFile(std::ifstream& in, std::string file_name) { return -3; } - INFO("Writing time step #%i", write_count); + INFO("Writing time step #{:i}", write_count); out.close(); INFO("Finished split."); return 0; @@ -447,7 +448,7 @@ int main(int argc, char* argv[]) std::ifstream in(input_arg.getValue().c_str()); if (!in.is_open()) { - ERR("Could not open file %s.", input_arg.getValue().c_str()); + ERR("Could not open file {:s}.", input_arg.getValue().c_str()); return -2; } diff --git a/Applications/Utils/FileConverter/VTK2OGS.cpp b/Applications/Utils/FileConverter/VTK2OGS.cpp index 53766376e7ede923a094e6852283fd674c672504..7f496cc15fe24052d9c490ec9c3ee81e72e08f58 100644 --- a/Applications/Utils/FileConverter/VTK2OGS.cpp +++ b/Applications/Utils/FileConverter/VTK2OGS.cpp @@ -45,7 +45,8 @@ int main (int argc, char* argv[]) cmd.parse(argc, argv); MeshLib::Mesh* mesh (MeshLib::IO::VtuInterface::readVTUFile(mesh_in.getValue())); - INFO("Mesh read: %d nodes, %d elements.", mesh->getNumberOfNodes(), mesh->getNumberOfElements()); + INFO("Mesh read: {:d} nodes, {:d} elements.", mesh->getNumberOfNodes(), + mesh->getNumberOfElements()); MeshLib::IO::Legacy::MeshIO meshIO; meshIO.setMesh(mesh); diff --git a/Applications/Utils/FileConverter/VTK2TIN.cpp b/Applications/Utils/FileConverter/VTK2TIN.cpp index 5f8adc5e3cc643323e86c9ad966e07d2e9dd98eb..9e5006d3f663713d0a34d162bfb3669f0b359d59 100644 --- a/Applications/Utils/FileConverter/VTK2TIN.cpp +++ b/Applications/Utils/FileConverter/VTK2TIN.cpp @@ -56,7 +56,8 @@ int main (int argc, char* argv[]) cmd.parse(argc, argv); std::unique_ptr<MeshLib::Mesh> mesh (MeshLib::IO::VtuInterface::readVTUFile(mesh_in.getValue())); - INFO("Mesh read: %d nodes, %d elements.", mesh->getNumberOfNodes(), mesh->getNumberOfElements()); + INFO("Mesh read: {:d} nodes, {:d} elements.", mesh->getNumberOfNodes(), + mesh->getNumberOfElements()); INFO("Converting the mesh to TIN"); GeoLib::GEOObjects geo_objects; diff --git a/Applications/Utils/FileConverter/generateMatPropsFromMatID.cpp b/Applications/Utils/FileConverter/generateMatPropsFromMatID.cpp index 103fed5fcab3201c4e320ab42f1620334d8364fe..386d14744858138345e73d5d18991a2b0e6d4e44 100644 --- a/Applications/Utils/FileConverter/generateMatPropsFromMatID.cpp +++ b/Applications/Utils/FileConverter/generateMatPropsFromMatID.cpp @@ -57,7 +57,7 @@ int main (int argc, char* argv[]) if (!mesh) { - INFO("Could not read mesh from file '%s'.", + INFO("Could not read mesh from file '{:s}'.", mesh_arg.getValue().c_str()); return EXIT_FAILURE; } @@ -86,17 +86,17 @@ int main (int argc, char* argv[]) } else { - ERR("Could not create property '%s' file.", new_matname.c_str()); + ERR("Could not create property '{:s}' file.", new_matname.c_str()); return EXIT_FAILURE; } mesh->getProperties().removePropertyVector("MaterialIDs"); std::string const new_mshname(name + "_new.vtu"); - INFO("Writing mesh to file '%s'.", new_mshname.c_str()); + INFO("Writing mesh to file '{:s}'.", new_mshname.c_str()); MeshLib::IO::writeMeshToFile(*mesh, new_mshname); - INFO("New files '%s' and '%s' written.", new_mshname.c_str(), + INFO("New files '{:s}' and '{:s}' written.", new_mshname.c_str(), new_matname.c_str()); return EXIT_SUCCESS; diff --git a/Applications/Utils/GeoTools/MoveGeometry.cpp b/Applications/Utils/GeoTools/MoveGeometry.cpp index b393404865eb3e04cb769af35ae5da095a89997d..165c3275546b3a0a69ba4dfdbc70a9fcfbc8f1c3 100644 --- a/Applications/Utils/GeoTools/MoveGeometry.cpp +++ b/Applications/Utils/GeoTools/MoveGeometry.cpp @@ -64,8 +64,8 @@ int main(int argc, char *argv[]) } catch (std::runtime_error const& err) { - ERR("Failed to read file `%s'.", geo_input_arg.getValue().c_str()); - ERR("%s", err.what()); + ERR("Failed to read file `{:s}'.", geo_input_arg.getValue().c_str()); + ERR("{:s}", err.what()); return EXIT_FAILURE; } diff --git a/Applications/Utils/GeoTools/TriangulatePolyline.cpp b/Applications/Utils/GeoTools/TriangulatePolyline.cpp index ad8a991468f2f5ff3d1a4184ebad50b8b898bf28..1e320147b23607f6664555bff833b3bc780c5f07 100644 --- a/Applications/Utils/GeoTools/TriangulatePolyline.cpp +++ b/Applications/Utils/GeoTools/TriangulatePolyline.cpp @@ -77,8 +77,8 @@ int main(int argc, char *argv[]) } catch (std::runtime_error const& err) { - ERR("Failed to read file `%s'.", file_name.c_str()); - ERR("%s", err.what()); + ERR("Failed to read file `{:s}'.", file_name.c_str()); + ERR("{:s}", err.what()); return EXIT_FAILURE; } @@ -90,7 +90,7 @@ int main(int argc, char *argv[]) // check if line exists if (line == nullptr) { - ERR("No polyline found with name '%s'. Aborting...", + ERR("No polyline found with name '{:s}'. Aborting...", polyline_name.c_str()); return EXIT_FAILURE; } diff --git a/Applications/Utils/MeshEdit/AddTopLayer.cpp b/Applications/Utils/MeshEdit/AddTopLayer.cpp index ade20901240b2e23b8ec77c9c2c7c1c3b991f29a..298e7f22a8a5914809ce41af9b4211364fb6942c 100644 --- a/Applications/Utils/MeshEdit/AddTopLayer.cpp +++ b/Applications/Utils/MeshEdit/AddTopLayer.cpp @@ -51,11 +51,11 @@ int main (int argc, char* argv[]) cmd.parse(argc, argv); - INFO("Reading mesh '%s' ... ", mesh_arg.getValue().c_str()); + INFO("Reading mesh '{:s}' ... ", mesh_arg.getValue().c_str()); auto subsfc_mesh = std::unique_ptr<MeshLib::Mesh>( MeshLib::IO::readMeshFromFile(mesh_arg.getValue())); if (!subsfc_mesh) { - ERR("Error reading mesh '%s'.", mesh_arg.getValue().c_str()); + ERR("Error reading mesh '{:s}'.", mesh_arg.getValue().c_str()); return EXIT_FAILURE; } INFO("done."); @@ -67,7 +67,7 @@ int main (int argc, char* argv[]) return EXIT_FAILURE; } - INFO("Writing mesh '%s' ... ", mesh_out_arg.getValue().c_str()); + INFO("Writing mesh '{:s}' ... ", mesh_out_arg.getValue().c_str()); MeshLib::IO::writeMeshToFile(*result, mesh_out_arg.getValue()); INFO("done."); diff --git a/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp b/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp index 1c2adee65de58fe884f843eaebc1701fc9eca737..b3b4f34c0ac715f2c7a75243b45efb0566fff0b4 100644 --- a/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp +++ b/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp @@ -90,7 +90,7 @@ void writeBCsAndGeometry(GeoLib::GEOObjects& geometry_sets, std::string const& bc_type, bool write_gml) { if (write_gml) { - INFO("write points to '%s.gml'.", geo_name.c_str()); + INFO("write points to '{:s}.gml'.", geo_name.c_str()); FileIO::writeGeometryToFile(geo_name, geometry_sets, out_fname+".gml"); } FileIO::writeGeometryToFile(geo_name, geometry_sets, out_fname+".gli"); @@ -178,11 +178,11 @@ int main (int argc, char* argv[]) cmd.parse(argc, argv); // *** read mesh - INFO("Reading mesh '%s' ... ", mesh_arg.getValue().c_str()); + INFO("Reading mesh '{:s}' ... ", mesh_arg.getValue().c_str()); std::unique_ptr<MeshLib::Mesh> subsurface_mesh( MeshLib::IO::readMeshFromFile(mesh_arg.getValue())); INFO("done."); - INFO("Extracting top surface of mesh '%s' ... ", + INFO("Extracting top surface of mesh '{:s}' ... ", mesh_arg.getValue().c_str()); const MathLib::Vector3 dir(0,0,-1); double const angle(90); @@ -208,7 +208,7 @@ int main (int argc, char* argv[]) // *** get vector of polylines std::vector<GeoLib::Polyline*> const* plys(geometries.getPolylineVec(geo_name)); if (!plys) { - ERR("Could not get vector of polylines out of geometry '%s'.", + ERR("Could not get vector of polylines out of geometry '{:s}'.", geo_name.c_str()); return EXIT_FAILURE; } diff --git a/Applications/Utils/MeshEdit/ExtractBoundary.cpp b/Applications/Utils/MeshEdit/ExtractBoundary.cpp index 93011e9d35235d70afa9f333981041ccd0be25ce..a8124a6bb60e99eef383c4b3816385b8c3398ac4 100644 --- a/Applications/Utils/MeshEdit/ExtractBoundary.cpp +++ b/Applications/Utils/MeshEdit/ExtractBoundary.cpp @@ -16,7 +16,6 @@ #include <string> #include <vector> -#include "Applications/ApplicationsLib/LogogSetup.h" #include "BaseLib/FileTools.h" #include "BaseLib/StringTools.h" #include "InfoLib/GitInfo.h" @@ -31,8 +30,6 @@ int main (int argc, char* argv[]) { - ApplicationsLib::LogogSetup logog_setup; - TCLAP::CmdLine cmd( "Tool extracts the boundary of the given mesh. The documentation is " "available at " @@ -89,7 +86,7 @@ int main (int argc, char* argv[]) return EXIT_FAILURE; } - INFO("Mesh read: %u nodes, %u elements.", mesh->getNumberOfNodes(), + INFO("Mesh read: {:d} nodes, {:d} elements.", mesh->getNumberOfNodes(), mesh->getNumberOfElements()); // extract surface @@ -98,7 +95,7 @@ int main (int argc, char* argv[]) *mesh, node_prop_name.getValue(), element_prop_name.getValue(), face_prop_name.getValue())); - INFO("Created surface mesh: %u nodes, %u elements.", + INFO("Created surface mesh: {:d} nodes, {:d} elements.", surface_mesh->getNumberOfNodes(), surface_mesh->getNumberOfElements()); std::string out_fname(mesh_out.getValue()); diff --git a/Applications/Utils/MeshEdit/ExtractSurface.cpp b/Applications/Utils/MeshEdit/ExtractSurface.cpp index 78d7501540dab4edb272bb74b1c429c69fa1b5e1..c45974f9d0eb28725a862a7ab0f9bbdf4e96988b 100644 --- a/Applications/Utils/MeshEdit/ExtractSurface.cpp +++ b/Applications/Utils/MeshEdit/ExtractSurface.cpp @@ -104,7 +104,7 @@ int main (int argc, char* argv[]) return EXIT_FAILURE; } - INFO("Mesh read: %u nodes, %u elements.", mesh->getNumberOfNodes(), + INFO("Mesh read: {:d} nodes, {:d} elements.", mesh->getNumberOfNodes(), mesh->getNumberOfElements()); // extract surface diff --git a/Applications/Utils/MeshEdit/MapGeometryToMeshSurface.cpp b/Applications/Utils/MeshEdit/MapGeometryToMeshSurface.cpp index 6a50ea9daf87dd0345ab7948fdc9a99d4857e267..9ad43bb2204d9895926bb71e4de15df1d0102975 100644 --- a/Applications/Utils/MeshEdit/MapGeometryToMeshSurface.cpp +++ b/Applications/Utils/MeshEdit/MapGeometryToMeshSurface.cpp @@ -61,7 +61,7 @@ int main (int argc, char* argv[]) { GeoLib::IO::BoostXmlGmlInterface xml_io(geometries); if (xml_io.readFile(input_geometry_fname.getValue())) { - INFO("Read geometry from file '%s'.", + INFO("Read geometry from file '{:s}'.", input_geometry_fname.getValue().c_str()); } else { return EXIT_FAILURE; diff --git a/Applications/Utils/MeshEdit/MoveMesh.cpp b/Applications/Utils/MeshEdit/MoveMesh.cpp index 32fb54f1739b4ee8520aa9ed3e28048826c9a455..bd9dca2d67c06aae4fa5d809a144ed8685fec715 100644 --- a/Applications/Utils/MeshEdit/MoveMesh.cpp +++ b/Applications/Utils/MeshEdit/MoveMesh.cpp @@ -64,7 +64,7 @@ int main(int argc, char *argv[]) std::unique_ptr<MeshLib::Mesh> mesh(MeshLib::IO::readMeshFromFile(fname)); if (!mesh) { - ERR("Could not read mesh from file '%s'.", fname.c_str()); + ERR("Could not read mesh from file '{:s}'.", fname.c_str()); return EXIT_FAILURE; } @@ -82,7 +82,7 @@ int main(int argc, char *argv[]) displacement[2] = z_arg.getValue(); } - INFO("translate model (%f, %f, %f).", + INFO("translate model ({:f}, {:f}, {:f}).", displacement[0], displacement[1], displacement[2]); diff --git a/Applications/Utils/MeshEdit/NodeReordering.cpp b/Applications/Utils/MeshEdit/NodeReordering.cpp index ee5b1df5525584334c41d9676931b74d5dea22d3..8bcee528fdea4fdf1271f017bfd1f699455473d0 100644 --- a/Applications/Utils/MeshEdit/NodeReordering.cpp +++ b/Applications/Utils/MeshEdit/NodeReordering.cpp @@ -77,7 +77,7 @@ void reorderNodes(std::vector<MeshLib::Element*> &elements) } } - INFO("Corrected %d elements.", n_corrected_elements); + INFO("Corrected {:d} elements.", n_corrected_elements); } /// Re-ordering prism elements to correct OGS6 meshes with and without InSitu-Lib diff --git a/Applications/Utils/MeshEdit/ResetPropertiesInPolygonalRegion.cpp b/Applications/Utils/MeshEdit/ResetPropertiesInPolygonalRegion.cpp index 53e8f8ccac22c20eb8140d8b2a3c39af7542e0eb..ca1834cf802edf78f6b0c5e30ce49eee6e0aa328 100644 --- a/Applications/Utils/MeshEdit/ResetPropertiesInPolygonalRegion.cpp +++ b/Applications/Utils/MeshEdit/ResetPropertiesInPolygonalRegion.cpp @@ -106,7 +106,7 @@ int main(int argc, char* argv[]) GeoLib::PolylineVec const* plys(geometries.getPolylineVecObj(geo_name)); if (!plys) { - ERR("Could not get vector of polylines out of geometry '%s'.", + ERR("Could not get vector of polylines out of geometry '{:s}'.", geo_name.c_str()); return EXIT_FAILURE; } @@ -116,7 +116,7 @@ int main(int argc, char* argv[]) plys->getElementByName(polygon_name_arg.getValue())); if (!ply) { - ERR("Polyline '%s' not found.", polygon_name_arg.getValue().c_str()); + ERR("Polyline '{:s}' not found.", polygon_name_arg.getValue().c_str()); return EXIT_FAILURE; } @@ -124,7 +124,7 @@ int main(int argc, char* argv[]) bool closed(ply->isClosed()); if (!closed) { - ERR("Polyline '%s' is not closed, i.e. does not describe a region.", + ERR("Polyline '{:s}' is not closed, i.e. does not describe a region.", polygon_name_arg.getValue().c_str()); return EXIT_FAILURE; } @@ -164,10 +164,10 @@ int main(int argc, char* argv[]) std::vector<std::string> property_names( mesh->getProperties().getPropertyVectorNames()); - INFO("Mesh contains %d property vectors:", property_names.size()); + INFO("Mesh contains {:d} property vectors:", property_names.size()); for (const auto& name : property_names) { - INFO("- %s", name.c_str()); + INFO("- {:s}", name.c_str()); } MeshLib::IO::writeMeshToFile(*mesh, mesh_out.getValue()); diff --git a/Applications/Utils/MeshEdit/UnityPreprocessing.cpp b/Applications/Utils/MeshEdit/UnityPreprocessing.cpp index 612e85f6c2cdbce0d897a6b40cfe58624ed37924..a52fe91c022311236cf4bc522de4aca0e0a4175f 100644 --- a/Applications/Utils/MeshEdit/UnityPreprocessing.cpp +++ b/Applications/Utils/MeshEdit/UnityPreprocessing.cpp @@ -66,7 +66,7 @@ bool fillPropVec(MeshLib::Properties const& props, MeshLib::PropertyVector<T> const*const vec = props.getPropertyVector<T>(name); if (vec->getNumberOfComponents() != 1) { - INFO("Ignoring array '%s' (more than one component).", name.c_str()); + INFO("Ignoring array '{:s}' (more than one component).", name.c_str()); return false; } @@ -75,7 +75,7 @@ bool fillPropVec(MeshLib::Properties const& props, new_vec->resize(total_nodes); if (vec->getMeshItemType() == MeshLib::MeshItemType::Node) { - INFO("Migrating node array '%s' to new mesh structure...", + INFO("Migrating node array '{:s}' to new mesh structure...", name.c_str()); std::size_t const n_nodes (node_map.size()); for (std::size_t i = 0; i<n_nodes; ++i) @@ -89,7 +89,7 @@ bool fillPropVec(MeshLib::Properties const& props, } else if (vec->getMeshItemType() == MeshLib::MeshItemType::Cell) { - INFO("Transforming cell array '%s' into node array...", name.c_str()); + INFO("Transforming cell array '{:s}' into node array...", name.c_str()); std::size_t const n_elems (vec->size()); for (std::size_t i = 0; i<n_elems; ++i) { @@ -204,7 +204,7 @@ int main (int argc, char* argv[]) cmd.parse(argc, argv); - INFO("Reading mesh '%s' ... ", mesh_arg.getValue().c_str()); + INFO("Reading mesh '{:s}' ... ", mesh_arg.getValue().c_str()); std::unique_ptr<MeshLib::Mesh> mesh {MeshLib::IO::readMeshFromFile(mesh_arg.getValue())}; if (!mesh) { @@ -231,7 +231,7 @@ int main (int argc, char* argv[]) MeshLib::ElementSearch searcher(*mesh); std::size_t const n_rem_elems = searcher.searchByElementType(MeshLib::MeshElemType::LINE); result.reset(MeshLib::removeElements(*mesh, searcher.getSearchedElementIDs(), "temp mesh")); - INFO ("%d line elements found and removed.\n", n_rem_elems); + INFO("{:d} line elements found and removed.\n", n_rem_elems); } INFO("Checking for cell-arrays..."); @@ -242,7 +242,7 @@ int main (int argc, char* argv[]) else INFO("No cell arrays found, keeping mesh structure.\n"); - INFO("Writing mesh '%s' ... ", mesh_out_arg.getValue().c_str()); + INFO("Writing mesh '{:s}' ... ", mesh_out_arg.getValue().c_str()); MeshLib::IO::VtuInterface writer(result.get(), vtkXMLWriter::Ascii, false); writer.writeToFile(mesh_out_arg.getValue()); INFO("done."); diff --git a/Applications/Utils/MeshEdit/Vtu2Grid.cpp b/Applications/Utils/MeshEdit/Vtu2Grid.cpp index 37baa463bf749e79e69113d5dc8ab5cd018f89e9..3e60d23c74b420e629de95f35a066873a2e1290b 100644 --- a/Applications/Utils/MeshEdit/Vtu2Grid.cpp +++ b/Applications/Utils/MeshEdit/Vtu2Grid.cpp @@ -10,7 +10,6 @@ #include <tclap/CmdLine.h> -#include "Applications/ApplicationsLib/LogogSetup.h" #include "InfoLib/GitInfo.h" #include "MeshLib/IO/writeMeshToFile.h" @@ -131,14 +130,13 @@ void mapMeshArraysOntoGrid(vtkSmartPointer<vtkUnstructuredGrid> const& mesh, mapArray<int, vtkSmartPointer<vtkIntArray>>(*grid, int_arr, name); continue; } - WARN("Ignoring array '%s', array type not implemented...", name.c_str()); + WARN("Ignoring array '{:s}', array type not implemented...", + name.c_str()); } } int main (int argc, char* argv[]) { - ApplicationsLib::LogogSetup logog_setup; - TCLAP::CmdLine cmd( "Reads a 3D unstructured mesh and samples it onto a structured grid of " "the same extent. Cell properties are mapped onto the grid (sampled at " diff --git a/Applications/Utils/MeshEdit/appendLinesAlongPolyline.cpp b/Applications/Utils/MeshEdit/appendLinesAlongPolyline.cpp index dca08d361a0a6c896a62df64196f784212a94835..5dc53e1b2c6c02a978f4cd0945c2a0fa9519edb5 100644 --- a/Applications/Utils/MeshEdit/appendLinesAlongPolyline.cpp +++ b/Applications/Utils/MeshEdit/appendLinesAlongPolyline.cpp @@ -70,7 +70,7 @@ int main (int argc, char* argv[]) const GeoLib::PolylineVec* ply_vec (geo_objs.getPolylineVecObj(geo_names[0])); if (!ply_vec) { - ERR("Could not find polylines in geometry '%s'.", + ERR("Could not find polylines in geometry '{:s}'.", geo_names.front().c_str()); return EXIT_FAILURE; } @@ -79,15 +79,17 @@ int main (int argc, char* argv[]) MeshLib::Mesh const*const mesh (MeshLib::IO::readMeshFromFile(mesh_in.getValue())); if (!mesh) { - ERR("Mesh file '%s' not found", mesh_in.getValue().c_str()); + ERR("Mesh file '{:s}' not found", mesh_in.getValue().c_str()); return EXIT_FAILURE; } - INFO("Mesh read: %d nodes, %d elements.", mesh->getNumberOfNodes(), mesh->getNumberOfElements()); + INFO("Mesh read: {:d} nodes, {:d} elements.", mesh->getNumberOfNodes(), + mesh->getNumberOfElements()); // add line elements std::unique_ptr<MeshLib::Mesh> new_mesh = MeshGeoToolsLib::appendLinesAlongPolylines(*mesh, *ply_vec); - INFO("Mesh created: %d nodes, %d elements.", new_mesh->getNumberOfNodes(), new_mesh->getNumberOfElements()); + INFO("Mesh created: {:d} nodes, {:d} elements.", + new_mesh->getNumberOfNodes(), new_mesh->getNumberOfElements()); MeshLib::IO::writeMeshToFile(*new_mesh, mesh_out.getValue()); diff --git a/Applications/Utils/MeshEdit/checkMesh.cpp b/Applications/Utils/MeshEdit/checkMesh.cpp index fa65f8245880bb45cff90a58b748429cf02c229a..8b4152b1ebe0759b03cdaa74b407f76fcaf3320e 100644 --- a/Applications/Utils/MeshEdit/checkMesh.cpp +++ b/Applications/Utils/MeshEdit/checkMesh.cpp @@ -65,21 +65,26 @@ int main(int argc, char *argv[]) const unsigned long mem_with_mesh (mem_watch.getVirtMemUsage()); if (mem_with_mesh>0) { - INFO ("Memory size: %i MB", (mem_with_mesh - mem_without_mesh)/(1024*1024)); + INFO("Memory size: {:i} MB", + (mem_with_mesh - mem_without_mesh) / (1024 * 1024)); (void)mem_with_mesh; } - INFO ("Time for reading: %g s", run_time.elapsed()); + INFO("Time for reading: {:g} s", run_time.elapsed()); // Geometric information const GeoLib::AABB aabb(MeshLib::MeshInformation::getBoundingBox(*mesh)); auto minPt(aabb.getMinPoint()); auto maxPt(aabb.getMaxPoint()); INFO("Node coordinates:"); - INFO("\tx [%g, %g] (extent %g)", minPt[0], maxPt[0], maxPt[0]-minPt[0]); - INFO("\ty [%g, %g] (extent %g)", minPt[1], maxPt[1], maxPt[1]-minPt[1]); - INFO("\tz [%g, %g] (extent %g)", minPt[2], maxPt[2], maxPt[2]-minPt[2]); - - INFO("Edge length: [%g, %g]", mesh->getMinEdgeLength(), mesh->getMaxEdgeLength()); + INFO("\tx [{:g}, {:g}] (extent {:g})", minPt[0], maxPt[0], + maxPt[0] - minPt[0]); + INFO("\ty [{:g}, {:g}] (extent {:g})", minPt[1], maxPt[1], + maxPt[1] - minPt[1]); + INFO("\tz [{:g}, {:g}] (extent {:g})", minPt[2], maxPt[2], + maxPt[2] - minPt[2]); + + INFO("Edge length: [{:g}, {:g}]", mesh->getMinEdgeLength(), + mesh->getMaxEdgeLength()); // Element information diff --git a/Applications/Utils/MeshEdit/createLayeredMeshFromRasters.cpp b/Applications/Utils/MeshEdit/createLayeredMeshFromRasters.cpp index fe64c7d4f00c35ecb70787ee0a0e772db4679738..ed8244e3d859b1fa6dc972fd3cb924a76270f7e6 100644 --- a/Applications/Utils/MeshEdit/createLayeredMeshFromRasters.cpp +++ b/Applications/Utils/MeshEdit/createLayeredMeshFromRasters.cpp @@ -35,7 +35,7 @@ int readRasterPaths(std::string const& raster_list_file, std::vector<std::string std::ifstream in (raster_list_file.c_str()); if (in.fail()) { - ERR ("Could not open file %s.", raster_list_file.c_str()); + ERR("Could not open file {:s}.", raster_list_file.c_str()); return -1; } std::string line; @@ -117,12 +117,12 @@ int main (int argc, char* argv[]) } } - INFO("Reading mesh '%s' ... ", mesh_arg.getValue().c_str()); + INFO("Reading mesh '{:s}' ... ", mesh_arg.getValue().c_str()); std::unique_ptr<MeshLib::Mesh> const sfc_mesh( MeshLib::IO::readMeshFromFile(mesh_arg.getValue())); if (!sfc_mesh) { - ERR("Error reading mesh '%s'.", mesh_arg.getValue().c_str()); + ERR("Error reading mesh '{:s}'.", mesh_arg.getValue().c_str()); return EXIT_FAILURE; } if (sfc_mesh->getDimension() != 2) @@ -157,7 +157,7 @@ int main (int argc, char* argv[]) output_name.append(".vtu"); } - INFO("Writing mesh '%s' ... ", output_name.c_str()); + INFO("Writing mesh '{:s}' ... ", output_name.c_str()); auto result_mesh = std::make_unique<MeshLib::Mesh>( *(mapper.getMesh("SubsurfaceMesh").release())); diff --git a/Applications/Utils/MeshEdit/editMaterialID.cpp b/Applications/Utils/MeshEdit/editMaterialID.cpp index c87484215de863a35862958b0549dd1fc37af387..bf37f69baab232b107b5fcc7230093b3ac8d5e87 100644 --- a/Applications/Utils/MeshEdit/editMaterialID.cpp +++ b/Applications/Utils/MeshEdit/editMaterialID.cpp @@ -84,7 +84,8 @@ int main (int argc, char* argv[]) std::unique_ptr<MeshLib::Mesh> mesh( MeshLib::IO::readMeshFromFile(mesh_in.getValue())); - INFO("Mesh read: %d nodes, %d elements.", mesh->getNumberOfNodes(), mesh->getNumberOfElements()); + INFO("Mesh read: {:d} nodes, {:d} elements.", mesh->getNumberOfNodes(), + mesh->getNumberOfElements()); if (condenseArg.isSet()) { INFO("Condensing material ID..."); @@ -94,7 +95,7 @@ int main (int argc, char* argv[]) const auto vecOldID = matIDArg.getValue(); const unsigned newID = newIDArg.getValue(); for (auto oldID : vecOldID) { - INFO("%d -> %d", oldID, newID); + INFO("{:d} -> {:d}", oldID, newID); MeshLib::ElementValueModification::replace(*mesh, oldID, newID, true); } } else if (specifyArg.isSet()) { @@ -103,7 +104,7 @@ int main (int argc, char* argv[]) const MeshLib::MeshElemType eleType = MeshLib::String2MeshElemType(eleTypeName); const unsigned newID = newIDArg.getValue(); unsigned cnt = MeshLib::ElementValueModification::setByElementType(*mesh, eleType, newID); - INFO("updated %d elements", cnt); + INFO("updated {:d} elements", cnt); } MeshLib::IO::writeMeshToFile(*mesh, mesh_out.getValue()); diff --git a/Applications/Utils/MeshEdit/moveMeshNodes.cpp b/Applications/Utils/MeshEdit/moveMeshNodes.cpp index 7ff5d75349b312fd1a0a2b32eadd0b11e5d5380d..ab02208dee53011faec194e2cb17af597736e422 100644 --- a/Applications/Utils/MeshEdit/moveMeshNodes.cpp +++ b/Applications/Utils/MeshEdit/moveMeshNodes.cpp @@ -57,7 +57,7 @@ int main (int argc, char* argv[]) INFO( "Moves mesh nodes and connected elements either by a given value " "or based on a list.\n"); - INFO("Usage: %s <msh-file.msh> <keyword> [<value1>] [<value2>]", + INFO("Usage: {:s} <msh-file.msh> <keyword> [<value1>] [<value2>]", argv[0]); INFO("Available keywords:"); INFO( @@ -78,7 +78,7 @@ int main (int argc, char* argv[]) if (!(ext == "msh" || ext == "vtu")) { ERR("Error: Parameter 1 must be a mesh-file (*.msh / *.vtu)."); - INFO("Usage: %s <msh-file.gml> <keyword> <value>", argv[0]); + INFO("Usage: {:s} <msh-file.gml> <keyword> <value>", argv[0]); return EXIT_FAILURE; } @@ -96,7 +96,7 @@ int main (int argc, char* argv[]) { ERR("Keyword not recognised. Available keywords:"); for (auto const& keyword : keywords) - INFO("\t%s", keyword.c_str()); + INFO("\t{:s}", keyword.c_str()); return EXIT_FAILURE; } @@ -120,8 +120,8 @@ int main (int argc, char* argv[]) const std::string dir(argv[3]); unsigned idx = (dir == "x") ? 0 : (dir == "y") ? 1 : 2; const double value(strtod(argv[4],0)); - INFO("Moving all mesh nodes by %g in direction %d (%s)...", value, idx, - dir.c_str()); + INFO("Moving all mesh nodes by {:g} in direction {:d} ({:s})...", value, + idx, dir.c_str()); //double value(-10); const std::size_t nNodes(mesh->getNumberOfNodes()); std::vector<MeshLib::Node*> nodes (mesh->getNodes()); diff --git a/Applications/Utils/MeshEdit/queryMesh.cpp b/Applications/Utils/MeshEdit/queryMesh.cpp index 321112d272fab5e32be1fec70ba669addc903176..5f98083c73433a668f03194359892495b914c9e7 100644 --- a/Applications/Utils/MeshEdit/queryMesh.cpp +++ b/Applications/Utils/MeshEdit/queryMesh.cpp @@ -104,7 +104,7 @@ int main(int argc, char *argv[]) } } out << std::endl; - INFO("%s", out.str().c_str()); + INFO("{:s}", out.str().c_str()); } for (auto node_id : selected_node_ids) @@ -128,6 +128,6 @@ int main(int argc, char *argv[]) out << nd->getID() << " "; } out << std::endl; - INFO("%s", out.str().c_str()); + INFO("{:s}", out.str().c_str()); } } diff --git a/Applications/Utils/MeshEdit/removeMeshElements.cpp b/Applications/Utils/MeshEdit/removeMeshElements.cpp index 2e57af6173a33c7e8c4b09cd0b2957edb2857112..99e663bfaa82710e44fce5824af01d285f3853a2 100644 --- a/Applications/Utils/MeshEdit/removeMeshElements.cpp +++ b/Applications/Utils/MeshEdit/removeMeshElements.cpp @@ -41,7 +41,7 @@ void searchByPropertyValue(std::string const& property_name, property_name, property_value); } - INFO("%d elements with property value %s found.", n_marked_elements, + INFO("{:d} elements with property value {:s} found.", n_marked_elements, std::to_string(property_value).c_str()); } } @@ -63,7 +63,7 @@ void searchByPropertyRange(std::string const& property_name, // add checks for other data types here (if n_marked_elements remains 0) - INFO("%d elements in range [%s, %s] found.", n_marked_elements, + INFO("{:d} elements in range [{:s}, {:s}] found.", n_marked_elements, std::to_string(min_value).c_str(), std::to_string(max_value).c_str()); } @@ -153,12 +153,13 @@ int main (int argc, char* argv[]) return EXIT_FAILURE; } - INFO("Mesh read: %d nodes, %d elements.", mesh->getNumberOfNodes(), mesh->getNumberOfElements()); + INFO("Mesh read: {:d} nodes, {:d} elements.", mesh->getNumberOfNodes(), + mesh->getNumberOfElements()); MeshLib::ElementSearch searcher(*mesh); // search elements IDs to be removed if (zveArg.isSet()) { - INFO("%d zero volume elements found.", searcher.searchByContent()); + INFO("{:d} zero volume elements found.", searcher.searchByContent()); } if (eleTypeArg.isSet()) { const std::vector<std::string> eleTypeNames = eleTypeArg.getValue(); @@ -168,8 +169,8 @@ int main (int argc, char* argv[]) { continue; } - INFO("%d %s elements found.", searcher.searchByElementType(type), - typeName.c_str()); + INFO("{:d} {:s} elements found.", + searcher.searchByElementType(type), typeName.c_str()); } } @@ -248,8 +249,9 @@ int main (int argc, char* argv[]) ySmallArg.getValue(), zSmallArg.getValue()}}), MathLib::Point3d(std::array<double,3>{{xLargeArg.getValue(), yLargeArg.getValue(), zLargeArg.getValue()}})}}); - INFO("%d elements found.", - searcher.searchByBoundingBox(GeoLib::AABB(extent.begin(), extent.end()))); + INFO("{:d} elements found.", + searcher.searchByBoundingBox( + GeoLib::AABB(extent.begin(), extent.end()))); } // remove the elements and create a new mesh object. diff --git a/Applications/Utils/MeshEdit/reviseMesh.cpp b/Applications/Utils/MeshEdit/reviseMesh.cpp index 545c2018b9bb5a2cd4d5811d06b7829871361060..9b2c137c8d99a8378386a9688917beb235e0ac9f 100644 --- a/Applications/Utils/MeshEdit/reviseMesh.cpp +++ b/Applications/Utils/MeshEdit/reviseMesh.cpp @@ -60,7 +60,8 @@ int main(int argc, char *argv[]) { return EXIT_FAILURE; } - INFO("Mesh read: %d nodes, %d elements.", org_mesh->getNumberOfNodes(), org_mesh->getNumberOfElements()); + INFO("Mesh read: {:d} nodes, {:d} elements.", org_mesh->getNumberOfNodes(), + org_mesh->getNumberOfElements()); // revise the mesh std::unique_ptr<MeshLib::Mesh> new_mesh; @@ -74,7 +75,8 @@ int main(int argc, char *argv[]) // write into a file if (new_mesh) { - INFO("Revised mesh: %d nodes, %d elements.", new_mesh->getNumberOfNodes(), new_mesh->getNumberOfElements()); + INFO("Revised mesh: {:d} nodes, {:d} elements.", + new_mesh->getNumberOfNodes(), new_mesh->getNumberOfElements()); MeshLib::IO::writeMeshToFile(*new_mesh, output_arg.getValue()); } diff --git a/Applications/Utils/MeshEdit/swapNodeCoordinateAxes.cpp b/Applications/Utils/MeshEdit/swapNodeCoordinateAxes.cpp index c2864214218e16993370f69fbd99de296ac3bcc0..1027c6b4a75b0a1227857327d763dabeed07c352 100644 --- a/Applications/Utils/MeshEdit/swapNodeCoordinateAxes.cpp +++ b/Applications/Utils/MeshEdit/swapNodeCoordinateAxes.cpp @@ -131,7 +131,8 @@ int main(int argc, char *argv[]) WARN("Swapping coordinate values of 3D elements can result in incorrect node-ordering."); } - INFO("Exchange node coordinates from xyz to %s", new_order_arg.getValue().data()); + INFO("Exchange node coordinates from xyz to {:s}", + new_order_arg.getValue().data()); swapNodeCoordinateAxes(*mesh, new_order); INFO("Save the new mesh into a file"); diff --git a/Applications/Utils/MeshGeoTools/computeSurfaceNodeIDsInPolygonalRegion.cpp b/Applications/Utils/MeshGeoTools/computeSurfaceNodeIDsInPolygonalRegion.cpp index 7d4dc1753c0893b3fd382eb6dafff86e0a25cf50..7b50a9189aeeab3368c1828ed26fb5d52d08561c 100644 --- a/Applications/Utils/MeshGeoTools/computeSurfaceNodeIDsInPolygonalRegion.cpp +++ b/Applications/Utils/MeshGeoTools/computeSurfaceNodeIDsInPolygonalRegion.cpp @@ -36,12 +36,12 @@ void writeToFile(std::string const& id_area_fname, std::string const& csv_fname, { std::ofstream ids_and_area_out(id_area_fname); if (!ids_and_area_out) { - OGS_FATAL("Unable to open the file '%s' - aborting.", + OGS_FATAL("Unable to open the file '{:s}' - aborting.", id_area_fname.c_str()); } std::ofstream csv_out(csv_fname); if (!csv_out) { - OGS_FATAL("Unable to open the file '%s' - aborting.", + OGS_FATAL("Unable to open the file '{:s}' - aborting.", csv_fname.c_str()); } @@ -95,14 +95,15 @@ int main (int argc, char* argv[]) cmd.parse(argc, argv); std::unique_ptr<MeshLib::Mesh const> mesh(MeshLib::IO::readMeshFromFile(mesh_in.getValue())); - INFO("Mesh read: %u nodes, %u elements.", mesh->getNumberOfNodes(), mesh->getNumberOfElements()); + INFO("Mesh read: {:d} nodes, {:d} elements.", mesh->getNumberOfNodes(), + mesh->getNumberOfElements()); GeoLib::GEOObjects geo_objs; FileIO::readGeometryFromFile(geo_in.getValue(), geo_objs, gmsh_path_arg.getValue()); std::vector<std::string> geo_names; geo_objs.getGeometryNames(geo_names); - INFO("Geometry '%s' read: %u points, %u polylines.", + INFO("Geometry '{:s}' read: {:d} points, {:d} polylines.", geo_names[0].c_str(), geo_objs.getPointVec(geo_names[0])->size(), geo_objs.getPolylineVec(geo_names[0])->size()); @@ -154,7 +155,7 @@ int main (int argc, char* argv[]) } } if (ids_and_areas.empty()) { - ERR("Polygonal part of surface '%s' doesn't contains nodes. No " + ERR("Polygonal part of surface '{:s}' doesn't contains nodes. No " "output will be generated.", polygon_name.c_str()); continue; @@ -166,8 +167,8 @@ int main (int argc, char* argv[]) id_and_area_fname += std::to_string(j) + ".txt"; csv_fname += std::to_string(j) + ".csv"; INFO( - "Polygonal part of surface '%s' contains %ul nodes. Writting to" - " files '%s' and '%s'.", + "Polygonal part of surface '{:s}' contains %{ul} nodes. Writting to" + " files '{:s}' and '{:s}'.", polygon_name.c_str(), ids_and_areas.size(), id_and_area_fname.c_str(), diff --git a/Applications/Utils/MeshGeoTools/constructMeshesFromGeometry.cpp b/Applications/Utils/MeshGeoTools/constructMeshesFromGeometry.cpp index 55d4a77cf974c63dc8f6b6a479405ddc60319a06..8f2ccc8b17ee52b4a8b15921730e1f194c3de56d 100644 --- a/Applications/Utils/MeshGeoTools/constructMeshesFromGeometry.cpp +++ b/Applications/Utils/MeshGeoTools/constructMeshesFromGeometry.cpp @@ -24,7 +24,7 @@ std::unique_ptr<GeoLib::GEOObjects> readGeometry(std::string const& filename) auto geo_objects = std::make_unique<GeoLib::GEOObjects>(); GeoLib::IO::BoostXmlGmlInterface gml_reader(*geo_objects); - DBUG("Reading geometry file '%s'.", filename.c_str()); + DBUG("Reading geometry file '{:s}'.", filename.c_str()); gml_reader.readFile(filename); return geo_objects; } @@ -107,7 +107,7 @@ int main(int argc, char* argv[]) if (m_ptr->getNodes().empty()) { WARN( - "The created mesh '%s' hasn't any nodes or elements and thus " + "The created mesh '{:s}' hasn't any nodes or elements and thus " "it isn't written to file.", m_ptr->getName().c_str()); continue; diff --git a/Applications/Utils/MeshGeoTools/createIntermediateRasters.cpp b/Applications/Utils/MeshGeoTools/createIntermediateRasters.cpp index 3b660c78b7fe52663a0b434e4f4d0e4012d3e6f1..907329ccdbc82ed3a2a72c5c89655fcbf5798d03 100644 --- a/Applications/Utils/MeshGeoTools/createIntermediateRasters.cpp +++ b/Applications/Utils/MeshGeoTools/createIntermediateRasters.cpp @@ -15,14 +15,11 @@ #include "InfoLib/GitInfo.h" #include "BaseLib/FileTools.h" -#include "Applications/ApplicationsLib/LogogSetup.h" #include "Applications/FileIO/AsciiRasterInterface.h" #include "GeoLib/Raster.h" int main(int argc, char* argv[]) { - ApplicationsLib::LogogSetup logog_setup; - TCLAP::CmdLine cmd( "Takes two DEMs located at the exact same spatial position (but at " "different elevation) and calculates n raster DEMs located at " @@ -145,7 +142,7 @@ int main(int argc, char* argv[]) GeoLib::Raster r(h1, raster[i].begin(), raster[i].end()); FileIO::AsciiRasterInterface::writeRasterAsASC(r, basename + std::to_string(i) + "." + ext); - INFO("Layer %d written.", i+1); + INFO("Layer {:d} written.", i + 1); } return EXIT_SUCCESS; } diff --git a/Applications/Utils/MeshGeoTools/identifySubdomains.cpp b/Applications/Utils/MeshGeoTools/identifySubdomains.cpp index 6dc2fb59a8370113b18ee6d88c83b5abedbc7209..457a88664df4825e36d687d8cdd1c960b203a38b 100644 --- a/Applications/Utils/MeshGeoTools/identifySubdomains.cpp +++ b/Applications/Utils/MeshGeoTools/identifySubdomains.cpp @@ -29,7 +29,8 @@ std::vector<std::unique_ptr<MeshLib::Mesh>> readMeshes( auto mesh = MeshLib::IO::readMeshFromFile(filename); if (mesh == nullptr) { - OGS_FATAL("Could not read mesh from '%s' file.", filename.c_str()); + OGS_FATAL("Could not read mesh from '{:s}' file.", + filename.c_str()); } meshes.emplace_back(mesh); } @@ -105,7 +106,7 @@ int main(int argc, char* argv[]) MeshLib::IO::readMeshFromFile(bulk_mesh_arg.getValue())}; if (bulk_mesh == nullptr) { - OGS_FATAL("Could not read bulk mesh from '%s'", + OGS_FATAL("Could not read bulk mesh from '{:s}'", bulk_mesh_arg.getValue().c_str()); } diff --git a/Applications/Utils/ModelPreparation/ComputeNodeAreasFromSurfaceMesh.cpp b/Applications/Utils/ModelPreparation/ComputeNodeAreasFromSurfaceMesh.cpp index 011cedc793d0a2de0e6254791cbe0968d81752c9..bf943a45ddc5740eb184e22ed2454df9c2d80fc3 100644 --- a/Applications/Utils/ModelPreparation/ComputeNodeAreasFromSurfaceMesh.cpp +++ b/Applications/Utils/ModelPreparation/ComputeNodeAreasFromSurfaceMesh.cpp @@ -32,12 +32,12 @@ void writeToFile(std::string const& id_area_fname, std::string const& csv_fname, { std::ofstream ids_and_area_out(id_area_fname); if (!ids_and_area_out) { - OGS_FATAL("Unable to open the file '%s' - aborting.", + OGS_FATAL("Unable to open the file '{:s}' - aborting.", id_area_fname.c_str()); } std::ofstream csv_out(csv_fname); if (!csv_out) { - OGS_FATAL("Unable to open the file '%s' - aborting.", + OGS_FATAL("Unable to open the file '{:s}' - aborting.", csv_fname.c_str()); } @@ -86,8 +86,8 @@ int main (int argc, char* argv[]) std::unique_ptr<MeshLib::Mesh> surface_mesh( MeshLib::IO::readMeshFromFile(mesh_in.getValue())); - INFO("Mesh read: %u nodes, %u elements.", surface_mesh->getNumberOfNodes(), - surface_mesh->getNumberOfElements()); + INFO("Mesh read: {:d} nodes, {:d} elements.", + surface_mesh->getNumberOfNodes(), surface_mesh->getNumberOfElements()); // ToDo check if mesh is read correct and if the mesh is a surface mesh MeshLib::PropertyVector<std::size_t>* orig_node_ids(nullptr); diff --git a/Applications/Utils/ModelPreparation/PartitionMesh/Metis.cpp b/Applications/Utils/ModelPreparation/PartitionMesh/Metis.cpp index 0534837886c57c8c454f598934640185c9352c7c..2dec1a4d2bce48027900a5465782acf9a1309e5c 100644 --- a/Applications/Utils/ModelPreparation/PartitionMesh/Metis.cpp +++ b/Applications/Utils/ModelPreparation/PartitionMesh/Metis.cpp @@ -22,12 +22,12 @@ void writeMETIS(std::vector<MeshLib::Element*> const& elements, std::ofstream os(file_name, std::ios::trunc); if (!os.is_open()) { - OGS_FATAL("Error: cannot open file %s.", file_name.data()); + OGS_FATAL("Error: cannot open file {:s}.", file_name.data()); } if (!os.good()) { - OGS_FATAL("Error: Cannot write in file %s.", file_name.data()); + OGS_FATAL("Error: Cannot write in file {:s}.", file_name.data()); } os << elements.size() << " \n"; @@ -56,7 +56,7 @@ std::vector<std::size_t> readMetisData(const std::string& file_name_base, if (!npart_in.is_open()) { OGS_FATAL( - "Error: cannot open file %s. It may not exist!\n" + "Error: cannot open file {:s}. It may not exist!\n" "Run mpmetis beforehand or use option -m", fname_parts.data()); } @@ -76,12 +76,12 @@ std::vector<std::size_t> readMetisData(const std::string& file_name_base, if (npart_in.bad()) { - OGS_FATAL("Error while reading file %s.", fname_parts.data()); + OGS_FATAL("Error while reading file {:s}.", fname_parts.data()); } if (counter != number_of_nodes) { - OGS_FATAL("Error: data in %s are less than expected.", + OGS_FATAL("Error: data in {:s} are less than expected.", fname_parts.data()); } diff --git a/Applications/Utils/ModelPreparation/PartitionMesh/NodeWiseMeshPartitioner.cpp b/Applications/Utils/ModelPreparation/PartitionMesh/NodeWiseMeshPartitioner.cpp index aa9c6b366a377782fc18d84c3456b030750b3c48..bde2354667585aebe00ae6bf6426f5e65c449a9a 100644 --- a/Applications/Utils/ModelPreparation/PartitionMesh/NodeWiseMeshPartitioner.cpp +++ b/Applications/Utils/ModelPreparation/PartitionMesh/NodeWiseMeshPartitioner.cpp @@ -403,7 +403,7 @@ bool copyPropertyVector(MeshLib::Properties const& original_properties, *partitioned_pv); } OGS_FATAL( - "Copying of property vector values for mesh item type %s is " + "Copying of property vector values for mesh item type {:s} is " "not implemented.", pv->getMeshItemType()); }; @@ -438,7 +438,7 @@ void applyToPropertyVectors(std::vector<std::string> const& property_names, f(static_cast<unsigned long>(0), name) || f(std::size_t{}, name); if (!success) { - OGS_FATAL("Could not apply function to PropertyVector '%s'.", + OGS_FATAL("Could not apply function to PropertyVector '{:s}'.", name.c_str()); } } @@ -456,8 +456,8 @@ void processProperties(MeshLib::Properties const& properties, }); DBUG( - "total number of tuples define on mesh item type '%s' after " - "partitioning: %d ", + "total number of tuples define on mesh item type '{:s}' after " + "partitioning: {:d} ", toString(mesh_item_type), total_number_of_tuples); // 1 create new PV @@ -488,7 +488,7 @@ void NodeWiseMeshPartitioner::partitionByMETIS( { for (std::size_t part_id = 0; part_id < _partitions.size(); part_id++) { - INFO("Processing partition: %d", part_id); + INFO("Processing partition: {:d}", part_id); processPartition(part_id, is_mixed_high_order_linear_elems); } @@ -608,7 +608,7 @@ std::vector<Partition> NodeWiseMeshPartitioner::partitionOtherMesh( for (std::size_t part_id = 0; part_id < _partitions.size(); part_id++) { auto& partition = partitions[part_id]; - INFO("Processing partition: %d", part_id); + INFO("Processing partition: {:d}", part_id); // Set the node numbers of base and all mesh nodes. partition.number_of_mesh_base_nodes = mesh.getNumberOfBaseNodes(); partition.number_of_mesh_all_nodes = mesh.getNumberOfNodes(); @@ -741,7 +741,7 @@ void writePropertiesBinary(const std::string& file_name_base, std::ofstream out(file_name_cfg, std::ios::binary); if (!out) { - OGS_FATAL("Could not open file '%s' for output.", + OGS_FATAL("Could not open file '{:s}' for output.", file_name_cfg.c_str()); } @@ -751,7 +751,7 @@ void writePropertiesBinary(const std::string& file_name_base, std::ofstream out_val(file_name_val, std::ios::binary); if (!out_val) { - OGS_FATAL("Could not open file '%s' for output.", + OGS_FATAL("Could not open file '{:s}' for output.", file_name_val.c_str()); } @@ -771,8 +771,9 @@ void writePropertiesBinary(const std::string& file_name_base, offset, static_cast<unsigned long>( partition.numberOfMeshItems(mesh_item_type))}; DBUG( - "Write meta data for node-based PropertyVector: global offset %d, " - "number of tuples %d", + "Write meta data for node-based PropertyVector: global offset " + "{:d}, " + "number of tuples {:d}", pvpmd.offset, pvpmd.number_of_tuples); MeshLib::IO::writePropertyVectorPartitionMetaData(out, pvpmd); offset += pvpmd.number_of_tuples; @@ -845,7 +846,7 @@ std::tuple<std::vector<long>, std::vector<long>> writeConfigDataBinary( std::ofstream of_bin_cfg(file_name_cfg, std::ios::binary); if (!of_bin_cfg) { - OGS_FATAL("Could not open file '%s' for output.", + OGS_FATAL("Could not open file '{:s}' for output.", file_name_cfg.c_str()); } @@ -929,7 +930,7 @@ void writeElementsBinary(std::string const& file_name_base, std::ofstream element_info_os(file_name_ele, std::ios::binary); if (!element_info_os) { - OGS_FATAL("Could not open file '%s' for output.", + OGS_FATAL("Could not open file '{:s}' for output.", file_name_ele.c_str()); } @@ -938,7 +939,7 @@ void writeElementsBinary(std::string const& file_name_base, std::ofstream ghost_element_info_os(file_name_ele_g, std::ios::binary); if (!ghost_element_info_os) { - OGS_FATAL("Could not open file '%s' for output.", + OGS_FATAL("Could not open file '{:s}' for output.", file_name_ele_g.c_str()); } @@ -997,7 +998,7 @@ void writeNodesBinary(const std::string& file_name_base, std::ofstream os(file_name, std::ios::binary); if (!os) { - OGS_FATAL("Could not open file '%s' for output.", file_name.c_str()); + OGS_FATAL("Could not open file '{:s}' for output.", file_name.c_str()); } for (const auto& partition : partitions) diff --git a/Applications/Utils/ModelPreparation/PartitionMesh/PartitionMesh.cpp b/Applications/Utils/ModelPreparation/PartitionMesh/PartitionMesh.cpp index 6a755caa1109cd69cb0d0b1aaf8525244da7c460..eab42b7cd7eb22b1acb9793c52f2d4a24b000fb4 100644 --- a/Applications/Utils/ModelPreparation/PartitionMesh/PartitionMesh.cpp +++ b/Applications/Utils/ModelPreparation/PartitionMesh/PartitionMesh.cpp @@ -95,7 +95,7 @@ int main(int argc, char* argv[]) BaseLib::dropFileExtension(mesh_input.getValue()); std::unique_ptr<MeshLib::Mesh> mesh_ptr( MeshLib::IO::readMeshFromFile(input_file_name_wo_extension + ".vtu")); - INFO("Mesh '%s' read: %d nodes, %d elements.", + INFO("Mesh '{:s}' read: {:d} nodes, {:d} elements.", mesh_ptr->getName().c_str(), mesh_ptr->getNumberOfNodes(), mesh_ptr->getNumberOfElements()); @@ -105,8 +105,8 @@ int main(int argc, char* argv[]) INFO("Write the mesh into METIS input file."); ApplicationUtils::writeMETIS(mesh_ptr->getElements(), input_file_name_wo_extension + ".mesh"); - INFO("Total runtime: %g s.", run_timer.elapsed()); - INFO("Total CPU time: %g s.", CPU_timer.elapsed()); + INFO("Total runtime: {:g} s.", run_timer.elapsed()); + INFO("Total CPU time: {:g} s.", CPU_timer.elapsed()); return EXIT_SUCCESS; } @@ -138,7 +138,7 @@ int main(int argc, char* argv[]) INFO("METIS is running ..."); const std::string exe_name = argv[0]; const std::string exe_path = BaseLib::extractPath(exe_name); - INFO("Path to mpmetis is: \n\t%s", exe_path.c_str()); + INFO("Path to mpmetis is: \n\t{:s}", exe_path.c_str()); const std::string mpmetis_com = BaseLib::joinPaths(exe_path, "mpmetis") + " -gtype=nodal " + "'" + @@ -149,7 +149,7 @@ int main(int argc, char* argv[]) if (status != 0) { INFO("Failed in system calling."); - INFO("Return value of system call %d ", status); + INFO("Return value of system call {:d} ", status); return EXIT_FAILURE; } } @@ -168,7 +168,7 @@ int main(int argc, char* argv[]) { std::unique_ptr<MeshLib::Mesh> mesh( MeshLib::IO::readMeshFromFile(filename)); - INFO("Mesh '%s' from file '%s' read: %d nodes, %d elements.", + INFO("Mesh '{:s}' from file '{:s}' read: {:d} nodes, {:d} elements.", mesh->getName().c_str(), filename.c_str(), mesh->getNumberOfNodes(), mesh->getNumberOfElements()); @@ -205,8 +205,8 @@ int main(int argc, char* argv[]) mesh_partitioner.writeBinary(output_file_name_wo_extension); } - INFO("Total runtime: %g s.", run_timer.elapsed()); - INFO("Total CPU time: %g s.", CPU_timer.elapsed()); + INFO("Total runtime: {:g} s.", run_timer.elapsed()); + INFO("Total CPU time: {:g} s.", CPU_timer.elapsed()); return EXIT_SUCCESS; } diff --git a/Applications/Utils/ModelPreparation/convertVtkDataArrayToVtkDataArray.cpp b/Applications/Utils/ModelPreparation/convertVtkDataArrayToVtkDataArray.cpp index 86f7babd067654b3075f231ac0ff8ed70b39f18f..3353c2838da9fcc9a6baf71af1bd4b2780fc1102 100644 --- a/Applications/Utils/ModelPreparation/convertVtkDataArrayToVtkDataArray.cpp +++ b/Applications/Utils/ModelPreparation/convertVtkDataArrayToVtkDataArray.cpp @@ -15,8 +15,6 @@ #include <tclap/CmdLine.h> -#include "Applications/ApplicationsLib/LogogSetup.h" - #include "InfoLib/GitInfo.h" #include "MeshLib/IO/readMeshFromFile.h" @@ -56,8 +54,6 @@ std::pair<bool, std::string> castPropertyVectorToPropertyVector( int main(int argc, char* argv[]) { - ApplicationsLib::LogogSetup logog_setup; - TCLAP::CmdLine cmd( "Converts a double or floating point cell data array of a vtk " "unstructured grid into a int or double cell data array.\n\n" @@ -156,7 +152,7 @@ int main(int argc, char* argv[]) if (!success) { - ERR("%s", err_msg.c_str()); + ERR("{:s}", err_msg.c_str()); return -1; } diff --git a/Applications/Utils/ModelPreparation/createNeumannBc.cpp b/Applications/Utils/ModelPreparation/createNeumannBc.cpp index 8fbc92b3bad2e213b5bfef704ea75efef68f5041..25a13b696448d5afec7a5f8dd5e92cad96f68b9c 100644 --- a/Applications/Utils/ModelPreparation/createNeumannBc.cpp +++ b/Applications/Utils/ModelPreparation/createNeumannBc.cpp @@ -40,7 +40,7 @@ std::vector<double> getSurfaceIntegratedValuesForNodes( if (!mesh.getProperties().existsPropertyVector<double>(prop_name)) { - ERR("Need element property, but the property '%s' is not " + ERR("Need element property, but the property '{:s}' is not " "available.", prop_name.c_str()); return std::vector<double>(); @@ -67,7 +67,7 @@ std::vector<double> getSurfaceIntegratedValuesForNodes( integrated_node_area_vec.push_back(integrated_node_area); } - INFO ("Total surface area: %g", total_area); + INFO("Total surface area: {:g}", total_area); return integrated_node_area_vec; } @@ -142,7 +142,7 @@ int main(int argc, char* argv[]) } catch (std::runtime_error const& e) { - WARN("%s", e.what()); + WARN("{:s}", e.what()); return nullptr; } }(); diff --git a/Applications/Utils/PostProcessing/postLIE.cpp b/Applications/Utils/PostProcessing/postLIE.cpp index 4c043b9ca31025d3125575c3930327e2c55fc740..0ec407a0333613903a3525fff1f941c62a307053 100644 --- a/Applications/Utils/PostProcessing/postLIE.cpp +++ b/Applications/Utils/PostProcessing/postLIE.cpp @@ -61,7 +61,7 @@ void postVTU(std::string const& int_vtu_filename, vec_junction_nodeID_matIDs); // create a new VTU file - INFO("create %s", out_vtu_filename.c_str()); + INFO("create {:s}", out_vtu_filename.c_str()); MeshLib::IO::writeMeshToFile(post.getOutputMesh(), out_vtu_filename); } @@ -70,7 +70,7 @@ void postPVD(std::string const& in_pvd_filename, { auto const in_pvd_file_dir = BaseLib::extractPath(in_pvd_filename); auto const out_pvd_file_dir = BaseLib::extractPath(out_pvd_filename); - INFO("start reading the PVD file %s", in_pvd_filename.c_str()); + INFO("start reading the PVD file {:s}", in_pvd_filename.c_str()); boost::property_tree::ptree pt; read_xml(in_pvd_filename, pt, boost::property_tree::xml_parser::trim_whitespace); @@ -94,7 +94,7 @@ void postPVD(std::string const& in_pvd_filename, } auto const org_vtu_filepath = BaseLib::joinPaths(org_vtu_dir, org_vtu_filebasename); - INFO("processing %s...", org_vtu_filepath.c_str()); + INFO("processing {:s}...", org_vtu_filepath.c_str()); // post-process the VTU and save into the new file auto const dest_vtu_filename = "post_" + org_vtu_filebasename; @@ -107,7 +107,7 @@ void postPVD(std::string const& in_pvd_filename, } // save into the new PVD file - INFO("save into the new PVD file %s", out_pvd_filename.c_str()); + INFO("save into the new PVD file {:s}", out_pvd_filename.c_str()); boost::property_tree::xml_writer_settings<std::string> settings('\t', 1); write_xml(out_pvd_filename, pt, std::locale(), settings); } @@ -148,7 +148,7 @@ int main(int argc, char* argv[]) } else { - OGS_FATAL("The given file type (%s) is not supported.", + OGS_FATAL("The given file type ({:s}) is not supported.", in_file_ext.c_str()); } diff --git a/Applications/Utils/SWMMConverter/SWMMConverter.cpp b/Applications/Utils/SWMMConverter/SWMMConverter.cpp index e6a3ff4270d5a81b020e54107586362736436ad3..8206650b0f466b32bf8d62213a6c09c347b88f5a 100644 --- a/Applications/Utils/SWMMConverter/SWMMConverter.cpp +++ b/Applications/Utils/SWMMConverter/SWMMConverter.cpp @@ -83,7 +83,7 @@ int writeMeshOutput(std::string const& input_file, std::string const extension = std::string("." + BaseLib::getFileExtension(output_file)); std::size_t const n_time_steps(swmm->getNumberOfTimeSteps()); - INFO("Number of simulation time steps: %d", n_time_steps); + INFO("Number of simulation time steps: {:d}", n_time_steps); for (std::size_t i = 0; i < n_time_steps; i++) { if (node_args) diff --git a/Applications/Utils/SimpleMeshCreation/generateStructuredMesh.cpp b/Applications/Utils/SimpleMeshCreation/generateStructuredMesh.cpp index e2dd122cbfe731f3acd97dc48b03640579ae25c1..0555896d03126b5e8f731eaf8446896c2a19b08c 100644 --- a/Applications/Utils/SimpleMeshCreation/generateStructuredMesh.cpp +++ b/Applications/Utils/SimpleMeshCreation/generateStructuredMesh.cpp @@ -165,7 +165,7 @@ int main (int argc, char* argv[]) { if (dim_used[i] && !vec_lengthArg[i]->isSet()) { - ERR("Missing input: Length for dimension [%d] is required but " + ERR("Missing input: Length for dimension [{:d}] is required but " "missing.", i); return EXIT_FAILURE; @@ -235,7 +235,8 @@ int main (int argc, char* argv[]) if (mesh) { - INFO("Mesh created: %d nodes, %d elements.", mesh->getNumberOfNodes(), mesh->getNumberOfElements()); + INFO("Mesh created: {:d} nodes, {:d} elements.", + mesh->getNumberOfNodes(), mesh->getNumberOfElements()); // write into a file MeshLib::IO::writeMeshToFile(*(mesh.get()), mesh_out.getValue()); diff --git a/BaseLib/Algorithm.h b/BaseLib/Algorithm.h index 84d867bc065dbc09075b779944ed32d1c10b94f5..66c82f8e3726473d9bd5387f2351e9b1c0ccccf3 100644 --- a/BaseLib/Algorithm.h +++ b/BaseLib/Algorithm.h @@ -72,7 +72,7 @@ typename std::iterator_traits<InputIt>::reference findElementOrError( auto it = std::find_if(begin, end, predicate); if (it == end) { - OGS_FATAL("Element not found in the input range; %s", error.c_str()); + OGS_FATAL("Element not found in the input range; {:s}", error.c_str()); } return *it; } @@ -91,7 +91,7 @@ void insertIfTypeIndexKeyUniqueElseError(Map& map, Key const& key, auto const inserted = map.emplace(key, std::forward<Value>(value)); if (!inserted.second) { // insertion failed, i.e., key already exists - OGS_FATAL("%s Key `%s' already exists.", error_message.c_str(), + OGS_FATAL("{:s} Key `{:s}' already exists.", error_message.c_str(), tostring(key.hash_code()).c_str()); } } @@ -108,7 +108,7 @@ void insertIfKeyUniqueElseError(Map& map, Key const& key, Value&& value, auto const inserted = map.emplace(key, std::forward<Value>(value)); if (!inserted.second) { // insertion failed, i.e., key already exists - OGS_FATAL("%s Key `%s' already exists.", error_message.c_str(), + OGS_FATAL("{:s} Key `{:s}' already exists.", error_message.c_str(), tostring(key).c_str()); } } @@ -127,14 +127,14 @@ void insertIfKeyValueUniqueElseError(Map& map, Key const& key, Value&& value, if (std::find_if(map.cbegin(), map.cend(), value_compare) != map.cend()) { - OGS_FATAL("%s Value `%s' already exists.", error_message.c_str(), + OGS_FATAL("{:s} Value `{:s}' already exists.", error_message.c_str(), tostring(value).c_str()); } auto const inserted = map.emplace(key, std::forward<Value>(value)); if (!inserted.second) { // insertion failed, i.e., key already exists - OGS_FATAL("%s Key `%s' already exists.", error_message.c_str(), + OGS_FATAL("{:s} Key `{:s}' already exists.", error_message.c_str(), tostring(key).c_str()); } } @@ -151,7 +151,7 @@ typename Map::mapped_type& getOrError(Map& map, Key const& key, auto it = map.find(key); if (it == map.end()) { - OGS_FATAL("%s Key `%s' does not exist.", error_message.c_str(), + OGS_FATAL("{:s} Key `{:s}' does not exist.", error_message.c_str(), tostring(key).c_str()); } @@ -165,7 +165,7 @@ typename Map::mapped_type const& getOrError(Map const& map, Key const& key, auto it = map.find(key); if (it == map.end()) { - OGS_FATAL("%s Key `%s' does not exist.", error_message.c_str(), + OGS_FATAL("{:s} Key `{:s}' does not exist.", error_message.c_str(), tostring(key).c_str()); } @@ -184,7 +184,7 @@ typename Container::value_type const& getIfOrError( auto it = std::find_if(begin(container), end(container), predicate); if (it == end(container)) { - OGS_FATAL("Could not find element matching the predicate: %s", + OGS_FATAL("Could not find element matching the predicate: {:s}", error_message.c_str()); } return *it; diff --git a/BaseLib/ConfigTree.cpp b/BaseLib/ConfigTree.cpp index a9216a3ddfd7711112f0e0dae6550fbb992ce5bd..a5c52150ca6c394095eb48f1ebd7d9fb8545bad2 100644 --- a/BaseLib/ConfigTree.cpp +++ b/BaseLib/ConfigTree.cpp @@ -85,7 +85,7 @@ ConfigTree::~ConfigTree() try { checkAndInvalidate(); } catch (std::exception& e) { - ERR("%s", e.what()); + ERR("{:s}", e.what()); configtree_destructor_error_messages.push_front(e.what()); } } @@ -232,15 +232,15 @@ void ConfigTree::warning(const std::string& message) const void ConfigTree::onerror(const std::string& filename, const std::string& path, const std::string& message) { - OGS_FATAL("ConfigTree: In file `%s' at path <%s>: %s", - filename.c_str(), path.c_str(), message.c_str()); + OGS_FATAL("ConfigTree: In file `{:s}' at path <{:s}>: {:s}", + filename.c_str(), path.c_str(), message.c_str()); } void ConfigTree::onwarning(const std::string& filename, const std::string& path, const std::string& message) { - WARN("ConfigTree: In file `%s' at path <%s>: %s", - filename.c_str(), path.c_str(), message.c_str()); + WARN("ConfigTree: In file `{:s}' at path <{:s}>: {:s}", filename.c_str(), + path.c_str(), message.c_str()); } void ConfigTree::assertNoSwallowedErrors() @@ -254,7 +254,7 @@ void ConfigTree::assertNoSwallowedErrors() "file(s):"); for (auto const& msg : configtree_destructor_error_messages) { - ERR("%s", msg.c_str()); + ERR("{:s}", msg.c_str()); } OGS_FATAL("There have been errors when parsing the configuration file(s)."); diff --git a/BaseLib/ConfigTreeUtil.cpp b/BaseLib/ConfigTreeUtil.cpp index de662d47203976984726f9a3c42125a8f636025a..3e41ee6fb251afb9978651c90a82789b5d60353e 100644 --- a/BaseLib/ConfigTreeUtil.cpp +++ b/BaseLib/ConfigTreeUtil.cpp @@ -63,17 +63,17 @@ makeConfigTree(const std::string& filepath, const bool be_ruthless, } catch (boost::property_tree::xml_parser_error const& e) { - OGS_FATAL("Error while parsing XML file `%s' at line %lu: %s.", + OGS_FATAL("Error while parsing XML file `{:s}' at line {:d}: {:s}.", e.filename().c_str(), e.line(), e.message().c_str()); } - DBUG("Project configuration from file '%s' read.", filepath.c_str()); + DBUG("Project configuration from file '{:s}' read.", filepath.c_str()); if (auto child = ptree.get_child_optional(toplevel_tag)) { return ConfigTreeTopLevel(filepath, be_ruthless, std::move(*child)); } - OGS_FATAL("Tag <%s> has not been found in file `%s'.", toplevel_tag.c_str(), - filepath.c_str()); + OGS_FATAL("Tag <{:s}> has not been found in file `{:s}'.", + toplevel_tag.c_str(), filepath.c_str()); } } // namespace BaseLib diff --git a/BaseLib/Error.h b/BaseLib/Error.h index cb27574300259d73cfe0124f77bdf8916065846a..c03c5b35ea68b821906d88dcdf84835a2699ac46 100644 --- a/BaseLib/Error.h +++ b/BaseLib/Error.h @@ -23,7 +23,7 @@ template <typename Msg> [[noreturn]] bool error_impl(Msg&& msg) { - ERR("%s", msg.data()); + ERR("{:s}", msg.data()); std::abort(); } diff --git a/BaseLib/FileTools.cpp b/BaseLib/FileTools.cpp index 835635b1996cf87d95a03b0448701a3696450bbd..3f881e8c30291d5dc82bf7542e4e2afa64a95bf5 100644 --- a/BaseLib/FileTools.cpp +++ b/BaseLib/FileTools.cpp @@ -228,7 +228,7 @@ void removeFiles(std::vector<std::string> const& files) int const success = std::remove(file.c_str()); if (success == 0) { - DBUG("Removed '%s'", file.c_str()); + DBUG("Removed '{:s}'", file.c_str()); } else { @@ -236,7 +236,7 @@ void removeFiles(std::vector<std::string> const& files) { continue; } - ERR("Removing file '%s' failed with error %d.", file.c_str(), + ERR("Removing file '{:s}' failed with error {:d}.", file.c_str(), errno); std::perror("Error: "); OGS_FATAL("Unrecoverable error happened while removing a file."); diff --git a/BaseLib/FileTools.h b/BaseLib/FileTools.h index cc5b9246fbc7177ae5849c626f3d1ac961e828b3..008d40ac399bea5ba45ba7486f7ba1a77e0e66d4 100644 --- a/BaseLib/FileTools.h +++ b/BaseLib/FileTools.h @@ -75,9 +75,9 @@ std::vector<T> readBinaryArray(std::string const& filename, std::size_t const n) { std::ifstream in(filename.c_str()); if (!in) { - ERR("readBinaryArray(): Error while reading from file '%s'.", + ERR("readBinaryArray(): Error while reading from file '{:s}'.", filename.c_str()); - ERR("Could not open file '%s' for input.", filename.c_str()); + ERR("Could not open file '{:s}' for input.", filename.c_str()); in.close(); return std::vector<T>(); } @@ -95,9 +95,11 @@ std::vector<T> readBinaryArray(std::string const& filename, std::size_t const n) return result; } - ERR("readBinaryArray(): Error while reading from file '%s'.", + ERR("readBinaryArray(): Error while reading from file '{:s}'.", filename.c_str()); - ERR("Read different number of values. Expected %d, got %d.", n, result.size()); + ERR("Read different number of values. Expected {:d}, got {:d}.", + n, + result.size()); if (!in.eof()) ERR("EOF reached.\n"); diff --git a/BaseLib/IO/Writer.cpp b/BaseLib/IO/Writer.cpp index 6e52e7774736944942a36a3dc2ab6ec538faf864..bd597a1e367d965623c0ad331da98ddcec48d436 100644 --- a/BaseLib/IO/Writer.cpp +++ b/BaseLib/IO/Writer.cpp @@ -54,7 +54,7 @@ int Writer::writeToFile(std::string const& filename) // check file stream if (!fileStream) { - ERR("Could not open file '%s'!", filename.c_str()); + ERR("Could not open file '{:s}'!", filename.c_str()); return 0; } diff --git a/BaseLib/IO/XmlIO/Qt/XMLQtInterface.cpp b/BaseLib/IO/XmlIO/Qt/XMLQtInterface.cpp index 428fb142e1bdfe6daab60dd276e878cad3c1ba99..f9b4a3b10fff958fcd5f6260736fb52de225f1a6 100644 --- a/BaseLib/IO/XmlIO/Qt/XMLQtInterface.cpp +++ b/BaseLib/IO/XmlIO/Qt/XMLQtInterface.cpp @@ -13,8 +13,6 @@ #include "XMLQtInterface.h" -#include <fstream> - #include <QByteArray> #include <QCoreApplication> #include <QCryptographicHash> @@ -23,9 +21,10 @@ #include <QXmlSchema> #include <QXmlSchemaValidator> #include <QXmlStreamReader> - +#include <fstream> #include <utility> -#include "Logging.h" + +#include "BaseLib/Logging.h" namespace BaseLib { @@ -41,7 +40,8 @@ int XMLQtInterface::readFile(const QString &fileName) QFile file(fileName); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { - ERR("XMLQtInterface::readFile(): Can't open xml-file %s.", fileName.toStdString().c_str()); + ERR("XMLQtInterface::readFile(): Can't open xml-file {:s}.", + fileName.toStdString().c_str()); return 0; } _fileData = file.readAll(); @@ -73,8 +73,8 @@ int XMLQtInterface::isValid() const } INFO( - "XMLQtInterface::isValid(): XML file %s is invalid (in reference " - "to schema %s).", + "XMLQtInterface::isValid(): XML file {:s} is invalid (in reference " + "to schema {:s}).", _fileName.toStdString().c_str(), _schemaFile.toStdString().c_str()); } else @@ -88,7 +88,7 @@ int XMLQtInterface::isValid() const } INFO( - "XMLQtInterface::isValid(): XML file %s is invalid (in reference " + "XMLQtInterface::isValid(): XML file {:s} is invalid (in reference " "to its schema).", _fileName.toStdString().c_str()); } diff --git a/BaseLib/Subdivision.cpp b/BaseLib/Subdivision.cpp index 7fb36ee5ba58739f7a988d8b35b2a9986cbbfa34..22284ee49441981db9c09de6ea5d83a8476afb1a 100644 --- a/BaseLib/Subdivision.cpp +++ b/BaseLib/Subdivision.cpp @@ -27,8 +27,8 @@ GradualSubdivision::GradualSubdivision(const double L, // Cf. geometric series formula. if (multiplier < 1.0 && dL0 / (1.0 - multiplier) < L) { OGS_FATAL( - "Using dL0=%g and multiplier=%g the generated subdivisions can not " - "sum up to a total length of %g.", + "Using dL0={:g} and multiplier={:g} the generated subdivisions can " + "not sum up to a total length of {:g}.", dL0, multiplier, L); diff --git a/ChemistryLib/CreateChemicalSolverInterface.cpp b/ChemistryLib/CreateChemicalSolverInterface.cpp index 8259f50d7e2185626eb5105b515093f9a5ef6ced..9203c2dc38c75e5556b333ef28e94e7da0467232 100644 --- a/ChemistryLib/CreateChemicalSolverInterface.cpp +++ b/ChemistryLib/CreateChemicalSolverInterface.cpp @@ -48,11 +48,11 @@ std::string parseDatabasePath(BaseLib::ConfigTree const& config) if (!BaseLib::IsFileExisting(path_to_database)) { - OGS_FATAL("Not found the specified thermodynamicdatabase: %s", + OGS_FATAL("Not found the specified thermodynamicdatabase: {:s}", path_to_database.c_str()); } - INFO("Found the specified thermodynamic database: %s", + INFO("Found the specified thermodynamic database: {:s}", path_to_database.c_str()); return path_to_database; @@ -83,7 +83,8 @@ createChemicalSolverInterface<ChemicalSolver::Phreeqc>( "Required mesh with name '" + mesh_name + "' not found."); assert(mesh.getID() != 0); - DBUG("Found mesh '%s' with id %d.", mesh.getName().c_str(), mesh.getID()); + DBUG("Found mesh '{:s}' with id {:d}.", mesh.getName().c_str(), + mesh.getID()); auto path_to_database = parseDatabasePath(config); diff --git a/ChemistryLib/PhreeqcIO.cpp b/ChemistryLib/PhreeqcIO.cpp index 4c9c9198b6139b1e7846bc63ef72e45650605e09..5473595034705b4acda0c0a5ab7621f8daf66c79 100644 --- a/ChemistryLib/PhreeqcIO.cpp +++ b/ChemistryLib/PhreeqcIO.cpp @@ -84,14 +84,14 @@ PhreeqcIO::PhreeqcIO(std::string const project_file_name, { OGS_FATAL( "Failed in loading the specified thermodynamic database file: " - "%s.", + "{:s}.", _database.c_str()); } if (SetSelectedOutputFileOn(phreeqc_instance_id, 1) != IPQ_OK) { OGS_FATAL( - "Failed to fly the flag for the specified file %s where phreeqc " + "Failed to fly the flag for the specified file {:s} where phreeqc " "will write output.", _output->basic_output_setups.output_file.c_str()); } @@ -229,7 +229,8 @@ void PhreeqcIO::setAqueousSolutionsPrevFromDumpFile() std::ifstream in(dump_file); if (!in) { - OGS_FATAL("Could not open phreeqc dump file '%s'.", dump_file.c_str()); + OGS_FATAL("Could not open phreeqc dump file '{:s}'.", + dump_file.c_str()); } std::size_t const num_chemical_systems = _mesh.getNumberOfBaseNodes(); @@ -237,7 +238,7 @@ void PhreeqcIO::setAqueousSolutionsPrevFromDumpFile() if (!in) { - OGS_FATAL("Error when reading phreeqc dump file '%s'", + OGS_FATAL("Error when reading phreeqc dump file '{:s}'", dump_file.c_str()); } @@ -246,12 +247,13 @@ void PhreeqcIO::setAqueousSolutionsPrevFromDumpFile() void PhreeqcIO::writeInputsToFile(double const dt) { - DBUG("Writing phreeqc inputs into file '%s'.", _phreeqc_input_file.c_str()); + DBUG("Writing phreeqc inputs into file '{:s}'.", + _phreeqc_input_file.c_str()); std::ofstream out(_phreeqc_input_file, std::ofstream::out); if (!out) { - OGS_FATAL("Could not open file '%s' for writing phreeqc inputs.", + OGS_FATAL("Could not open file '{:s}' for writing phreeqc inputs.", _phreeqc_input_file.c_str()); } @@ -259,7 +261,7 @@ void PhreeqcIO::writeInputsToFile(double const dt) if (!out) { - OGS_FATAL("Failed in generating phreeqc input file '%s'.", + OGS_FATAL("Failed in generating phreeqc input file '{:s}'.", _phreeqc_input_file.c_str()); } @@ -373,7 +375,7 @@ void PhreeqcIO::execute() OutputErrorString(phreeqc_instance_id); OGS_FATAL( "Failed in performing speciation calculation with the generated " - "phreeqc input file '%s'.", + "phreeqc input file '{:s}'.", _phreeqc_input_file.c_str()); } } @@ -382,13 +384,13 @@ void PhreeqcIO::readOutputsFromFile() { auto const& basic_output_setups = _output->basic_output_setups; auto const& phreeqc_result_file = basic_output_setups.output_file; - DBUG("Reading phreeqc results from file '%s'.", + DBUG("Reading phreeqc results from file '{:s}'.", phreeqc_result_file.c_str()); std::ifstream in(phreeqc_result_file); if (!in) { - OGS_FATAL("Could not open phreeqc result file '%s'.", + OGS_FATAL("Could not open phreeqc result file '{:s}'.", phreeqc_result_file.c_str()); } @@ -396,7 +398,7 @@ void PhreeqcIO::readOutputsFromFile() if (!in) { - OGS_FATAL("Error when reading phreeqc result file '%s'", + OGS_FATAL("Error when reading phreeqc result file '{:s}'", phreeqc_result_file.c_str()); } @@ -436,7 +438,7 @@ std::istream& operator>>(std::istream& in, PhreeqcIO& phreeqc_io) if (!std::getline(in, line)) { OGS_FATAL( - "Error when reading calculation result of Solution %u after " + "Error when reading calculation result of Solution {:d} after " "the reaction.", global_id); } @@ -460,17 +462,20 @@ std::istream& operator>>(std::istream& in, PhreeqcIO& phreeqc_io) catch (const std::invalid_argument& e) { OGS_FATAL( - "Invalid argument. Could not convert string '%s' to " - "double for chemical system %d, column %d. Exception " - "'%s' was thrown.", + "Invalid argument. Could not convert string '{:s}' to " + "double for chemical system {:d}, column {:d}. " + "Exception " + "'{:s}' was thrown.", items[item_id].c_str(), global_id, item_id, e.what()); } catch (const std::out_of_range& e) { OGS_FATAL( - "Out of range error. Could not convert string '%s' to " - "double for chemical system %d, column %d. Exception " - "'%s' was thrown.", + "Out of range error. Could not convert string '{:s}' " + "to " + "double for chemical system {:d}, column {:d}. " + "Exception " + "'{:s}' was thrown.", items[item_id].c_str(), global_id, item_id, e.what()); } accepted_items.push_back(value); diff --git a/ChemistryLib/PhreeqcIOData/CreateSolutionComponent.cpp b/ChemistryLib/PhreeqcIOData/CreateSolutionComponent.cpp index 2801451193bf136b8fd5a1a54871fc0a4cbecd00..45b01d8e8696403e887ee6c5ef9e3e9022db3832 100644 --- a/ChemistryLib/PhreeqcIOData/CreateSolutionComponent.cpp +++ b/ChemistryLib/PhreeqcIOData/CreateSolutionComponent.cpp @@ -46,7 +46,8 @@ std::vector<Component> createSolutionComponents( process_id_to_component_name_map.end()) { OGS_FATAL( - "Component %s given in <solution>/<components> is not found in " + "Component {:s} given in <solution>/<components> is not found " + "in " "specified coupled processes (see " "<process>/<process_variables>/<concentration>).", component.name.c_str()); diff --git a/ChemistryLib/PhreeqcKernel.cpp b/ChemistryLib/PhreeqcKernel.cpp index fe545e63c62beb48670d67f9d316b2051721dc3e..5648119467f8249c8a0d51fab6026b9d8bb4351d 100644 --- a/ChemistryLib/PhreeqcKernel.cpp +++ b/ChemistryLib/PhreeqcKernel.cpp @@ -131,7 +131,7 @@ void PhreeqcKernel::loadDatabase(std::string const& database) std::ifstream in(database); if (!in) { - OGS_FATAL("Unable to open database file '%s'.", database.c_str()); + OGS_FATAL("Unable to open database file '{:s}'.", database.c_str()); } assert(phrq_io->get_istream() == nullptr); phrq_io->push_istream(&in, false); @@ -153,7 +153,7 @@ void PhreeqcKernel::reinitializeRates() malloc(sizeof(char) * reaction_rate.commands().size() + 1)); if (rates[rate_id].commands == nullptr) { - OGS_FATAL("Could not allocate memory for rate[%d] commands.", + OGS_FATAL("Could not allocate memory for rate[{:d}] commands.", rate_id); } reaction_rate.commands().copy(rates[rate_id].commands, diff --git a/ChemistryLib/PhreeqcKernelData/CreateInitialAqueousSolution.cpp b/ChemistryLib/PhreeqcKernelData/CreateInitialAqueousSolution.cpp index 8aa8d3e0778d96ac33ef1e3f91edf7d41cf96bd6..2afda65161f70ec86d64835f59065dee85c9f6aa 100644 --- a/ChemistryLib/PhreeqcKernelData/CreateInitialAqueousSolution.cpp +++ b/ChemistryLib/PhreeqcKernelData/CreateInitialAqueousSolution.cpp @@ -49,7 +49,8 @@ InitialAqueousSolution createInitialAqueousSolution( process_id_to_component_name_map.end()) { OGS_FATAL( - "Component %s given in <solution>/<components> is not found in " + "Component {:s} given in <solution>/<components> is not found " + "in " "specified coupled processes (see " "<process>/<process_variables>/<concentration>).", component.first.c_str()); diff --git a/GeoLib/AnalyticalGeometry.cpp b/GeoLib/AnalyticalGeometry.cpp index 623d0913e03f0476686d72cc8f805b4a36f8cccb..51d13a3740753eda8887c344c716b7d9d96eec5a 100644 --- a/GeoLib/AnalyticalGeometry.cpp +++ b/GeoLib/AnalyticalGeometry.cpp @@ -440,7 +440,7 @@ std::vector<MathLib::Point3d> lineSegmentIntersect2d( err.precision(std::numeric_limits<double>::digits10); err << ab << " x " << cd; OGS_FATAL( - "The case of parallel line segments (%s) is not handled yet. " + "The case of parallel line segments ({:s}) is not handled yet. " "Aborting.", err.str().c_str()); } @@ -468,7 +468,7 @@ std::vector<MathLib::Point3d> lineSegmentIntersect2d( err.precision(std::numeric_limits<double>::digits10); err << ab << " x " << cd; OGS_FATAL( - "The case of parallel line segments (%s) " + "The case of parallel line segments ({:s}) " "is not handled yet. Aborting.", err.str().c_str()); } diff --git a/GeoLib/DuplicateGeometry.cpp b/GeoLib/DuplicateGeometry.cpp index 43d1de8a5246495854f137b6e66fbdf79f4e10a1..85e1fd7db0450fdf914dd25efa8a53f19119b54f 100644 --- a/GeoLib/DuplicateGeometry.cpp +++ b/GeoLib/DuplicateGeometry.cpp @@ -35,7 +35,7 @@ void DuplicateGeometry::duplicate(std::string const& input_name) std::vector<GeoLib::Point*> const*const pnts (_geo_objects.getPointVec(input_name)); if (pnts == nullptr) { - ERR("Geometry '%s' not found.", input_name.c_str()); + ERR("Geometry '{:s}' not found.", input_name.c_str()); return; } diff --git a/GeoLib/GEOObjects.cpp b/GeoLib/GEOObjects.cpp index 25f16641438b449feeb29c06804a47f0f68ba6f7..b9dc4335b3128f0b9dfc929f96ebcf3e6dbfda3c 100644 --- a/GeoLib/GEOObjects.cpp +++ b/GeoLib/GEOObjects.cpp @@ -68,7 +68,7 @@ const std::vector<Point*>* GEOObjects::getPointVec(const std::string &name) cons return _pnt_vecs[idx]->getVector(); } - DBUG("GEOObjects::getPointVec() - No entry found with name '%s'.", + DBUG("GEOObjects::getPointVec() - No entry found with name '{:s}'.", name.c_str()); return nullptr; } @@ -81,7 +81,7 @@ const PointVec* GEOObjects::getPointVecObj(const std::string &name) const return _pnt_vecs[idx]; } - DBUG("GEOObjects::getPointVecObj() - No entry found with name '%s'.", + DBUG("GEOObjects::getPointVecObj() - No entry found with name '{:s}'.", name.c_str()); return nullptr; } @@ -104,7 +104,7 @@ bool GEOObjects::removePointVec(std::string const& name) return true; } } - DBUG("GEOObjects::removePointVec() - No entry found with name '%s'.", + DBUG("GEOObjects::removePointVec() - No entry found with name '{:s}'.", name.c_str()); return false; } @@ -129,7 +129,7 @@ const std::vector<GeoLib::Point*>* GEOObjects::getStationVec( { return (*it)->getVector(); } - DBUG("GEOObjects::getStationVec() - No entry found with name '%s'.", + DBUG("GEOObjects::getStationVec() - No entry found with name '{:s}'.", name.c_str()); return nullptr; } @@ -205,7 +205,7 @@ const std::vector<Polyline*>* GEOObjects::getPolylineVec(const std::string &name } } - DBUG("GEOObjects::getPolylineVec() - No entry found with name '%s'.", + DBUG("GEOObjects::getPolylineVec() - No entry found with name '{:s}'.", name.c_str()); return nullptr; } @@ -221,7 +221,7 @@ const PolylineVec* GEOObjects::getPolylineVecObj(const std::string &name) const } } - DBUG("GEOObjects::getPolylineVecObj() - No entry found with name '%s'.", + DBUG("GEOObjects::getPolylineVecObj() - No entry found with name '{:s}'.", name.c_str()); return nullptr; } @@ -239,7 +239,7 @@ bool GEOObjects::removePolylineVec(std::string const& name) } } - DBUG("GEOObjects::removePolylineVec() - No entry found with name '%s'.", + DBUG("GEOObjects::removePolylineVec() - No entry found with name '{:s}'.", name.c_str()); return false; } @@ -300,7 +300,7 @@ const std::vector<Surface*>* GEOObjects::getSurfaceVec(const std::string &name) return _sfc_vecs[i]->getVector(); } } - DBUG("GEOObjects::getSurfaceVec() - No entry found with name '%s'.", + DBUG("GEOObjects::getSurfaceVec() - No entry found with name '{:s}'.", name.c_str()); return nullptr; } @@ -318,7 +318,7 @@ bool GEOObjects::removeSurfaceVec(const std::string &name) } } - DBUG("GEOObjects::removeSurfaceVec() - No entry found with name '%s'.", + DBUG("GEOObjects::removeSurfaceVec() - No entry found with name '{:s}'.", name.c_str()); return false; } @@ -333,7 +333,7 @@ const SurfaceVec* GEOObjects::getSurfaceVecObj(const std::string &name) const return _sfc_vecs[i]; } } - DBUG("GEOObjects::getSurfaceVecObj() - No entry found with name '%s'.", + DBUG("GEOObjects::getSurfaceVecObj() - No entry found with name '{:s}'.", name.c_str()); return nullptr; } @@ -667,13 +667,13 @@ int GEOObjects::geoPointsToStations(std::string const& geo_name, GeoLib::PointVec const* const pnt_obj(getPointVecObj(geo_name)); if (pnt_obj == nullptr) { - ERR("Point vector %s not found.", geo_name.c_str()); + ERR("Point vector {:s} not found.", geo_name.c_str()); return -1; } std::vector<GeoLib::Point*> const& pnts = *pnt_obj->getVector(); if (pnts.empty()) { - ERR("Point vector %s is empty.", geo_name.c_str()); + ERR("Point vector {:s} is empty.", geo_name.c_str()); return -1; } std::size_t const n_pnts(pnts.size()); @@ -752,9 +752,11 @@ const GeoLib::GeoObject* GEOObjects::getGeoObject( }; if (!geo_obj) { - DBUG("GEOObjects::getGeoObject(): Could not find %s '%s' in geometry.", - GeoLib::convertGeoTypeToString(type).c_str(), - geo_obj_name.c_str()); + DBUG( + "GEOObjects::getGeoObject(): Could not find {:s} '{:s}' in " + "geometry.", + GeoLib::convertGeoTypeToString(type).c_str(), + geo_obj_name.c_str()); } return geo_obj; } @@ -780,8 +782,10 @@ GeoLib::GeoObject const* GEOObjects::getGeoObject( } if (!geo_obj) { - DBUG("GEOObjects::getGeoObject(): Could not find '%s' in geometry %s.", - geo_obj_name.c_str(), geo_name.c_str()); + DBUG( + "GEOObjects::getGeoObject(): Could not find '{:s}' in geometry " + "{:s}.", + geo_obj_name.c_str(), geo_name.c_str()); } return geo_obj; } diff --git a/GeoLib/Grid.h b/GeoLib/Grid.h index cac765a59194df76bd5c78ea612f8fd6fc88a9c3..8266d9efcae0f4c3fc5301249722b02bba6c6dc3 100644 --- a/GeoLib/Grid.h +++ b/GeoLib/Grid.h @@ -225,9 +225,10 @@ Grid<POINT>::Grid(InputIterator first, InputIterator last, std::size_t const pos(coords[0]+coords[1]*_n_steps[0]+coords[2]*n_plane); _grid_cell_nodes_map[pos].push_back(const_cast<POINT*>(copyOrAddress(*it))); } else { - ERR("Grid constructor: error computing indices [%d, %d, %d], " - "max indices [%d, %d, %d].", coords[0], coords[1], coords[2], - _n_steps[0], _n_steps[1], _n_steps[2]); + ERR("Grid constructor: error computing indices [{:d}, {:d}, {:d}], " + "max indices [{:d}, {:d}, {:d}].", + coords[0], coords[1], coords[2], _n_steps[0], _n_steps[1], + _n_steps[2]); } it++; } diff --git a/GeoLib/IO/TINInterface.cpp b/GeoLib/IO/TINInterface.cpp index 4fa8cd926577f2bb5fc81ef555e90759055a8cc4..5b109b3f7277dbff392a1aa335440e073c8a2752 100644 --- a/GeoLib/IO/TINInterface.cpp +++ b/GeoLib/IO/TINInterface.cpp @@ -34,7 +34,7 @@ GeoLib::Surface* TINInterface::readTIN(std::string const& fname, // open file std::ifstream in(fname.c_str()); if (!in) { - WARN("readTIN(): could not open stream from %s.", fname.c_str()); + WARN("readTIN(): could not open stream from {:s}.", fname.c_str()); if (errors) { errors->push_back("readTINFile error opening stream from " + fname); @@ -66,7 +66,7 @@ GeoLib::Surface* TINInterface::readTIN(std::string const& fname, } // read first point if (!(input >> p0[0] >> p0[1] >> p0[2])) { - ERR("Could not read coords of 1st point of triangle %d.", id); + ERR("Could not read coords of 1st point of triangle {:d}.", id); if (errors) { errors->push_back( @@ -81,7 +81,7 @@ GeoLib::Surface* TINInterface::readTIN(std::string const& fname, } // read second point if (!(input >> p1[0] >> p1[1] >> p1[2])) { - ERR("Could not read coords of 2nd point of triangle %d.", id); + ERR("Could not read coords of 2nd point of triangle {:d}.", id); if (errors) { errors->push_back( @@ -96,7 +96,7 @@ GeoLib::Surface* TINInterface::readTIN(std::string const& fname, } // read third point if (!(input >> p2[0] >> p2[1] >> p2[2])) { - ERR("Could not read coords of 3rd point of triangle %d.", id); + ERR("Could not read coords of 3rd point of triangle {:d}.", id); if (errors) { errors->push_back( @@ -113,7 +113,7 @@ GeoLib::Surface* TINInterface::readTIN(std::string const& fname, // check area of triangle double const d_eps(std::numeric_limits<double>::epsilon()); if (MathLib::calcTriangleArea(p0, p1, p2) < d_eps) { - ERR("readTIN: Triangle %d has zero area.", id); + ERR("readTIN: Triangle {:d} has zero area.", id); if (errors) { errors->push_back(std::string("readTIN: Triangle ") + @@ -156,7 +156,8 @@ void TINInterface::writeSurfaceAsTIN(GeoLib::Surface const& surface, std::string { std::ofstream os (file_name.c_str()); if (!os) { - WARN("writeSurfaceAsTIN(): could not open stream to %s.", file_name.c_str()); + WARN("writeSurfaceAsTIN(): could not open stream to {:s}.", + file_name.c_str()); return; } os.precision(std::numeric_limits<double>::digits10); diff --git a/GeoLib/IO/XmlIO/Boost/BoostXmlGmlInterface.cpp b/GeoLib/IO/XmlIO/Boost/BoostXmlGmlInterface.cpp index d029a6bd1ea5295bc3716a98e25d30ff6fa3fa35..b035188374e928f9f847943c0c5c8ba3975b64ba 100644 --- a/GeoLib/IO/XmlIO/Boost/BoostXmlGmlInterface.cpp +++ b/GeoLib/IO/XmlIO/Boost/BoostXmlGmlInterface.cpp @@ -169,7 +169,7 @@ void BoostXmlGmlInterface::readPolylines( if (search == _idx_map.end()) { OGS_FATAL( - "Polyline `%s' contains the point id `%d', but the " + "Polyline `{:s}' contains the point id `{:d}', but the " "id is not in the point list.", p_name->c_str(), pt_idx); } @@ -231,8 +231,9 @@ void BoostXmlGmlInterface::readSurfaces( if (search == _idx_map.end()) { OGS_FATAL( - "The element list of the surface `%s' contains the " - "invalid point id `%d'.", + "The element list of the surface `{:s}' contains " + "the " + "invalid point id `{:d}'.", s_name->c_str(), pt_idx); } return search->second; @@ -262,7 +263,7 @@ bool BoostXmlGmlInterface::write() GeoLib::PointVec const*const pnt_vec(_geo_objects.getPointVecObj(_exportName)); if (! pnt_vec) { ERR("BoostXmlGmlInterface::write(): No PointVec within the geometry " - "'%s'.", + "'{:s}'.", _exportName.c_str()); return false; } @@ -270,13 +271,13 @@ bool BoostXmlGmlInterface::write() std::vector<GeoLib::Point*> const*const pnts(pnt_vec->getVector()); if (! pnts) { ERR("BoostXmlGmlInterface::write(): No vector of points within the " - "geometry '%s'.", + "geometry '{:s}'.", _exportName.c_str()); return false; } if (pnts->empty()) { ERR("BoostXmlGmlInterface::write(): No points within the geometry " - "'%s'.", + "'{:s}'.", _exportName.c_str()); return false; } @@ -320,7 +321,7 @@ void BoostXmlGmlInterface::addSurfacesToPropertyTree( if (!sfc_vec) { INFO( "BoostXmlGmlInterface::addSurfacesToPropertyTree(): " - "No surfaces within the geometry '%s'.", + "No surfaces within the geometry '{:s}'.", _exportName.c_str()); return; } @@ -330,7 +331,7 @@ void BoostXmlGmlInterface::addSurfacesToPropertyTree( { INFO( "BoostXmlGmlInterface::addSurfacesToPropertyTree(): " - "No surfaces within the geometry '%s'.", + "No surfaces within the geometry '{:s}'.", _exportName.c_str()); return; } @@ -362,7 +363,7 @@ void BoostXmlGmlInterface::addPolylinesToPropertyTree( if (!vec) { INFO( "BoostXmlGmlInterface::addPolylinesToPropertyTree(): " - "No polylines within the geometry '%s'.", + "No polylines within the geometry '{:s}'.", _exportName.c_str()); return; } @@ -372,7 +373,7 @@ void BoostXmlGmlInterface::addPolylinesToPropertyTree( { INFO( "BoostXmlGmlInterface::addPolylinesToPropertyTree(): " - "No polylines within the geometry '%s'.", + "No polylines within the geometry '{:s}'.", _exportName.c_str()); return; } diff --git a/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp b/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp index d29004cecd6a76a0abd6d953d797fc02c94d31bd..aff68e29f5a7d7299c4510f1065692eef7977bbb 100644 --- a/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp +++ b/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp @@ -229,7 +229,7 @@ void XmlGmlInterface::readPolylines( ply_names->insert(std::pair<std::string, std::size_t>(ply_name, idx)); } else { WARN( - "Polyline '%s' exists already. Polyline %d will be " + "Polyline '{:s}' exists already. Polyline {:d} will be " "inserted without a name.", ply_name.c_str(), idx); } @@ -248,7 +248,7 @@ void XmlGmlInterface::readPolylines( polyline.attribute("name").toStdString(); } OGS_FATAL( - "Polyline `%s' contains the point id `%d' which is " + "Polyline `{:s}' contains the point id `{:d}' which is " "not in the point list.", polyline_name.c_str(), pt_idx); } @@ -295,7 +295,7 @@ void XmlGmlInterface::readSurfaces( surface_name = surface.attribute("name").toStdString(); } OGS_FATAL( - "Surface `%s' contains the point id `%d', which is " + "Surface `{:s}' contains the point id `{:d}', which is " "not in the point list.", surface_name.c_str(), pt_idx); } diff --git a/GeoLib/IO/XmlIO/Qt/XmlStnInterface.cpp b/GeoLib/IO/XmlIO/Qt/XmlStnInterface.cpp index 95d7d6a666b066b6ed4d3b1d190fabcb70378fda..bb8a33f9d517c6dc037a43af2be27027d060091c 100644 --- a/GeoLib/IO/XmlIO/Qt/XmlStnInterface.cpp +++ b/GeoLib/IO/XmlIO/Qt/XmlStnInterface.cpp @@ -217,8 +217,8 @@ void XmlStnInterface::readStratigraphy( const QDomNode &stratRoot, } else WARN( - "XmlStnInterface::readStratigraphy(): Skipped layer '%s' " - "in borehole '%s' because of thickness 0.0.", + "XmlStnInterface::readStratigraphy(): Skipped layer '{:s}' " + "in borehole '{:s}' because of thickness 0.0.", horizonName.c_str(), borehole->getName().c_str()); } else diff --git a/GeoLib/PointVec.cpp b/GeoLib/PointVec.cpp index 8da015a35f4ed8c57483f4dbe3bba593462f909e..f1292ff47f25aeef2ac1409b1d0cce91f60391c1 100644 --- a/GeoLib/PointVec.cpp +++ b/GeoLib/PointVec.cpp @@ -111,7 +111,7 @@ PointVec::PointVec( } if (number_of_all_input_pnts > _data_vec->size()) - WARN("PointVec::PointVec(): there are %d double points.", + WARN("PointVec::PointVec(): there are {:d} double points.", number_of_all_input_pnts - _data_vec->size()); correctNameIDMapping(); @@ -149,7 +149,7 @@ void PointVec::push_back(Point* pnt, std::string const* const name) if (it != _name_id_map->end()) { _id_to_name_map.emplace_back(""); - WARN("PointVec::push_back(): two points share the name %s.", + WARN("PointVec::push_back(): two points share the name {:s}.", name->c_str()); return; } diff --git a/GeoLib/Polyline.cpp b/GeoLib/Polyline.cpp index e73302642fa089d72063cabaf0f27347aab348a7..f8976916064158a6ed4aed9eec6d435519f4e146 100644 --- a/GeoLib/Polyline.cpp +++ b/GeoLib/Polyline.cpp @@ -230,7 +230,10 @@ bool Polyline::isCoplanar() const { if (!MathLib::isCoplanar(p0, p1, p2, *this->getPoint(i))) { - DBUG ("Point %d is not coplanar to the first three points of the line.", i); + DBUG( + "Point {:d} is not coplanar to the first three points of the " + "line.", + i); return false; } } @@ -590,7 +593,7 @@ bool containsEdge (const Polyline& ply, std::size_t id0, std::size_t id1) { if (id0 == id1) { - ERR("no valid edge id0 == id1 == %d.", id0); + ERR("no valid edge id0 == id1 == {:d}.", id0); return false; } if (id0 > id1) diff --git a/GeoLib/QuadTree.h b/GeoLib/QuadTree.h index d844c9da33a0b17e3f15395d29dd47c3c1ef9820..0ae7fda4190074631b4275d562f984044ad5d5be 100644 --- a/GeoLib/QuadTree.h +++ b/GeoLib/QuadTree.h @@ -75,7 +75,16 @@ public: _ur[0] = _ll[0] + _ur[1] - _ll[1]; } - DBUG("QuadTree(): lower left: (%f,%f,%f), upper right: (%f,%f,%f), depth: %d", _ll[0], _ll[1], _ll[2], _ur[0], _ur[1], _ur[2], _depth); + DBUG( + "QuadTree(): lower left: ({:f},{:f},{:f}), upper right: " + "({:f},{:f},{:f}), depth: {:d}", + _ll[0], + _ll[1], + _ll[2], + _ur[0], + _ur[1], + _ur[2], + _depth); } /** diff --git a/GeoLib/SensorData.cpp b/GeoLib/SensorData.cpp index da1c08843a953bd7df8ba7d3d0d1f244b99a3987..e254f5cf21f1675406b1a097ea640281882191ee 100644 --- a/GeoLib/SensorData.cpp +++ b/GeoLib/SensorData.cpp @@ -85,7 +85,7 @@ const std::vector<float>* SensorData::getTimeSeries(SensorDataType time_series_n return _data_vecs[i]; } } - ERR("Error in SensorData::getTimeSeries() - Time series '{s}' not found.", + ERR("Error in SensorData::getTimeSeries() - Time series '{:s}' not found.", convertSensorDataType2String(time_series_name)); return nullptr; } @@ -96,7 +96,8 @@ int SensorData::readDataFromFile(const std::string &file_name) if (!in.is_open()) { - INFO("SensorData::readDataFromFile() - Could not open file %s.", file_name.c_str()); + INFO("SensorData::readDataFromFile() - Could not open file {:s}.", + file_name.c_str()); return 0; } diff --git a/GeoLib/SurfaceGrid.cpp b/GeoLib/SurfaceGrid.cpp index 60347d3a651d7810c6b4e05262c94a7f971d3b56..2118db1e9fc49c1decf3d87326304533bacf017b 100644 --- a/GeoLib/SurfaceGrid.cpp +++ b/GeoLib/SurfaceGrid.cpp @@ -127,10 +127,11 @@ void SurfaceGrid::sortTrianglesInGridCells(Surface const*const sfc) Point const& p0(*((*sfc)[l]->getPoint(0))); Point const& p1(*((*sfc)[l]->getPoint(1))); Point const& p2(*((*sfc)[l]->getPoint(2))); - ERR("Sorting triangle %d [(%f,%f,%f), (%f,%f,%f), (%f,%f,%f) into " + ERR("Sorting triangle {:d} [({:f},{:f},{:f}), ({:f},{:f},{:f}), " + "({:f},{:f},{:f}) into " "grid.", - l, p0[0], p0[1], p0[2], p1[0], p1[1], p1[2], p2[0], p2[1], p2[2] - ); + l, p0[0], p0[1], p0[2], p1[0], p1[1], p1[2], p2[0], p2[1], + p2[2]); OGS_FATAL(""); } } @@ -190,8 +191,11 @@ SurfaceGrid::getGridCellCoordinates(MathLib::Point3d const& p) const }}; if (coords[0]>=_n_steps[0] || coords[1]>=_n_steps[1] || coords[2]>=_n_steps[2]) { - DBUG("Computed indices (%d,%d,%d), max grid cell indices (%d,%d,%d)", - coords[0], coords[1], coords[2], _n_steps[0], _n_steps[1], _n_steps[2]); + DBUG( + "Computed indices ({:d},{:d},{:d}), max grid cell indices " + "({:d},{:d},{:d})", + coords[0], coords[1], coords[2], _n_steps[0], _n_steps[1], + _n_steps[2]); return boost::optional<std::array<std::size_t, 3>>(); } return boost::optional<std::array<std::size_t, 3>>(coords); diff --git a/GeoLib/TemplateVec.h b/GeoLib/TemplateVec.h index 85c894010317995b6c1df58fcb0a246fdcf42465..0d29410f17ebbca6fa6f91772296a83e2815e590 100644 --- a/GeoLib/TemplateVec.h +++ b/GeoLib/TemplateVec.h @@ -204,7 +204,7 @@ public: _name_id_map->insert(NameIdPair(*name, _data_vec->size() - 1)); } else { WARN( - "Name '%s' exists already. The object will be inserted " + "Name '{:s}' exists already. The object will be inserted " "without a name", name->c_str()); } diff --git a/MaterialLib/Adsorption/Adsorption.cpp b/MaterialLib/Adsorption/Adsorption.cpp index 49381c0914f6da8f61d583791bed53c54f503b82..c7769841885bda55fe36b922c0eb586b4498bbf6 100644 --- a/MaterialLib/Adsorption/Adsorption.cpp +++ b/MaterialLib/Adsorption/Adsorption.cpp @@ -126,7 +126,8 @@ double AdsorptionReaction::getEntropy(const double T_Ads, const double A) const if (W_p <= 0.0 || W_m <= 0.0) { - ERR("characteristic curve in negative region (W-, W+): %g, %g", W_m, W_p); + ERR("characteristic curve in negative region (W-, W+): {:g}, {:g}", W_m, + W_p); return 0.0; } diff --git a/MaterialLib/Adsorption/Reaction.cpp b/MaterialLib/Adsorption/Reaction.cpp index 80e587bfd23a566c43e6599efef69831e9515f26..3ee1739c8923327ef78927950a4f6f92c18c4f66 100644 --- a/MaterialLib/Adsorption/Reaction.cpp +++ b/MaterialLib/Adsorption/Reaction.cpp @@ -82,7 +82,7 @@ newInstance(BaseLib::ConfigTree const& conf) return std::make_unique<ReactionCaOH2>(conf); } - OGS_FATAL("Unknown reactive system: %s.", type.c_str()); + OGS_FATAL("Unknown reactive system: {:s}.", type.c_str()); return nullptr; } diff --git a/MaterialLib/Fluid/Density/CreateFluidDensityModel.cpp b/MaterialLib/Fluid/Density/CreateFluidDensityModel.cpp index 762b09c196f710a32413f4218dcde539e31d462f..8d52f12c675d26322b62c8a75fbf5f53d99069df 100644 --- a/MaterialLib/Fluid/Density/CreateFluidDensityModel.cpp +++ b/MaterialLib/Fluid/Density/CreateFluidDensityModel.cpp @@ -168,7 +168,7 @@ std::unique_ptr<FluidProperty> createFluidDensityModel( } OGS_FATAL( - "The density type %s is unavailable.\n" + "The density type {:s} is unavailable.\n" "The available types are: \n\tConstant, \n\tLiquidDensity, " "\n\tTemperatureDependent, \n\tIdealGasLaw." "\n\tWaterDensityIAPWSIF97Region1\n", diff --git a/MaterialLib/Fluid/SpecificHeatCapacity/CreateSpecificFluidHeatCapacityModel.cpp b/MaterialLib/Fluid/SpecificHeatCapacity/CreateSpecificFluidHeatCapacityModel.cpp index 355a0fbeb982e54c72be2ce3cd0cfca205388211..289a011c9f8f610e466e48fdda9066ff9ee899f5 100644 --- a/MaterialLib/Fluid/SpecificHeatCapacity/CreateSpecificFluidHeatCapacityModel.cpp +++ b/MaterialLib/Fluid/SpecificHeatCapacity/CreateSpecificFluidHeatCapacityModel.cpp @@ -37,7 +37,7 @@ std::unique_ptr<FluidProperty> createSpecificFluidHeatCapacityModel( // TODO: add more models OGS_FATAL( - "The specific heat capacity type %s is unavailable.\n" + "The specific heat capacity type {:s} is unavailable.\n" "The available type is \n\tConstant\n", type.data()); } diff --git a/MaterialLib/Fluid/ThermalConductivity/CreateFluidThermalConductivityModel.cpp b/MaterialLib/Fluid/ThermalConductivity/CreateFluidThermalConductivityModel.cpp index 4dbb1d33dd4c83384618e28460d77546a7b24b70..55a4e4c9ba99cb78e55c22a4578314fed9ac3e84 100644 --- a/MaterialLib/Fluid/ThermalConductivity/CreateFluidThermalConductivityModel.cpp +++ b/MaterialLib/Fluid/ThermalConductivity/CreateFluidThermalConductivityModel.cpp @@ -37,7 +37,7 @@ std::unique_ptr<FluidProperty> createFluidThermalConductivityModel( // TODO: add more models OGS_FATAL( - "The viscosity type %s is unavailable.\n" + "The viscosity type {:s} is unavailable.\n" "The available type is \n\tConstant\n", type.data()); } diff --git a/MaterialLib/Fluid/Viscosity/CreateViscosityModel.cpp b/MaterialLib/Fluid/Viscosity/CreateViscosityModel.cpp index 9cfd71b9305b00118096d46b3a5805ae4d9b6768..7e1e1f916233356c5bb9ba163e3f3b44d4467ada 100644 --- a/MaterialLib/Fluid/Viscosity/CreateViscosityModel.cpp +++ b/MaterialLib/Fluid/Viscosity/CreateViscosityModel.cpp @@ -131,7 +131,7 @@ std::unique_ptr<FluidProperty> createViscosityModel( } OGS_FATAL( - "The fluid type %s for Vogels model is unavailable.\n" + "The fluid type {:s} for Vogels model is unavailable.\n" "The available fluid types are Water, CO2 and CH4\n", fluid_type.data()); } @@ -143,7 +143,7 @@ std::unique_ptr<FluidProperty> createViscosityModel( } OGS_FATAL( - "The viscosity type %s is unavailable.\n" + "The viscosity type {:s} is unavailable.\n" "The available types are \n\tConstant, \n\tLinearPressure " "\n\tTemperatureDependent, \n\tVogels\n", type.data()); diff --git a/MaterialLib/FractureModels/Coulomb.cpp b/MaterialLib/FractureModels/Coulomb.cpp index 4db3b9e11f1db9f7e23703b8058d784b1627abf3..8b91ff246d5495ca5f88cf22cd4eddd314ae3214 100644 --- a/MaterialLib/FractureModels/Coulomb.cpp +++ b/MaterialLib/FractureModels/Coulomb.cpp @@ -171,7 +171,7 @@ void Coulomb<DisplacementDim>::computeConstitutiveRelation( auto const update_solution = [&](ResidualVectorType const& increment) { solution += increment; - /*DBUG("analytical = %g", + /*DBUG("analytical = {:g}", Fs / (mat.Ks + mat.Kn * std::tan(mat.psi) * std::tan(mat.phi))) */ state.w_p = state.w_p_prev + diff --git a/MaterialLib/FractureModels/Permeability/CreateConstantPermeability.cpp b/MaterialLib/FractureModels/Permeability/CreateConstantPermeability.cpp index 31232955fea89f6fec9aacbbf68550d4878da608..50482028aa8407751920de673cf00ce1722078dd 100644 --- a/MaterialLib/FractureModels/Permeability/CreateConstantPermeability.cpp +++ b/MaterialLib/FractureModels/Permeability/CreateConstantPermeability.cpp @@ -28,7 +28,8 @@ std::unique_ptr<Permeability> createConstantPermeability( if (permeability < 0) { OGS_FATAL( - "The permeability parameter must be non-negative. Given value %g.", + "The permeability parameter must be non-negative. Given value " + "{:g}.", permeability); } diff --git a/MaterialLib/FractureModels/Permeability/CreatePermeabilityModel.cpp b/MaterialLib/FractureModels/Permeability/CreatePermeabilityModel.cpp index 0f5d5daae9cdf684001894e97f9aa37298f7f030..55b26532630a442f831f8871c9812c8aba63e6a0 100644 --- a/MaterialLib/FractureModels/Permeability/CreatePermeabilityModel.cpp +++ b/MaterialLib/FractureModels/Permeability/CreatePermeabilityModel.cpp @@ -32,7 +32,7 @@ std::unique_ptr<Permeability> createPermeabilityModel( { return MaterialLib::Fracture::Permeability::createCubicLaw(config); } - OGS_FATAL("Unknown fracture permeability model type \"%s\".", + OGS_FATAL("Unknown fracture permeability model type \"{:s}\".", permeability_model_type.c_str()); } } // namespace MaterialLib::Fracture::Permeability diff --git a/MaterialLib/MPL/Component.h b/MaterialLib/MPL/Component.h index 05aaca3c6dd6505e50595ad40946c3f4018bb363..3305b0facb836dd08f31d503a7b537d46ad6a712 100644 --- a/MaterialLib/MPL/Component.h +++ b/MaterialLib/MPL/Component.h @@ -93,7 +93,7 @@ void checkRequiredProperties(Component const& c, { if (!c.hasProperty(p)) { - OGS_FATAL("The property '%s' is missing in the component '%s'.", + OGS_FATAL("The property '{:s}' is missing in the component '{:s}'.", property_enum_to_string[p].c_str(), c.name.c_str()); } } diff --git a/MaterialLib/MPL/CreateComponent.cpp b/MaterialLib/MPL/CreateComponent.cpp index 1014b57be6503f36023d40eaeb27e2db7530f195..e41d46f8db6ccc2963c9f2b58e101ab38c2c6231 100644 --- a/MaterialLib/MPL/CreateComponent.cpp +++ b/MaterialLib/MPL/CreateComponent.cpp @@ -97,8 +97,9 @@ std::vector<std::unique_ptr<Component>> createComponents( return c->name == component_name; }) != components.end()) { - OGS_FATAL("Found duplicates with the same component name tag '%s'.", - component->name.c_str()); + OGS_FATAL( + "Found duplicates with the same component name tag '{:s}'.", + component->name.c_str()); } components.push_back(std::move(component)); diff --git a/MaterialLib/MPL/CreateMaterialSpatialDistributionMap.cpp b/MaterialLib/MPL/CreateMaterialSpatialDistributionMap.cpp index f4e31dc2700a401330c00cc47ec8a0f76bedc792..15e2b79efdfe83bb89614502270ed981a020f3bd 100644 --- a/MaterialLib/MPL/CreateMaterialSpatialDistributionMap.cpp +++ b/MaterialLib/MPL/CreateMaterialSpatialDistributionMap.cpp @@ -29,17 +29,19 @@ createMaterialSpatialDistributionMap( if (max_material_id > static_cast<int>(media.size() - 1)) { WARN( - "The maximum value of MaterialIDs in mesh is %d. As the given " - "number of porous media definitions in the project file is %d, the " - "maximum value of MaterialIDs in mesh must be %d (index starts " + "The maximum value of MaterialIDs in mesh is {:d}. As the given " + "number of porous media definitions in the project file is {:d}, " + "the " + "maximum value of MaterialIDs in mesh must be {:d} (index starts " "with zero).", max_material_id, media.size(), max_material_id - 1); } if (max_material_id < static_cast<int>(media.size() - 1)) WARN( - "There are %d porous medium definitions in the project file but " - "only %d different values in the MaterialIDs vector/data_array in " + "There are {:d} porous medium definitions in the project file but " + "only {:d} different values in the MaterialIDs vector/data_array " + "in " "the mesh.", media.size(), max_material_id - 1); diff --git a/MaterialLib/MPL/CreatePhase.cpp b/MaterialLib/MPL/CreatePhase.cpp index 234d85f1bea70d4948c4a45abd773e29f1a55ec5..2cb89190c327b2eba33d858b125bf1de98036553 100644 --- a/MaterialLib/MPL/CreatePhase.cpp +++ b/MaterialLib/MPL/CreatePhase.cpp @@ -56,7 +56,7 @@ std::unique_ptr<MaterialPropertyLib::Phase> createPhase( { ERR(type.c_str()); } - OGS_FATAL("Wrong phase type '%s' given.", phase_type.c_str()); + OGS_FATAL("Wrong phase type '{:s}' given.", phase_type.c_str()); } // Parsing of optional components. @@ -75,7 +75,7 @@ std::unique_ptr<MaterialPropertyLib::Phase> createPhase( { OGS_FATAL( "Neither tag <components> nor tag <properties> has been set for " - "the phase '%s'.", + "the phase '{:s}'.", phase_type.c_str()); } @@ -114,7 +114,7 @@ std::vector<std::unique_ptr<Phase>> createPhases( return p->name == phase_name; }) != phases.end()) { - OGS_FATAL("Found duplicates with the same phase name tag '%s'.", + OGS_FATAL("Found duplicates with the same phase name tag '{:s}'.", phase->name.c_str()); } diff --git a/MaterialLib/MPL/CreateProperty.cpp b/MaterialLib/MPL/CreateProperty.cpp index 90d7d0b978b1efece4d9bf0a141df5397ec87670..85458e860943babf28e7f02147d1385bd448506d 100644 --- a/MaterialLib/MPL/CreateProperty.cpp +++ b/MaterialLib/MPL/CreateProperty.cpp @@ -135,7 +135,7 @@ std::unique_ptr<MaterialPropertyLib::Property> createProperty( } // If none of the above property types are found, OGS throws an error. - OGS_FATAL("The specified component property type '%s' was not recognized", + OGS_FATAL("The specified component property type '{:s}' was not recognized", property_type.c_str()); } } // namespace diff --git a/MaterialLib/MPL/MaterialSpatialDistributionMap.cpp b/MaterialLib/MPL/MaterialSpatialDistributionMap.cpp index f44b07644ffa1589b7385b71a05f0e1c63dd5049..7f122ceb1babdc3e4785edfa9fb61857cbf1e4b6 100644 --- a/MaterialLib/MPL/MaterialSpatialDistributionMap.cpp +++ b/MaterialLib/MPL/MaterialSpatialDistributionMap.cpp @@ -38,9 +38,9 @@ void MaterialSpatialDistributionMap::checkElementHasMedium(std::size_t const ele if (_media.find(material_id) == _media.end()) { OGS_FATAL( - "There is no medium definition for element %d with material " - "ID %d. Please define a medium for each material.", - element_id, material_id); + "There is no medium definition for element {:d} with material " + "ID {:d}. Please define a medium for each material.", + element_id, material_id); } } diff --git a/MaterialLib/MPL/Medium.h b/MaterialLib/MPL/Medium.h index f3defca3d60a1098ac4f41445d47637fd14c6681..58355279ce2745a34c47d51cd9e4bf001e207fd6 100644 --- a/MaterialLib/MPL/Medium.h +++ b/MaterialLib/MPL/Medium.h @@ -97,8 +97,9 @@ void checkRequiredProperties(Medium const& medium, { if (!medium.hasProperty(p)) { - OGS_FATAL("The property '%s' is missing in the medium definition.", - property_enum_to_string[p].c_str()); + OGS_FATAL( + "The property '{:s}' is missing in the medium definition.", + property_enum_to_string[p].c_str()); } } } diff --git a/MaterialLib/MPL/Phase.h b/MaterialLib/MPL/Phase.h index 140c42f672236258213da6d02551d5969985033c..feba1546d5f1579ae3342f0ab28d49a661933a80 100644 --- a/MaterialLib/MPL/Phase.h +++ b/MaterialLib/MPL/Phase.h @@ -72,7 +72,7 @@ void checkRequiredProperties(Phase const& phase, Container const& required_prope { if (!phase.hasProperty(p)) { - OGS_FATAL("The property '%s' is missing in the %s phase.", + OGS_FATAL("The property '{:s}' is missing in the {:s} phase.", property_enum_to_string[p].c_str(), phase.name.c_str()); } } diff --git a/MaterialLib/MPL/Properties/CapillaryPressureSaturation/SaturationVanGenuchten.cpp b/MaterialLib/MPL/Properties/CapillaryPressureSaturation/SaturationVanGenuchten.cpp index e4e01bb5891a272b6cbf51c2b9be973ba2512163..4a2e23f8c8b12f3b2e85758e20b373916df5c5e6 100644 --- a/MaterialLib/MPL/Properties/CapillaryPressureSaturation/SaturationVanGenuchten.cpp +++ b/MaterialLib/MPL/Properties/CapillaryPressureSaturation/SaturationVanGenuchten.cpp @@ -30,7 +30,7 @@ SaturationVanGenuchten::SaturationVanGenuchten( if (!(_m > 0 && _m < 1)) { OGS_FATAL( - "The exponent value m = %g of van Genuchten saturation model, is " + "The exponent value m = {:g} of van Genuchten saturation model, is " "out of its range of (0, 1)", _m); } diff --git a/MaterialLib/MPL/Properties/CreateCurveProperty.cpp b/MaterialLib/MPL/Properties/CreateCurveProperty.cpp index c22dbafa9d4942b9b1be7861bc15700122b311a0..337a22fba0a75980d279f142a1f6963a4ffad7f4 100644 --- a/MaterialLib/MPL/Properties/CreateCurveProperty.cpp +++ b/MaterialLib/MPL/Properties/CreateCurveProperty.cpp @@ -30,7 +30,7 @@ std::unique_ptr<CurveProperty> createCurveProperty( //! \ogs_file_param{properties__property__Curve__curve} auto curve_name = config.getConfigParameter<std::string>("curve"); - DBUG("Using curve '%s'", curve_name.c_str()); + DBUG("Using curve '{:s}'", curve_name.c_str()); auto const& curve = *BaseLib::getOrError(curves, curve_name, "Could not find curve."); @@ -38,7 +38,7 @@ std::unique_ptr<CurveProperty> createCurveProperty( auto const independent_variable_string = //! \ogs_file_param{properties__property__Curve__independent_variable} config.getConfigParameter<std::string>("independent_variable"); - DBUG("Using independent_variable '%s'", + DBUG("Using independent_variable '{:s}'", independent_variable_string.c_str()); auto const independent_variable = MaterialPropertyLib::convertStringToVariable( diff --git a/MaterialLib/MPL/Properties/CreatePermeabilityOrthotropicPowerLaw.cpp b/MaterialLib/MPL/Properties/CreatePermeabilityOrthotropicPowerLaw.cpp index 092d9b4f8b111ca26ee094e8758db6e090ad7736..9bd132b8b170672e36f6c4d53270b4f23cf3bd3f 100644 --- a/MaterialLib/MPL/Properties/CreatePermeabilityOrthotropicPowerLaw.cpp +++ b/MaterialLib/MPL/Properties/CreatePermeabilityOrthotropicPowerLaw.cpp @@ -31,7 +31,7 @@ std::unique_ptr<Property> createPermeabilityOrthotropicPowerLaw( { OGS_FATAL( "The number of intrinsic permeabilities must be two or three, but " - "%d were given.", + "{:d} were given.", intrinsic_permeabilities.size()); } @@ -42,7 +42,8 @@ std::unique_ptr<Property> createPermeabilityOrthotropicPowerLaw( if (exponents.size() != 3 && exponents.size() != 2) { OGS_FATAL( - "The number of exponents must be two or three, but %d were given.", + "The number of exponents must be two or three, but {:d} were " + "given.", exponents.size()); } @@ -50,7 +51,7 @@ std::unique_ptr<Property> createPermeabilityOrthotropicPowerLaw( { OGS_FATAL( "The number of intrinsic permeabilities and exponents must be " - "equal, but they are %d and %d, respectively.", + "equal, but they are {:d} and {:d}, respectively.", intrinsic_permeabilities.size(), exponents.size()); } diff --git a/MaterialLib/MPL/Properties/CreateSaturationDependentSwelling.cpp b/MaterialLib/MPL/Properties/CreateSaturationDependentSwelling.cpp index d5395a5fa4475d3eaf4236daf2a7e2075e4293bb..f0226ae89bc61bdbb1495537f25a67bb57c5606f 100644 --- a/MaterialLib/MPL/Properties/CreateSaturationDependentSwelling.cpp +++ b/MaterialLib/MPL/Properties/CreateSaturationDependentSwelling.cpp @@ -28,7 +28,7 @@ std::unique_ptr<SaturationDependentSwelling> createSaturationDependentSwelling( if (swelling_pressures.size() != 3) { OGS_FATAL( - "The number of swelling pressures must be three, but %d were " + "The number of swelling pressures must be three, but {:d} were " "given.", swelling_pressures.size()); } @@ -39,7 +39,7 @@ std::unique_ptr<SaturationDependentSwelling> createSaturationDependentSwelling( if (exponents.size() != 3) { - OGS_FATAL("The number of exponents must be three, but %d were given.", + OGS_FATAL("The number of exponents must be three, but {:d} were given.", exponents.size()); } @@ -47,7 +47,7 @@ std::unique_ptr<SaturationDependentSwelling> createSaturationDependentSwelling( { OGS_FATAL( "The number of swelling pressures and exponents must be equal, but " - "they are %d and %d, respectively.", + "they are {:d} and {:d}, respectively.", swelling_pressures.size(), exponents.size()); } diff --git a/MaterialLib/MPL/Properties/PermeabilityOrthotropicPowerLaw.cpp b/MaterialLib/MPL/Properties/PermeabilityOrthotropicPowerLaw.cpp index 21cf8c38c4bdc5eb7ad1cfe00c29cf091c8059a1..25abb24255c9c96767b57d092f6bd6ae7576fe11 100644 --- a/MaterialLib/MPL/Properties/PermeabilityOrthotropicPowerLaw.cpp +++ b/MaterialLib/MPL/Properties/PermeabilityOrthotropicPowerLaw.cpp @@ -42,7 +42,7 @@ void PermeabilityOrthotropicPowerLaw<DisplacementDim>::setScale( { OGS_FATAL( "The property 'PermeabilityOrthotropicPowerLaw' must be " - "given in the 'Solid' phase, not in '%s' phase.", + "given in the 'Solid' phase, not in '{:s}' phase.", _phase->name.c_str()); } } diff --git a/MaterialLib/MPL/Properties/PorosityFromMassBalance.cpp b/MaterialLib/MPL/Properties/PorosityFromMassBalance.cpp index d6889fdb435ca955389b7fc283cd06c4f65f4d44..4b7a31d83247b7d54afffa1440fcd8622f4c41a1 100644 --- a/MaterialLib/MPL/Properties/PorosityFromMassBalance.cpp +++ b/MaterialLib/MPL/Properties/PorosityFromMassBalance.cpp @@ -26,7 +26,7 @@ void PorosityFromMassBalance::setScale( { OGS_FATAL( "The property 'PorosityFromMassBalance' must be " - "given in the 'Solid' phase, not in '%s' phase.", + "given in the 'Solid' phase, not in '{:s}' phase.", _phase->name.c_str()); } } diff --git a/MaterialLib/MPL/Properties/RelativePermeability/RelPermVanGenuchten.cpp b/MaterialLib/MPL/Properties/RelativePermeability/RelPermVanGenuchten.cpp index 9161df966dca9a829273878c37f8c080766835b5..7cc97329c940c8737a4d33a2cd7ea5050ff19478 100644 --- a/MaterialLib/MPL/Properties/RelativePermeability/RelPermVanGenuchten.cpp +++ b/MaterialLib/MPL/Properties/RelativePermeability/RelPermVanGenuchten.cpp @@ -30,8 +30,8 @@ RelPermVanGenuchten::RelPermVanGenuchten( if (!(_m > 0 && _m < 1)) { OGS_FATAL( - "The exponent value m = %g of van Genuchten relative permeability " - "model, is out of its range of (0, 1)", + "The exponent value m = {:g} of van Genuchten relative " + "permeability model, is out of its range of (0, 1)", _m); } } diff --git a/MaterialLib/MPL/Properties/SaturationDependentSwelling.cpp b/MaterialLib/MPL/Properties/SaturationDependentSwelling.cpp index a36343200f8da5ade7b581aaa822cd2117af4615..3c89e83b674c606e32381f7418cd5d307bee631c 100644 --- a/MaterialLib/MPL/Properties/SaturationDependentSwelling.cpp +++ b/MaterialLib/MPL/Properties/SaturationDependentSwelling.cpp @@ -42,7 +42,7 @@ void SaturationDependentSwelling::setScale( { OGS_FATAL( "The property 'SaturationDependentSwelling' must be " - "given in the 'Solid' phase, not in '%s' phase.", + "given in the 'Solid' phase, not in '{:s}' phase.", _phase->name.c_str()); } } diff --git a/MaterialLib/MPL/Properties/TransportPorosityFromMassBalance.cpp b/MaterialLib/MPL/Properties/TransportPorosityFromMassBalance.cpp index e15ee0ae0c12022b82ab31f3986ef598fda7c77b..25e06ce87cc20c00cf7466fd8640aaaf100e4642 100644 --- a/MaterialLib/MPL/Properties/TransportPorosityFromMassBalance.cpp +++ b/MaterialLib/MPL/Properties/TransportPorosityFromMassBalance.cpp @@ -26,7 +26,7 @@ void TransportPorosityFromMassBalance::setScale( { OGS_FATAL( "The property 'TransportPorosityFromMassBalance' must be " - "given in the 'Solid' phase, not in '%s' phase.", + "given in the 'Solid' phase, not in '{:s}' phase.", _phase->name.c_str()); } } diff --git a/MaterialLib/MPL/Property.cpp b/MaterialLib/MPL/Property.cpp index 6e4e1aa9e16d6a7987ee641e4ffff3855820827f..829814d516f89b3ecd8a013cebd40b061cfe6a1e 100644 --- a/MaterialLib/MPL/Property.cpp +++ b/MaterialLib/MPL/Property.cpp @@ -51,7 +51,7 @@ PropertyDataType fromVector(std::vector<double> const& values) default: { OGS_FATAL( - "Conversion of a %d-vector to PropertyDataType is not " + "Conversion of a {:d}-vector to PropertyDataType is not " "implemented.", values.size()); } diff --git a/MaterialLib/MPL/PropertyType.h b/MaterialLib/MPL/PropertyType.h index 61daf950eea0a54ab3c28905680cded1b63222d8..3b44b4c59182101648139173558e2d6c67cd09a0 100644 --- a/MaterialLib/MPL/PropertyType.h +++ b/MaterialLib/MPL/PropertyType.h @@ -270,7 +270,7 @@ inline PropertyType convertStringToProperty(std::string const& inString) } OGS_FATAL( - "The property name '%s' does not correspond to any known property", + "The property name '{:s}' does not correspond to any known property", inString.c_str()); return PropertyType::number_of_properties; // to avoid the 'no return' diff --git a/MaterialLib/MPL/Utils/FormEigenTensor.cpp b/MaterialLib/MPL/Utils/FormEigenTensor.cpp index 1628825b1284568de6019581c6dae0e46cc69c5d..4d90d3314994cdacc3db76a85e2f3b02de213ea4 100644 --- a/MaterialLib/MPL/Utils/FormEigenTensor.cpp +++ b/MaterialLib/MPL/Utils/FormEigenTensor.cpp @@ -31,7 +31,7 @@ struct FormEigenTensor { return values.asDiagonal(); } - OGS_FATAL("Cannot convert 2d vector to %dx%d diagonal matrix.", + OGS_FATAL("Cannot convert 2d vector to {:d}x{:d} diagonal matrix.", GlobalDim, GlobalDim); } @@ -42,7 +42,7 @@ struct FormEigenTensor { return values.asDiagonal(); } - OGS_FATAL("Cannot convert 3d vector to %dx%d diagonal matrix.", + OGS_FATAL("Cannot convert 3d vector to {:d}x{:d} diagonal matrix.", GlobalDim, GlobalDim); } @@ -52,7 +52,7 @@ struct FormEigenTensor if constexpr (GlobalDim == 2) { return values; } - OGS_FATAL("Cannot convert a 2d tensor to %dx%d matrix", GlobalDim, + OGS_FATAL("Cannot convert a 2d tensor to {:d}x{:d} matrix", GlobalDim, GlobalDim); } Eigen::Matrix<double, GlobalDim, GlobalDim> operator()( @@ -61,7 +61,7 @@ struct FormEigenTensor if constexpr (GlobalDim == 3) { return values; } - OGS_FATAL("Cannot convert a 3d tensor to %dx%d matrix", GlobalDim, + OGS_FATAL("Cannot convert a 3d tensor to {:d}x{:d} matrix", GlobalDim, GlobalDim); } @@ -92,7 +92,7 @@ struct FormEigenTensor return result; } - OGS_FATAL("Cannot convert a symmetric 3d tensor to %dx%d matrix", + OGS_FATAL("Cannot convert a symmetric 3d tensor to {:d}x{:d} matrix", GlobalDim); } }; diff --git a/MaterialLib/MPL/VariableType.cpp b/MaterialLib/MPL/VariableType.cpp index 4b048981c0330f04b179cca8f1336e43fdc52ebe..a93a464ef6cacef0e914769466186237ab4b0d43 100644 --- a/MaterialLib/MPL/VariableType.cpp +++ b/MaterialLib/MPL/VariableType.cpp @@ -46,7 +46,7 @@ Variable convertStringToVariable(std::string const& input) } OGS_FATAL( - "The variable name '%s' does not correspond to any known variable", + "The variable name '{:s}' does not correspond to any known variable", input.c_str()); return Variable::number_of_variables; // to avoid the 'no return' warning diff --git a/MaterialLib/PorousMedium/CreatePorousMediaProperties.cpp b/MaterialLib/PorousMedium/CreatePorousMediaProperties.cpp index bfbe3030d795ea9051e4f636e9fc182b939df2dc..2bbf1a2075654e8784b6f17f6fd2b46857c85cfc 100644 --- a/MaterialLib/PorousMedium/CreatePorousMediaProperties.cpp +++ b/MaterialLib/PorousMedium/CreatePorousMediaProperties.cpp @@ -84,17 +84,19 @@ PorousMediaProperties createPorousMediaProperties( if (max_material_id > static_cast<int>(mat_ids.size() - 1)) { OGS_FATAL( - "The maximum value of MaterialIDs in mesh is %d. As the " + "The maximum value of MaterialIDs in mesh is {:d}. As the " "given number of porous media definitions in the project " - "file is %d, the maximum value of MaterialIDs in mesh must be %d " + "file is {:d}, the maximum value of MaterialIDs in mesh must be " + "{:d} " "(index starts with zero).", max_material_id, mat_ids.size(), max_material_id - 1); } if (max_material_id < static_cast<int>(mat_ids.size() - 1)) WARN( - "There are %d porous medium definitions in the project file but " - "only %d different values in the MaterialIDs vector/data_array in " + "There are {:d} porous medium definitions in the project file but " + "only {:d} different values in the MaterialIDs vector/data_array " + "in " "the mesh.", mat_ids.size(), max_material_id - 1); diff --git a/MaterialLib/PorousMedium/Permeability/Permeability.h b/MaterialLib/PorousMedium/Permeability/Permeability.h index e3275f332d275edbfc35a30972ba7bbd7963c972..612e89bcd0928162ab74eee14cd22e9da62e4613 100644 --- a/MaterialLib/PorousMedium/Permeability/Permeability.h +++ b/MaterialLib/PorousMedium/Permeability/Permeability.h @@ -33,8 +33,8 @@ public: _dimension * _dimension) { OGS_FATAL( - "The given parameter has %d components, but the permeability " - "tensor is defined for a %d dimensional problem.", + "The given parameter has {:d} components, but the permeability " + "tensor is defined for a {:d} dimensional problem.", permeability_parameter.getNumberOfComponents(), _dimension); } } diff --git a/MaterialLib/PorousMedium/Permeability/createPermeabilityModel.cpp b/MaterialLib/PorousMedium/Permeability/createPermeabilityModel.cpp index 229570dfe709fbea377fee6ab575c85c78e89a92..88e116358651136c83e387ec2c06f0fb8fee598c 100644 --- a/MaterialLib/PorousMedium/Permeability/createPermeabilityModel.cpp +++ b/MaterialLib/PorousMedium/Permeability/createPermeabilityModel.cpp @@ -48,8 +48,8 @@ std::unique_ptr<Permeability> createPermeabilityModel( dimension * dimension) { OGS_FATAL( - "The given parameter has %d components, but the permeability " - "tensor is defined for a %d dimensional problem.", + "The given parameter has {:d} components, but the permeability " + "tensor is defined for a {:d} dimensional problem.", permeability_parameter.getNumberOfComponents(), dimension); } @@ -71,15 +71,15 @@ std::unique_ptr<Permeability> createPermeabilityModel( dimension * dimension) { OGS_FATAL( - "The given parameter has %d components, but the permeability " - "tensor is defined for a %d dimensional problem.", + "The given parameter has {:d} components, but the permeability " + "tensor is defined for a {:d} dimensional problem.", permeability_parameter.getNumberOfComponents(), dimension); } return std::make_unique<DupuitPermeability>(permeability_parameter, dimension); } - OGS_FATAL("The permeability type '%s' is unavailable.\n", + OGS_FATAL("The permeability type '{:s}' is unavailable.\n", "The available types are \n\tConstant.", type.data()); } diff --git a/MaterialLib/PorousMedium/Porosity/createPorosityModel.cpp b/MaterialLib/PorousMedium/Porosity/createPorosityModel.cpp index 4f2f86d644bce39b9606781bf9b647a77867c64f..7edcbccaf8ab63a19cf19bfb72997b3d1b3b4ec8 100644 --- a/MaterialLib/PorousMedium/Porosity/createPorosityModel.cpp +++ b/MaterialLib/PorousMedium/Porosity/createPorosityModel.cpp @@ -39,7 +39,7 @@ std::unique_ptr<Porosity> createPorosityModel( return std::make_unique<Porosity>(constant_porosity); } - OGS_FATAL("The porosity type %s is unavailable.\n", + OGS_FATAL("The porosity type {:s} is unavailable.\n", "The available type is Constant.", type.data()); } diff --git a/MaterialLib/PorousMedium/Storage/createStorageModel.cpp b/MaterialLib/PorousMedium/Storage/createStorageModel.cpp index 9e3fa67e75f5f5300e03cc372a47cd5eaa9dcdf2..18371ac9113bf884d915cd687654f049dc21da80 100644 --- a/MaterialLib/PorousMedium/Storage/createStorageModel.cpp +++ b/MaterialLib/PorousMedium/Storage/createStorageModel.cpp @@ -34,7 +34,7 @@ std::unique_ptr<Storage> createStorageModel(BaseLib::ConfigTree const& config) config.getConfigParameter<double>("value")); } - OGS_FATAL("The storage type %s is unavailable.\n", type.data(), + OGS_FATAL("The storage type {:s} is unavailable.\n", type.data(), "The available type is Constant."); } diff --git a/MaterialLib/PorousMedium/UnsaturatedProperty/CapillaryPressure/CreateCapillaryPressureModel.cpp b/MaterialLib/PorousMedium/UnsaturatedProperty/CapillaryPressure/CreateCapillaryPressureModel.cpp index 5a906ea39096c987ed0213c80505298ed015f1c0..c0aec2cc24096431b0f9670ac8880cf45dc39dd2 100644 --- a/MaterialLib/PorousMedium/UnsaturatedProperty/CapillaryPressure/CreateCapillaryPressureModel.cpp +++ b/MaterialLib/PorousMedium/UnsaturatedProperty/CapillaryPressure/CreateCapillaryPressureModel.cpp @@ -49,7 +49,7 @@ static std::unique_ptr<CapillaryPressureSaturation> createBrooksCorey( if (auto const Sg_r_ptr = config.getConfigParameterOptional<double>("sg_r")) { DBUG( - "Using value %g for nonwetting phase residual saturation in " + "Using value {:g} for nonwetting phase residual saturation in " "capillary pressure model.", (*Sg_r_ptr)); Sg_r = *Sg_r_ptr; @@ -94,7 +94,7 @@ static std::unique_ptr<CapillaryPressureSaturation> createVanGenuchten( if (auto const Sg_r_ptr = config.getConfigParameterOptional<double>("sg_r")) { DBUG( - "Using value %g for nonwetting phase residual saturation in " + "Using value {:g} for nonwetting phase residual saturation in " "capillary pressure model.", (*Sg_r_ptr)); Sg_r = *Sg_r_ptr; @@ -119,7 +119,7 @@ static std::unique_ptr<CapillaryPressureSaturation> createVanGenuchten( //! \ogs_file_param{material__porous_medium__capillary_pressure__vanGenuchten__has_regularized} config.getConfigParameterOptional<bool>("has_regularized")) { - DBUG("capillary pressure model: %s", + DBUG("capillary pressure model: {:s}", (*has_regularized_conf) ? "true" : "false"); has_regularized = *has_regularized_conf; } @@ -157,7 +157,7 @@ std::unique_ptr<CapillaryPressureSaturation> createCapillaryPressureModel( } OGS_FATAL( - "The capillary pressure saturation models %s are unavailable.\n" + "The capillary pressure saturation models {:s} are unavailable.\n" "The available types are: \n\tBrooksCorey, \n\tvanGenuchten,", "\n\tCurve.\n", type.data()); diff --git a/MaterialLib/PorousMedium/UnsaturatedProperty/RelativePermeability/CreateRelativePermeabilityModel.cpp b/MaterialLib/PorousMedium/UnsaturatedProperty/RelativePermeability/CreateRelativePermeabilityModel.cpp index d17f94c2cba889a3b15f4a1db8186f1bd9735019..8848037181f73e6efd9a72e357651e094e27b8f4 100644 --- a/MaterialLib/PorousMedium/UnsaturatedProperty/RelativePermeability/CreateRelativePermeabilityModel.cpp +++ b/MaterialLib/PorousMedium/UnsaturatedProperty/RelativePermeability/CreateRelativePermeabilityModel.cpp @@ -199,7 +199,7 @@ std::unique_ptr<RelativePermeability> createRelativePermeabilityModel( } OGS_FATAL( - "The relative permeability model %s is unavailable.\n" + "The relative permeability model {:s} is unavailable.\n" "The available models are:" "\n\tWettingPhaseVanGenuchten," "\n\tNonWettingPhaseVanGenuchten," diff --git a/MaterialLib/SolidModels/CreateConstitutiveRelation.cpp b/MaterialLib/SolidModels/CreateConstitutiveRelation.cpp index aec10048af81bb850d0f999cb78c7da5989c5484..d99a9ab5c512cff81a394b6168d194ca35eb3297 100644 --- a/MaterialLib/SolidModels/CreateConstitutiveRelation.cpp +++ b/MaterialLib/SolidModels/CreateConstitutiveRelation.cpp @@ -82,7 +82,7 @@ createConstitutiveRelation( "option."); #endif // OGS_USE_MFRONT } - OGS_FATAL("Cannot construct constitutive relation of given type '%s'.", + OGS_FATAL("Cannot construct constitutive relation of given type '{:s}'.", type.c_str()); } @@ -114,7 +114,7 @@ createConstitutiveRelations( { OGS_FATAL( "Multiple constitutive relations were specified for the same " - "material id %d. Keep in mind, that if no material id is " + "material id {:d}. Keep in mind, that if no material id is " "specified, it is assumed to be 0 by default.", material_id); } @@ -127,7 +127,7 @@ createConstitutiveRelations( constitutive_relation_config)); } - DBUG("Found %d constitutive relations.", constitutive_relations.size()); + DBUG("Found {:d} constitutive relations.", constitutive_relations.size()); return constitutive_relations; } diff --git a/MaterialLib/SolidModels/CreateEhlers.h b/MaterialLib/SolidModels/CreateEhlers.h index a76bebe77413500eabf37df52125f6554127b9be..0cf567ee0b85c1974c983b74dd867c9c39fdae6d 100644 --- a/MaterialLib/SolidModels/CreateEhlers.h +++ b/MaterialLib/SolidModels/CreateEhlers.h @@ -29,19 +29,19 @@ inline std::unique_ptr<DamagePropertiesParameters> createDamageProperties( auto& alpha_d = ParameterLib::findParameter<double>(config, "alpha_d", parameters, 1); - DBUG("Use '%s' as alpha_d.", alpha_d.name.c_str()); + DBUG("Use '{:s}' as alpha_d.", alpha_d.name.c_str()); //! \ogs_file_param_special{material__solid__constitutive_relation__Ehlers__damage_properties__beta_d} auto& beta_d = ParameterLib::findParameter<double>(config, "beta_d", parameters, 1); - DBUG("Use '%s' as beta_d.", beta_d.name.c_str()); + DBUG("Use '{:s}' as beta_d.", beta_d.name.c_str()); //! \ogs_file_param_special{material__solid__constitutive_relation__Ehlers__damage_properties__h_d} auto& h_d = ParameterLib::findParameter<double>(config, "h_d", parameters, 1); - DBUG("Use '%s' as h_d.", h_d.name.c_str()); + DBUG("Use '{:s}' as h_d.", h_d.name.c_str()); return std::make_unique<DamagePropertiesParameters>( DamagePropertiesParameters{alpha_d, beta_d, h_d}); @@ -60,97 +60,97 @@ std::unique_ptr<SolidEhlers<DisplacementDim>> createEhlers( auto& shear_modulus = ParameterLib::findParameter<double>( config, "shear_modulus", parameters, 1); - DBUG("Use '%s' as shear modulus parameter.", shear_modulus.name.c_str()); + DBUG("Use '{:s}' as shear modulus parameter.", shear_modulus.name.c_str()); //! \ogs_file_param_special{material__solid__constitutive_relation__Ehlers__bulk_modulus} auto& bulk_modulus = ParameterLib::findParameter<double>( config, "bulk_modulus", parameters, 1); - DBUG("Use '%s' as bulk modulus parameter.", bulk_modulus.name.c_str()); + DBUG("Use '{:s}' as bulk modulus parameter.", bulk_modulus.name.c_str()); //! \ogs_file_param_special{material__solid__constitutive_relation__Ehlers__kappa} auto& kappa = ParameterLib::findParameter<double>(config, "kappa", parameters, 1); - DBUG("Use '%s' as kappa.", kappa.name.c_str()); + DBUG("Use '{:s}' as kappa.", kappa.name.c_str()); //! \ogs_file_param_special{material__solid__constitutive_relation__Ehlers__beta} auto& beta = ParameterLib::findParameter<double>(config, "beta", parameters, 1); - DBUG("Use '%s' as beta.", beta.name.c_str()); + DBUG("Use '{:s}' as beta.", beta.name.c_str()); //! \ogs_file_param_special{material__solid__constitutive_relation__Ehlers__gamma} auto& gamma = ParameterLib::findParameter<double>(config, "gamma", parameters, 1); - DBUG("Use '%s' as gamma.", gamma.name.c_str()); + DBUG("Use '{:s}' as gamma.", gamma.name.c_str()); //! \ogs_file_param_special{material__solid__constitutive_relation__Ehlers__hardening_modulus} auto& hardening_modulus = ParameterLib::findParameter<double>( config, "hardening_modulus", parameters, 1); - DBUG("Use '%s' as hardening modulus parameter.", + DBUG("Use '{:s}' as hardening modulus parameter.", hardening_modulus.name.c_str()); //! \ogs_file_param_special{material__solid__constitutive_relation__Ehlers__alpha} auto& alpha = ParameterLib::findParameter<double>(config, "alpha", parameters, 1); - DBUG("Use '%s' as alpha.", alpha.name.c_str()); + DBUG("Use '{:s}' as alpha.", alpha.name.c_str()); //! \ogs_file_param_special{material__solid__constitutive_relation__Ehlers__delta} auto& delta = ParameterLib::findParameter<double>(config, "delta", parameters, 1); - DBUG("Use '%s' as delta.", delta.name.c_str()); + DBUG("Use '{:s}' as delta.", delta.name.c_str()); //! \ogs_file_param_special{material__solid__constitutive_relation__Ehlers__eps} auto& eps = ParameterLib::findParameter<double>(config, "eps", parameters, 1); - DBUG("Use '%s' as eps.", eps.name.c_str()); + DBUG("Use '{:s}' as eps.", eps.name.c_str()); //! \ogs_file_param_special{material__solid__constitutive_relation__Ehlers__m} auto& m = ParameterLib::findParameter<double>(config, "m", parameters, 1); - DBUG("Use '%s' as m.", m.name.c_str()); + DBUG("Use '{:s}' as m.", m.name.c_str()); //! \ogs_file_param_special{material__solid__constitutive_relation__Ehlers__alphap} auto& alphap = ParameterLib::findParameter<double>(config, "alphap", parameters, 1); - DBUG("Use '%s' as alphap.", alphap.name.c_str()); + DBUG("Use '{:s}' as alphap.", alphap.name.c_str()); //! \ogs_file_param_special{material__solid__constitutive_relation__Ehlers__deltap} auto& deltap = ParameterLib::findParameter<double>(config, "deltap", parameters, 1); - DBUG("Use '%s' as deltap.", deltap.name.c_str()); + DBUG("Use '{:s}' as deltap.", deltap.name.c_str()); //! \ogs_file_param_special{material__solid__constitutive_relation__Ehlers__epsp} auto& epsp = ParameterLib::findParameter<double>(config, "epsp", parameters, 1); - DBUG("Use '%s' as epsp.", epsp.name.c_str()); + DBUG("Use '{:s}' as epsp.", epsp.name.c_str()); //! \ogs_file_param_special{material__solid__constitutive_relation__Ehlers__mp} auto& paremeter_mp = ParameterLib::findParameter<double>(config, "mp", parameters, 1); - DBUG("Use '%s' as mp.", paremeter_mp.name.c_str()); + DBUG("Use '{:s}' as mp.", paremeter_mp.name.c_str()); //! \ogs_file_param_special{material__solid__constitutive_relation__Ehlers__betap} auto& betap = ParameterLib::findParameter<double>(config, "betap", parameters, 1); - DBUG("Use '%s' as betap.", betap.name.c_str()); + DBUG("Use '{:s}' as betap.", betap.name.c_str()); //! \ogs_file_param_special{material__solid__constitutive_relation__Ehlers__gammap} auto& gammap = ParameterLib::findParameter<double>(config, "gammap", parameters, 1); - DBUG("Use '%s' as gammap.", gammap.name.c_str()); + DBUG("Use '{:s}' as gammap.", gammap.name.c_str()); auto tangent_type = //! \ogs_file_param{material__solid__constitutive_relation__Ehlers__tangent_type} diff --git a/MaterialLib/SolidModels/CreateLinearElasticIsotropic.h b/MaterialLib/SolidModels/CreateLinearElasticIsotropic.h index e9fa96316adcd4953a0c1a21d83f1c8d7535141b..0866f924cc0565d1553e096e9fe02172ddb48789 100644 --- a/MaterialLib/SolidModels/CreateLinearElasticIsotropic.h +++ b/MaterialLib/SolidModels/CreateLinearElasticIsotropic.h @@ -36,14 +36,16 @@ createLinearElasticIsotropic( //! \ogs_file_param_special{material__solid__constitutive_relation__LinearElasticIsotropic__youngs_modulus} config, "youngs_modulus", parameters, 1); - DBUG("Use '%s' as youngs_modulus parameter.", youngs_modulus.name.c_str()); + DBUG("Use '{:s}' as youngs_modulus parameter.", + youngs_modulus.name.c_str()); // Poissons ratio auto& poissons_ratio = ParameterLib::findParameter<double>( //! \ogs_file_param_special{material__solid__constitutive_relation__LinearElasticIsotropic__poissons_ratio} config, "poissons_ratio", parameters, 1); - DBUG("Use '%s' as poissons_ratio parameter.", poissons_ratio.name.c_str()); + DBUG("Use '{:s}' as poissons_ratio parameter.", + poissons_ratio.name.c_str()); typename LinearElasticIsotropic<DisplacementDim>::MaterialProperties mp{ youngs_modulus, poissons_ratio}; diff --git a/MaterialLib/SolidModels/CreateLinearElasticOrthotropic.cpp b/MaterialLib/SolidModels/CreateLinearElasticOrthotropic.cpp index bff7e3fdc2ad497969326b389ebed10c27518cbd..1a0c48b859a8395ca5399d0b8efbb028bf9873c2 100644 --- a/MaterialLib/SolidModels/CreateLinearElasticOrthotropic.cpp +++ b/MaterialLib/SolidModels/CreateLinearElasticOrthotropic.cpp @@ -35,19 +35,19 @@ createLinearElasticOrthotropic( auto& youngs_moduli = ParameterLib::findParameter<double>( //! \ogs_file_param_special{material__solid__constitutive_relation__LinearElasticOrthotropic__youngs_moduli} config, "youngs_moduli", parameters, 3); - DBUG("Use '%s' as youngs_moduli parameter.", youngs_moduli.name.c_str()); + DBUG("Use '{:s}' as youngs_moduli parameter.", youngs_moduli.name.c_str()); // Shear moduli auto& shear_moduli = ParameterLib::findParameter<double>( //! \ogs_file_param_special{material__solid__constitutive_relation__LinearElasticOrthotropic__shear_moduli} config, "shear_moduli", parameters, 3); - DBUG("Use '%s' as shear_moduli parameter.", shear_moduli.name.c_str()); + DBUG("Use '{:s}' as shear_moduli parameter.", shear_moduli.name.c_str()); // Poissons ratios auto& poissons_ratios = ParameterLib::findParameter<double>( //! \ogs_file_param_special{material__solid__constitutive_relation__LinearElasticOrthotropic__poissons_ratios} config, "poissons_ratios", parameters, 3); - DBUG("Use '%s' as poissons_ratios parameter.", + DBUG("Use '{:s}' as poissons_ratios parameter.", poissons_ratios.name.c_str()); typename LinearElasticOrthotropic<DisplacementDim>::MaterialProperties mp{ diff --git a/MaterialLib/SolidModels/CreateLubby2.h b/MaterialLib/SolidModels/CreateLubby2.h index 9441adb1055a5fe4dfbdd7bc58e13a75f4e4f948..346dce709fb6f9ac8520e4030ef410baae748af2 100644 --- a/MaterialLib/SolidModels/CreateLubby2.h +++ b/MaterialLib/SolidModels/CreateLubby2.h @@ -35,7 +35,7 @@ std::unique_ptr<Lubby2<DisplacementDim>> createLubby2( //! \ogs_file_param_special{material__solid__constitutive_relation__Lubby2__kelvin_shear_modulus} config, "kelvin_shear_modulus", parameters, 1); - DBUG("Use '%s' as kelvin shear modulus parameter.", + DBUG("Use '{:s}' as kelvin shear modulus parameter.", kelvin_shear_modulus.name.c_str()); // Kelvin viscosity. @@ -43,7 +43,7 @@ std::unique_ptr<Lubby2<DisplacementDim>> createLubby2( //! \ogs_file_param_special{material__solid__constitutive_relation__Lubby2__kelvin_viscosity} config, "kelvin_viscosity", parameters, 1); - DBUG("Use '%s' as kelvin viscosity parameter.", + DBUG("Use '{:s}' as kelvin viscosity parameter.", kelvin_viscosity.name.c_str()); // Maxwell shear modulus. @@ -51,7 +51,7 @@ std::unique_ptr<Lubby2<DisplacementDim>> createLubby2( //! \ogs_file_param_special{material__solid__constitutive_relation__Lubby2__maxwell_shear_modulus} config, "maxwell_shear_modulus", parameters, 1); - DBUG("Use '%s' as maxwell shear modulus parameter.", + DBUG("Use '{:s}' as maxwell shear modulus parameter.", maxwell_shear_modulus.name.c_str()); // Maxwell bulk modulus. @@ -59,7 +59,7 @@ std::unique_ptr<Lubby2<DisplacementDim>> createLubby2( //! \ogs_file_param_special{material__solid__constitutive_relation__Lubby2__maxwell_bulk_modulus} config, "maxwell_bulk_modulus", parameters, 1); - DBUG("Use '%s' as maxwell bulk modulus parameter.", + DBUG("Use '{:s}' as maxwell bulk modulus parameter.", maxwell_bulk_modulus.name.c_str()); // Maxwell viscosity. @@ -67,7 +67,7 @@ std::unique_ptr<Lubby2<DisplacementDim>> createLubby2( //! \ogs_file_param_special{material__solid__constitutive_relation__Lubby2__maxwell_viscosity} config, "maxwell_viscosity", parameters, 1); - DBUG("Use '%s' as maxwell viscosity parameter.", + DBUG("Use '{:s}' as maxwell viscosity parameter.", maxwell_viscosity.name.c_str()); // Dependency parameter for mK. @@ -75,7 +75,7 @@ std::unique_ptr<Lubby2<DisplacementDim>> createLubby2( //! \ogs_file_param_special{material__solid__constitutive_relation__Lubby2__dependency_parameter_mk} config, "dependency_parameter_mk", parameters, 1); - DBUG("Use '%s' as dependency parameter mK.", + DBUG("Use '{:s}' as dependency parameter mK.", dependency_parameter_mK.name.c_str()); // Dependency parameter for mvK. @@ -83,7 +83,7 @@ std::unique_ptr<Lubby2<DisplacementDim>> createLubby2( //! \ogs_file_param_special{material__solid__constitutive_relation__Lubby2__dependency_parameter_mvk} config, "dependency_parameter_mvk", parameters, 1); - DBUG("Use '%s' as dependency parameter mvK.", + DBUG("Use '{:s}' as dependency parameter mvK.", dependency_parameter_mvK.name.c_str()); // Dependency parameter for mvM. @@ -91,7 +91,7 @@ std::unique_ptr<Lubby2<DisplacementDim>> createLubby2( //! \ogs_file_param_special{material__solid__constitutive_relation__Lubby2__dependency_parameter_mvm} config, "dependency_parameter_mvm", parameters, 1); - DBUG("Use '%s' as dependency parameter mvM.", + DBUG("Use '{:s}' as dependency parameter mvM.", dependency_parameter_mvM.name.c_str()); Lubby2MaterialProperties mp{ diff --git a/MaterialLib/SolidModels/CreateNewtonRaphsonSolverParameters.cpp b/MaterialLib/SolidModels/CreateNewtonRaphsonSolverParameters.cpp index 16d33eb199d3b1f3458b851dda1418f783da2804..55c9d0caaccd040ac1b58d8e521b6be61532305f 100644 --- a/MaterialLib/SolidModels/CreateNewtonRaphsonSolverParameters.cpp +++ b/MaterialLib/SolidModels/CreateNewtonRaphsonSolverParameters.cpp @@ -26,13 +26,13 @@ NumLib::NewtonRaphsonSolverParameters createNewtonRaphsonSolverParameters( //! \ogs_file_param{nonlinear_solver__maximum_iterations} config.getConfigParameter<int>("maximum_iterations"); - DBUG("\tmaximum_iterations: %d.", maximum_iterations); + DBUG("\tmaximum_iterations: {:d}.", maximum_iterations); auto const error_tolerance = //! \ogs_file_param{nonlinear_solver__error_tolerance} config.getConfigParameter<double>("error_tolerance"); - DBUG("\terror_tolerance: %g.", error_tolerance); + DBUG("\terror_tolerance: {:g}.", error_tolerance); return {maximum_iterations, error_tolerance}; } diff --git a/MaterialLib/SolidModels/Ehlers.cpp b/MaterialLib/SolidModels/Ehlers.cpp index bb694bc071b1ccd559ef7676b9f8420970d432ee..e63408c6f4c045d55273bca150ffe2085d786014 100644 --- a/MaterialLib/SolidModels/Ehlers.cpp +++ b/MaterialLib/SolidModels/Ehlers.cpp @@ -675,7 +675,7 @@ SolidEhlers<DisplacementDim>::integrateStress( { OGS_FATAL( "Unimplemented tangent type behaviour for the tangent type " - "'%d'.", + "'{:d}'.", _tangent_type); } } diff --git a/MaterialLib/SolidModels/Ehlers.h b/MaterialLib/SolidModels/Ehlers.h index 0838e47b2a2bf370bc5cf697aaa0bc03de7f5c2b..0fd26b599802892492d5d7b2c91b22d998281f66 100644 --- a/MaterialLib/SolidModels/Ehlers.h +++ b/MaterialLib/SolidModels/Ehlers.h @@ -55,7 +55,7 @@ inline TangentType makeTangentType(std::string const& s) { return TangentType::Plastic; } - OGS_FATAL("Not valid string '%s' to create a tangent type from.", + OGS_FATAL("Not valid string '{:s}' to create a tangent type from.", s.c_str()); } diff --git a/MaterialLib/SolidModels/MFront/CreateMFront.cpp b/MaterialLib/SolidModels/MFront/CreateMFront.cpp index a1615bf935c8dcb319e01a018bba18cacd290499..49550899a3cd9a1ed6ffd972172870b34f5df55a 100644 --- a/MaterialLib/SolidModels/MFront/CreateMFront.cpp +++ b/MaterialLib/SolidModels/MFront/CreateMFront.cpp @@ -20,13 +20,13 @@ void varInfo(std::string const& msg, std::vector<mgis::behaviour::Variable> const& vars, mgis::behaviour::Hypothesis hypothesis) { - INFO("#%s: %lu (array size %lu).", + INFO("#{:s}: {:d} (array size {:d}).", msg.c_str(), vars.size(), mgis::behaviour::getArraySize(vars, hypothesis)); for (auto& var : vars) { - INFO(" --> type `%s' with name `%s', size %lu, offset %lu.", + INFO(" --> type `{:s}' with name `{:s}', size {:d}, offset {:d}.", MaterialLib::Solids::MFront::varTypeToString(var.type), var.name.c_str(), mgis::behaviour::getVariableSize(var, hypothesis), @@ -37,11 +37,11 @@ void varInfo(std::string const& msg, /// Prints info about MFront parameters. void varInfo(std::string const& msg, std::vector<std::string> const& parameters) { - INFO("#%s: %lu.", msg.c_str(), parameters.size()); + INFO("#{:s}: {:d}.", msg.c_str(), parameters.size()); // mgis::behaviour::getArraySize(vars, hypothesis)); for (auto const& parameter : parameters) { - INFO(" --> with name `%s'.", parameter.c_str()); + INFO(" --> with name `{:s}'.", parameter.c_str()); } } } // anonymous namespace @@ -98,13 +98,13 @@ std::unique_ptr<MechanicsBase<DisplacementDim>> createMFront( auto behaviour = mgis::behaviour::load(lib_path, behaviour_name, hypothesis); - INFO("Behaviour: `%s'.", behaviour.behaviour.c_str()); - INFO("Hypothesis: `%s'.", mgis::behaviour::toString(hypothesis)); - INFO("Source: `%s'.", behaviour.source.c_str()); - INFO("TFEL version: `%s'.", behaviour.tfel_version.c_str()); - INFO("Behaviour type: `%s'.", btypeToString(behaviour.btype)); - INFO("Kinematic: `%s'.", toString(behaviour.kinematic)); - INFO("Symmetry: `%s'.", toString(behaviour.symmetry)); + INFO("Behaviour: `{:s}'.", behaviour.behaviour.c_str()); + INFO("Hypothesis: `{:s}'.", mgis::behaviour::toString(hypothesis)); + INFO("Source: `{:s}'.", behaviour.source.c_str()); + INFO("TFEL version: `{:s}'.", behaviour.tfel_version.c_str()); + INFO("Behaviour type: `{:s}'.", btypeToString(behaviour.btype)); + INFO("Kinematic: `{:s}'.", toString(behaviour.kinematic)); + INFO("Symmetry: `{:s}'.", toString(behaviour.symmetry)); varInfo("Mat. props.", behaviour.mps, hypothesis); varInfo("Gradients", behaviour.gradients, hypothesis); @@ -146,7 +146,7 @@ std::unique_ptr<MechanicsBase<DisplacementDim>> createMFront( auto const it = map_name_to_param.find(mp.name); if (it == map_name_to_param.end()) OGS_FATAL( - "Material Property `%s' has not been configured in the " + "Material Property `{:s}' has not been configured in the " "project file.", mp.name.c_str()); @@ -156,16 +156,17 @@ std::unique_ptr<MechanicsBase<DisplacementDim>> createMFront( auto const* param = &ParameterLib::findParameter<double>( param_name, parameters, num_comp); - INFO("Using OGS parameter `%s' for material property `%s'.", + INFO("Using OGS parameter `{:s}' for material property `{:s}'.", param_name.c_str(), mp.name.c_str()); using V = mgis::behaviour::Variable; if (mp.type == V::STENSOR || mp.type == V::TENSOR) { WARN( - "Material property `%s' is a tensorial quantity. You, the " + "Material property `{:s}' is a tensorial quantity. You, " + "the " "user, have to make sure that the component order of " - "parameter `%s' matches the one required by MFront!", + "parameter `{:s}' matches the one required by MFront!", mp.name.c_str(), param_name.c_str()); } @@ -181,7 +182,7 @@ std::unique_ptr<MechanicsBase<DisplacementDim>> createMFront( for (auto& e : map_name_to_param) { - ERR(" name: `%s', parameter: `%s'.", e.first.c_str(), + ERR(" name: `{:s}', parameter: `{:s}'.", e.first.c_str(), e.second.c_str()); } diff --git a/MaterialLib/SolidModels/MFront/MFront.cpp b/MaterialLib/SolidModels/MFront/MFront.cpp index 3095289b6f3ba2654be69b00f46adb055df7af3c..8c0713d87189e33d1618ae3b433f39adf5408f18 100644 --- a/MaterialLib/SolidModels/MFront/MFront.cpp +++ b/MaterialLib/SolidModels/MFront/MFront.cpp @@ -111,7 +111,7 @@ const char* toString(mgis::behaviour::Behaviour::Kinematic kin) return "FINITESTRAINKINEMATIC_ETO_PK1"; } - OGS_FATAL("Unknown kinematic %d.", kin); + OGS_FATAL("Unknown kinematic {:d}.", kin); } const char* toString(mgis::behaviour::Behaviour::Symmetry sym) @@ -125,7 +125,7 @@ const char* toString(mgis::behaviour::Behaviour::Symmetry sym) return "ORTHOTROPIC"; } - OGS_FATAL("Unknown symmetry %d.", sym); + OGS_FATAL("Unknown symmetry {:d}.", sym); } const char* btypeToString(int btype) { @@ -139,7 +139,7 @@ const char* btypeToString(int btype) if (btype == B::COHESIVEZONEMODEL) return "COHESIVEZONEMODEL"; - OGS_FATAL("Unknown behaviour type %d.", btype); + OGS_FATAL("Unknown behaviour type {:d}.", btype); } const char* varTypeToString(int v) { @@ -153,7 +153,7 @@ const char* varTypeToString(int v) if (v == V::TENSOR) return "TENSOR"; - OGS_FATAL("Unknown variable type %d.", v); + OGS_FATAL("Unknown variable type {:d}.", v); } template <int DisplacementDim> @@ -181,7 +181,7 @@ MFront<DisplacementDim>::MFront( if (mgis::behaviour::getVariableSize(_behaviour.gradients[0], hypothesis) != MFront<DisplacementDim>::KelvinVector::SizeAtCompileTime) - OGS_FATAL("Strain must have %ld components instead of %lu.", + OGS_FATAL("Strain must have {:d} components instead of {:d}.", MFront<DisplacementDim>::KelvinVector::SizeAtCompileTime, mgis::behaviour::getVariableSize(_behaviour.gradients[0], hypothesis)); @@ -200,7 +200,7 @@ MFront<DisplacementDim>::MFront( if (mgis::behaviour::getVariableSize(_behaviour.thermodynamic_forces[0], hypothesis) != MFront<DisplacementDim>::KelvinVector::SizeAtCompileTime) - OGS_FATAL("Stress must have %ld components instead of %lu.", + OGS_FATAL("Stress must have {:d} components instead of {:d}.", MFront<DisplacementDim>::KelvinVector::SizeAtCompileTime, mgis::behaviour::getVariableSize( _behaviour.thermodynamic_forces[0], hypothesis)); @@ -216,7 +216,7 @@ MFront<DisplacementDim>::MFront( if (mgis::behaviour::getVariableSize(_behaviour.esvs[0], hypothesis) != 1) OGS_FATAL( - "Temperature must be a scalar instead of having %lu " + "Temperature must be a scalar instead of having {:d} " "components.", mgis::behaviour::getVariableSize( _behaviour.thermodynamic_forces[0], hypothesis)); @@ -224,13 +224,13 @@ MFront<DisplacementDim>::MFront( if (_behaviour.mps.size() != _material_properties.size()) { - ERR("There are %d material properties in the loaded behaviour:", + ERR("There are {:d} material properties in the loaded behaviour:", _behaviour.mps.size()); for (auto const& mp : _behaviour.mps) { - ERR("\t%s", mp.name.c_str()); + ERR("\t{:s}", mp.name.c_str()); } - OGS_FATAL("But the number of passed material properties is %d.", + OGS_FATAL("But the number of passed material properties is {:d}.", _material_properties.size()); } } diff --git a/MaterialLib/SolidModels/SelectSolidConstitutiveRelation.h b/MaterialLib/SolidModels/SelectSolidConstitutiveRelation.h index 0d915d3cec2f49abf537a07529e279c65ba43cbe..7daea399d2fedefed35133082f6fd13915797696 100644 --- a/MaterialLib/SolidModels/SelectSolidConstitutiveRelation.h +++ b/MaterialLib/SolidModels/SelectSolidConstitutiveRelation.h @@ -50,16 +50,16 @@ MechanicsBase<DisplacementDim>& selectSolidConstitutiveRelation( if (constitutive_relation == end(constitutive_relations)) { OGS_FATAL( - "No constitutive relation found for material id %d and element %d. " - "There are %d constitutive relations available.", + "No constitutive relation found for material id {:d} and element " + "{:d}. There are {:d} constitutive relations available.", material_id, element_id, constitutive_relations.size()); } if (constitutive_relation->second == nullptr) { OGS_FATAL( - "The constitutive relation found for material id %d and element %d " - "is a nullptr, which is impossible.", + "The constitutive relation found for material id {:d} and element " + "{:d} is a nullptr, which is impossible.", material_id, element_id); } diff --git a/MathLib/InterpolationAlgorithms/PiecewiseLinearInterpolation.cpp b/MathLib/InterpolationAlgorithms/PiecewiseLinearInterpolation.cpp index 2cadad0470b542fd4aa7c6a8ef8230b7fb832805..fd51e249ad2a67042f3b03c7956a5316904d2c05 100644 --- a/MathLib/InterpolationAlgorithms/PiecewiseLinearInterpolation.cpp +++ b/MathLib/InterpolationAlgorithms/PiecewiseLinearInterpolation.cpp @@ -41,7 +41,7 @@ PiecewiseLinearInterpolation::PiecewiseLinearInterpolation( { const std::size_t i = std::distance(_supp_pnts.begin(), it); OGS_FATAL( - "Variable %d and variable %d are the same. " + "Variable {:d} and variable {:d} are the same. " "Piecewise linear interpolation is not possible\n", i, i + 1); } diff --git a/MathLib/KelvinVector.cpp b/MathLib/KelvinVector.cpp index e4391aa333c87b28cb7f917c69645e79c20b919c..2d45a12ad4af7cd51b4403f403f8ee31b4b6290b 100644 --- a/MathLib/KelvinVector.cpp +++ b/MathLib/KelvinVector.cpp @@ -102,7 +102,7 @@ Eigen::Matrix<double, 3, 3> kelvinVectorToTensor(Eigen::Matrix<double, return kelvinVectorToTensor(v6); } OGS_FATAL( - "Conversion of dynamic Kelvin vector of size %d to a tensor is not " + "Conversion of dynamic Kelvin vector of size {:d} to a tensor is not " "possible. Kelvin vector must be of size 4 or 6.", v.size()); } @@ -176,7 +176,7 @@ kelvinVectorToSymmetricTensor(Eigen::Matrix<double, } OGS_FATAL( "Kelvin vector to tensor conversion expected an input vector of size 4 " - "or 6, but a vector of size %d was given.", + "or 6, but a vector of size {:d} was given.", v.size()); } diff --git a/MathLib/KelvinVector.h b/MathLib/KelvinVector.h index 48f4c04940b5675e1fa877eb60662f6805957df7..45f5701db863f50290620d2a18954c9f0c7a6084 100644 --- a/MathLib/KelvinVector.h +++ b/MathLib/KelvinVector.h @@ -180,7 +180,7 @@ symmetricTensorToKelvinVector(Eigen::MatrixBase<Derived> const& v) if (v.cols() != 1) { OGS_FATAL( - "KelvinVector must be a column vector, but input has %d columns.", + "KelvinVector must be a column vector, but input has {:d} columns.", v.cols()); } @@ -201,7 +201,7 @@ symmetricTensorToKelvinVector(Eigen::MatrixBase<Derived> const& v) { OGS_FATAL( "Symmetric tensor to Kelvin vector conversion expected an input " - "vector of size 4 or 6, but a vector of size %d was given.", + "vector of size 4 or 6, but a vector of size {:d} was given.", v.size()); } return result; @@ -222,7 +222,7 @@ KelvinVectorType<DisplacementDim> symmetricTensorToKelvinVector( { OGS_FATAL( "Symmetric tensor to Kelvin vector conversion expected an input " - "vector of size %d, but a vector of size %d was given.", + "vector of size {:d}, but a vector of size {:d} was given.", kelvin_vector_size, values.size()); } diff --git a/MathLib/LinAlg/Eigen/EigenLinearSolver.cpp b/MathLib/LinAlg/Eigen/EigenLinearSolver.cpp index 124e0f3c8b0bf6ba8e115602293f34319af4b6e7..a8f3955c1ce5d15059326a124e9ba9ed4944ac90 100644 --- a/MathLib/LinAlg/Eigen/EigenLinearSolver.cpp +++ b/MathLib/LinAlg/Eigen/EigenLinearSolver.cpp @@ -55,7 +55,7 @@ class EigenDirectLinearSolver final : public EigenLinearSolverBase public: bool solve(Matrix& A, Vector const& b, Vector& x, EigenOption& opt) override { - INFO("-> solve with %s", + INFO("-> solve with {:s}", EigenOption::getSolverName(opt.solver_type).c_str()); if (!A.isCompressed()) { @@ -88,7 +88,7 @@ class EigenIterativeLinearSolver final : public EigenLinearSolverBase public: bool solve(Matrix& A, Vector const& b, Vector& x, EigenOption& opt) override { - INFO("-> solve with %s (precon %s)", + INFO("-> solve with {:s} (precon {:s})", EigenOption::getSolverName(opt.solver_type).c_str(), EigenOption::getPreconName(opt.precon_type).c_str()); _solver.setTolerance(opt.error_tolerance); @@ -106,8 +106,9 @@ public: } x = _solver.solveWithGuess(b, x); - INFO("\t iteration: %d/%ld", _solver.iterations(), opt.max_iterations); - INFO("\t residual: %e\n", _solver.error()); + INFO("\t iteration: {:d}/{:d}", _solver.iterations(), + opt.max_iterations); + INFO("\t residual: {:e}\n", _solver.error()); if(_solver.info()!=Eigen::Success) { ERR("Failed during Eigen linear solve"); diff --git a/MathLib/LinAlg/Eigen/EigenOption.cpp b/MathLib/LinAlg/Eigen/EigenOption.cpp index 782a4dd24ed3374853f451ec5c28e6e6247cf6ec..35271534c242af387030092a2dbca46c6226e409 100644 --- a/MathLib/LinAlg/Eigen/EigenOption.cpp +++ b/MathLib/LinAlg/Eigen/EigenOption.cpp @@ -48,7 +48,7 @@ EigenOption::SolverType EigenOption::getSolverType(const std::string &solver_nam return SolverType::GMRES; } - OGS_FATAL("Unknown Eigen solver type `%s'", solver_name.c_str()); + OGS_FATAL("Unknown Eigen solver type `{:s}'", solver_name.c_str()); } EigenOption::PreconType EigenOption::getPreconType(const std::string &precon_name) @@ -66,7 +66,7 @@ EigenOption::PreconType EigenOption::getPreconType(const std::string &precon_nam return PreconType::ILUT; } - OGS_FATAL("Unknown Eigen preconditioner type `%s'", precon_name.c_str()); + OGS_FATAL("Unknown Eigen preconditioner type `{:s}'", precon_name.c_str()); } std::string EigenOption::getSolverName(SolverType const solver_type) diff --git a/MathLib/LinAlg/Lis/LisCheck.h b/MathLib/LinAlg/Lis/LisCheck.h index a6d26869de1f5e102364923f77f3a7714d7fff94..5396ea6795aefa869da25c90e7dfa189f0f269ea 100644 --- a/MathLib/LinAlg/Lis/LisCheck.h +++ b/MathLib/LinAlg/Lis/LisCheck.h @@ -31,7 +31,7 @@ inline bool checkLisError(int err) { bool ok = (err == LIS_SUCCESS); if (!ok) { - ERR("***ERROR: Lis error code = %d", err); + ERR("***ERROR: Lis error code = {:d}", err); } return ok; } diff --git a/MathLib/LinAlg/Lis/LisLinearSolver.cpp b/MathLib/LinAlg/Lis/LisLinearSolver.cpp index 21438d8ea257c3c9fcd4e8a46aac381cfa1892c6..c5f82e5701f046b4adfa0d647385e41364d5bda2 100644 --- a/MathLib/LinAlg/Lis/LisLinearSolver.cpp +++ b/MathLib/LinAlg/Lis/LisLinearSolver.cpp @@ -50,21 +50,21 @@ bool LisLinearSolver::solve(LisMatrix &A, LisVector &b, LisVector &x) lis_solver_set_option( const_cast<char*>(_lis_option._option_string.c_str()), solver); #ifdef _OPENMP - INFO("-> number of threads: %i", (int) omp_get_max_threads()); + INFO("-> number of threads: {:i}", (int)omp_get_max_threads()); #endif { int precon; ierr = lis_solver_get_precon(solver, &precon); if (!checkLisError(ierr)) return false; - INFO("-> precon: %i", precon); + INFO("-> precon: {:i}", precon); } { int slv; ierr = lis_solver_get_solver(solver, &slv); if (!checkLisError(ierr)) return false; - INFO("-> solver: %i", slv); + INFO("-> solver: {:i}", slv); } // solve @@ -78,7 +78,7 @@ bool LisLinearSolver::solve(LisMatrix &A, LisVector &b, LisVector &x) if (!checkLisError(ierr)) return false; - INFO("-> status: %d", linear_solver_status); + INFO("-> status: {:d}", linear_solver_status); { int iter = 0; @@ -86,14 +86,14 @@ bool LisLinearSolver::solve(LisMatrix &A, LisVector &b, LisVector &x) if (!checkLisError(ierr)) return false; - INFO("-> iteration: %d", iter); + INFO("-> iteration: {:d}", iter); } { double resid = 0.0; ierr = lis_solver_get_residualnorm(solver, &resid); if (!checkLisError(ierr)) return false; - INFO("-> residual: %g", resid); + INFO("-> residual: {:g}", resid); } { double time, itime, ptime, p_ctime, p_itime; @@ -101,11 +101,11 @@ bool LisLinearSolver::solve(LisMatrix &A, LisVector &b, LisVector &x) &ptime, &p_ctime, &p_itime); if (!checkLisError(ierr)) return false; - INFO("-> time total (s): %g", time); - INFO("-> time iterations (s): %g", itime); - INFO("-> time preconditioning (s): %g", ptime); - INFO("-> time precond. create (s): %g", p_ctime); - INFO("-> time precond. iter (s): %g", p_itime); + INFO("-> time total (s): {:g}", time); + INFO("-> time iterations (s): {:g}", itime); + INFO("-> time preconditioning (s): {:g}", ptime); + INFO("-> time precond. create (s): {:g}", p_ctime); + INFO("-> time precond. iter (s): {:g}", p_itime); } // Clear solver diff --git a/MathLib/LinAlg/Lis/LisOption.h b/MathLib/LinAlg/Lis/LisOption.h index 10037ab5d6df7e1ed2ab03d5e3ed53339bd52833..30160602b3a4e471eaedc78a5f3123e90ff3de62 100644 --- a/MathLib/LinAlg/Lis/LisOption.h +++ b/MathLib/LinAlg/Lis/LisOption.h @@ -47,7 +47,7 @@ struct LisOption final if (auto s = options->getConfigParameterOptional<std::string>("lis")) { if (!s->empty()) { _option_string += " " + *s; - INFO("Lis options: '%s'", _option_string.c_str()); + INFO("Lis options: '{:s}'", _option_string.c_str()); } } } diff --git a/MathLib/ODE/CVodeSolver.cpp b/MathLib/ODE/CVodeSolver.cpp index b8a2416572fa1829eddff7787fe1199cdf5ed4a3..655ce7140e23f860db369ca6f793acc52173b966 100644 --- a/MathLib/ODE/CVodeSolver.cpp +++ b/MathLib/ODE/CVodeSolver.cpp @@ -33,8 +33,8 @@ void check_error(std::string const& f_name, int const error_flag) { if (error_flag != CV_SUCCESS) { - OGS_FATAL("CVodeSolver: %s failed with error flag %d.", f_name.c_str(), - error_flag); + OGS_FATAL("CVodeSolver: {:s} failed with error flag {:d}.", + f_name.c_str(), error_flag); } } @@ -59,10 +59,11 @@ void printStats(void* cvode_mem) check_error("CVodeGetNumGEvals", CVodeGetNumGEvals(cvode_mem, &nge)); DBUG("Sundials CVode solver. Statistics:"); - DBUG("nst = %-6ld nfe = %-6ld nsetups = %-6ld nfeLS = %-6ld nje = %ld", - nst, nfe, nsetups, nfeLS, nje); - DBUG("nni = %-6ld ncfn = %-6ld netf = %-6ld nge = %ld\n", nni, ncfn, - netf, nge); + DBUG( + "nst = {:<0d} nfe = {:<0d} nsetups = {:<0d} nfeLS = {:<0d} nje = {:d}", + nst, nfe, nsetups, nfeLS, nje); + DBUG("nni = {:<0d} ncfn = {:<0d} netf = {:<0d} nge = {:d}\n", nni, + ncfn, netf, nge); } //! @} @@ -134,7 +135,7 @@ CVodeSolverImpl::CVodeSolverImpl(const BaseLib::ConfigTree& config, //! \ogs_file_param{ode_solver__CVODE__linear_multistep_method} config.getConfigParameterOptional<std::string>("linear_multistep_method")) { - DBUG("setting linear multistep method (config: %s)", param->c_str()); + DBUG("setting linear multistep method (config: {:s})", param->c_str()); if (*param == "Adams") { @@ -146,7 +147,7 @@ CVodeSolverImpl::CVodeSolverImpl(const BaseLib::ConfigTree& config, } else { - OGS_FATAL("unknown linear multistep method: %s", param->c_str()); + OGS_FATAL("unknown linear multistep method: {:s}", param->c_str()); } } @@ -154,7 +155,8 @@ CVodeSolverImpl::CVodeSolverImpl(const BaseLib::ConfigTree& config, //! \ogs_file_param{ode_solver__CVODE__nonlinear_solver_iteration} config.getConfigParameterOptional<std::string>("nonlinear_solver_iteration")) { - DBUG("setting nonlinear solver iteration (config: %s)", param->c_str()); + DBUG("setting nonlinear solver iteration (config: {:s})", + param->c_str()); if (*param == "Functional") { @@ -166,7 +168,8 @@ CVodeSolverImpl::CVodeSolverImpl(const BaseLib::ConfigTree& config, } else { - OGS_FATAL("unknown nonlinear solver iteration: %s", param->c_str()); + OGS_FATAL("unknown nonlinear solver iteration: {:s}", + param->c_str()); } } diff --git a/MeshGeoToolsLib/AppendLinesAlongPolyline.cpp b/MeshGeoToolsLib/AppendLinesAlongPolyline.cpp index 30344e05b438df4fd28e9d72298aa8aa7de1af35..f5474e8dace997033683c5e6d1e08b9b2f4328fd 100644 --- a/MeshGeoToolsLib/AppendLinesAlongPolyline.cpp +++ b/MeshGeoToolsLib/AppendLinesAlongPolyline.cpp @@ -52,7 +52,7 @@ std::unique_ptr<MeshLib::Mesh> appendLinesAlongPolylines( if (vec_nodes_on_ply.empty()) { std::string ply_name; ply_vec.getNameOfElementByID(k, ply_name); - INFO("No nodes found on polyline %s", ply_name.c_str()); + INFO("No nodes found on polyline {:s}", ply_name.c_str()); continue; } diff --git a/MeshGeoToolsLib/BoundaryElementsAlongPolyline.cpp b/MeshGeoToolsLib/BoundaryElementsAlongPolyline.cpp index 2ac93a42e3c0628e1b3fb53089976937b984d812..a44cb59745bc06cb1d488366ad3ced0d4ea281c9 100644 --- a/MeshGeoToolsLib/BoundaryElementsAlongPolyline.cpp +++ b/MeshGeoToolsLib/BoundaryElementsAlongPolyline.cpp @@ -147,7 +147,7 @@ MeshLib::Element* BoundaryElementsAlongPolyline::modifyEdgeNodeOrdering( } else { - OGS_FATAL("Not implemented for element type %s", + OGS_FATAL("Not implemented for element type {:s}", typeid(edge).name()); } diff --git a/MeshGeoToolsLib/BoundaryElementsAtPoint.cpp b/MeshGeoToolsLib/BoundaryElementsAtPoint.cpp index 1bda95b46e65404f1f83020e72fca5c63a276154..dcbb6ef334f86863ff1bb47234cdffad01342938 100644 --- a/MeshGeoToolsLib/BoundaryElementsAtPoint.cpp +++ b/MeshGeoToolsLib/BoundaryElementsAtPoint.cpp @@ -29,7 +29,7 @@ BoundaryElementsAtPoint::BoundaryElementsAtPoint( { OGS_FATAL( "BoundaryElementsAtPoint: the mesh node searcher was unable to " - "locate the point (%f, %f, %f) in the mesh.", + "locate the point ({:f}, {:f}, {:f}) in the mesh.", _point[0], _point[1], _point[2]); } if (node_ids.size() == 1) @@ -52,9 +52,11 @@ BoundaryElementsAtPoint::BoundaryElementsAtPoint( if (!multiple_nodes_allowed) { OGS_FATAL( - "BoundaryElementsAtPoint: the mesh node searcher found %d points " - "near the requested point (%f, %f, %f) in the mesh, while exactly " - "one is expected. Node (id=%d) (%f, %f, %f) has distance %f.", + "BoundaryElementsAtPoint: the mesh node searcher found {:d} points " + "near the requested point ({:f}, {:f}, {:f}) in the mesh, while " + "exactly " + "one is expected. Node (id={:d}) ({:f}, {:f}, {:f}) has distance " + "{:f}.", node_ids.size(), _point[0], _point[1], _point[2], mesh_nodes[nearest_node_id]->getID(), (*mesh_nodes[nearest_node_id])[0], @@ -63,14 +65,14 @@ BoundaryElementsAtPoint::BoundaryElementsAtPoint( MathLib::sqrDist(*mesh_nodes[nearest_node_id], point)); } WARN( - "BoundaryElementsAtPoint: the mesh node searcher found %d points " - "near the requested point (%f, %f, %f) in the mesh, while exactly " - "one is expected. Node (id=%d) (%f, %f, %f) has distance %f.", + "BoundaryElementsAtPoint: the mesh node searcher found {:d} points " + "near the requested point ({:f}, {:f}, {:f}) in the mesh, while " + "exactly " + "one is expected. Node (id={:d}) ({:f}, {:f}, {:f}) has distance " + "{:f}.", node_ids.size(), _point[0], _point[1], _point[2], - mesh_nodes[nearest_node_id]->getID(), - (*mesh_nodes[nearest_node_id])[0], - (*mesh_nodes[nearest_node_id])[1], - (*mesh_nodes[nearest_node_id])[2], + mesh_nodes[nearest_node_id]->getID(), (*mesh_nodes[nearest_node_id])[0], + (*mesh_nodes[nearest_node_id])[1], (*mesh_nodes[nearest_node_id])[2], MathLib::sqrDist(*mesh_nodes[nearest_node_id], point)); std::array<MeshLib::Node*, 1> const nodes = { diff --git a/MeshGeoToolsLib/ConstructMeshesFromGeometries.cpp b/MeshGeoToolsLib/ConstructMeshesFromGeometries.cpp index c782c4c69931fb685894b07cea65fac409fd8d9c..81ca8381a87a4180572414e8f5a1c1f138ca6b5f 100644 --- a/MeshGeoToolsLib/ConstructMeshesFromGeometries.cpp +++ b/MeshGeoToolsLib/ConstructMeshesFromGeometries.cpp @@ -58,7 +58,7 @@ constructAdditionalMeshesFromGeometries( auto const& geometry = *vec_data[i]; - DBUG("Creating mesh from geometry %s %s.", vec_name.c_str(), + DBUG("Creating mesh from geometry {:s} {:s}.", vec_name.c_str(), geometry_name.c_str()); additional_meshes.emplace_back(createMeshFromElementSelection( diff --git a/MeshGeoToolsLib/CreateSearchLength.cpp b/MeshGeoToolsLib/CreateSearchLength.cpp index bd8cb76a35c320888bc8d04e5d40b209dde63f75..b5371b158c00a1863392bdf622e404a63d35f144 100644 --- a/MeshGeoToolsLib/CreateSearchLength.cpp +++ b/MeshGeoToolsLib/CreateSearchLength.cpp @@ -44,7 +44,7 @@ std::unique_ptr<MeshGeoToolsLib::SearchLength> createSearchLengthAlgorithm( //! \ogs_file_param_special{prj__search_length_algorithm__heuristic} return std::make_unique<HeuristicSearchLength>(mesh); } - OGS_FATAL("Unknown search length algorithm type '%s'.", type.c_str()); + OGS_FATAL("Unknown search length algorithm type '{:s}'.", type.c_str()); } } // end namespace MeshGeoToolsLib diff --git a/MeshGeoToolsLib/GeoMapper.cpp b/MeshGeoToolsLib/GeoMapper.cpp index 2d58d769752712d2638eba9d8291afb711a1a1cd..5cd7098a00a824efd59e1ae556d665ec9fdc6d34 100644 --- a/MeshGeoToolsLib/GeoMapper.cpp +++ b/MeshGeoToolsLib/GeoMapper.cpp @@ -53,7 +53,7 @@ void GeoMapper::mapOnDEM(std::unique_ptr<GeoLib::Raster const> raster) { std::vector<GeoLib::Point*> const* pnts(_geo_objects.getPointVec(_geo_name)); if (! pnts) { - ERR("Geometry '%s' does not exist.", _geo_name.c_str()); + ERR("Geometry '{:s}' does not exist.", _geo_name.c_str()); return; } _raster = std::move(raster); @@ -69,7 +69,7 @@ void GeoMapper::mapOnMesh(MeshLib::Mesh const*const mesh) { std::vector<GeoLib::Point*> const* pnts(_geo_objects.getPointVec(_geo_name)); if (! pnts) { - ERR("Geometry '%s' does not exist.", _geo_name.c_str()); + ERR("Geometry '{:s}' does not exist.", _geo_name.c_str()); return; } @@ -115,7 +115,7 @@ void GeoMapper::mapToConstantValue(double value) std::vector<GeoLib::Point*> const* points (this->_geo_objects.getPointVec(this->_geo_name)); if (points == nullptr) { - ERR("Geometry '%s' not found.", this->_geo_name.c_str()); + ERR("Geometry '{:s}' not found.", this->_geo_name.c_str()); return; } std::for_each(points->begin(), points->end(), [value](GeoLib::Point* pnt){ (*pnt)[2] = value; }); @@ -306,7 +306,7 @@ static std::vector<GeoLib::LineSegment> createSubSegmentsForElement( out << k << " " << intersections[k] << "\n"; } out << "Could not map segment on element. Aborting.\n"; - OGS_FATAL("%s", out.str().c_str()); + OGS_FATAL("{:s}", out.str().c_str()); } if (intersections.size() == 1 && elem == beg_elem) @@ -476,7 +476,7 @@ static bool snapPointToElementNode(MathLib::Point3d& p, p = node; #ifdef DEBUG_GEOMAPPER out << "to " << p; - DBUG("%s", out.str().c_str()); + DBUG("{:s}", out.str().c_str()); #endif return true; } diff --git a/MeshGeoToolsLib/HeuristicSearchLength.cpp b/MeshGeoToolsLib/HeuristicSearchLength.cpp index e7eaf3a411000b46a6ed041af45a21b00966786f..85558faeadaf5f50786db50c0dce964af0f552fd 100644 --- a/MeshGeoToolsLib/HeuristicSearchLength.cpp +++ b/MeshGeoToolsLib/HeuristicSearchLength.cpp @@ -72,7 +72,7 @@ HeuristicSearchLength::HeuristicSearchLength(MeshLib::Mesh const& mesh, LengthTy DBUG( "[MeshNodeSearcher::MeshNodeSearcher] Calculated search length for " - "mesh '%s' is %f.", + "mesh '{:s}' is {:f}.", _mesh.getName().c_str(), _search_length); } diff --git a/MeshGeoToolsLib/IdentifySubdomainMesh.cpp b/MeshGeoToolsLib/IdentifySubdomainMesh.cpp index c654562c379d23d0be21dda0cab3756fd45a9196..77a9261b44f31afbeb90d52c64ac09867eb71ef5 100644 --- a/MeshGeoToolsLib/IdentifySubdomainMesh.cpp +++ b/MeshGeoToolsLib/IdentifySubdomainMesh.cpp @@ -36,7 +36,8 @@ std::vector<std::size_t> identifySubdomainMeshNodes( { OGS_FATAL( "Expected to find exactly one node in the bulk mesh for each node " - "of the subdomain; Found %d nodes in the bulk mesh out of %d nodes " + "of the subdomain; Found {:d} nodes in the bulk mesh out of {:d} " + "nodes " "in the subdomain.", bulk_node_ids.size(), subdomain_mesh.getNumberOfNodes()); } @@ -125,11 +126,11 @@ std::vector<std::vector<std::size_t>> identifySubdomainMeshElements( if (bulk_element_ids.empty()) { - ERR("No element could be found for the subdomain element %d. " + ERR("No element could be found for the subdomain element {:d}. " "Corresponding bulk mesh node ids are:", e->getID()); for (auto const i : element_node_ids_bulk) - ERR("\t%d", i); + ERR("\t{:d}", i); OGS_FATAL( "Expect at least one element to be found in the bulk mesh."); } @@ -162,8 +163,8 @@ void updateOrCheckExistingSubdomainProperty( begin(values), end(values))) { INFO( - "There is already a '%s' property present in the subdomain mesh " - "'%s' and it is equal to the newly computed values.", + "There is already a '{:s}' property present in the subdomain mesh " + "'{:s}' and it is equal to the newly computed values.", property_name.c_str(), mesh.getName().c_str()); return; } @@ -172,7 +173,8 @@ void updateOrCheckExistingSubdomainProperty( // Property differs. Notify and update if forced. // WARN( - "There is already a '%s' property present in the subdomain mesh '%s' " + "There is already a '{:s}' property present in the subdomain mesh " + "'{:s}' " "and it is not equal to the newly computed values.", property_name.c_str(), mesh.getName().c_str()); @@ -182,7 +184,7 @@ void updateOrCheckExistingSubdomainProperty( OGS_FATAL("The force overwrite flag was not specified, exiting."); } - INFO("Overwriting '%s' property.", property_name.c_str()); + INFO("Overwriting '{:s}' property.", property_name.c_str()); original_property.resize(values.size()); std::copy(begin(values), end(values), begin(original_property)); } diff --git a/MeshGeoToolsLib/MeshNodeSearcher.cpp b/MeshGeoToolsLib/MeshNodeSearcher.cpp index b18140540c0485981b6f91b0135fbbb08f1796c7..4be0bc8f023f38a6b8a04e7c08fa95f2c5255abf 100644 --- a/MeshGeoToolsLib/MeshNodeSearcher.cpp +++ b/MeshGeoToolsLib/MeshNodeSearcher.cpp @@ -41,7 +41,7 @@ MeshNodeSearcher::MeshNodeSearcher( _search_length_algorithm(std::move(search_length_algorithm)), _search_all_nodes(search_all_nodes) { - DBUG("The search length for mesh '%s' is %e.", _mesh.getName().c_str(), + DBUG("The search length for mesh '{:s}' is {:e}.", _mesh.getName().c_str(), _search_length_algorithm->getSearchLength()); } @@ -103,8 +103,8 @@ std::vector<std::size_t> MeshNodeSearcher::getMeshNodeIDs( if (ids.empty()) { OGS_FATAL( - "No nodes could be found in the mesh for point %d : (%g, %g, " - "%g) in %g epsilon radius in the mesh '%s'", + "No nodes could be found in the mesh for point {:d} : ({:g}, " + "{:g}, {:g}) in {:g} epsilon radius in the mesh '{:s}'", p.getID(), p[0], p[1], p[2], epsilon_radius, _mesh.getName().c_str()); } @@ -120,9 +120,9 @@ std::vector<std::size_t> MeshNodeSearcher::getMeshNodeIDs( << "\n"; } OGS_FATAL( - "Found %d nodes in the mesh for point %d : (%g, %g, %g) in %g " - "epsilon radius in the mesh '%s'. Expected to find exactly one " - "node.\n%s", + "Found {:d} nodes in the mesh for point {:d} : ({:g}, {:g}, " + "{:g}) in {:g} epsilon radius in the mesh '{:s}'. Expected to " + "find exactly one node.\n{:s}", ids.size(), p.getID(), p[0], p[1], p[2], epsilon_radius, _mesh.getName().c_str(), ss.str().c_str()); } diff --git a/MeshLib/ElementStatus.cpp b/MeshLib/ElementStatus.cpp index c0c69fe323395404aa905618331126118c21c4e6..f000e70f9832c5a6fcdc8026c36480606da4fe79 100644 --- a/MeshLib/ElementStatus.cpp +++ b/MeshLib/ElementStatus.cpp @@ -71,7 +71,7 @@ ElementStatus::ElementStatus(Mesh const* const mesh, } DBUG( - "Deactivated %d materials and resulting active %d nodes and %d " + "Deactivated {:d} materials and resulting active {:d} nodes and {:d} " "elements", vec_inactive_matIDs.size(), _vec_active_nodes.size(), diff --git a/MeshLib/Elements/Element.cpp b/MeshLib/Elements/Element.cpp index baa4e1f82c14199fada7ce10ccc2fa0c872fa795..50b5f0b6f25493ab084c3fbd3ea396ddeeb26df6 100644 --- a/MeshLib/Elements/Element.cpp +++ b/MeshLib/Elements/Element.cpp @@ -164,7 +164,8 @@ const Node* Element::getNode(unsigned i) const return _nodes[i]; } #ifndef NDEBUG - ERR("Error in MeshLib::Element::getNode() - Index %d in %s", i, MeshElemType2String(getGeomType()).c_str()); + ERR("Error in MeshLib::Element::getNode() - Index {:d} in {:s}", i, + MeshElemType2String(getGeomType()).c_str()); return nullptr; #endif } @@ -261,7 +262,7 @@ bool isPointInElementXY(MathLib::Point3d const& p, Element const& e) MathLib::isPointInTriangleXY(p, n0, n2, n3); } - WARN("isPointInElementXY: element type '%s' is not supported.", + WARN("isPointInElementXY: element type '{:s}' is not supported.", MeshLib::MeshElemType2String(e.getGeomType()).c_str()); return false; } diff --git a/MeshLib/Elements/HexRule20.cpp b/MeshLib/Elements/HexRule20.cpp index 3ce8467f95f51f0915a042a9ee859cef1cc1e454..c854c0faa83d42d05eb81c22bad8aeffc33f9f6e 100644 --- a/MeshLib/Elements/HexRule20.cpp +++ b/MeshLib/Elements/HexRule20.cpp @@ -55,7 +55,7 @@ const Element* HexRule20::getFace(const Element* e, unsigned i) } return new Quad8(nodes, e->getID()); } - ERR("Error in MeshLib::Element::getFace() - Index %d does not exist.", i); + ERR("Error in MeshLib::Element::getFace() - Index {:d} does not exist.", i); return nullptr; } diff --git a/MeshLib/Elements/HexRule8.cpp b/MeshLib/Elements/HexRule8.cpp index 81d6e875df58732728c686daf77ed1be1be35c84..31526574a6527abc71ba0c4ff8dc1c0c1f2a72e3 100644 --- a/MeshLib/Elements/HexRule8.cpp +++ b/MeshLib/Elements/HexRule8.cpp @@ -59,7 +59,7 @@ const Element* HexRule8::getFace(const Element* e, unsigned i) } return new Quad(nodes, e->getID()); } - ERR("Error in MeshLib::Element::getFace() - Index %d does not exist.", i); + ERR("Error in MeshLib::Element::getFace() - Index {:d} does not exist.", i); return nullptr; } diff --git a/MeshLib/Elements/MapBulkElementPoint.cpp b/MeshLib/Elements/MapBulkElementPoint.cpp index 5df1657b1ab41dbe6e9922399293c1553e8c3727..538e66310d43da14d2f288e7227a2a4ad51c44ad 100644 --- a/MeshLib/Elements/MapBulkElementPoint.cpp +++ b/MeshLib/Elements/MapBulkElementPoint.cpp @@ -28,7 +28,7 @@ MathLib::Point3d getBulkElementPoint(MeshLib::Quad const& /*quad*/, case 3: return MathLib::Point3d{std::array<double, 3>{{0.0, 1.0 - wp[0], 0.0}}}; default: - OGS_FATAL("Invalid face id '%u' for the quad.", face_id); + OGS_FATAL("Invalid face id '{:d}' for the quad.", face_id); } } @@ -55,7 +55,7 @@ MathLib::Point3d getBulkElementPoint(MeshLib::Hex const& /*hex*/, case 5: return MathLib::Point3d{std::array<double, 3>{{wp[0], wp[1], 1.0}}}; default: - OGS_FATAL("Invalid face id '%u' for the hexahedron.", face_id); + OGS_FATAL("Invalid face id '{:d}' for the hexahedron.", face_id); } } @@ -76,7 +76,7 @@ MathLib::Point3d getBulkElementPoint(MeshLib::Tet const& /*tet*/, return MathLib::Point3d{ std::array<double, 3>{{0, 1 - wp[0], wp[1]}}}; default: - OGS_FATAL("Invalid face id '%u' for the tetrahedron.", face_id); + OGS_FATAL("Invalid face id '{:d}' for the tetrahedron.", face_id); } } @@ -102,7 +102,7 @@ MathLib::Point3d getBulkElementPoint(MeshLib::Prism const& /*prism*/, return MathLib::Point3d{ std::array<double, 3>{{wp[0], wp[1], 1.0}}}; default: - OGS_FATAL("Invalid face id '%u' for the prism.", face_id); + OGS_FATAL("Invalid face id '{:d}' for the prism.", face_id); } } @@ -117,7 +117,7 @@ MathLib::Point3d getBulkElementPoint(MeshLib::Mesh const& mesh, MeshLib::Quad const& quad(*dynamic_cast<MeshLib::Quad const*>(element)); return getBulkElementPoint(quad, bulk_face_id, wp); } - OGS_FATAL("Wrong cell type '%s' or functionality not yet implemented.", + OGS_FATAL("Wrong cell type '{:s}' or functionality not yet implemented.", MeshLib::CellType2String(element->getCellType()).c_str()); } @@ -143,7 +143,7 @@ MathLib::Point3d getBulkElementPoint(MeshLib::Mesh const& mesh, MeshLib::Tet const& tet = *static_cast<MeshLib::Tet const*>(element); return getBulkElementPoint(tet, bulk_face_id, wp); } - OGS_FATAL("Wrong cell type '%s' or functionality not yet implemented.", + OGS_FATAL("Wrong cell type '{:s}' or functionality not yet implemented.", MeshLib::CellType2String(element->getCellType()).c_str()); } diff --git a/MeshLib/Elements/PrismRule15.cpp b/MeshLib/Elements/PrismRule15.cpp index 8786f34a3f172fe6a8d349250d150e9836a8e968..df497e8032725b4cfe73962517dfa63069b163e7 100644 --- a/MeshLib/Elements/PrismRule15.cpp +++ b/MeshLib/Elements/PrismRule15.cpp @@ -60,7 +60,7 @@ const Element* PrismRule15::getFace(const Element* e, unsigned i) return new Quad8(nodes); } - ERR("Error in MeshLib::Element::getFace() - Index %d does not exist.", i); + ERR("Error in MeshLib::Element::getFace() - Index {:d} does not exist.", i); return nullptr; } diff --git a/MeshLib/Elements/PrismRule6.cpp b/MeshLib/Elements/PrismRule6.cpp index 029fe718b0f9931d17d073381429bb4d7604ae9b..5ea981fe4f8582d769d81b84fb06e22670d823ab 100644 --- a/MeshLib/Elements/PrismRule6.cpp +++ b/MeshLib/Elements/PrismRule6.cpp @@ -62,7 +62,7 @@ const Element* PrismRule6::getFace(const Element* e, unsigned i) return new Quad(nodes); } - ERR("Error in MeshLib::Element::getFace() - Index %d does not exist.", i); + ERR("Error in MeshLib::Element::getFace() - Index {:d} does not exist.", i); return nullptr; } diff --git a/MeshLib/Elements/PyramidRule13.cpp b/MeshLib/Elements/PyramidRule13.cpp index b50cd86793196cc048b094df01c9c9d91038b266..9235df3c01d2d01f6cd087d781a1b8b9f4bc2395 100644 --- a/MeshLib/Elements/PyramidRule13.cpp +++ b/MeshLib/Elements/PyramidRule13.cpp @@ -59,7 +59,7 @@ const Element* PyramidRule13::getFace(const Element* e, unsigned i) return new Quad8(nodes, e->getID()); } - ERR("Error in MeshLib::Element::getFace() - Index %d does not exist.", i); + ERR("Error in MeshLib::Element::getFace() - Index {:d} does not exist.", i); return nullptr; } diff --git a/MeshLib/Elements/PyramidRule5.cpp b/MeshLib/Elements/PyramidRule5.cpp index 69812cbc87ab1a35b6c7087e984cfeb41fd21c52..eea3de3bafd60c5592b30cb97109212b058d4189 100644 --- a/MeshLib/Elements/PyramidRule5.cpp +++ b/MeshLib/Elements/PyramidRule5.cpp @@ -61,7 +61,7 @@ const Element* PyramidRule5::getFace(const Element* e, unsigned i) return new Quad(nodes, e->getID()); } - ERR("Error in MeshLib::Element::getFace() - Index %d does not exist.", i); + ERR("Error in MeshLib::Element::getFace() - Index {:d} does not exist.", i); return nullptr; } diff --git a/MeshLib/Elements/TemplateElement.h b/MeshLib/Elements/TemplateElement.h index a05d7cab6e666d519afe60f273e3ff7aeb4ffdf6..2db18f3ba50876a475bf26dc1f78b0daaf1b7c81 100644 --- a/MeshLib/Elements/TemplateElement.h +++ b/MeshLib/Elements/TemplateElement.h @@ -98,7 +98,7 @@ public: { return ELEMENT_RULE::getFace(this, i); } - OGS_FATAL("TemplateElement::getBoundary for boundary %u failed.", i); + OGS_FATAL("TemplateElement::getBoundary for boundary {:d} failed.", i); } /// Returns the number of boundaries of the element. diff --git a/MeshLib/Elements/TetRule10.cpp b/MeshLib/Elements/TetRule10.cpp index f7aaf65964368f6402edb8b921c150ca584798ed..1a75211da36bec9ab57451e622a4a0ee1af81416 100644 --- a/MeshLib/Elements/TetRule10.cpp +++ b/MeshLib/Elements/TetRule10.cpp @@ -49,7 +49,7 @@ const Element* TetRule10::getFace(const Element* e, unsigned i) } return new Tri6(nodes, e->getID()); } - ERR("Error in MeshLib::Element::getFace() - Index %d does not exist.", i); + ERR("Error in MeshLib::Element::getFace() - Index {:d} does not exist.", i); return nullptr; } diff --git a/MeshLib/Elements/TetRule4.cpp b/MeshLib/Elements/TetRule4.cpp index d423f91088d244a9a94bbf12d0d4a899777f98a3..26fa1a874971fdbc1856ea85bd8904cf34f172fb 100644 --- a/MeshLib/Elements/TetRule4.cpp +++ b/MeshLib/Elements/TetRule4.cpp @@ -51,7 +51,7 @@ const Element* TetRule4::getFace(const Element* e, unsigned i) } return new Tri(nodes, e->getID()); } - ERR("Error in MeshLib::Element::getFace() - Index %d does not exist.", i); + ERR("Error in MeshLib::Element::getFace() - Index {:d} does not exist.", i); return nullptr; } diff --git a/MeshLib/IO/Legacy/MeshIO.cpp b/MeshLib/IO/Legacy/MeshIO.cpp index 84406556a61cb52e5a241682c0a3a9a4ab9a0894..c69ee8be54c1dbeec4e27f20c4a3572e5cc3cb12 100644 --- a/MeshLib/IO/Legacy/MeshIO.cpp +++ b/MeshLib/IO/Legacy/MeshIO.cpp @@ -46,7 +46,8 @@ MeshLib::Mesh* MeshIO::loadMeshFromFile(const std::string& file_name) std::ifstream in (file_name.c_str(),std::ios::in); if (!in.is_open()) { - WARN("MeshIO::loadMeshFromFile() - Could not open file %s.", file_name.c_str()); + WARN("MeshIO::loadMeshFromFile() - Could not open file {:s}.", + file_name.c_str()); return nullptr; } @@ -105,8 +106,9 @@ MeshLib::Mesh* MeshIO::loadMeshFromFile(const std::string& file_name) materials.push_back(readMaterialID(ss)); MeshLib::Element *elem(readElement(ss,nodes)); if (elem == nullptr) { - ERR("Reading mesh element %d from file '%s' failed.", i, - file_name.c_str()); + ERR("Reading mesh element {:d} from file '{:s}' " + "failed.", + i, file_name.c_str()); // clean up the elements vector std::for_each(elements.begin(), elements.end(), std::default_delete<MeshLib::Element>()); @@ -146,8 +148,8 @@ MeshLib::Mesh* MeshIO::loadMeshFromFile(const std::string& file_name) materials.cend()); } INFO("\t... finished."); - INFO("Nr. Nodes: %d.", nodes.size()); - INFO("Nr. Elements: %d.", elements.size()); + INFO("Nr. Nodes: {:d}.", nodes.size()); + INFO("Nr. Elements: {:d}.", elements.size()); in.close(); return mesh; diff --git a/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.cpp b/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.cpp index 7bc9ae043436dd56566886f942597c3c107f3f05..e3143fdd1e6a1151b8369babcdde59695512c2c3 100644 --- a/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.cpp +++ b/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.cpp @@ -35,8 +35,9 @@ is_safely_convertable(VALUE const& value) bool const result = value <= std::numeric_limits<TYPE>::max(); if (!result) { - ERR("The value %d is too large for conversion.", value); - ERR("Maximum available size is %d.", std::numeric_limits<TYPE>::max()); + ERR("The value {:d} is too large for conversion.", value); + ERR("Maximum available size is {:d}.", + std::numeric_limits<TYPE>::max()); } return result; } @@ -95,7 +96,7 @@ MeshLib::NodePartitionedMesh* NodePartitionedMeshReader::read( mesh = readBinary(file_name_base); } - INFO("[time] Reading the mesh took %f s.", timer.elapsed()); + INFO("[time] Reading the mesh took {:f} s.", timer.elapsed()); MPI_Barrier(_mpi_comm); @@ -123,7 +124,8 @@ NodePartitionedMeshReader::readBinaryDataFromFile(std::string const& filename, if(file_status != 0) { - ERR("Error opening file %s. MPI error code %d", filename.c_str(), file_status); + ERR("Error opening file {:s}. MPI error code {:d}", filename.c_str(), + file_status); return false; } @@ -217,9 +219,11 @@ void NodePartitionedMeshReader::readPropertiesBinary( std::ifstream is(fname_cfg.c_str(), std::ios::binary | std::ios::in); if (!is) { - WARN("Could not open file '%s'.\n" - "\tYou can ignore this warning if the mesh does not contain %s-" - "wise property data.", fname_cfg.c_str(), item_type.data()); + WARN( + "Could not open file '{:s}'.\n" + "\tYou can ignore this warning if the mesh does not contain {:s}-" + "wise property data.", + fname_cfg.c_str(), item_type.data()); return; } std::size_t number_of_properties = 0; @@ -233,15 +237,15 @@ void NodePartitionedMeshReader::readPropertiesBinary( { OGS_FATAL( "Error in NodePartitionedMeshReader::readPropertiesBinary: " - "Could not read the meta data for the PropertyVector %d", + "Could not read the meta data for the PropertyVector {:d}", i); } } for (std::size_t i(0); i < number_of_properties; ++i) { - DBUG("[%d] +++++++++++++", _mpi_rank); + DBUG("[{:d}] +++++++++++++", _mpi_rank); MeshLib::IO::writePropertyVectorMetaData(*(vec_pvmd[i])); - DBUG("[%d] +++++++++++++", _mpi_rank); + DBUG("[{:d}] +++++++++++++", _mpi_rank); } auto pos = is.tellg(); auto offset = @@ -259,11 +263,12 @@ void NodePartitionedMeshReader::readPropertiesBinary( { OGS_FATAL( "Error in NodePartitionedMeshReader::readPropertiesBinary: " - "Could not read the partition meta data for the mpi process %d", + "Could not read the partition meta data for the mpi process {:d}", _mpi_rank); } - DBUG("[%d] offset in the PropertyVector: %d", _mpi_rank, pvpmd->offset); - DBUG("[%d] %d tuples in partition.", _mpi_rank, pvpmd->number_of_tuples); + DBUG("[{:d}] offset in the PropertyVector: {:d}", _mpi_rank, pvpmd->offset); + DBUG("[{:d}] {:d} tuples in partition.", _mpi_rank, + pvpmd->number_of_tuples); is.close(); const std::string fname_val = file_name_base + "_partitioned_" + item_type + @@ -272,9 +277,10 @@ void NodePartitionedMeshReader::readPropertiesBinary( is.open(fname_val.c_str(), std::ios::binary | std::ios::in); if (!is) { - ERR("Could not open file '%s'\n." - "\tYou can ignore this warning if the mesh does not contain %s-" - "wise property data.", fname_val.c_str(), item_type.data()); + ERR("Could not open file '{:s}'\n." + "\tYou can ignore this warning if the mesh does not contain {:s}-" + "wise property data.", + fname_val.c_str(), item_type.data()); } readDomainSpecificPartOfPropertyVectors(vec_pvmd, *pvpmd, t, is, p); @@ -292,10 +298,12 @@ void NodePartitionedMeshReader::readDomainSpecificPartOfPropertyVectors( std::size_t const number_of_properties = vec_pvmd.size(); for (std::size_t i(0); i < number_of_properties; ++i) { - DBUG("[%d] global offset: %d, offset within the PropertyVector: %d.", - _mpi_rank, global_offset, - global_offset + - pvpmd.offset * vec_pvmd[i]->data_type_size_in_bytes); + DBUG( + "[{:d}] global offset: {:d}, offset within the PropertyVector: " + "{:d}.", + _mpi_rank, global_offset, + global_offset + + pvpmd.offset * vec_pvmd[i]->data_type_size_in_bytes); if (vec_pvmd[i]->is_int_type) { if (vec_pvmd[i]->is_data_type_signed) @@ -347,7 +355,7 @@ bool NodePartitionedMeshReader::openASCIIFiles( if( !is_cfg.good() ) { - ERR("Error opening file %s for input.", filename.c_str()); + ERR("Error opening file {:s} for input.", filename.c_str()); return false; } @@ -369,7 +377,7 @@ bool NodePartitionedMeshReader::openASCIIFiles( is_node.open(filename); if( !is_node.good() ) { - ERR("Error opening file %s for input.", filename.c_str()); + ERR("Error opening file {:s} for input.", filename.c_str()); return false; } } @@ -379,7 +387,7 @@ bool NodePartitionedMeshReader::openASCIIFiles( is_elem.open(filename); if( !is_elem.good() ) { - ERR("Error opening file %s for input.", filename.c_str()); + ERR("Error opening file {:s} for input.", filename.c_str()); return false; } } @@ -665,7 +673,7 @@ void NodePartitionedMeshReader::setElements( default: OGS_FATAL( "NodePartitionedMeshReader: construction of element type " - "%d is not implemented.", + "{:d} is not implemented.", e_type); } } diff --git a/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.h b/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.h index 2a6139b8cce459163d54f143306591cf1a4067e7..b954ef8033df6c6eb932f65b5ce3b17e3a90c3fd 100644 --- a/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.h +++ b/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.h @@ -200,7 +200,7 @@ private: if (!is.read(reinterpret_cast<char*>(pv->data()), number_of_bytes)) OGS_FATAL( "Error in NodePartitionedMeshReader::readPropertiesBinary: " - "Could not read part %d of the PropertyVector.", + "Could not read part {:d} of the PropertyVector.", _mpi_rank); } diff --git a/MeshLib/IO/MPI_IO/PropertyVectorMetaData.h b/MeshLib/IO/MPI_IO/PropertyVectorMetaData.h index 0e3a01f177eb06522be3c2f829527eeff319bc4a..37953d89067cdd4d9b5ab4b3be07347dc678b103 100644 --- a/MeshLib/IO/MPI_IO/PropertyVectorMetaData.h +++ b/MeshLib/IO/MPI_IO/PropertyVectorMetaData.h @@ -69,13 +69,13 @@ inline void writePropertyVectorMetaDataBinary( inline void writePropertyVectorMetaData(PropertyVectorMetaData const& pvmd) { - DBUG("size of name: %d", pvmd.property_name.length()); - DBUG("name: '%s'", pvmd.property_name.c_str()); - DBUG("is_int_data_type: %d", pvmd.is_int_type); - DBUG("is_data_type_signed: %d", pvmd.is_data_type_signed); - DBUG("data_type_size_in_bytes: %d", pvmd.data_type_size_in_bytes); - DBUG("number of components: %d", pvmd.number_of_components); - DBUG("number of tuples: %d", pvmd.number_of_tuples); + DBUG("size of name: {:d}", pvmd.property_name.length()); + DBUG("name: '{:s}'", pvmd.property_name.c_str()); + DBUG("is_int_data_type: {:d}", pvmd.is_int_type); + DBUG("is_data_type_signed: {:d}", pvmd.is_data_type_signed); + DBUG("data_type_size_in_bytes: {:d}", pvmd.data_type_size_in_bytes); + DBUG("number of components: {:d}", pvmd.number_of_components); + DBUG("number of tuples: {:d}", pvmd.number_of_tuples); } inline boost::optional<PropertyVectorMetaData> readPropertyVectorMetaData( diff --git a/MeshLib/IO/VtkIO/PVDFile.cpp b/MeshLib/IO/VtkIO/PVDFile.cpp index 4ad3b12ad85145ccdbb4a0bd03087159ea721b3b..8419d0f031d0a9d129788ae83d3ffaba507b1ad6 100644 --- a/MeshLib/IO/VtkIO/PVDFile.cpp +++ b/MeshLib/IO/VtkIO/PVDFile.cpp @@ -35,7 +35,7 @@ void PVDFile::addVTUFile(const std::string &vtu_fname, double timestep) std::ofstream fh(_pvd_filename.c_str()); if (!fh) { - OGS_FATAL("could not open file `%s'", _pvd_filename.c_str()); + OGS_FATAL("could not open file `{:s}'", _pvd_filename.c_str()); } fh << std::setprecision(std::numeric_limits<double>::digits10); diff --git a/MeshLib/IO/VtkIO/VtuInterface.cpp b/MeshLib/IO/VtkIO/VtuInterface.cpp index 9953a61b3b90edadbfd8fb7463f70c132d6a3d5a..39a7ad0bc1715d63ff72a616c7bcb58ff512c1ae 100644 --- a/MeshLib/IO/VtkIO/VtuInterface.cpp +++ b/MeshLib/IO/VtkIO/VtuInterface.cpp @@ -50,7 +50,7 @@ VtuInterface::VtuInterface(const MeshLib::Mesh* mesh, int dataMode, bool compres MeshLib::Mesh* VtuInterface::readVTUFile(std::string const &file_name) { if (!BaseLib::IsFileExisting(file_name)) { - ERR("File '%s' does not exist.", file_name.c_str()); + ERR("File '{:s}' does not exist.", file_name.c_str()); return nullptr; } @@ -62,7 +62,7 @@ MeshLib::Mesh* VtuInterface::readVTUFile(std::string const &file_name) vtkUnstructuredGrid* vtkGrid = reader->GetOutput(); if (vtkGrid->GetNumberOfPoints() == 0) { - ERR("Mesh '%s' contains zero points.", file_name.c_str()); + ERR("Mesh '{:s}' contains zero points.", file_name.c_str()); return nullptr; } @@ -116,7 +116,7 @@ int writeVtu(MeshLib::Mesh const& mesh, std::string const& file_name, auto const result = writer.writeToFile(file_name); if (!result) { - ERR("writeMeshToFile(): Could not write mesh to '%s'.", + ERR("writeMeshToFile(): Could not write mesh to '{:s}'.", file_name.c_str()); return -1; } diff --git a/MeshLib/IO/readMeshFromFile.cpp b/MeshLib/IO/readMeshFromFile.cpp index 8dd6dd54dd653c715d176083c878aa85f05c36f4..cc85f06bc4205597d6e64c5b7e5d35c424611f47 100644 --- a/MeshLib/IO/readMeshFromFile.cpp +++ b/MeshLib/IO/readMeshFromFile.cpp @@ -80,7 +80,8 @@ MeshLib::Mesh* readMeshFromFileSerial(const std::string &file_name) return MeshLib::IO::VtuInterface::readVTUFile(file_name); } - ERR("readMeshFromFile(): Unknown mesh file format in file %s.", file_name.c_str()); + ERR("readMeshFromFile(): Unknown mesh file format in file {:s}.", + file_name.c_str()); return nullptr; } diff --git a/MeshLib/IO/writeMeshToFile.cpp b/MeshLib/IO/writeMeshToFile.cpp index ef6ecb80f80729d6aa26f087b950845afc686e83..4f21f343c53e35972c5e4649c8997340dd9e61bc 100644 --- a/MeshLib/IO/writeMeshToFile.cpp +++ b/MeshLib/IO/writeMeshToFile.cpp @@ -38,14 +38,15 @@ int writeMeshToFile(const MeshLib::Mesh &mesh, const std::string &file_name) auto const result = writer.writeToFile(file_name); if (!result) { - ERR("writeMeshToFile(): Could not write mesh to '%s'.", + ERR("writeMeshToFile(): Could not write mesh to '{:s}'.", file_name.c_str()); return -1; } return 0; } - ERR("writeMeshToFile(): Unknown mesh file format in file %s.", file_name.c_str()); + ERR("writeMeshToFile(): Unknown mesh file format in file {:s}.", + file_name.c_str()); return -1; } diff --git a/MeshLib/Mesh.cpp b/MeshLib/Mesh.cpp index 19a54a8b08bf55f58b9b0c3713cc7672e2bc573f..03e929c8b29c386e6d6aa0c963f14159e6b12757 100644 --- a/MeshLib/Mesh.cpp +++ b/MeshLib/Mesh.cpp @@ -273,8 +273,8 @@ void Mesh::checkNonlinearNodeIDs() const } WARN( - "Found a nonlinear node whose ID (%d) is smaller than the " - "number of base node IDs (%d). Some functions may not work " + "Found a nonlinear node whose ID ({:d}) is smaller than the " + "number of base node IDs ({:d}). Some functions may not work " "properly.", e->getNodeIndex(i), getNumberOfBaseNodes()); return; @@ -296,7 +296,7 @@ void scaleMeshPropertyVector(MeshLib::Mesh & mesh, { if (!mesh.getProperties().existsPropertyVector<double>(property_name)) { - WARN("Did not find PropertyVector '%s' for scaling.", + WARN("Did not find PropertyVector '{:s}' for scaling.", property_name.c_str()); return; } @@ -320,7 +320,7 @@ PropertyVector<int> const* materialIDs(Mesh const& mesh) std::unique_ptr<MeshLib::Mesh> createMeshFromElementSelection( std::string mesh_name, std::vector<MeshLib::Element*> const& elements) { - DBUG("Found %d elements in the mesh", elements.size()); + DBUG("Found {:d} elements in the mesh", elements.size()); // Store bulk element ids for each of the new elements. std::vector<std::size_t> bulk_element_ids; diff --git a/MeshLib/Mesh.h b/MeshLib/Mesh.h index 8ceaa95cf620db66c2484cf7d2825c646fc04807..332be920f437dce72a322ac25be86b69b4a94c37 100644 --- a/MeshLib/Mesh.h +++ b/MeshLib/Mesh.h @@ -214,8 +214,8 @@ void addPropertyToMesh(MeshLib::Mesh& mesh, std::string const& name, if (mesh.getNumberOfNodes() != values.size() / number_of_components) { OGS_FATAL( - "Error number of nodes (%u) does not match the number of " - "tuples (%u).", + "Error number of nodes ({:d}) does not match the number of " + "tuples ({:d}).", mesh.getNumberOfNodes(), values.size() / number_of_components); } } @@ -224,8 +224,8 @@ void addPropertyToMesh(MeshLib::Mesh& mesh, std::string const& name, if (mesh.getNumberOfElements() != values.size() / number_of_components) { OGS_FATAL( - "Error number of elements (%u) does not match the number of " - "tuples (%u).", + "Error number of elements ({:d}) does not match the number of " + "tuples ({:d}).", mesh.getNumberOfElements(), values.size() / number_of_components); } @@ -235,7 +235,7 @@ void addPropertyToMesh(MeshLib::Mesh& mesh, std::string const& name, name, item_type, number_of_components); if (!property) { - OGS_FATAL("Error while creating PropertyVector '%s'.", name.c_str()); + OGS_FATAL("Error while creating PropertyVector '{:s}'.", name.c_str()); } property->reserve(values.size()); std::copy(values.cbegin(), values.cend(), std::back_inserter(*property)); diff --git a/MeshLib/MeshEditing/AddLayerToMesh.cpp b/MeshLib/MeshEditing/AddLayerToMesh.cpp index 56c8e6098af3918033c4f3e94c46737706144d11..66b28fd2939adceecd40af7746c5558aa5e9050b 100644 --- a/MeshLib/MeshEditing/AddLayerToMesh.cpp +++ b/MeshLib/MeshEditing/AddLayerToMesh.cpp @@ -94,7 +94,7 @@ MeshLib::Mesh* addLayerToMesh(MeshLib::Mesh const& mesh, double thickness, std::string const& name, bool on_top) { - INFO("Extracting top surface of mesh '%s' ... ", mesh.getName().c_str()); + INFO("Extracting top surface of mesh '{:s}' ... ", mesh.getName().c_str()); int const flag = (on_top) ? -1 : 1; const MathLib::Vector3 dir(0, 0, flag); double const angle(90); @@ -139,7 +139,7 @@ MeshLib::Mesh* addLayerToMesh(MeshLib::Mesh const& mesh, double thickness, if (!sfc_mesh->getProperties().existsPropertyVector<std::size_t>(prop_name)) { - ERR("Need subsurface node ids, but the property '%s' is not " + ERR("Need subsurface node ids, but the property '{:s}' is not " "available.", prop_name.c_str()); return nullptr; diff --git a/MeshLib/MeshEditing/ConvertToLinearMesh.cpp b/MeshLib/MeshEditing/ConvertToLinearMesh.cpp index 3ed4fc0f75cfb8f47b8a9c88947f879d98d321d2..959d6d89dfebd3273e471abe887cc23c727ac472 100644 --- a/MeshLib/MeshEditing/ConvertToLinearMesh.cpp +++ b/MeshLib/MeshEditing/ConvertToLinearMesh.cpp @@ -44,8 +44,9 @@ T_ELEMENT* createLinearElement(MeshLib::Element const* e, if (it == end(vec_new_nodes)) { OGS_FATAL( - "A base node %d (with original global node id %d) not found in " - "the list for element %d.", + "A base node {:d} (with original global node id {:d}) not " + "found in " + "the list for element {:d}.", i, e->getNode(i)->getID(), e->getID()); } nodes[i] = const_cast<MeshLib::Node*>(*it); @@ -92,7 +93,7 @@ std::unique_ptr<MeshLib::Mesh> convertToLinearMesh( } else { - OGS_FATAL("Mesh element type %s is not supported", + OGS_FATAL("Mesh element type {:s} is not supported", MeshLib::CellType2String(e->getCellType()).c_str()); } } diff --git a/MeshLib/MeshEditing/ElementValueModification.cpp b/MeshLib/MeshEditing/ElementValueModification.cpp index 9ddbb957d7ee87272abf9f44b39ce11668b68b93..03366a60a370a1dc7ef74ac03783f6e6e1445b48 100644 --- a/MeshLib/MeshEditing/ElementValueModification.cpp +++ b/MeshLib/MeshEditing/ElementValueModification.cpp @@ -36,7 +36,7 @@ bool ElementValueModification::replace(MeshLib::Mesh &mesh, } catch (std::runtime_error const& e) { - ERR("%s", e.what()); + ERR("{:s}", e.what()); return false; } @@ -51,7 +51,7 @@ bool ElementValueModification::replace(MeshLib::Mesh &mesh, { WARN( "ElementValueModification::replaceElementValue() " - "- Replacement value '%d' is already taken, " + "- Replacement value '{:d}' is already taken, " "no changes have been made.", new_value); return false; @@ -86,7 +86,7 @@ std::size_t ElementValueModification::condense(MeshLib::Mesh &mesh) } catch (std::runtime_error const& e) { - ERR("%s", e.what()); + ERR("{:s}", e.what()); return 0; } @@ -120,7 +120,7 @@ std::size_t ElementValueModification::setByElementType(MeshLib::Mesh &mesh, Mesh } catch (std::runtime_error const& e) { - ERR("%s", e.what()); + ERR("{:s}", e.what()); return 0; } diff --git a/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.cpp b/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.cpp index 556bf92f0c7c3ef739180a11845474eb8ab83228..973d46ec42445a42c05e54cb5b6d4f29165417e3 100644 --- a/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.cpp +++ b/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.cpp @@ -38,7 +38,8 @@ bool Mesh2MeshPropertyInterpolation::setPropertiesForMesh(Mesh& dest_mesh) const { if (_src_mesh.getDimension() != dest_mesh.getDimension()) { ERR("MeshLib::Mesh2MeshPropertyInterpolation::setPropertiesForMesh() " - "dimension of source (dim = %d) and destination (dim = %d) mesh " + "dimension of source (dim = {:d}) and destination (dim = {:d}) " + "mesh " "does not match.", _src_mesh.getDimension(), dest_mesh.getDimension()); return false; @@ -59,7 +60,7 @@ bool Mesh2MeshPropertyInterpolation::setPropertiesForMesh(Mesh& dest_mesh) const } else { - INFO("Create new PropertyVector '%s' of type double.", + INFO("Create new PropertyVector '{:s}' of type double.", _property_name.c_str()); dest_properties = dest_mesh.getProperties().createNewPropertyVector<double>( @@ -68,7 +69,7 @@ bool Mesh2MeshPropertyInterpolation::setPropertiesForMesh(Mesh& dest_mesh) const { WARN( "Could not get or create a PropertyVector of type double" - " using the given name '%s'.", + " using the given name '{:s}'.", _property_name.c_str()); return false; } @@ -139,7 +140,7 @@ void Mesh2MeshPropertyInterpolation::interpolatePropertiesForMesh( { OGS_FATAL( "Mesh2MeshInterpolation: Could not find values in source mesh " - "for the element %d.", + "for the element {:d}.", k); } dest_properties[k] = average_value / cnt; @@ -152,7 +153,7 @@ void Mesh2MeshPropertyInterpolation::interpolateElementPropertiesToNodePropertie // fetch the source of property values if (!_src_mesh.getProperties().existsPropertyVector<double>(_property_name)) { - WARN("Did not find PropertyVector<double> '%s'.", + WARN("Did not find PropertyVector<double> '{:s}'.", _property_name.c_str()); return; } diff --git a/MeshLib/MeshEditing/MeshRevision.cpp b/MeshLib/MeshEditing/MeshRevision.cpp index 1122b411597fea49cb1597b9ef21f74b837f94c0..d5015604dd9022187c3469596c1d0842b97f1860 100644 --- a/MeshLib/MeshEditing/MeshRevision.cpp +++ b/MeshLib/MeshEditing/MeshRevision.cpp @@ -87,7 +87,7 @@ MeshLib::Mesh* MeshRevision::simplifyMesh(const std::string &new_mesh_name, subdivideElement(elem, new_nodes, new_elements)); if (n_new_elements == 0) { - ERR("Element %d has unknown element type.", k); + ERR("Element {:d} has unknown element type.", k); this->resetNodeIDs(); this->cleanUp(new_nodes, new_elements); return nullptr; diff --git a/MeshLib/MeshEditing/RemoveMeshComponents.cpp b/MeshLib/MeshEditing/RemoveMeshComponents.cpp index f32b566977985c5ed3535634f6ef4265b1bc5c7b..5bd10e19433cc0f850872ef6680a1aa6850183e7 100644 --- a/MeshLib/MeshEditing/RemoveMeshComponents.cpp +++ b/MeshLib/MeshEditing/RemoveMeshComponents.cpp @@ -60,10 +60,10 @@ MeshLib::Mesh* removeElements( return nullptr; } - INFO("Removing total %d elements...", removed_element_ids.size()); + INFO("Removing total {:d} elements...", removed_element_ids.size()); std::vector<MeshLib::Element*> tmp_elems = details::excludeElementCopy(mesh.getElements(), removed_element_ids); - INFO("%d elements remain in mesh.", tmp_elems.size()); + INFO("{:d} elements remain in mesh.", tmp_elems.size()); // copy node and element objects std::vector<MeshLib::Node*> new_nodes = @@ -75,7 +75,7 @@ MeshLib::Mesh* removeElements( NodeSearch ns(mesh); ns.searchNodesConnectedToOnlyGivenElements(removed_element_ids); auto& removed_node_ids(ns.getSearchedNodeIDs()); - INFO("Removing total %d nodes...", removed_node_ids.size()); + INFO("Removing total {:d} nodes...", removed_node_ids.size()); for (auto nodeid : removed_node_ids) { delete new_nodes[nodeid]; diff --git a/MeshLib/MeshGenerators/MeshLayerMapper.cpp b/MeshLib/MeshGenerators/MeshLayerMapper.cpp index 36e6d926ad2a77b6861fa7775e11939c0110e9e5..571b34811d83270b17f987d5c789dd0ae252a01f 100644 --- a/MeshLib/MeshGenerators/MeshLayerMapper.cpp +++ b/MeshLib/MeshGenerators/MeshLayerMapper.cpp @@ -42,7 +42,7 @@ MeshLib::Mesh* MeshLayerMapper::createStaticLayers(MeshLib::Mesh const& mesh, st thickness.push_back(layer_thickness_vector[i]); } else - WARN("Ignoring layer %d with thickness %f.", i, + WARN("Ignoring layer {:d} with thickness {:f}.", i, layer_thickness_vector[i]); } diff --git a/MeshLib/MeshGenerators/QuadraticMeshGenerator.cpp b/MeshLib/MeshGenerators/QuadraticMeshGenerator.cpp index abf437b6f8b8523128c73705423b85253b5c817c..6b6fd7ed01fd381482ffa87104961bd024eb1558 100644 --- a/MeshLib/MeshGenerators/QuadraticMeshGenerator.cpp +++ b/MeshLib/MeshGenerators/QuadraticMeshGenerator.cpp @@ -76,7 +76,7 @@ std::unique_ptr<MeshLib::Element> createQuadraticElement( return convertLinearToQuadratic<MeshLib::Hex20>(e); } - OGS_FATAL("Mesh element type %s is not supported", + OGS_FATAL("Mesh element type {:s} is not supported", MeshLib::CellType2String(e.getCellType()).c_str()); } diff --git a/MeshLib/MeshGenerators/VtkMeshConverter.cpp b/MeshLib/MeshGenerators/VtkMeshConverter.cpp index 92eaf78e9610a72b0b8d11a6e17958144c8e5cee..307458c56db150072bdabdb6b4976b38f1d50de4 100644 --- a/MeshLib/MeshGenerators/VtkMeshConverter.cpp +++ b/MeshLib/MeshGenerators/VtkMeshConverter.cpp @@ -229,7 +229,7 @@ MeshLib::Mesh* VtkMeshConverter::convertUnstructuredGrid( } default: ERR("VtkMeshConverter::convertUnstructuredGrid(): Unknown mesh " - "element type '%d'.", + "element type '{:d}'.", cell_type); return nullptr; } @@ -343,7 +343,7 @@ void VtkMeshConverter::convertArray(vtkDataArray& array, } WARN( - "Array '%s' in VTU file uses unsupported data type '%s'. The data " + "Array '{:s}' in VTU file uses unsupported data type '{:s}'. The data " "array will not be available.", array.GetName(), array.GetDataTypeAsString()); } diff --git a/MeshLib/MeshGenerators/VtkMeshConverter.h b/MeshLib/MeshGenerators/VtkMeshConverter.h index 6c0e6c47ff70ea39718769923e535168a54c6230..266ab9bfdba461d48ff553c9a0865e1bfcc778db 100644 --- a/MeshLib/MeshGenerators/VtkMeshConverter.h +++ b/MeshLib/MeshGenerators/VtkMeshConverter.h @@ -109,7 +109,7 @@ private: array_name, type, nComponents); if (!vec) { - WARN("Array %s could not be converted to PropertyVector.", + WARN("Array {:s} could not be converted to PropertyVector.", array_name); return; } diff --git a/MeshLib/MeshInformation.cpp b/MeshLib/MeshInformation.cpp index 11af2d82694b2d1603db2370866afd406e3a8dfa..86e7f60fd7177b703ff04a9ebe23da1dcec31501 100644 --- a/MeshLib/MeshInformation.cpp +++ b/MeshLib/MeshInformation.cpp @@ -75,7 +75,7 @@ void MeshInformation::writeAllNumbersOfElementTypes(const MeshLib::Mesh& mesh) for (unsigned int element_type = 0; element_type < nr_ele_types.size(); element_type++) { - INFO("\t%d %s ", nr_ele_types[element_type], + INFO("\t{:d} {:s} ", nr_ele_types[element_type], element_names[element_type].c_str()); } } @@ -84,25 +84,25 @@ void MeshInformation::writePropertyVectorInformation(const MeshLib::Mesh& mesh) { std::vector<std::string> const& vec_names( mesh.getProperties().getPropertyVectorNames()); - INFO("There are %d properties in the mesh:", vec_names.size()); + INFO("There are {:d} properties in the mesh:", vec_names.size()); for (const auto& vec_name : vec_names) { if (auto const vec_bounds = MeshLib::MeshInformation::getValueBounds<int>(mesh, vec_name)) { - INFO("\t%s: [%d, %d]", vec_name.c_str(), vec_bounds->first, + INFO("\t{:s}: [{:d}, {:d}]", vec_name.c_str(), vec_bounds->first, vec_bounds->second); } else if (auto const vec_bounds = MeshLib::MeshInformation::getValueBounds<double>(mesh, vec_name)) { - INFO("\t%s: [%g, %g]", vec_name.c_str(), vec_bounds->first, + INFO("\t{:s}: [{:g}, {:g}]", vec_name.c_str(), vec_bounds->first, vec_bounds->second); } else { - INFO("\t%s: Could not get value bounds for property vector.", + INFO("\t{:s}: Could not get value bounds for property vector.", vec_name.c_str()); } } @@ -115,7 +115,7 @@ void MeshInformation::writeMeshValidationResults(MeshLib::Mesh& mesh) unsigned const n_holes(MeshLib::MeshValidation::detectHoles(mesh)); if (n_holes > 0) { - INFO("%d hole(s) detected within the mesh", n_holes); + INFO("{:d} hole(s) detected within the mesh", n_holes); } else { diff --git a/MeshLib/MeshInformation.h b/MeshLib/MeshInformation.h index cddff750b8cb152d5a9fd78680ffcdfaf8266510..d95921d3e910f914c36c475344ab9f46f4de913f 100644 --- a/MeshLib/MeshInformation.h +++ b/MeshLib/MeshInformation.h @@ -46,7 +46,7 @@ public: mesh.getProperties().getPropertyVector<T>(name); if (data_vec->empty()) { - INFO("Mesh does not contain values for the property '%s'.", + INFO("Mesh does not contain values for the property '{:s}'.", name.c_str()); return {}; } diff --git a/MeshLib/MeshQuality/EdgeRatioMetric.cpp b/MeshLib/MeshQuality/EdgeRatioMetric.cpp index 96766eaf8bd2fc5d22e4972b915eeaf5db334325..1aaff213308e57a73228cec8ee147552f89b6d44 100644 --- a/MeshLib/MeshQuality/EdgeRatioMetric.cpp +++ b/MeshLib/MeshQuality/EdgeRatioMetric.cpp @@ -77,8 +77,9 @@ void EdgeRatioMetric::calculateQuality() break; } default: - ERR ("MeshQualityShortestLongestRatio::check () check for element type %s not implemented.", - MeshElemType2String(elem.getGeomType()).c_str()); + ERR("MeshQualityShortestLongestRatio::check () check for element " + "type {:s} not implemented.", + MeshElemType2String(elem.getGeomType()).c_str()); } } } diff --git a/MeshLib/MeshQuality/ElementSizeMetric.cpp b/MeshLib/MeshQuality/ElementSizeMetric.cpp index 5da8d05f201f5de491f2823ef6d3b57062a42b9b..52383aeeadeba4bdddc075577abee986f3a9247e 100644 --- a/MeshLib/MeshQuality/ElementSizeMetric.cpp +++ b/MeshLib/MeshQuality/ElementSizeMetric.cpp @@ -38,9 +38,12 @@ void ElementSizeMetric::calculateQuality() error_count = calc3dQuality(); } - INFO ("ElementSizeMetric::calculateQuality() minimum: %f, max_volume: %f", _min, _max); + INFO( + "ElementSizeMetric::calculateQuality() minimum: {:f}, max_volume: {:f}", + _min, + _max); if (error_count > 0) - WARN ("Warning: %d elements with zero volume found.", error_count); + WARN("Warning: {:d} elements with zero volume found.", error_count); } std::size_t ElementSizeMetric::calc1dQuality() diff --git a/MeshLib/MeshQuality/MeshValidation.cpp b/MeshLib/MeshQuality/MeshValidation.cpp index 9fd6b87acc68f491368b087cb8709879add1628b..1d2e2d6a549ce548fecdf2a97122d16dc616b3a3 100644 --- a/MeshLib/MeshQuality/MeshValidation.cpp +++ b/MeshLib/MeshQuality/MeshValidation.cpp @@ -36,10 +36,11 @@ MeshValidation::MeshValidation(MeshLib::Mesh &mesh) NodeSearch ns(mesh); ns.searchUnused(); if (!ns.getSearchedNodeIDs().empty()) { - INFO ("%d unused mesh nodes found.", ns.getSearchedNodeIDs().size()); + INFO("{:d} unused mesh nodes found.", ns.getSearchedNodeIDs().size()); } MeshRevision rev(mesh); - INFO ("Found %d potentially collapsable nodes.", rev.getNumberOfCollapsableNodes()); + INFO("Found {:d} potentially collapsable nodes.", + rev.getNumberOfCollapsableNodes()); const std::vector<ElementErrorCode> codes( MeshLib::MeshValidation::testElementGeometry(mesh)); @@ -101,7 +102,7 @@ std::vector<ElementErrorCode> MeshValidation::testElementGeometry(const MeshLib: for (std::size_t i = 0; i < nErrorCodes; ++i) { if (error_count[i]) - INFO("%d elements found with %s.", + INFO("{:d} elements found with {:s}.", error_count[i], ElementErrorCode::toString(flags[i]).c_str()); } diff --git a/MeshLib/MeshSearch/ElementSearch.h b/MeshLib/MeshSearch/ElementSearch.h index a39ef8dcd1361c3a71acbeb4cb183c5aa67bedd7..f852681958af536750b04d5e68a8cec3a88e90ce 100644 --- a/MeshLib/MeshSearch/ElementSearch.h +++ b/MeshLib/MeshSearch/ElementSearch.h @@ -81,7 +81,7 @@ public: } catch (std::runtime_error const& e) { - ERR("%s", e.what()); + ERR("{:s}", e.what()); WARN( "Value-based element removal currently only works for " "scalars."); diff --git a/MeshLib/MeshSearch/MeshElementGrid.cpp b/MeshLib/MeshSearch/MeshElementGrid.cpp index a27bbe6ab6d0318ce4938121833cf96a8797bff9..41528bdc9f9533aeb6ca1a83497a3f2167a5ad4c 100644 --- a/MeshLib/MeshSearch/MeshElementGrid.cpp +++ b/MeshLib/MeshSearch/MeshElementGrid.cpp @@ -117,8 +117,8 @@ void MeshElementGrid::sortElementsInGridCells(MeshLib::Mesh const& sfc_mesh) { for (auto const element : sfc_mesh.getElements()) { if (! sortElementInGridCells(*element)) { - OGS_FATAL("Sorting element (id=%d) into mesh element grid.", - element->getID()); + OGS_FATAL("Sorting element (id={:d}) into mesh element grid.", + element->getID()); } } } diff --git a/MeshLib/MeshSubset.h b/MeshLib/MeshSubset.h index 72cec1204ac13ed0094bc901ddb354359b32c6eb..c4ea7e4dd1be85fa47e0e07c02ef1783ea02fc6e 100644 --- a/MeshLib/MeshSubset.h +++ b/MeshLib/MeshSubset.h @@ -53,7 +53,8 @@ public: auto it = lower_bound(begin(mesh_nodes), end(mesh_nodes), n); if (it == end(mesh_nodes)) { - ERR("A node %d (%g, %g, %g) in mesh subset is not a part " + ERR("A node {:d} ({:g}, {:g}, {:g}) in mesh subset is not " + "a part " "of the mesh.", n->getID(), (*n)[0], (*n)[1], (*n)[2]); return false; diff --git a/MeshLib/MeshSurfaceExtraction.cpp b/MeshLib/MeshSurfaceExtraction.cpp index ca63ba1c6e126ee15abf0919c484eae22cd34b13..354a43ae568e8d0f7b3d7542ff5f539ac53aef81 100644 --- a/MeshLib/MeshSurfaceExtraction.cpp +++ b/MeshLib/MeshSurfaceExtraction.cpp @@ -75,16 +75,17 @@ bool createSfcMeshProperties(MeshLib::Mesh& sfc_mesh, std::size_t const n_nodes(sfc_mesh.getNumberOfNodes()); if (node_ids_map.size() != n_nodes) { - ERR("createSfcMeshProperties() - Incorrect number of node IDs (%d) " - "compared to actual number of surface nodes (%d).", + ERR("createSfcMeshProperties() - Incorrect number of node IDs ({:d}) " + "compared to actual number of surface nodes ({:d}).", node_ids_map.size(), n_nodes); return false; } if (element_ids_map.size() != n_elems) { - ERR("createSfcMeshProperties() - Incorrect number of element IDs (%d) " - "compared to actual number of surface elements (%d).", + ERR("createSfcMeshProperties() - Incorrect number of element IDs " + "({:d}) " + "compared to actual number of surface elements ({:d}).", element_ids_map.size(), n_elems); return false; } @@ -112,12 +113,14 @@ bool createSfcMeshProperties(MeshLib::Mesh& sfc_mesh, } else { - WARN("Skipping property vector '%s' - no matching data type found.", - name.c_str()); + WARN( + "Skipping property vector '{:s}' - no matching data type " + "found.", + name.c_str()); vectors_skipped++; } } - INFO("%d property vectors copied, %d vectors skipped.", vectors_copied, + INFO("{:d} property vectors copied, {:d} vectors skipped.", vectors_copied, vectors_skipped); return true; } @@ -186,7 +189,7 @@ std::vector<double> MeshSurfaceExtraction::getSurfaceAreaForNodes( node_area_vec.push_back(node_area); } - INFO("Total surface Area: %f", total_area); + INFO("Total surface Area: {:f}", total_area); return node_area_vec; } @@ -255,7 +258,7 @@ void MeshSurfaceExtraction::get2DSurfaceElements( const MathLib::Vector3& dir, double angle, unsigned mesh_dimension) { if (mesh_dimension < 2 || mesh_dimension > 3) - ERR("Cannot handle meshes of dimension %i", mesh_dimension); + ERR("Cannot handle meshes of dimension {:i}", mesh_dimension); bool const complete_surface = (MathLib::scalarProduct(dir, dir) == 0); @@ -416,7 +419,7 @@ std::unique_ptr<MeshLib::Mesh> getBoundaryElementsAsMesh( auto const mesh_dimension = bulk_mesh.getDimension(); if (mesh_dimension < 2 || mesh_dimension > 3) { - ERR("Cannot handle meshes of dimension %i", mesh_dimension); + ERR("Cannot handle meshes of dimension {:i}", mesh_dimension); } // create boundary elements based on the subsurface nodes diff --git a/MeshLib/Properties-impl.h b/MeshLib/Properties-impl.h index 798e77b317d80f8b06265736aff481a16d326256..683288e8f3ebc863ac8db611bb33841dad138fbb 100644 --- a/MeshLib/Properties-impl.h +++ b/MeshLib/Properties-impl.h @@ -20,7 +20,7 @@ PropertyVector<T>* Properties::createNewPropertyVector( _properties.find(name) ); if (it != _properties.end()) { - ERR("A property of the name '%s' is already assigned to the mesh.", + ERR("A property of the name '{:s}' is already assigned to the mesh.", name.c_str()); return nullptr; } @@ -48,7 +48,7 @@ PropertyVector<T>* Properties::createNewPropertyVector( _properties.find(name) ); if (it != _properties.end()) { - ERR("A property of the name '%s' already assigned to the mesh.", + ERR("A property of the name '{:s}' already assigned to the mesh.", name.c_str()); return nullptr; } @@ -57,7 +57,9 @@ PropertyVector<T>* Properties::createNewPropertyVector( for (std::size_t k(0); k<item2group_mapping.size(); k++) { std::size_t const group_id (item2group_mapping[k]); if (group_id >= n_prop_groups) { - ERR("The mapping to property %d for item %d is not in the correct range [0,%d).", group_id, k, n_prop_groups); + ERR("The mapping to property {:d} for item {:d} is not in the " + "correct range [0,{:d}).", + group_id, k, n_prop_groups); return nullptr; } } @@ -121,14 +123,13 @@ PropertyVector<T> const* Properties::getPropertyVector( auto it(_properties.find(name)); if (it == _properties.end()) { - OGS_FATAL( - "The PropertyVector '%s' is not available in the mesh.", - name.c_str()); + OGS_FATAL("The PropertyVector '{:s}' is not available in the mesh.", + name.c_str()); } if (!dynamic_cast<PropertyVector<T> const*>(it->second)) { OGS_FATAL( - "The PropertyVector '%s' has a different type than the requested " + "The PropertyVector '{:s}' has a different type than the requested " "PropertyVector.", name.c_str()); } @@ -142,13 +143,13 @@ PropertyVector<T>* Properties::getPropertyVector(std::string const& name) if (it == _properties.end()) { OGS_FATAL( - "A PropertyVector with the specified name '%s' is not available.", + "A PropertyVector with the specified name '{:s}' is not available.", name.c_str()); } if (!dynamic_cast<PropertyVector<T>*>(it->second)) { OGS_FATAL( - "The PropertyVector '%s' has a different type than the requested " + "The PropertyVector '{:s}' has a different type than the requested " "PropertyVector.", name.c_str()); } @@ -163,29 +164,32 @@ PropertyVector<T> const* Properties::getPropertyVector( auto const it = _properties.find(name); if (it == _properties.end()) { - OGS_FATAL("A PropertyVector with name '%s' does not exist in the mesh.", - name.c_str()); + OGS_FATAL( + "A PropertyVector with name '{:s}' does not exist in the mesh.", + name.c_str()); } auto property = dynamic_cast<PropertyVector<T>*>(it->second); if (property == nullptr) { OGS_FATAL( - "Could not cast the data type of the PropertyVector '%s' to " + "Could not cast the data type of the PropertyVector '{:s}' to " "requested data type.", name.c_str()); } if (property->getMeshItemType() != item_type) { OGS_FATAL( - "The PropertyVector '%s' has type '%s'. A '%s' field is requested.", + "The PropertyVector '{:s}' has type '{:s}'. A '{:s}' field is " + "requested.", name.c_str(), toString(property->getMeshItemType()), toString(item_type)); } if (property->getNumberOfComponents() != n_components) { OGS_FATAL( - "PropertyVector '%s' has %d components, %d components are needed.", + "PropertyVector '{:s}' has {:d} components, {:d} components are " + "needed.", name.c_str(), property->getNumberOfComponents(), n_components); } return property; @@ -199,29 +203,32 @@ PropertyVector<T>* Properties::getPropertyVector(std::string const& name, auto const it = _properties.find(name); if (it == _properties.end()) { - OGS_FATAL("A PropertyVector with name '%s' does not exist in the mesh.", - name.c_str()); + OGS_FATAL( + "A PropertyVector with name '{:s}' does not exist in the mesh.", + name.c_str()); } auto property = dynamic_cast<PropertyVector<T>*>(it->second); if (property == nullptr) { OGS_FATAL( - "Could not cast the data type of the PropertyVector '%s' to " + "Could not cast the data type of the PropertyVector '{:s}' to " "requested data type.", name.c_str()); } if (property->getMeshItemType() != item_type) { OGS_FATAL( - "The PropertyVector '%s' has type '%s'. A '%s' field is requested.", + "The PropertyVector '{:s}' has type '{:s}'. A '{:s}' field is " + "requested.", name.c_str(), toString(property->getMeshItemType()), toString(item_type)); } if (property->getNumberOfComponents() != n_components) { OGS_FATAL( - "PropertyVector '%s' has %d components, %d components are needed.", + "PropertyVector '{:s}' has {:d} components, {:d} components are " + "needed.", name.c_str(), property->getNumberOfComponents(), n_components); } return property; diff --git a/MeshLib/Properties.cpp b/MeshLib/Properties.cpp index 685186da4c51c66b802e98b2b6366ee06dc1c2ab..de11bb70a6c30b26ea7090c7353415b859655cf1 100644 --- a/MeshLib/Properties.cpp +++ b/MeshLib/Properties.cpp @@ -21,7 +21,7 @@ void Properties::removePropertyVector(std::string const& name) _properties.find(name) ); if (it == _properties.end()) { - WARN("A property of the name '%s' does not exist.", name.c_str()); + WARN("A property of the name '{:s}' does not exist.", name.c_str()); return; } delete it->second; diff --git a/MeshLib/PropertyVector.h b/MeshLib/PropertyVector.h index 1a4f3fdf09ded126bbcf275f028427d0269b20e7..b79aecce97954194434b297c95f921abc2f9997a 100644 --- a/MeshLib/PropertyVector.h +++ b/MeshLib/PropertyVector.h @@ -231,8 +231,8 @@ public: if (p == nullptr) { OGS_FATAL( - "No data found in the property vector %s " - "for the tuple index %d and component %d", + "No data found in the property vector {:s} " + "for the tuple index {:d} and component {:d}", getPropertyName().c_str(), tuple_index, component); } return p[component]; diff --git a/MeshLib/Vtk/VtkMappedMeshSource.cpp b/MeshLib/Vtk/VtkMappedMeshSource.cpp index c31e9dfbd80bf38159c6709f797e38bc11fed3c8..064dff910b958547e30b328125e0a45f7a67f2ee 100644 --- a/MeshLib/Vtk/VtkMappedMeshSource.cpp +++ b/MeshLib/Vtk/VtkMappedMeshSource.cpp @@ -172,7 +172,8 @@ int VtkMappedMeshSource::RequestData(vtkInformation* /*request*/, } OGS_FATAL( - "Mesh property '%s' with unknown data type. Please check the data " + "Mesh property '{:s}' with unknown data type. Please check the " + "data " "type of the mesh properties. The available data types are:" "\n\t double," "\n\t float," diff --git a/MeshLib/VtkOGSEnum.cpp b/MeshLib/VtkOGSEnum.cpp index adb03cb5faaa52c278953ccfa6682e6385284a12..ab773418698b4f3890dc8f17c89c8d2a15f9c06b 100644 --- a/MeshLib/VtkOGSEnum.cpp +++ b/MeshLib/VtkOGSEnum.cpp @@ -59,7 +59,7 @@ int OGSToVtkCellType(MeshLib::CellType ogs) default: OGS_FATAL( "Unknown cell type in conversion from OGS to VTK. Given cell " - "type value is %d.", + "type value is {:d}.", ogs); } } diff --git a/MeshLib/convertMeshToGeo.cpp b/MeshLib/convertMeshToGeo.cpp index 2b6776c7dbdb51a5b80818c48f3a003cc2c685b5..3f0fe7b1f1a67f2492aa99ba5113f36708a287ae 100644 --- a/MeshLib/convertMeshToGeo.cpp +++ b/MeshLib/convertMeshToGeo.cpp @@ -103,7 +103,7 @@ bool convertMeshToGeo(const MeshLib::Mesh& mesh, { OGS_FATAL( "Could not get minimum/maximum ranges values for the " - "MaterialIDs property in the mesh '%s'.", + "MaterialIDs property in the mesh '{:s}'.", mesh.getName().c_str()); } return std::make_tuple(materialIds, *bounds); diff --git a/NumLib/DOF/LocalToGlobalIndexMap.cpp b/NumLib/DOF/LocalToGlobalIndexMap.cpp index 9d2958b96a7f7653916f61903726c4b0f7a00c52..83fa3a9f5ec1033be8534f02d1fc5a80d37d6464 100644 --- a/NumLib/DOF/LocalToGlobalIndexMap.cpp +++ b/NumLib/DOF/LocalToGlobalIndexMap.cpp @@ -209,7 +209,7 @@ LocalToGlobalIndexMap::LocalToGlobalIndexMap( { OGS_FATAL( "Number of mesh subsets is not equal to number of components. " - "There are %d mesh subsets and %d components.", + "There are {:d} mesh subsets and {:d} components.", _mesh_subsets.size(), global_component_ids.size()); } diff --git a/NumLib/DOF/MeshComponentMap.cpp b/NumLib/DOF/MeshComponentMap.cpp index badc124d5fd621ee28d040e90496af6030adea64..a69b7c9f13ffd3b8feafd2b7b8df629d5f22a328 100644 --- a/NumLib/DOF/MeshComponentMap.cpp +++ b/NumLib/DOF/MeshComponentMap.cpp @@ -126,7 +126,7 @@ MeshComponentMap MeshComponentMap::getSubset( OGS_FATAL( "Assumption in the MeshComponentMap violated. Expecting " "all of mesh ids to be the same, but it is not true for " - "the mesh '%s' with id %d.", + "the mesh '{:s}' with id {:d}.", first_mismatch->getMesh().getName().c_str(), first_mismatch->getMeshID()); } @@ -173,9 +173,11 @@ MeshComponentMap MeshComponentMap::getSubset( if (is_base_node) { OGS_FATAL( - "Could not find a global index for global component %d " - "for the mesh '%s', node %d, in the corresponding bulk " - "mesh '%s' and node %d. This happens because the " + "Could not find a global index for global component " + "{:d} " + "for the mesh '{:s}', node {:d}, in the corresponding " + "bulk " + "mesh '{:s}' and node {:d}. This happens because the " "boundary mesh is larger then the definition region of " "the bulk component, usually because the geometry for " "the boundary condition is too large.", @@ -342,7 +344,7 @@ GlobalIndexType MeshComponentMap::getLocalIndex( _ghosts_indices.begin(), _ghosts_indices.end(), real_global_index); if (ghost_index_it == _ghosts_indices.end()) { - OGS_FATAL("index %d not found in ghost_indices", real_global_index); + OGS_FATAL("index {:d} not found in ghost_indices", real_global_index); } // Using std::distance on a std::vector is O(1). As long as _ghost_indices diff --git a/NumLib/Extrapolation/LocalLinearLeastSquaresExtrapolator.cpp b/NumLib/Extrapolation/LocalLinearLeastSquaresExtrapolator.cpp index 24aaec4ab34cc4fd41a851cc7fa0a70e97102608..46096293f72005d74dc7b0e296fd87fc20483a90 100644 --- a/NumLib/Extrapolation/LocalLinearLeastSquaresExtrapolator.cpp +++ b/NumLib/Extrapolation/LocalLinearLeastSquaresExtrapolator.cpp @@ -160,7 +160,7 @@ void LocalLinearLeastSquaresExtrapolator::extrapolateElement( OGS_FATAL( "The number of computed integration point values is not divisable " "by the number of num_components. Maybe the computed property is " - "not a %d-component vector for each integration point.", + "not a {:d}-component vector for each integration point.", num_components); } @@ -289,7 +289,7 @@ void LocalLinearLeastSquaresExtrapolator::calculateResidualElement( OGS_FATAL( "The number of computed integration point values is not divisable " "by the number of num_components. Maybe the computed property is " - "not a %d-component vector for each integration point.", + "not a {:d}-component vector for each integration point.", num_components); } diff --git a/NumLib/Fem/CoordinatesMapping/NaturalCoordinatesMapping.cpp b/NumLib/Fem/CoordinatesMapping/NaturalCoordinatesMapping.cpp index c8b17dd35ab8522f2bd9052ee9d0ece97ccc1d88..f33dac6f53cde2aa074efbe8780ec6a778f63edf 100644 --- a/NumLib/Fem/CoordinatesMapping/NaturalCoordinatesMapping.cpp +++ b/NumLib/Fem/CoordinatesMapping/NaturalCoordinatesMapping.cpp @@ -108,7 +108,9 @@ static void checkJacobianDeterminant(const double detJ, if (detJ < 0) { - ERR("det J = %g is negative for element %d.", detJ, element.getID()); + ERR("det J = {:g} is negative for element {:d}.", + detJ, + element.getID()); #ifndef NDEBUG std::cerr << element << "\n"; #endif // NDEBUG @@ -119,7 +121,7 @@ static void checkJacobianDeterminant(const double detJ, if (detJ == 0) { - ERR("det J is zero for element %d.", element.getID()); + ERR("det J is zero for element {:d}.", element.getID()); #ifndef NDEBUG std::cerr << element << "\n"; #endif // NDEBUG diff --git a/NumLib/NewtonRaphson.h b/NumLib/NewtonRaphson.h index eb0209080e473aad136bbaea438da9f08cf8f708..290c3149ae8c828a8f321a5d3503acb5387a47af 100644 --- a/NumLib/NewtonRaphson.h +++ b/NumLib/NewtonRaphson.h @@ -71,20 +71,21 @@ public: increment.noalias() = _linear_solver.compute(jacobian).solve(-residual); - // DBUG("Local linear solver accuracy |J dx - r| = %g", + // DBUG("Local linear solver accuracy |J dx - r| = {:g}", // (jacobian * increment + residual).norm()); _solution_update(increment); - // DBUG("Local Newton: Iteration #%d |dx| = %g, |r| = %g", + // DBUG("Local Newton: Iteration #{:d} |dx| = {:g}, |r| = {:g}", // iteration, increment.norm(), residual.norm()); } while (iteration++ < _maximum_iterations); if (iteration > _maximum_iterations) { ERR("The local Newton method did not converge within the given " - "number of iterations. Iteration: %d, increment %g, residual: " - "%g", + "number of iterations. Iteration: {:d}, increment {:g}, " + "residual: " + "{:g}", iteration - 1, increment.norm(), residual.norm()); return {}; } diff --git a/NumLib/ODESolver/ConvergenceCriterion.cpp b/NumLib/ODESolver/ConvergenceCriterion.cpp index 7924e9176aeec1c455c01021734625170981cf45..5babc76d086b4cb442736f49b58661189afdfb5d 100644 --- a/NumLib/ODESolver/ConvergenceCriterion.cpp +++ b/NumLib/ODESolver/ConvergenceCriterion.cpp @@ -41,7 +41,8 @@ std::unique_ptr<ConvergenceCriterion> createConvergenceCriterion( return createConvergenceCriterionPerComponentResidual(config); } - OGS_FATAL("There is no convergence criterion of type `%s'.", type.c_str()); + OGS_FATAL("There is no convergence criterion of type `{:s}'.", + type.c_str()); } bool checkRelativeTolerance(const double reltol, const double numerator, diff --git a/NumLib/ODESolver/ConvergenceCriterionDeltaX.cpp b/NumLib/ODESolver/ConvergenceCriterionDeltaX.cpp index 2c846325e663b4291cb3148c4f2837a4b7c0669a..438caf36a27a555a5b157b8d64599d5669f004b8 100644 --- a/NumLib/ODESolver/ConvergenceCriterionDeltaX.cpp +++ b/NumLib/ODESolver/ConvergenceCriterionDeltaX.cpp @@ -38,8 +38,8 @@ void ConvergenceCriterionDeltaX::checkDeltaX(const GlobalVector& minus_delta_x, auto error_dx = MathLib::LinAlg::norm(minus_delta_x, _norm_type); auto norm_x = MathLib::LinAlg::norm(x, _norm_type); - INFO("Convergence criterion: |dx|=%.4e, |x|=%.4e, |dx|/|x|=%.4e", error_dx, - norm_x, + INFO("Convergence criterion: |dx|={:.4e}, |x|={:.4e}, |dx|/|x|={:.4e}", + error_dx, norm_x, (norm_x == 0. ? std::numeric_limits<double>::quiet_NaN() : (error_dx / norm_x))); @@ -73,7 +73,7 @@ std::unique_ptr<ConvergenceCriterionDeltaX> createConvergenceCriterionDeltaX( if (norm_type == MathLib::VecNormType::INVALID) { - OGS_FATAL("Unknown vector norm type `%s'.", norm_type_str.c_str()); + OGS_FATAL("Unknown vector norm type `{:s}'.", norm_type_str.c_str()); } return std::make_unique<ConvergenceCriterionDeltaX>( diff --git a/NumLib/ODESolver/ConvergenceCriterionPerComponentDeltaX.cpp b/NumLib/ODESolver/ConvergenceCriterionPerComponentDeltaX.cpp index a289aa81bdeeaa741650a0d8285123df65bdd641..8fe5bffb16b150a644ce01408d3443c12cee354d 100644 --- a/NumLib/ODESolver/ConvergenceCriterionPerComponentDeltaX.cpp +++ b/NumLib/ODESolver/ConvergenceCriterionPerComponentDeltaX.cpp @@ -60,8 +60,8 @@ void ConvergenceCriterionPerComponentDeltaX::checkDeltaX( norm(x, global_component, _norm_type, *_dof_table, *_mesh); INFO( - "Convergence criterion, component %u: |dx|=%.4e, |x|=%.4e, " - "|dx|/|x|=%.4e", + "Convergence criterion, component {:d}: |dx|={:.4e}, |x|={:.4e}, " + "|dx|/|x|={:.4e}", global_component, error_dx, norm_x, (norm_x == 0. ? std::numeric_limits<double>::quiet_NaN() : (error_dx / norm_x))); @@ -122,7 +122,7 @@ createConvergenceCriterionPerComponentDeltaX(const BaseLib::ConfigTree& config) if (norm_type == MathLib::VecNormType::INVALID) { - OGS_FATAL("Unknown vector norm type `%s'.", norm_type_str.c_str()); + OGS_FATAL("Unknown vector norm type `{:s}'.", norm_type_str.c_str()); } return std::make_unique<ConvergenceCriterionPerComponentDeltaX>( diff --git a/NumLib/ODESolver/ConvergenceCriterionPerComponentResidual.cpp b/NumLib/ODESolver/ConvergenceCriterionPerComponentResidual.cpp index e725ee37a9b3c579225246c73402a026bc1aaa4c..0a9d3196c369c2d8c58df1988e0a91bdacca50a4 100644 --- a/NumLib/ODESolver/ConvergenceCriterionPerComponentResidual.cpp +++ b/NumLib/ODESolver/ConvergenceCriterionPerComponentResidual.cpp @@ -59,8 +59,8 @@ void ConvergenceCriterionPerComponentResidual::checkDeltaX( norm(x, global_component, _norm_type, *_dof_table, *_mesh); INFO( - "Convergence criterion, component %u: |dx|=%.4e, |x|=%.4e, " - "|dx|/|x|=%.4e", + "Convergence criterion, component {:d}: |dx|={:.4e}, |x|={:.4e}, " + "|dx|/|x|={:.4e}", global_component, error_dx, norm_x, (norm_x == 0. ? std::numeric_limits<double>::quiet_NaN() : (error_dx / norm_x))); @@ -89,13 +89,15 @@ void ConvergenceCriterionPerComponentResidual::checkResidual( *_dof_table, *_mesh); if (_is_first_iteration) { - INFO("Convergence criterion, component %u: |r0|=%.4e", global_component, norm_res); + INFO("Convergence criterion, component {:d}: |r0|={:.4e}", + global_component, norm_res); _residual_norms_0[global_component] = norm_res; } else { auto const norm_res0 = _residual_norms_0[global_component]; INFO( - "Convergence criterion, component %u: |r|=%.4e, |r0|=%.4e, " - "|r|/|r0|=%.4e", + "Convergence criterion, component {:d}: |r|={:.4e}, " + "|r0|={:.4e}, " + "|r|/|r0|={:.4e}", global_component, norm_res, norm_res0, (norm_res0 == 0. ? std::numeric_limits<double>::quiet_NaN() : (norm_res / norm_res0))); @@ -159,7 +161,7 @@ createConvergenceCriterionPerComponentResidual( if (norm_type == MathLib::VecNormType::INVALID) { - OGS_FATAL("Unknown vector norm type `%s'.", norm_type_str.c_str()); + OGS_FATAL("Unknown vector norm type `{:s}'.", norm_type_str.c_str()); } return std::make_unique<ConvergenceCriterionPerComponentResidual>( diff --git a/NumLib/ODESolver/ConvergenceCriterionResidual.cpp b/NumLib/ODESolver/ConvergenceCriterionResidual.cpp index 97196e21aba2db8c2674ddcc414e271f8950de54..1d94919c10273046ef9777bb0b04241148374a33 100644 --- a/NumLib/ODESolver/ConvergenceCriterionResidual.cpp +++ b/NumLib/ODESolver/ConvergenceCriterionResidual.cpp @@ -38,8 +38,8 @@ void ConvergenceCriterionResidual::checkDeltaX( auto error_dx = MathLib::LinAlg::norm(minus_delta_x, _norm_type); auto norm_x = MathLib::LinAlg::norm(x, _norm_type); - INFO("Convergence criterion: |dx|=%.4e, |x|=%.4e, |dx|/|x|=%.4e", error_dx, - norm_x, + INFO("Convergence criterion: |dx|={:.4e}, |x|={:.4e}, |dx|/|x|={:.4e}", + error_dx, norm_x, (norm_x == 0. ? std::numeric_limits<double>::quiet_NaN() : (error_dx / norm_x))); } @@ -50,7 +50,7 @@ void ConvergenceCriterionResidual::checkResidual(const GlobalVector& residual) if (_is_first_iteration) { - INFO("Convergence criterion: |r0|=%.4e", norm_res); + INFO("Convergence criterion: |r0|={:.4e}", norm_res); _residual_norm_0 = norm_res; } else @@ -61,16 +61,17 @@ void ConvergenceCriterionResidual::checkResidual(const GlobalVector& residual) : _residual_norm_0; if (_residual_norm_0 < std::numeric_limits<double>::epsilon()) { - INFO("Convergence criterion: |r|=%.4e |r0|=%.4e", norm_res, + INFO("Convergence criterion: |r|={:.4e} |r0|={:.4e}", norm_res, _residual_norm_0); } else { - INFO("Convergence criterion: |r|=%.4e |r0|=%.4e |r|/|r0|=%.4e", - norm_res, _residual_norm_0, - (_residual_norm_0 == 0. - ? std::numeric_limits<double>::quiet_NaN() - : (norm_res / _residual_norm_0))); + INFO( + "Convergence criterion: |r|={:.4e} |r0|={:.4e} |r|/|r0|={:.4e}", + norm_res, _residual_norm_0, + (_residual_norm_0 == 0. + ? std::numeric_limits<double>::quiet_NaN() + : (norm_res / _residual_norm_0))); } } @@ -107,7 +108,7 @@ createConvergenceCriterionResidual(const BaseLib::ConfigTree& config) if (norm_type == MathLib::VecNormType::INVALID) { - OGS_FATAL("Unknown vector norm type `%s'.", norm_type_str.c_str()); + OGS_FATAL("Unknown vector norm type `{:s}'.", norm_type_str.c_str()); } return std::make_unique<ConvergenceCriterionResidual>( diff --git a/NumLib/ODESolver/NonlinearSolver.cpp b/NumLib/ODESolver/NonlinearSolver.cpp index 97d867739be33822d6c80be4b788f8bed96ee2d1..5d648181bc803e77824b53d4a3ea1872255a6ec0 100644 --- a/NumLib/ODESolver/NonlinearSolver.cpp +++ b/NumLib/ODESolver/NonlinearSolver.cpp @@ -94,7 +94,7 @@ NonlinearSolverStatus NonlinearSolver<NonlinearSolverTag::Picard>::solve( sys.assemble(x_new, process_id); sys.getA(A); sys.getRhs(rhs); - INFO("[time] Assembly took %g s.", time_assembly.elapsed()); + INFO("[time] Assembly took {:g} s.", time_assembly.elapsed()); // Subract non-equilibrium initial residuum if set if (_r_neq != nullptr) @@ -105,7 +105,7 @@ NonlinearSolverStatus NonlinearSolver<NonlinearSolverTag::Picard>::solve( timer_dirichlet.start(); sys.applyKnownSolutionsPicard(A, rhs, *x_new[process_id]); time_dirichlet += timer_dirichlet.elapsed(); - INFO("[time] Applying Dirichlet BCs took %g s.", time_dirichlet); + INFO("[time] Applying Dirichlet BCs took {:g} s.", time_dirichlet); if (!sys.isLinear() && _convergence_criterion->hasResidualCheck()) { GlobalVector res; @@ -118,7 +118,7 @@ NonlinearSolverStatus NonlinearSolver<NonlinearSolverTag::Picard>::solve( time_linear_solver.start(); bool iteration_succeeded = _linear_solver.solve(A, rhs, *x_new[process_id]); - INFO("[time] Linear solver took %g s.", time_linear_solver.elapsed()); + INFO("[time] Linear solver took {:g} s.", time_linear_solver.elapsed()); if (!iteration_succeeded) { @@ -181,7 +181,7 @@ NonlinearSolverStatus NonlinearSolver<NonlinearSolverTag::Picard>::solve( // Update x s.t. in the next iteration we will compute the right delta x LinAlg::copy(*x_new[process_id], *x[process_id]); - INFO("[time] Iteration #%u took %g s.", iteration, + INFO("[time] Iteration #{:d} took {:g} s.", iteration, time_iteration.elapsed()); if (error_norms_met) @@ -199,7 +199,7 @@ NonlinearSolverStatus NonlinearSolver<NonlinearSolverTag::Picard>::solve( if (iteration > _maxiter) { - ERR("Picard: Could not solve the given nonlinear system within %u " + ERR("Picard: Could not solve the given nonlinear system within {:d} " "iterations", _maxiter); } @@ -284,7 +284,7 @@ NonlinearSolverStatus NonlinearSolver<NonlinearSolverTag::Newton>::solve( } catch (AssemblyException const& e) { - ERR("Abort nonlinear iteration. Repeating timestep. Reason: %s", + ERR("Abort nonlinear iteration. Repeating timestep. Reason: {:s}", e.what()); error_norms_met = false; iteration = _maxiter; @@ -292,7 +292,7 @@ NonlinearSolverStatus NonlinearSolver<NonlinearSolverTag::Newton>::solve( } sys.getResidual(*x[process_id], res); sys.getJacobian(J); - INFO("[time] Assembly took %g s.", time_assembly.elapsed()); + INFO("[time] Assembly took {:g} s.", time_assembly.elapsed()); // Subract non-equilibrium initial residuum if set if (_r_neq != nullptr) @@ -303,7 +303,7 @@ NonlinearSolverStatus NonlinearSolver<NonlinearSolverTag::Newton>::solve( timer_dirichlet.start(); sys.applyKnownSolutionsNewton(J, res, minus_delta_x); time_dirichlet += timer_dirichlet.elapsed(); - INFO("[time] Applying Dirichlet BCs took %g s.", time_dirichlet); + INFO("[time] Applying Dirichlet BCs took {:g} s.", time_dirichlet); if (!sys.isLinear() && _convergence_criterion->hasResidualCheck()) { @@ -313,7 +313,7 @@ NonlinearSolverStatus NonlinearSolver<NonlinearSolverTag::Newton>::solve( BaseLib::RunTime time_linear_solver; time_linear_solver.start(); bool iteration_succeeded = _linear_solver.solve(J, res, minus_delta_x); - INFO("[time] Linear solver took %g s.", time_linear_solver.elapsed()); + INFO("[time] Linear solver took {:g} s.", time_linear_solver.elapsed()); if (!iteration_succeeded) { @@ -382,7 +382,7 @@ NonlinearSolverStatus NonlinearSolver<NonlinearSolverTag::Newton>::solve( error_norms_met = _convergence_criterion->isSatisfied(); } - INFO("[time] Iteration #%u took %g s.", iteration, + INFO("[time] Iteration #{:d} took {:g} s.", iteration, time_iteration.elapsed()); if (error_norms_met) @@ -400,7 +400,7 @@ NonlinearSolverStatus NonlinearSolver<NonlinearSolverTag::Newton>::solve( if (iteration > _maxiter) { - ERR("Newton: Could not solve the given nonlinear system within %u " + ERR("Newton: Could not solve the given nonlinear system within {:d} " "iterations", _maxiter); } @@ -436,7 +436,7 @@ createNonlinearSolver(GlobalLinearSolver& linear_solver, { OGS_FATAL( "The damping factor for the Newon method must be positive, got " - "%g.", + "{:g}.", damping); } auto const tag = NonlinearSolverTag::Newton; diff --git a/NumLib/ODESolver/TimeDiscretizationBuilder.cpp b/NumLib/ODESolver/TimeDiscretizationBuilder.cpp index a79f66160a71fe3375e8b4425f9364251363f25a..59fbb2070daed49627de36a5192ebc81e3019c56 100644 --- a/NumLib/ODESolver/TimeDiscretizationBuilder.cpp +++ b/NumLib/ODESolver/TimeDiscretizationBuilder.cpp @@ -45,6 +45,6 @@ std::unique_ptr<TimeDiscretization> createTimeDiscretization( return std::make_unique<BackwardDifferentiationFormula>(order); } - OGS_FATAL("Unrecognized time discretization type `%s'", type.c_str()); + OGS_FATAL("Unrecognized time discretization type `{:s}'", type.c_str()); } } // namespace NumLib diff --git a/NumLib/TimeStepping/Algorithms/CreateFixedTimeStepping.cpp b/NumLib/TimeStepping/Algorithms/CreateFixedTimeStepping.cpp index 39ef6017d81c083af0ed80c10ed20df42a2adfba..b35a8600f66c6033de1db5f199398a4e11e56e5f 100644 --- a/NumLib/TimeStepping/Algorithms/CreateFixedTimeStepping.cpp +++ b/NumLib/TimeStepping/Algorithms/CreateFixedTimeStepping.cpp @@ -72,9 +72,9 @@ std::unique_ptr<TimeStepAlgorithm> createFixedTimeStepping( { OGS_FATAL( "Resize of the time steps vector failed for the requested " - "new size %u. Probably there is not enough memory (%g GiB " - "requested).\n" - "Thrown exception: %s", + "new size {:d}. Probably there is not enough memory ({:g} " + "GiB requested).\n" + "Thrown exception: {:s}", new_size, new_size * sizeof(double) / 1024. / 1024. / 1024., e.what()); @@ -83,9 +83,9 @@ std::unique_ptr<TimeStepAlgorithm> createFixedTimeStepping( { OGS_FATAL( "Resize of the time steps vector failed for the requested " - "new size %u. Probably there is not enough memory (%g GiB " - "requested).\n" - "Thrown exception: %s", + "new size {:d}. Probably there is not enough memory ({:g} " + "GiB requested).\n" + "Thrown exception: {:s}", new_size, new_size * sizeof(double) / 1024. / 1024. / 1024., e.what()); } @@ -108,9 +108,9 @@ std::unique_ptr<TimeStepAlgorithm> createFixedTimeStepping( { OGS_FATAL( "Resize of the time steps vector failed for the requested new " - "size %u. Probably there is not enough memory (%g GiB " + "size {:d}. Probably there is not enough memory ({:g} GiB " "requested).\n" - "Thrown exception: %s", + "Thrown exception: {:s}", new_size, new_size * sizeof(double) / 1024. / 1024. / 1024., e.what()); @@ -119,9 +119,9 @@ std::unique_ptr<TimeStepAlgorithm> createFixedTimeStepping( { OGS_FATAL( "Resize of the time steps vector failed for the requested new " - "size %u. Probably there is not enough memory (%g GiB " + "size {:d}. Probably there is not enough memory ({:g} GiB " "requested).\n" - "Thrown exception: %s", + "Thrown exception: {:s}", new_size, new_size * sizeof(double) / 1024. / 1024. / 1024., e.what()); } diff --git a/NumLib/TimeStepping/Algorithms/EvolutionaryPIDcontroller.cpp b/NumLib/TimeStepping/Algorithms/EvolutionaryPIDcontroller.cpp index 9810500f20775cbaa4bc051f7438568b6626fd5f..b0d0c3de1a6a2d162413a8100a29633a19238994 100644 --- a/NumLib/TimeStepping/Algorithms/EvolutionaryPIDcontroller.cpp +++ b/NumLib/TimeStepping/Algorithms/EvolutionaryPIDcontroller.cpp @@ -66,9 +66,9 @@ bool EvolutionaryPIDcontroller::next(double const solution_error, "This step is rejected due to the relative change from the" " solution of the previous\n" "\t time step to the current solution exceeds the given tolerance" - " of %g.\n" + " of {:g}.\n" "\t This time step will be repeated with a new time step size of" - " %g\n" + " {:g}\n" "\t or the simulation will be halted.", _tol, h_new); diff --git a/NumLib/TimeStepping/Algorithms/TimeStepAlgorithm.h b/NumLib/TimeStepping/Algorithms/TimeStepAlgorithm.h index faf0a559f57379d1a7729ebd6300b5442d0b3b8f..c65c9f7b8b86384ac83d4c9affa1ae90cdc5e489 100644 --- a/NumLib/TimeStepping/Algorithms/TimeStepAlgorithm.h +++ b/NumLib/TimeStepping/Algorithms/TimeStepAlgorithm.h @@ -44,9 +44,9 @@ public: { OGS_FATAL( "Resize of the time steps vector failed for the requested new " - "size %u. Probably there is not enough memory (%g GiB " + "size {:d}. Probably there is not enough memory ({:g} GiB " "requested).\n" - "Thrown exception: %s", + "Thrown exception: {:s}", new_size, new_size * sizeof(double) / 1024. / 1024. / 1024., e.what()); } @@ -54,9 +54,9 @@ public: { OGS_FATAL( "Allocation of the time steps vector failed for the requested " - "size %u. Probably there is not enough memory (%d GiB " + "size {:d}. Probably there is not enough memory ({:d} GiB " "requested).\n" - "Thrown exception: %s", + "Thrown exception: {:s}", new_size, new_size * sizeof(double) / 1024. / 1024. / 1024., e.what()); diff --git a/NumLib/TimeStepping/CreateTimeStepper.cpp b/NumLib/TimeStepping/CreateTimeStepper.cpp index cd24414076f564912d7d3741a6bf84d2fcc7dd63..1623568cecbef115f5883268e9c1736fb2279d8a 100644 --- a/NumLib/TimeStepping/CreateTimeStepper.cpp +++ b/NumLib/TimeStepping/CreateTimeStepper.cpp @@ -49,7 +49,7 @@ std::unique_ptr<TimeStepAlgorithm> createTimeStepper( return NumLib::createIterationNumberBasedTimeStepping(config); } OGS_FATAL( - "Unknown time stepping type: '%s'. The available types are: " + "Unknown time stepping type: '{:s}'. The available types are: " "\n\tSingleStep," "\n\tFixedTimeStepping," "\n\tEvolutionaryPIDcontroller,", diff --git a/ParameterLib/ConstantParameter.cpp b/ParameterLib/ConstantParameter.cpp index f38fc02ac80619c08190419a8e9d99c7e3958726..9091ba090c374ec8ab415566eece2cf9f17a227b 100644 --- a/ParameterLib/ConstantParameter.cpp +++ b/ParameterLib/ConstantParameter.cpp @@ -34,10 +34,10 @@ std::unique_ptr<ParameterBase> createConstantParameter( if (value->size() != 1) { OGS_FATAL( - "Expected to read exactly one value, but %d were given.", + "Expected to read exactly one value, but {:d} were given.", value->size()); } - DBUG("Using value %g for constant parameter.", (*value)[0]); + DBUG("Using value {:g} for constant parameter.", (*value)[0]); return std::make_unique<ConstantParameter<double>>(name, (*value)[0]); } @@ -57,7 +57,7 @@ std::unique_ptr<ParameterBase> createConstantParameter( for (double const v : values) { (void)v; // unused value if building w/o DBUG output. - DBUG("\t%g", v); + DBUG("\t{:g}", v); } return std::make_unique<ConstantParameter<double>>(name, values); diff --git a/ParameterLib/CoordinateSystem.cpp b/ParameterLib/CoordinateSystem.cpp index 0dc9fc8bb4acb4c30b5c3b590de7b25eb338cad5..510e8172971bdf44a291d2ce11f417d6ddf0c146 100644 --- a/ParameterLib/CoordinateSystem.cpp +++ b/ParameterLib/CoordinateSystem.cpp @@ -23,8 +23,9 @@ CoordinateSystem::CoordinateSystem(Parameter<double> const& e0, if (typeid(_base[0]) != typeid(_base[1])) { OGS_FATAL( - "The parameter types for the basis must be equal but they are '%s' " - "and '%s'.", + "The parameter types for the basis must be equal but they are " + "'{:s}' " + "and '{:s}'.", typeid(_base[0]).name(), typeid(_base[1]).name()); } @@ -50,7 +51,7 @@ CoordinateSystem::CoordinateSystem(Parameter<double> const& e0, { OGS_FATAL( "The parameter types for the basis must be equal but they are " - "'%s', '%s', and '%s'.", + "'{:s}', '{:s}', and '{:s}'.", typeid(_base[0]).name(), typeid(_base[1]).name(), typeid(_base[2]).name()); @@ -90,7 +91,7 @@ Eigen::Matrix<double, 2, 2> CoordinateSystem::transformation<2>( { OGS_FATAL( "The determinant of the coordinate system transformation matrix is " - "'%g', which is not sufficiently close to unity.", + "'{:g}', which is not sufficiently close to unity.", t.determinant()); } #endif // NDEBUG @@ -119,7 +120,7 @@ Eigen::Matrix<double, 3, 3> CoordinateSystem::transformation<3>( { OGS_FATAL( "The determinant of the coordinate system transformation matrix is " - "'%g', which is not sufficiently close to unity.", + "'{:g}', which is not sufficiently close to unity.", t.determinant()); } #endif // NDEBUG @@ -144,7 +145,7 @@ Eigen::Matrix<double, 3, 3> CoordinateSystem::transformation_3d( { OGS_FATAL( "The determinant of the coordinate system transformation matrix is " - "'%g', which is not sufficiently close to unity.", + "'{:g}', which is not sufficiently close to unity.", t.determinant()); } #endif // NDEBUG diff --git a/ParameterLib/CurveScaledParameter.cpp b/ParameterLib/CurveScaledParameter.cpp index 117be7f8c81b004025803357398e4f29d083f3ae..94ba48e4cb876f8e764121c2c8aca7b00f7c82b2 100644 --- a/ParameterLib/CurveScaledParameter.cpp +++ b/ParameterLib/CurveScaledParameter.cpp @@ -25,18 +25,18 @@ std::unique_ptr<ParameterBase> createCurveScaledParameter( //! \ogs_file_param{prj__parameters__parameter__CurveScaled__curve} auto curve_name = config.getConfigParameter<std::string>("curve"); - DBUG("Using curve %s", curve_name.c_str()); + DBUG("Using curve {:s}", curve_name.c_str()); auto const curve_it = curves.find(curve_name); if (curve_it == curves.end()) { - OGS_FATAL("Curve `%s' does not exists.", curve_name.c_str()); + OGS_FATAL("Curve `{:s}' does not exists.", curve_name.c_str()); } auto referenced_parameter_name = //! \ogs_file_param{prj__parameters__parameter__CurveScaled__parameter} config.getConfigParameter<std::string>("parameter"); - DBUG("Using parameter %s", referenced_parameter_name.c_str()); + DBUG("Using parameter {:s}", referenced_parameter_name.c_str()); // TODO other data types than only double return std::make_unique<CurveScaledParameter<double>>( diff --git a/ParameterLib/FunctionParameter.h b/ParameterLib/FunctionParameter.h index 98e922648274b8a5d1613ca2797cb980fbadcb87..acfa869a4ce3d4cb63641120c915c79397be7b47 100644 --- a/ParameterLib/FunctionParameter.h +++ b/ParameterLib/FunctionParameter.h @@ -61,7 +61,8 @@ struct FunctionParameter final : public Parameter<T> parser_t parser; if (!parser.compile(_vec_expression_str[i], _vec_expression[i])) { - OGS_FATAL("Error: %s\tExpression: %s\n", parser.error().c_str(), + OGS_FATAL("Error: {:s}\tExpression: {:s}\n", + parser.error().c_str(), _vec_expression_str[i].c_str()); } } diff --git a/ParameterLib/GroupBasedParameter.cpp b/ParameterLib/GroupBasedParameter.cpp index 2ed9e87313b78c8451af3146ede0603c012b5914..512eaeb1eed63d4d6e05db0c6bd2a1830a5a4644 100644 --- a/ParameterLib/GroupBasedParameter.cpp +++ b/ParameterLib/GroupBasedParameter.cpp @@ -27,7 +27,7 @@ std::unique_ptr<ParameterBase> createGroupBasedParameter( std::string const group_id_property_name = //! \ogs_file_param{prj__parameters__parameter__Group__group_id_property} config.getConfigParameter<std::string>("group_id_property"); - DBUG("Using group_id_property %s", group_id_property_name.c_str()); + DBUG("Using group_id_property {:s}", group_id_property_name.c_str()); auto const& group_id_property = mesh.getProperties().getPropertyVector<int>(group_id_property_name); @@ -74,16 +74,16 @@ std::unique_ptr<ParameterBase> createGroupBasedParameter( if (itr == group_id_property->end()) { OGS_FATAL( - "Specified property index %d does not exist in the property " - "vector %s", + "Specified property index {:d} does not exist in the property " + "vector {:s}", p.first, group_id_property_name.c_str()); } if (p.second.size() != n_values) { OGS_FATAL( - "The length of some values (%d) is different from the first " - "one (%d). " + "The length of some values ({:d}) is different from the first " + "one ({:d}). " "The length should be same for all index_values.", p.second.size(), n_values); } diff --git a/ParameterLib/GroupBasedParameter.h b/ParameterLib/GroupBasedParameter.h index 2728e36ae81aa5b43bf332408bd48d708b124b2d..833ab79289edc37b9386a3708f300204262b88c0 100644 --- a/ParameterLib/GroupBasedParameter.h +++ b/ParameterLib/GroupBasedParameter.h @@ -67,7 +67,7 @@ struct GroupBasedParameter final : public Parameter<T> auto const& values = _vec_values[index]; if (values.empty()) { - OGS_FATAL("No data found for the group index %d", index); + OGS_FATAL("No data found for the group index {:d}", index); } if (!this->_coordinate_system) diff --git a/ParameterLib/MeshElementParameter.cpp b/ParameterLib/MeshElementParameter.cpp index af75cff185a566724b0d65ec93fd44c73198b801..f953c815bed8a4de234c340610c03d685ae330c4 100644 --- a/ParameterLib/MeshElementParameter.cpp +++ b/ParameterLib/MeshElementParameter.cpp @@ -23,7 +23,7 @@ std::unique_ptr<ParameterBase> createMeshElementParameter( auto const field_name = //! \ogs_file_param{prj__parameters__parameter__MeshElement__field_name} config.getConfigParameter<std::string>("field_name"); - DBUG("Using field_name %s", field_name.c_str()); + DBUG("Using field_name {:s}", field_name.c_str()); // TODO other data types than only double auto const& property = @@ -31,7 +31,7 @@ std::unique_ptr<ParameterBase> createMeshElementParameter( if (property->getMeshItemType() != MeshLib::MeshItemType::Cell) { - OGS_FATAL("The mesh property `%s' is not an element property.", + OGS_FATAL("The mesh property `{:s}' is not an element property.", field_name.c_str()); } diff --git a/ParameterLib/MeshNodeParameter.cpp b/ParameterLib/MeshNodeParameter.cpp index 7b9c745551b526f73c4ba7c4e452b43bee1e3ca0..2ff3833aa46f58b49865da9b107a9cd87eee51ba 100644 --- a/ParameterLib/MeshNodeParameter.cpp +++ b/ParameterLib/MeshNodeParameter.cpp @@ -23,7 +23,7 @@ std::unique_ptr<ParameterBase> createMeshNodeParameter( auto const field_name = //! \ogs_file_param{prj__parameters__parameter__MeshNode__field_name} config.getConfigParameter<std::string>("field_name"); - DBUG("Using field_name %s", field_name.c_str()); + DBUG("Using field_name {:s}", field_name.c_str()); // TODO other data types than only double auto const& property = @@ -31,7 +31,7 @@ std::unique_ptr<ParameterBase> createMeshNodeParameter( if (property->getMeshItemType() != MeshLib::MeshItemType::Node) { - OGS_FATAL("The mesh property `%s' is not a nodal property.", + OGS_FATAL("The mesh property `{:s}' is not a nodal property.", field_name.c_str()); } diff --git a/ParameterLib/Parameter.cpp b/ParameterLib/Parameter.cpp index 3b8c84405eb396797105d50136444aaa70735b08..a8b7bd3e6f835e6e0b5a925c5dff94ba7ac1226b 100644 --- a/ParameterLib/Parameter.cpp +++ b/ParameterLib/Parameter.cpp @@ -48,41 +48,42 @@ std::unique_ptr<ParameterBase> createParameter( // Create parameter based on the provided type. if (type == "Constant") { - INFO("ConstantParameter: %s", name.c_str()); + INFO("ConstantParameter: {:s}", name.c_str()); return createConstantParameter(name, config); } if (type == "CurveScaled") { - INFO("CurveScaledParameter: %s", name.c_str()); + INFO("CurveScaledParameter: {:s}", name.c_str()); return createCurveScaledParameter(name, config, curves); } if (type == "Function") { - INFO("FunctionParameter: %s", name.c_str()); + INFO("FunctionParameter: {:s}", name.c_str()); return createFunctionParameter(name, config, mesh); } if (type == "Group") { - INFO("GroupBasedParameter: %s", name.c_str()); + INFO("GroupBasedParameter: {:s}", name.c_str()); return createGroupBasedParameter(name, config, mesh); } if (type == "MeshElement") { - INFO("MeshElementParameter: %s", name.c_str()); + INFO("MeshElementParameter: {:s}", name.c_str()); return createMeshElementParameter(name, config, mesh); } if (type == "MeshNode") { - INFO("MeshNodeParameter: %s", name.c_str()); + INFO("MeshNodeParameter: {:s}", name.c_str()); return createMeshNodeParameter(name, config, mesh); } if (type == "TimeDependentHeterogeneousParameter") { - INFO("TimeDependentHeterogeneousParameter: %s", name.c_str()); + INFO("TimeDependentHeterogeneousParameter: {:s}", name.c_str()); return createTimeDependentHeterogeneousParameter(name, config); } - OGS_FATAL("Cannot construct a parameter of given type '%s'.", type.c_str()); + OGS_FATAL("Cannot construct a parameter of given type '{:s}'.", + type.c_str()); } boost::optional<std::string> isDefinedOnSameMesh(ParameterBase const& parameter, diff --git a/ParameterLib/Parameter.h b/ParameterLib/Parameter.h index bf2ca98f3e321e715879bf9175e9eea2b9dad294..6a835c7c5f233a03621f8c5186f26dad0286afc7 100644 --- a/ParameterLib/Parameter.h +++ b/ParameterLib/Parameter.h @@ -118,7 +118,7 @@ protected: }; } OGS_FATAL( - "Coordinate transformation for a %d-component parameter is not " + "Coordinate transformation for a {:d}-component parameter is not " "implemented.", values.size()); } diff --git a/ParameterLib/TimeDependentHeterogeneousParameter.cpp b/ParameterLib/TimeDependentHeterogeneousParameter.cpp index e3a643781189c38c4bf6dcb720c733a9116b2ac6..063004b449583709a4d95664b3db7762c0b63c69 100644 --- a/ParameterLib/TimeDependentHeterogeneousParameter.cpp +++ b/ParameterLib/TimeDependentHeterogeneousParameter.cpp @@ -78,7 +78,7 @@ std::vector<double> TimeDependentHeterogeneousParameter::operator()( void TimeDependentHeterogeneousParameter::initialize( std::vector<std::unique_ptr<ParameterBase>> const& parameters) { - DBUG("TimeDependentHeterogeneousParameter init %d time series entries.", + DBUG("TimeDependentHeterogeneousParameter init {:d} time series entries.", _time_parameter_name_mapping.size()); for (auto const& time_parameter_map : _time_parameter_name_mapping) { @@ -98,7 +98,7 @@ void TimeDependentHeterogeneousParameter::initialize( { OGS_FATAL( "All referenced parameters in time dependent heterogeneous " - "parameter '%s' have to have the same number of components.", + "parameter '{:s}' have to have the same number of components.", name.c_str()); } } @@ -128,7 +128,7 @@ std::unique_ptr<ParameterBase> createTimeDependentHeterogeneousParameter( if (time_series.empty()) { OGS_FATAL( - "Time dependent heterogeneous parameter '%s' doesn't contain " + "Time dependent heterogeneous parameter '{:s}' doesn't contain " "necessary time series data.", name.c_str()); } @@ -141,7 +141,7 @@ std::unique_ptr<ParameterBase> createTimeDependentHeterogeneousParameter( p1) { return p0.first < p1.first; })) { OGS_FATAL( - "The points in time in the time series '%s' aren't in ascending " + "The points in time in the time series '{:s}' aren't in ascending " "order.", name.c_str()); } diff --git a/ParameterLib/Utils.cpp b/ParameterLib/Utils.cpp index ab90282693770e1bad3c29091ddc1562452b2fad..58525d1f53a9046a802d0613424f5602bb975ea9 100644 --- a/ParameterLib/Utils.cpp +++ b/ParameterLib/Utils.cpp @@ -28,7 +28,7 @@ ParameterBase* findParameterByName( return nullptr; } - DBUG("Found parameter `%s'.", (*it)->name.c_str()); + DBUG("Found parameter `{:s}'.", (*it)->name.c_str()); return it->get(); } } // namespace ParameterLib diff --git a/ParameterLib/Utils.h b/ParameterLib/Utils.h index a7f7dfa6e48ecbd556a5af82ef9baf1647e22e52..10eef070febfd0740b2a24f798aadf4e98fbcd64 100644 --- a/ParameterLib/Utils.h +++ b/ParameterLib/Utils.h @@ -57,7 +57,7 @@ Parameter<ParameterDataType>* findParameterOptional( dynamic_cast<Parameter<ParameterDataType>*>(parameter_ptr); if (!parameter) { - OGS_FATAL("The read parameter `%s' is of incompatible type.", + OGS_FATAL("The read parameter `{:s}' is of incompatible type.", parameter_name.c_str()); } @@ -65,8 +65,9 @@ Parameter<ParameterDataType>* findParameterOptional( parameter->getNumberOfComponents() != num_components) { OGS_FATAL( - "The read parameter `%s' has the wrong number of components (%lu " - "instead of %u).", + "The read parameter `{:s}' has the wrong number of components " + "({:d} " + "instead of {:d}).", parameter_name.c_str(), parameter->getNumberOfComponents(), num_components); } @@ -78,7 +79,7 @@ Parameter<ParameterDataType>* findParameterOptional( { OGS_FATAL( "The found parameter is not suitable for the use on the " - "required mesh.\n%s", + "required mesh.\n{:s}", error->c_str()); } } @@ -110,7 +111,7 @@ Parameter<ParameterDataType>& findParameter( if (!parameter) { OGS_FATAL( - "Could not find parameter `%s' in the provided parameters list.", + "Could not find parameter `{:s}' in the provided parameters list.", parameter_name.c_str()); } return *parameter; diff --git a/ProcessLib/BoundaryCondition/ConstraintDirichletBoundaryCondition.cpp b/ProcessLib/BoundaryCondition/ConstraintDirichletBoundaryCondition.cpp index 8722182e4b3df6ede948e82d114495c023783f44..6e958f8dab1fe6af64ee3faf3543462ab12972c9 100644 --- a/ProcessLib/BoundaryCondition/ConstraintDirichletBoundaryCondition.cpp +++ b/ProcessLib/BoundaryCondition/ConstraintDirichletBoundaryCondition.cpp @@ -47,16 +47,17 @@ ConstraintDirichletBoundaryCondition::ConstraintDirichletBoundaryCondition( dof_table_bulk.getNumberOfVariableComponents(variable_id)) { OGS_FATAL( - "Variable id or component id too high. Actual values: (%d, " - "%d), maximum values: (%d, %d).", + "Variable id or component id too high. Actual values: ({:d}, " + "{:d}), maximum values: ({:d}, {:d}).", variable_id, component_id, dof_table_bulk.getNumberOfVariables(), dof_table_bulk.getNumberOfVariableComponents(variable_id)); } std::vector<MeshLib::Node*> const& bc_nodes = _bc_mesh.getNodes(); DBUG( - "Found %d nodes for constraint Dirichlet BCs for the variable %d and " - "component %d", + "Found {:d} nodes for constraint Dirichlet BCs for the variable {:d} " + "and " + "component {:d}", bc_nodes.size(), variable_id, component_id); MeshLib::MeshSubset bc_mesh_subset{_bc_mesh, bc_nodes}; @@ -219,7 +220,7 @@ void ConstraintDirichletBoundaryCondition::getEssentialBCValues( bc_values.ids.emplace_back(current_id); bc_values.values.emplace_back(sum / cnt); - DBUG("Found %d constraint dirichlet boundary condition values.", + DBUG("Found {:d} constraint dirichlet boundary condition values.", bc_values.ids.size()); } @@ -240,7 +241,7 @@ createConstraintDirichletBoundaryCondition( config.getConfigParameter<std::string>("constraint_type"); if (constraint_type != "Flux") { - OGS_FATAL("The constraint type is '%s', but has to be 'Flux'.", + OGS_FATAL("The constraint type is '{:s}', but has to be 'Flux'.", constraint_type.c_str()); } @@ -269,9 +270,10 @@ createConstraintDirichletBoundaryCondition( auto const& constraining_process_variable_name = process_variables[variable_id].get().getName(); OGS_FATAL( - "<constraining_process_variable> in process variable name '%s' at " + "<constraining_process_variable> in process variable name '{:s}' " + "at " "geometry 'TODO' : The constraining process variable is set as " - "'%s', but this is not specified in the project file.", + "'{:s}', but this is not specified in the project file.", constraining_process_variable_name.c_str(), constraining_process_variable.c_str()); } @@ -287,7 +289,8 @@ createConstraintDirichletBoundaryCondition( constraint_direction_string != "lower") { OGS_FATAL( - "The constraint direction is '%s', but has to be either 'greater' " + "The constraint direction is '{:s}', but has to be either " + "'greater' " "or 'lower'.", constraint_direction_string.c_str()); } @@ -296,7 +299,7 @@ createConstraintDirichletBoundaryCondition( //! \ogs_file_param{prj__process_variables__process_variable__boundary_conditions__boundary_condition__ConstraintDirichletBoundaryCondition__parameter} auto const param_name = config.getConfigParameter<std::string>("parameter"); - DBUG("Using parameter %s", param_name.c_str()); + DBUG("Using parameter {:s}", param_name.c_str()); auto& param = ParameterLib::findParameter<double>(param_name, parameters, 1, &bc_mesh); diff --git a/ProcessLib/BoundaryCondition/CreateBoundaryCondition.cpp b/ProcessLib/BoundaryCondition/CreateBoundaryCondition.cpp index e6454440924a152e72a22d338a7a138fff6c9bed..b3ca1e122564e07eda0c505c40ab581e3c75556a 100644 --- a/ProcessLib/BoundaryCondition/CreateBoundaryCondition.cpp +++ b/ProcessLib/BoundaryCondition/CreateBoundaryCondition.cpp @@ -43,7 +43,8 @@ std::unique_ptr<BoundaryCondition> createBoundaryCondition( bulk_mesh.isAxiallySymmetric()) { OGS_FATAL( - "The boundary mesh %s axially symmetric but the bulk mesh %s. Both " + "The boundary mesh {:s} axially symmetric but the bulk mesh {:s}. " + "Both " "must have an equal axial symmetry property.", config.boundary_mesh.isAxiallySymmetric() ? "is" : "is not", bulk_mesh.isAxiallySymmetric() ? "is" : "is not"); @@ -130,7 +131,7 @@ std::unique_ptr<BoundaryCondition> createBoundaryCondition( config.config, dof_table, bulk_mesh, variable_id, *config.component_id); } - OGS_FATAL("Unknown boundary condition type: `%s'.", type.c_str()); + OGS_FATAL("Unknown boundary condition type: `{:s}'.", type.c_str()); } } // namespace ProcessLib diff --git a/ProcessLib/BoundaryCondition/DirichletBoundaryCondition.cpp b/ProcessLib/BoundaryCondition/DirichletBoundaryCondition.cpp index da46b7b0121cdbf1c5f7531e39bb97b7bb947d4a..361787d93f78d78b489c6c9945f9c5828c054fc9 100644 --- a/ProcessLib/BoundaryCondition/DirichletBoundaryCondition.cpp +++ b/ProcessLib/BoundaryCondition/DirichletBoundaryCondition.cpp @@ -67,7 +67,7 @@ std::unique_ptr<DirichletBoundaryCondition> createDirichletBoundaryCondition( //! \ogs_file_param{prj__process_variables__process_variable__boundary_conditions__boundary_condition__Dirichlet__parameter} auto const param_name = config.getConfigParameter<std::string>("parameter"); - DBUG("Using parameter %s", param_name.c_str()); + DBUG("Using parameter {:s}", param_name.c_str()); auto& parameter = ParameterLib::findParameter<double>( param_name, parameters, 1, &bc_mesh); diff --git a/ProcessLib/BoundaryCondition/DirichletBoundaryConditionAuxiliaryFunctions.cpp b/ProcessLib/BoundaryCondition/DirichletBoundaryConditionAuxiliaryFunctions.cpp index c3a55caed78f4d9966a79e11b26c1709639fa136..8bdcb355a516286d5ddbdd4cd7498cfb0bd985e2 100644 --- a/ProcessLib/BoundaryCondition/DirichletBoundaryConditionAuxiliaryFunctions.cpp +++ b/ProcessLib/BoundaryCondition/DirichletBoundaryConditionAuxiliaryFunctions.cpp @@ -33,8 +33,8 @@ void checkParametersOfDirichletBoundaryCondition( dof_table_bulk.getNumberOfVariableComponents(variable_id)) { OGS_FATAL( - "Variable id or component id too high. Actual values: (%d, " - "%d), maximum values: (%d, %d).", + "Variable id or component id too high. Actual values: ({:d}, " + "{:d}), maximum values: ({:d}, {:d}).", variable_id, component_id, dof_table_bulk.getNumberOfVariables(), dof_table_bulk.getNumberOfVariableComponents(variable_id)); } @@ -44,14 +44,14 @@ void checkParametersOfDirichletBoundaryCondition( { OGS_FATAL( "The required bulk node ids map does not exist in the boundary " - "mesh '%s'.", + "mesh '{:s}'.", bc_mesh.getName().c_str()); } DBUG( - "Found %d nodes for Dirichlet BCs for the variable %d and " + "Found {:d} nodes for Dirichlet BCs for the variable {:d} and " "component " - "%d", + "{:d}", bc_mesh.getNodes().size(), variable_id, component_id); } diff --git a/ProcessLib/BoundaryCondition/DirichletBoundaryConditionWithinTimeInterval.cpp b/ProcessLib/BoundaryCondition/DirichletBoundaryConditionWithinTimeInterval.cpp index d9323faa67c9d292a3479a6db90cabae2b96c8f5..fd2c99ea7ca2855ccf7de94ab0029c85aa460e3e 100644 --- a/ProcessLib/BoundaryCondition/DirichletBoundaryConditionWithinTimeInterval.cpp +++ b/ProcessLib/BoundaryCondition/DirichletBoundaryConditionWithinTimeInterval.cpp @@ -108,7 +108,7 @@ createDirichletBoundaryConditionWithinTimeInterval( //! \ogs_file_param{prj__process_variables__process_variable__boundary_conditions__boundary_condition__DirichletWithinTimeInterval__parameter} auto const param_name = config.getConfigParameter<std::string>("parameter"); - DBUG("Using parameter %s", param_name.c_str()); + DBUG("Using parameter {:s}", param_name.c_str()); auto& param = ParameterLib::findParameter<double>(param_name, parameters, 1, &bc_mesh); diff --git a/ProcessLib/BoundaryCondition/GenericNaturalBoundaryCondition-impl.h b/ProcessLib/BoundaryCondition/GenericNaturalBoundaryCondition-impl.h index c35cde29da709ebff1b4006f09af4392024d7696..25f7d7db31276e996453a1d8fb58b44f30f77d7d 100644 --- a/ProcessLib/BoundaryCondition/GenericNaturalBoundaryCondition-impl.h +++ b/ProcessLib/BoundaryCondition/GenericNaturalBoundaryCondition-impl.h @@ -37,8 +37,9 @@ GenericNaturalBoundaryCondition<BoundaryConditionData, dof_table_bulk.getNumberOfVariableComponents(variable_id)) { OGS_FATAL( - "Variable id or component id too high. Actual values: (%d, %d), " - "maximum values: (%d, %d).", + "Variable id or component id too high. Actual values: ({:d}, " + "{:d}), " + "maximum values: ({:d}, {:d}).", variable_id, component_id, dof_table_bulk.getNumberOfVariables(), dof_table_bulk.getNumberOfVariableComponents(variable_id)); } @@ -48,13 +49,15 @@ GenericNaturalBoundaryCondition<BoundaryConditionData, { OGS_FATAL( "The required bulk node ids map does not exist in the boundary " - "mesh '%s'.", + "mesh '{:s}'.", _bc_mesh.getName().c_str()); } std::vector<MeshLib::Node*> const& bc_nodes = _bc_mesh.getNodes(); - DBUG("Found %d nodes for Natural BCs for the variable %d and component %d", - bc_nodes.size(), variable_id, component_id); + DBUG( + "Found {:d} nodes for Natural BCs for the variable {:d} and component " + "{:d}", + bc_nodes.size(), variable_id, component_id); MeshLib::MeshSubset bc_mesh_subset(_bc_mesh, bc_nodes); diff --git a/ProcessLib/BoundaryCondition/HCNonAdvectiveFreeComponentFlowBoundaryCondition.cpp b/ProcessLib/BoundaryCondition/HCNonAdvectiveFreeComponentFlowBoundaryCondition.cpp index 178e5706c4464ab092e15998faeef9cc0d21b8e5..66b2f47e257ef3528c4843707641ae5d79d5e524 100644 --- a/ProcessLib/BoundaryCondition/HCNonAdvectiveFreeComponentFlowBoundaryCondition.cpp +++ b/ProcessLib/BoundaryCondition/HCNonAdvectiveFreeComponentFlowBoundaryCondition.cpp @@ -33,8 +33,9 @@ createHCNonAdvectiveFreeComponentFlowBoundaryCondition( if (bc_mesh.getDimension() + 1 != global_dim) { OGS_FATAL( - "The dimension (%d) of the given boundary mesh '%s' is not by one " - "lower than the bulk dimension (%d).", + "The dimension ({:d}) of the given boundary mesh '{:s}' is not by " + "one " + "lower than the bulk dimension ({:d}).", bc_mesh.getDimension(), bc_mesh.getName().c_str(), global_dim); } diff --git a/ProcessLib/BoundaryCondition/NeumannBoundaryCondition.cpp b/ProcessLib/BoundaryCondition/NeumannBoundaryCondition.cpp index 775b9deb96498b0df20247ee0f13b70644444efd..79d4a2679d0047a772dfac5d9d08928a465f2d46 100644 --- a/ProcessLib/BoundaryCondition/NeumannBoundaryCondition.cpp +++ b/ProcessLib/BoundaryCondition/NeumannBoundaryCondition.cpp @@ -26,7 +26,7 @@ std::unique_ptr<NeumannBoundaryCondition> createNeumannBoundaryCondition( //! \ogs_file_param{prj__process_variables__process_variable__boundary_conditions__boundary_condition__Neumann__parameter} auto const param_name = config.getConfigParameter<std::string>("parameter"); - DBUG("Using parameter %s", param_name.c_str()); + DBUG("Using parameter {:s}", param_name.c_str()); auto const& param = ParameterLib::findParameter<double>( param_name, parameters, 1, &bc_mesh); @@ -51,7 +51,7 @@ std::unique_ptr<NeumannBoundaryCondition> createNeumannBoundaryCondition( auto const area_parameter_name = //! \ogs_file_param{prj__process_variables__process_variable__boundary_conditions__boundary_condition__Neumann__area_parameter} config.getConfigParameter<std::string>("area_parameter"); - DBUG("area parameter name '%s'", area_parameter_name.c_str()); + DBUG("area parameter name '{:s}'", area_parameter_name.c_str()); integral_measure = &ParameterLib::findParameter<double>( area_parameter_name, parameters, 1, &bc_mesh); } @@ -59,8 +59,9 @@ std::unique_ptr<NeumannBoundaryCondition> createNeumannBoundaryCondition( if (bc_mesh.getDimension() >= global_dim) { OGS_FATAL( - "The dimension (%d) of the given boundary mesh '%s' is not lower " - "than the bulk dimension (%d).", + "The dimension ({:d}) of the given boundary mesh '{:s}' is not " + "lower " + "than the bulk dimension ({:d}).", bc_mesh.getDimension(), bc_mesh.getName().c_str(), global_dim); } diff --git a/ProcessLib/BoundaryCondition/NormalTractionBoundaryCondition-impl.h b/ProcessLib/BoundaryCondition/NormalTractionBoundaryCondition-impl.h index 3c54a6eca5ad4f4b9fe69a16e58735306efd410a..23bac056da2ba4e68952f82d3100e081b552e438 100644 --- a/ProcessLib/BoundaryCondition/NormalTractionBoundaryCondition-impl.h +++ b/ProcessLib/BoundaryCondition/NormalTractionBoundaryCondition-impl.h @@ -43,8 +43,8 @@ NormalTractionBoundaryCondition<LocalAssemblerImplementation>:: // BC mesh subset creation std::vector<MeshLib::Node*> const bc_nodes = _bc_mesh.getNodes(); - DBUG("Found %d nodes for Natural BCs for the variable %d", bc_nodes.size(), - variable_id); + DBUG("Found {:d} nodes for Natural BCs for the variable {:d}", + bc_nodes.size(), variable_id); MeshLib::MeshSubset bc_mesh_subset(_bc_mesh, bc_nodes); @@ -87,7 +87,7 @@ createNormalTractionBoundaryCondition( auto const parameter_name = //! \ogs_file_param{prj__process_variables__process_variable__boundary_conditions__boundary_condition__NormalTraction__parameter} config.getConfigParameter<std::string>("parameter"); - DBUG("Using parameter %s", parameter_name.c_str()); + DBUG("Using parameter {:s}", parameter_name.c_str()); auto const& pressure = ParameterLib::findParameter<double>( parameter_name, parameters, 1, &bc_mesh); diff --git a/ProcessLib/BoundaryCondition/PhaseFieldIrreversibleDamageOracleBoundaryCondition.h b/ProcessLib/BoundaryCondition/PhaseFieldIrreversibleDamageOracleBoundaryCondition.h index 149c7146aa956139f446a2ea6ad54502fcc7778b..9c3bec9254afe3bc5f7184b66bca3a565b46e701 100644 --- a/ProcessLib/BoundaryCondition/PhaseFieldIrreversibleDamageOracleBoundaryCondition.h +++ b/ProcessLib/BoundaryCondition/PhaseFieldIrreversibleDamageOracleBoundaryCondition.h @@ -35,9 +35,9 @@ public: dof_table.getNumberOfVariableComponents(variable_id)) { OGS_FATAL( - "Variable id or component id too high. Actual values: (%d, " - "%d), " - "maximum values: (%d, %d).", + "Variable id or component id too high. Actual values: ({:d}, " + "{:d}), " + "maximum values: ({:d}, {:d}).", variable_id, component_id, dof_table.getNumberOfVariables(), dof_table.getNumberOfVariableComponents(variable_id)); } diff --git a/ProcessLib/BoundaryCondition/Python/BHEInflowPythonBoundaryCondition.h b/ProcessLib/BoundaryCondition/Python/BHEInflowPythonBoundaryCondition.h index 02f80f2fc4edf8788e673db953d9468fb5f4ab3d..57ed204bf26160b0873e4ea4000b0812b1f946e5 100644 --- a/ProcessLib/BoundaryCondition/Python/BHEInflowPythonBoundaryCondition.h +++ b/ProcessLib/BoundaryCondition/Python/BHEInflowPythonBoundaryCondition.h @@ -14,7 +14,6 @@ #endif // OGS_USE_PYTHON #include <algorithm> #include <iostream> -#include <logog/include/logog.hpp> #include <vector> #include "BHEInflowPythonBoundaryConditionPythonSideInterface.h" diff --git a/ProcessLib/BoundaryCondition/Python/PythonBoundaryCondition.cpp b/ProcessLib/BoundaryCondition/Python/PythonBoundaryCondition.cpp index ec08eff3eee8d976e8c04080504ca2f9cef5731d..5af5c82004b7294b0833ddaf95eb7c74adf0896e 100644 --- a/ProcessLib/BoundaryCondition/Python/PythonBoundaryCondition.cpp +++ b/ProcessLib/BoundaryCondition/Python/PythonBoundaryCondition.cpp @@ -125,7 +125,8 @@ void PythonBoundaryCondition::getEssentialBCValues( { // TODO extend Python BC to mixed FEM ansatz functions OGS_FATAL( - "No d.o.f. found for (node=%d, var=%d, comp=%d). " + "No d.o.f. found for (node={:d}, var={:d}, comp={:d}). " + " " "That might be due to the use of mixed FEM ansatz " "functions, which is currently not supported by " "the implementation of Python BCs. That excludes, " @@ -220,7 +221,8 @@ std::unique_ptr<PythonBoundaryCondition> createPythonBoundaryCondition( if (!scope.contains(bc_object)) { OGS_FATAL( - "Function `%s' is not defined in the python script file, or there " + "Function `{:s}' is not defined in the python script file, or " + "there " "was no python script file specified.", bc_object.c_str()); } @@ -232,8 +234,9 @@ std::unique_ptr<PythonBoundaryCondition> createPythonBoundaryCondition( component_id >= dof_table.getNumberOfVariableComponents(variable_id)) { OGS_FATAL( - "Variable id or component id too high. Actual values: (%d, %d), " - "maximum values: (%d, %d).", + "Variable id or component id too high. Actual values: ({:d}, " + "{:d}), " + "maximum values: ({:d}, {:d}).", variable_id, component_id, dof_table.getNumberOfVariables(), dof_table.getNumberOfVariableComponents(variable_id)); } diff --git a/ProcessLib/BoundaryCondition/Python/PythonBoundaryConditionLocalAssembler.h b/ProcessLib/BoundaryCondition/Python/PythonBoundaryConditionLocalAssembler.h index d6a6cd2ea575e7fa1abfc0de57ee29c5cadefb45..c567a55de2c4a8d97f2023b3e5ad615a46a3bdbf 100644 --- a/ProcessLib/BoundaryCondition/Python/PythonBoundaryConditionLocalAssembler.h +++ b/ProcessLib/BoundaryCondition/Python/PythonBoundaryConditionLocalAssembler.h @@ -97,7 +97,8 @@ public: { // TODO extend Python BC to mixed FEM ansatz functions OGS_FATAL( - "No d.o.f. found for (node=%d, var=%d, comp=%d). " + "No d.o.f. found for (node={:d}, var={:d}, " + "comp={:d}). " "That might be due to the use of mixed FEM ansatz " "functions, which is currently not supported by " "the implementation of Python BCs. That excludes, " @@ -151,8 +152,8 @@ public: // for cases without Jacobian assembly. OGS_FATAL( "The Python BC must return the derivative of the flux " - "w.r.t. each primary variable. %d components expected. %d " - "components returned from Python.", + "w.r.t. each primary variable. {:d} components expected. " + "{:d} components returned from Python.", num_comp_total, dFlux.size()); } diff --git a/ProcessLib/BoundaryCondition/RobinBoundaryCondition.cpp b/ProcessLib/BoundaryCondition/RobinBoundaryCondition.cpp index 0866bdf0bf27536275f31d34154dc76ef2f97556..64f3ebeafeca2363880c84a37c5e2f1a93c25326 100644 --- a/ProcessLib/BoundaryCondition/RobinBoundaryCondition.cpp +++ b/ProcessLib/BoundaryCondition/RobinBoundaryCondition.cpp @@ -28,8 +28,9 @@ std::unique_ptr<RobinBoundaryCondition> createRobinBoundaryCondition( if (bc_mesh.getDimension() >= global_dim) { OGS_FATAL( - "The dimension (%d) of the given boundary mesh '%s' is not lower " - "than the bulk dimension (%d).", + "The dimension ({:d}) of the given boundary mesh '{:s}' is not " + "lower " + "than the bulk dimension ({:d}).", bc_mesh.getDimension(), bc_mesh.getName().c_str(), global_dim); } @@ -49,7 +50,7 @@ std::unique_ptr<RobinBoundaryCondition> createRobinBoundaryCondition( auto const area_parameter_name = //! \ogs_file_param{prj__process_variables__process_variable__boundary_conditions__boundary_condition__Robin__area_parameter} config.getConfigParameter<std::string>("area_parameter"); - DBUG("area parameter name '%s'", area_parameter_name.c_str()); + DBUG("area parameter name '{:s}'", area_parameter_name.c_str()); integral_measure = &ParameterLib::findParameter<double>( area_parameter_name, parameters, 1, &bc_mesh); } diff --git a/ProcessLib/BoundaryCondition/VariableDependentNeumannBoundaryCondition.cpp b/ProcessLib/BoundaryCondition/VariableDependentNeumannBoundaryCondition.cpp index 03d88b26e06559a05a05e58257aa608c04693149..b4e3bd3243044fe2542e56ba37cf2682246f284b 100644 --- a/ProcessLib/BoundaryCondition/VariableDependentNeumannBoundaryCondition.cpp +++ b/ProcessLib/BoundaryCondition/VariableDependentNeumannBoundaryCondition.cpp @@ -36,8 +36,9 @@ createVariableDependentNeumannBoundaryCondition( if (bc_mesh.getDimension() + 1 != global_dim) { OGS_FATAL( - "The dimension (%d) of the given boundary mesh '%s' is not by one " - "lower than the bulk dimension (%d).", + "The dimension ({:d}) of the given boundary mesh '{:s}' is not by " + "one " + "lower than the bulk dimension ({:d}).", bc_mesh.getDimension(), bc_mesh.getName().c_str(), global_dim); } diff --git a/ProcessLib/CentralDifferencesJacobianAssembler.cpp b/ProcessLib/CentralDifferencesJacobianAssembler.cpp index d2813c66365ae16418292bf166b9817c9e89804f..2515e051713332e466f47a9ed453c2f01eda00d3 100644 --- a/ProcessLib/CentralDifferencesJacobianAssembler.cpp +++ b/ProcessLib/CentralDifferencesJacobianAssembler.cpp @@ -36,8 +36,8 @@ void CentralDifferencesJacobianAssembler::assembleWithJacobian( // TODO do not check in every call. if (local_x_data.size() % _absolute_epsilons.size() != 0) { OGS_FATAL( - "The number of specified epsilons (%u) and the number of local " - "d.o.f.s (%u) do not match, i.e., the latter is not divisable by " + "The number of specified epsilons ({:d}) and the number of local " + "d.o.f.s ({:d}) do not match, i.e., the latter is not divisable by " "the former.", _absolute_epsilons.size(), local_x_data.size()); } diff --git a/ProcessLib/CompareJacobiansJacobianAssembler.cpp b/ProcessLib/CompareJacobiansJacobianAssembler.cpp index 339bd01b9a044dfc046ca6e161f21aed669856a8..e0b8aa1094ebc8370f6d501ba5682a48fb32a5c9 100644 --- a/ProcessLib/CompareJacobiansJacobianAssembler.cpp +++ b/ProcessLib/CompareJacobiansJacobianAssembler.cpp @@ -277,7 +277,7 @@ void CompareJacobiansJacobianAssembler::assembleWithJacobian( if (tol_exceeded) { - WARN("Compare Jacobians: %s", msg_tolerance.str().c_str()); + WARN("Compare Jacobians: {:s}", msg_tolerance.str().c_str()); } bool const output = tol_exceeded || fatal_error; @@ -384,7 +384,7 @@ void CompareJacobiansJacobianAssembler::assembleWithJacobian( if (fatal_error) { _log_file << std::flush; - OGS_FATAL("%s", msg_fatal.c_str()); + OGS_FATAL("{:s}", msg_fatal.c_str()); } if (tol_exceeded && _fail_on_error) diff --git a/ProcessLib/ComponentTransport/CreateComponentTransportProcess.cpp b/ProcessLib/ComponentTransport/CreateComponentTransportProcess.cpp index efda052904f141f4ad0944bc2359f01e787eda7a..a14f77355f464b4fe922629cc321d42ab0d4d948 100644 --- a/ProcessLib/ComponentTransport/CreateComponentTransportProcess.cpp +++ b/ProcessLib/ComponentTransport/CreateComponentTransportProcess.cpp @@ -61,7 +61,7 @@ void checkMPLProperties( if (!liquid_phase.hasComponent(component_id)) { OGS_FATAL( - "The component %u in the AqueousLiquid phase isn't " + "The component {:d} in the AqueousLiquid phase isn't " "specified.", component_id); } @@ -121,8 +121,9 @@ std::unique_ptr<Process> createComponentTransportProcess( if (it != collected_process_variables.end()) { OGS_FATAL( - "Number of components for process variable '%s' should be 1 rather " - "than %d.", + "Number of components for process variable '{:s}' should be 1 " + "rather " + "than {:d}.", it->get().getName().c_str(), it->get().getNumberOfComponents()); } @@ -165,8 +166,8 @@ std::unique_ptr<Process> createComponentTransportProcess( if (b.size() < mesh.getDimension()) { OGS_FATAL( - "specific body force (gravity vector) has %d components, mesh " - "dimension is %d", + "specific body force (gravity vector) has {:d} components, mesh " + "dimension is {:d}", b.size(), mesh.getDimension()); } bool const has_gravity = MathLib::toVector(b).norm() > 0; diff --git a/ProcessLib/CreateJacobianAssembler.cpp b/ProcessLib/CreateJacobianAssembler.cpp index 9a1e848d1a2529193b76c74a29abb0714c2e8f8f..3b0d5fac9aee8f7e3a53e20e3fe4adeb9126700d 100644 --- a/ProcessLib/CreateJacobianAssembler.cpp +++ b/ProcessLib/CreateJacobianAssembler.cpp @@ -41,6 +41,6 @@ std::unique_ptr<AbstractJacobianAssembler> createJacobianAssembler( return createCompareJacobiansJacobianAssembler(*config); } - OGS_FATAL("Unknown Jacobian assembler type: `%s'.", type.c_str()); + OGS_FATAL("Unknown Jacobian assembler type: `{:s}'.", type.c_str()); } } // namespace ProcessLib diff --git a/ProcessLib/DeactivatedSubdomain.cpp b/ProcessLib/DeactivatedSubdomain.cpp index 1156217c67d668c2de15e814a9262d97cef06503..942753e6b822a473dff3793c821b3d4fde59096b 100644 --- a/ProcessLib/DeactivatedSubdomain.cpp +++ b/ProcessLib/DeactivatedSubdomain.cpp @@ -12,8 +12,6 @@ */ #include "DeactivatedSubdomain.h" -#include <logog/include/logog.hpp> - #include "BaseLib/ConfigTree.h" #include "BaseLib/Error.h" #include "MeshLib/Elements/Element.h" diff --git a/ProcessLib/Deformation/SolidMaterialInternalToSecondaryVariables.h b/ProcessLib/Deformation/SolidMaterialInternalToSecondaryVariables.h index 21a0f9171712323dc3aebaf645a3142fdd09fefb..164e6d8c2f9cffc250de2f47775a986fb8f9a183 100644 --- a/ProcessLib/Deformation/SolidMaterialInternalToSecondaryVariables.h +++ b/ProcessLib/Deformation/SolidMaterialInternalToSecondaryVariables.h @@ -42,7 +42,7 @@ void solidMaterialInternalToSecondaryVariables( auto const& name = internal_variable.name; auto const& fct = internal_variable.getter; auto const num_components = internal_variable.num_components; - DBUG("Registering internal variable %s.", name.c_str()); + DBUG("Registering internal variable {:s}.", name.c_str()); auto getIntPtValues = [fct, num_components]( diff --git a/ProcessLib/HT/CreateHTProcess.cpp b/ProcessLib/HT/CreateHTProcess.cpp index e6d39866d8b9c79ef01e8407a5a28ed458b4a19d..67a781f659c2a81cd745d14669d1611dd90d16e4 100644 --- a/ProcessLib/HT/CreateHTProcess.cpp +++ b/ProcessLib/HT/CreateHTProcess.cpp @@ -114,8 +114,8 @@ std::unique_ptr<Process> createHTProcess( if (b.size() < mesh.getDimension()) { OGS_FATAL( - "specific body force (gravity vector) has %d components, mesh " - "dimension is %d", + "specific body force (gravity vector) has {:d} components, mesh " + "dimension is {:d}", b.size(), mesh.getDimension()); } bool const has_gravity = MathLib::toVector(b).norm() > 0; @@ -142,12 +142,12 @@ std::unique_ptr<Process> createHTProcess( solid_thermal_expansion = &ParameterLib::findParameter<double>( //! \ogs_file_param_special{prj__processes__process__HT__solid_thermal_expansion__thermal_expansion} *solid_config, "thermal_expansion", parameters, 1, &mesh); - DBUG("Use '%s' as solid thermal expansion.", + DBUG("Use '{:s}' as solid thermal expansion.", solid_thermal_expansion->name.c_str()); biot_constant = &ParameterLib::findParameter<double>( //! \ogs_file_param_special{prj__processes__process__HT__solid_thermal_expansion__biot_constant} *solid_config, "biot_constant", parameters, 1, &mesh); - DBUG("Use '%s' as Biot's constant.", biot_constant->name.c_str()); + DBUG("Use '{:s}' as Biot's constant.", biot_constant->name.c_str()); } std::unique_ptr<ProcessLib::SurfaceFluxData> surfaceflux; diff --git a/ProcessLib/HeatConduction/CreateHeatConductionProcess.cpp b/ProcessLib/HeatConduction/CreateHeatConductionProcess.cpp index afdc46f252cf903b09a5d272a7b8ced3189e62da..8061591280d055b6f6f8d8e2cd021fcddeb178c4 100644 --- a/ProcessLib/HeatConduction/CreateHeatConductionProcess.cpp +++ b/ProcessLib/HeatConduction/CreateHeatConductionProcess.cpp @@ -53,7 +53,7 @@ std::unique_ptr<Process> createHeatConductionProcess( //! \ogs_file_param_special{prj__processes__process__HEAT_CONDUCTION__thermal_conductivity} "thermal_conductivity", parameters, 1, &mesh); - DBUG("Use '%s' as thermal conductivity parameter.", + DBUG("Use '{:s}' as thermal conductivity parameter.", thermal_conductivity.name.c_str()); // heat capacity parameter. @@ -62,7 +62,7 @@ std::unique_ptr<Process> createHeatConductionProcess( //! \ogs_file_param_special{prj__processes__process__HEAT_CONDUCTION__heat_capacity} "heat_capacity", parameters, 1, &mesh); - DBUG("Use '%s' as heat capacity parameter.", heat_capacity.name.c_str()); + DBUG("Use '{:s}' as heat capacity parameter.", heat_capacity.name.c_str()); // density parameter. auto& density = ParameterLib::findParameter<double>( @@ -70,7 +70,7 @@ std::unique_ptr<Process> createHeatConductionProcess( //! \ogs_file_param_special{prj__processes__process__HEAT_CONDUCTION__density} "density", parameters, 1, &mesh); - DBUG("Use '%s' as density parameter.", density.name.c_str()); + DBUG("Use '{:s}' as density parameter.", density.name.c_str()); HeatConductionProcessData process_data{thermal_conductivity, heat_capacity, density}; diff --git a/ProcessLib/HeatTransportBHE/BHE/BHE_1U.cpp b/ProcessLib/HeatTransportBHE/BHE/BHE_1U.cpp index 38e0f829ccceab9784f56c548db6bae193b5d559..ea0105d68c8ab240b05b8608c67d517e22b95e73 100644 --- a/ProcessLib/HeatTransportBHE/BHE/BHE_1U.cpp +++ b/ProcessLib/HeatTransportBHE/BHE/BHE_1U.cpp @@ -145,7 +145,7 @@ std::pair<double, double> thermalResistancesGroutSoil(double chi, } DBUG( "Warning! Correction procedure was applied due to negative thermal " - "resistance! Chi = %f.\n", + "resistance! Chi = {:f}.\n", m_chi); R_gs = compute_R_gs(m_chi, R_g); diff --git a/ProcessLib/HeatTransportBHE/BHE/BHE_2U.cpp b/ProcessLib/HeatTransportBHE/BHE/BHE_2U.cpp index 75a862340f543929679328c7f9a0d1135d0303ae..3cdcb2bfaeba4bb93d22f25d9c8002dc5d828369 100644 --- a/ProcessLib/HeatTransportBHE/BHE/BHE_2U.cpp +++ b/ProcessLib/HeatTransportBHE/BHE/BHE_2U.cpp @@ -165,7 +165,7 @@ std::vector<double> thermalResistancesGroutSoil2U(double chi, } DBUG( "Warning! Correction procedure was applied due to negative thermal " - "resistance! Chi = %f.\n", + "resistance! Chi = {:f}.\n", m_chi); R_gs = compute_R_gs_2U(m_chi, R_g); R_gg_1 = compute_R_gg_2U(m_chi, R_gs, R_ar_1, R_g); diff --git a/ProcessLib/HeatTransportBHE/BHE/CreateBHECoaxial.cpp b/ProcessLib/HeatTransportBHE/BHE/CreateBHECoaxial.cpp index be1986e31e3bcb07ab96469ec9aa4a64f602d863..49b0afeec7d9dfdacd06f05e865aebe645759d65 100644 --- a/ProcessLib/HeatTransportBHE/BHE/CreateBHECoaxial.cpp +++ b/ProcessLib/HeatTransportBHE/BHE/CreateBHECoaxial.cpp @@ -36,7 +36,7 @@ parseBHECoaxialConfig( auto const bhe_if_use_python_bc_conf = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__use_bhe_pipe_network} config.getConfigParameter<bool>("use_bhe_pipe_network", false); - DBUG("If using python boundary condition : %s", + DBUG("If using python boundary condition : {:s}", (bhe_if_use_python_bc_conf) ? "true" : "false"); auto const borehole_geometry = diff --git a/ProcessLib/HeatTransportBHE/BHE/CreateBHEUType.cpp b/ProcessLib/HeatTransportBHE/BHE/CreateBHEUType.cpp index 37766ce994dc721a873d2017ce1496d5a4a3957e..5ae29e1670d37c4c3a5de4656d80315fca465740 100644 --- a/ProcessLib/HeatTransportBHE/BHE/CreateBHEUType.cpp +++ b/ProcessLib/HeatTransportBHE/BHE/CreateBHEUType.cpp @@ -37,7 +37,7 @@ parseBHEUTypeConfig( auto const bhe_if_use_python_bc_conf = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__use_bhe_pipe_network} config.getConfigParameter<bool>("use_bhe_pipe_network", false); - DBUG("If using python boundary condition : %s", + DBUG("If using python boundary condition : {:s}", (bhe_if_use_python_bc_conf) ? "true" : "false"); auto const borehole_geometry = diff --git a/ProcessLib/HeatTransportBHE/BHE/CreateFlowAndTemperatureControl.cpp b/ProcessLib/HeatTransportBHE/BHE/CreateFlowAndTemperatureControl.cpp index abd3a1717588a8dbcaf59f029161642a73b670de..5f5c8de933d9086277e1e1f0c5327e511de3ffd8 100644 --- a/ProcessLib/HeatTransportBHE/BHE/CreateFlowAndTemperatureControl.cpp +++ b/ProcessLib/HeatTransportBHE/BHE/CreateFlowAndTemperatureControl.cpp @@ -112,7 +112,7 @@ FlowAndTemperatureControl createFlowAndTemperatureControl( building_power_curves, flow_rate, refrigerant.specific_heat_capacity, refrigerant.density}; } - OGS_FATAL("FlowAndTemperatureControl type '%s' is not implemented.", + OGS_FATAL("FlowAndTemperatureControl type '{:s}' is not implemented.", type.c_str()); } } // namespace BHE diff --git a/ProcessLib/HeatTransportBHE/BHE/MeshUtils.cpp b/ProcessLib/HeatTransportBHE/BHE/MeshUtils.cpp index 9164b68a7d7aaa168f084a3287967a45bf0f699e..c24ea808fc7cb5e10d810f05a8c81b052724eec9 100644 --- a/ProcessLib/HeatTransportBHE/BHE/MeshUtils.cpp +++ b/ProcessLib/HeatTransportBHE/BHE/MeshUtils.cpp @@ -9,6 +9,8 @@ #include "MeshUtils.h" +#include <set> + #include "BaseLib/Algorithm.h" #include "MeshLib/Elements/Element.h" #include "MeshLib/Mesh.h" @@ -54,7 +56,7 @@ BHEMeshData getBHEDataInMesh(MeshLib::Mesh const& mesh) // finally counting two types of elements // They are (i) soil, and (ii) BHE type of elements - DBUG("-> found total %d soil elements and %d BHE elements", + DBUG("-> found total {:d} soil elements and {:d} BHE elements", mesh.getNumberOfElements() - all_bhe_elements.size(), all_bhe_elements.size()); @@ -68,7 +70,7 @@ BHEMeshData getBHEDataInMesh(MeshLib::Mesh const& mesh) auto const& bhe_material_ids = getUniqueMaterialIds(material_ids, all_bhe_elements); - DBUG("-> found %d BHE material groups", bhe_material_ids.size()); + DBUG("-> found {:d} BHE material groups", bhe_material_ids.size()); // create a vector of BHE elements for each group std::vector<std::vector<MeshLib::Element*>> bhe_elements; @@ -81,7 +83,8 @@ BHEMeshData getBHEDataInMesh(MeshLib::Mesh const& mesh) back_inserter(vec_elements), [&](MeshLib::Element* e) { return material_ids[e->getID()] == bhe_mat_id; }); - DBUG("-> found %d elements on the BHE_%d", vec_elements.size(), bhe_id); + DBUG("-> found {:d} elements on the BHE_{:d}", vec_elements.size(), + bhe_id); } // get a vector of BHE nodes @@ -101,7 +104,7 @@ BHEMeshData getBHEDataInMesh(MeshLib::Mesh const& mesh) vec_nodes, [](MeshLib::Node* node1, MeshLib::Node* node2) { return node1->getID() < node2->getID(); }); - DBUG("-> found %d nodes on the BHE_%d", vec_nodes.size(), bhe_id); + DBUG("-> found {:d} nodes on the BHE_{:d}", vec_nodes.size(), bhe_id); } return {bhe_material_ids, bhe_elements, bhe_nodes}; diff --git a/ProcessLib/HeatTransportBHE/CreateHeatTransportBHEProcess.cpp b/ProcessLib/HeatTransportBHE/CreateHeatTransportBHEProcess.cpp index 64279e35d6e52432f2ed47d6039a37b52b947f87..7d54a4c1ca0ce096643feeebb8d4ffa3feb72472 100644 --- a/ProcessLib/HeatTransportBHE/CreateHeatTransportBHEProcess.cpp +++ b/ProcessLib/HeatTransportBHE/CreateHeatTransportBHEProcess.cpp @@ -67,7 +67,7 @@ std::unique_ptr<Process> createHeatTransportBHEProcess( pv_name.find("temperature_BHE") == std::string::npos) { OGS_FATAL( - "Found a process variable name '%s'. It should be " + "Found a process variable name '{:s}'. It should be " "'temperature_soil' or 'temperature_BHE_X'"); } auto variable = std::find_if(variables.cbegin(), variables.cend(), @@ -78,12 +78,12 @@ std::unique_ptr<Process> createHeatTransportBHEProcess( if (variable == variables.end()) { OGS_FATAL( - "Could not find process variable '%s' in the provided " + "Could not find process variable '{:s}' in the provided " "variables " - "list for config tag <%s>.", + "list for config tag <{:s}>.", pv_name.c_str(), "process_variable"); } - DBUG("Found process variable '%s' for config tag <%s>.", + DBUG("Found process variable '{:s}' for config tag <{:s}>.", variable->getName().c_str(), "process_variable"); per_process_variables.emplace_back( @@ -144,7 +144,7 @@ std::unique_ptr<Process> createHeatTransportBHEProcess( BHE::createBHE1PType<BHE::BHE_1P>(bhe_config, curves)); continue; } - OGS_FATAL("Unknown BHE type '%s'.", bhe_type.c_str()); + OGS_FATAL("Unknown BHE type '{:s}'.", bhe_type.c_str()); } // end of reading BHE parameters ------------------------------------------- diff --git a/ProcessLib/HeatTransportBHE/HeatTransportBHEProcess.cpp b/ProcessLib/HeatTransportBHE/HeatTransportBHEProcess.cpp index 2762473f388b62c32c25b33150098c88292c2213..f7aaaa564c06e2b95d02887d178982623a507eef 100644 --- a/ProcessLib/HeatTransportBHE/HeatTransportBHEProcess.cpp +++ b/ProcessLib/HeatTransportBHE/HeatTransportBHEProcess.cpp @@ -44,8 +44,8 @@ HeatTransportBHEProcess::HeatTransportBHEProcess( _process_data._vec_BHE_property.size()) { OGS_FATAL( - "The number of the given BHE properties (%d) are not consistent " - "with the number of BHE groups in the mesh (%d).", + "The number of the given BHE properties ({:d}) are not consistent " + "with the number of BHE groups in the mesh ({:d}).", _process_data._vec_BHE_property.size(), _bheMeshData.BHE_mat_IDs.size()); } diff --git a/ProcessLib/HeatTransportBHE/LocalAssemblers/LocalDataInitializer.h b/ProcessLib/HeatTransportBHE/LocalAssemblers/LocalDataInitializer.h index f3d8ca38e3a010877e206c9ef81f1005e23f71e8..09413077b67a03778c53ba02d2269c8337bf3862 100644 --- a/ProcessLib/HeatTransportBHE/LocalAssemblers/LocalDataInitializer.h +++ b/ProcessLib/HeatTransportBHE/LocalAssemblers/LocalDataInitializer.h @@ -199,7 +199,7 @@ public: { OGS_FATAL( "You are trying to build a local assembler for an unknown mesh " - "element type (%s)." + "element type ({:s})." " Maybe you have disabled this mesh element type in your build " "configuration or this process requires higher order elements.", type_idx.name()); diff --git a/ProcessLib/HydroMechanics/CreateHydroMechanicsProcess.cpp b/ProcessLib/HydroMechanics/CreateHydroMechanicsProcess.cpp index b4c8cf25cf569781e375ece9b87794896f83d63b..a2dc0d40cedd1c0f5d2cd70668525bfc3efed885 100644 --- a/ProcessLib/HydroMechanics/CreateHydroMechanicsProcess.cpp +++ b/ProcessLib/HydroMechanics/CreateHydroMechanicsProcess.cpp @@ -84,26 +84,26 @@ std::unique_ptr<Process> createHydroMechanicsProcess( variable_u = &process_variables[1][0].get(); } - DBUG("Associate displacement with process variable '%s'.", + DBUG("Associate displacement with process variable '{:s}'.", variable_u->getName().c_str()); if (variable_u->getNumberOfComponents() != DisplacementDim) { OGS_FATAL( - "Number of components of the process variable '%s' is different " - "from the displacement dimension: got %d, expected %d", + "Number of components of the process variable '{:s}' is different " + "from the displacement dimension: got {:d}, expected {:d}", variable_u->getName().c_str(), variable_u->getNumberOfComponents(), DisplacementDim); } - DBUG("Associate pressure with process variable '%s'.", + DBUG("Associate pressure with process variable '{:s}'.", variable_p->getName().c_str()); if (variable_p->getNumberOfComponents() != 1) { OGS_FATAL( - "Pressure process variable '%s' is not a scalar variable but has " - "%d components.", + "Pressure process variable '{:s}' is not a scalar variable but has " + "{:d} components.", variable_p->getName().c_str(), variable_p->getNumberOfComponents()); } @@ -123,8 +123,8 @@ std::unique_ptr<Process> createHydroMechanicsProcess( { OGS_FATAL( "The size of the specific body force vector does not match the " - "displacement dimension. Vector size is %d, displacement " - "dimension is %d", + "displacement dimension. Vector size is {:d}, displacement " + "dimension is {:d}", b.size(), DisplacementDim); } diff --git a/ProcessLib/HydroMechanics/HydroMechanicsFEM-impl.h b/ProcessLib/HydroMechanics/HydroMechanicsFEM-impl.h index 8df477be704e45dad661f054b071a18ca31fba68..b3950f66a7554cf5d0c9c84e8e0b35a553703732 100644 --- a/ProcessLib/HydroMechanics/HydroMechanicsFEM-impl.h +++ b/ProcessLib/HydroMechanics/HydroMechanicsFEM-impl.h @@ -722,7 +722,7 @@ std::size_t HydroMechanicsLocalAssembler< { OGS_FATAL( "Setting integration point initial conditions; The integration " - "order of the local assembler for element %d is different from " + "order of the local assembler for element {:d} is different from " "the integration order in the initial condition.", _element.getID()); } diff --git a/ProcessLib/HydroMechanics/HydroMechanicsProcess.cpp b/ProcessLib/HydroMechanics/HydroMechanicsProcess.cpp index 19fecd56e602327ac32c26f9e0582284b9ab109c..31d6c019f19753e360663f37aa3f909652a07b8f 100644 --- a/ProcessLib/HydroMechanics/HydroMechanicsProcess.cpp +++ b/ProcessLib/HydroMechanics/HydroMechanicsProcess.cpp @@ -325,8 +325,8 @@ void HydroMechanicsProcess<DisplacementDim>::initializeConcreteProcess( if (ip_meta_data.n_components != mesh_property.getNumberOfComponents()) { OGS_FATAL( - "Different number of components in meta data (%d) than in " - "the integration point field data for '%s': %d.", + "Different number of components in meta data ({:d}) than in " + "the integration point field data for '{:s}': {:d}.", ip_meta_data.n_components, name.c_str(), mesh_property.getNumberOfComponents()); } diff --git a/ProcessLib/HydroMechanics/LocalDataInitializer.h b/ProcessLib/HydroMechanics/LocalDataInitializer.h index 9810c1533e6397b03338cb4a6afe675837bb9eaa..08695710585ca2f700721583b19f65a011ce4150 100644 --- a/ProcessLib/HydroMechanics/LocalDataInitializer.h +++ b/ProcessLib/HydroMechanics/LocalDataInitializer.h @@ -133,7 +133,7 @@ public: if (shapefunction_order != 2) { OGS_FATAL( - "The given shape function order %d is not supported.\nOnly " + "The given shape function order {:d} is not supported.\nOnly " "shape functions of order 2 are supported.", shapefunction_order); } @@ -207,7 +207,7 @@ public: { OGS_FATAL( "You are trying to build a local assembler for an unknown mesh " - "element type (%s)." + "element type ({:s})." " Maybe you have disabled this mesh element type in your build " "configuration or this process requires higher order elements.", type_idx.name()); diff --git a/ProcessLib/LIE/Common/FractureProperty.h b/ProcessLib/LIE/Common/FractureProperty.h index 631338e9fecc7478c3094fab8d2fc60c3c1a2f01..201fd0bcd01b1ded04a41fc1df0ed6b90e4ee4a8 100644 --- a/ProcessLib/LIE/Common/FractureProperty.h +++ b/ProcessLib/LIE/Common/FractureProperty.h @@ -90,8 +90,8 @@ inline void setFractureProperty(int const dim, MeshLib::Element const& e, computeNormalVector(e, dim, n); frac_prop.R.resize(dim, dim); computeRotationMatrix(e, n, dim, frac_prop.R); - DBUG("Normal vector of the fracture element %d: [%g, %g, %g]", e.getID(), - n[0], n[1], n[2]); + DBUG("Normal vector of the fracture element {:d}: [{:g}, {:g}, {:g}]", + e.getID(), n[0], n[1], n[2]); } inline BranchProperty createBranchProperty(MeshLib::Node const& branchNode, diff --git a/ProcessLib/LIE/Common/MeshUtils.cpp b/ProcessLib/LIE/Common/MeshUtils.cpp index 089c7e039da7a07f1f78b220fa73128af21b5d64..88919f8d72c5cf17688698ecbd9c39cff80488ab 100644 --- a/ProcessLib/LIE/Common/MeshUtils.cpp +++ b/ProcessLib/LIE/Common/MeshUtils.cpp @@ -205,7 +205,7 @@ void findFracutreIntersections( BaseLib::makeVectorUnique(eles); } - DBUG("-> found %d branchs and %d junctions", + DBUG("-> found {:d} branchs and {:d} junctions", vec_branch_nodeID_matIDs.size(), vec_junction_nodeID_matIDs.size()); } @@ -239,7 +239,7 @@ void getFractureMatrixDataInMesh( all_fracture_elements.push_back(e); } } - DBUG("-> found total %d matrix elements and %d fracture elements", + DBUG("-> found total {:d} matrix elements and {:d} fracture elements", vec_matrix_elements.size(), all_fracture_elements.size()); // get fracture material IDs @@ -253,7 +253,7 @@ void getFractureMatrixDataInMesh( vec_fracture_mat_IDs.push_back((*material_ids)[e->getID()]); } BaseLib::makeVectorUnique(vec_fracture_mat_IDs); - DBUG("-> found %d fracture material groups", vec_fracture_mat_IDs.size()); + DBUG("-> found {:d} fracture material groups", vec_fracture_mat_IDs.size()); // create a vector of fracture elements for each material vec_fracture_elements.resize(vec_fracture_mat_IDs.size()); @@ -267,7 +267,7 @@ void getFractureMatrixDataInMesh( [&](MeshLib::Element* e) { return (*material_ids)[e->getID()] == frac_mat_id; }); - DBUG("-> found %d elements on the fracture %d", vec_elements.size(), + DBUG("-> found {:d} elements on the fracture {:d}", vec_elements.size(), frac_id); } @@ -291,7 +291,8 @@ void getFractureMatrixDataInMesh( vec_nodes, [](MeshLib::Node* node1, MeshLib::Node* node2) { return node1->getID() < node2->getID(); }); - DBUG("-> found %d nodes on the fracture %d", vec_nodes.size(), frac_id); + DBUG("-> found {:d} nodes on the fracture {:d}", vec_nodes.size(), + frac_id); } // find branch/junction nodes which connect to multiple fractures diff --git a/ProcessLib/LIE/Common/PostUtils.cpp b/ProcessLib/LIE/Common/PostUtils.cpp index 58f84edde45c8e3ebbaa60faaa5f685d3e389f89..5809c62890323e3aef3580df2a04cd61a235d723 100644 --- a/ProcessLib/LIE/Common/PostUtils.cpp +++ b/ProcessLib/LIE/Common/PostUtils.cpp @@ -252,7 +252,8 @@ void PostProcessTool::createProperties() else { WARN( - "Property '%s' cannot be created because its mesh item type is " + "Property '{:s}' cannot be created because its mesh item type " + "is " "not supported.", name.c_str()); } @@ -311,7 +312,8 @@ void PostProcessTool::copyProperties() else { WARN( - "Property '%s' cannot be created because its mesh item type is " + "Property '{:s}' cannot be created because its mesh item type " + "is " "not supported.", name.c_str()); } diff --git a/ProcessLib/LIE/HydroMechanics/CreateHydroMechanicsProcess.cpp b/ProcessLib/LIE/HydroMechanics/CreateHydroMechanicsProcess.cpp index 9504bd3d231ccbd553a60746b97861667c460ce5..0447440fb8427a650a302141a610c398c60e3d0d 100644 --- a/ProcessLib/LIE/HydroMechanics/CreateHydroMechanicsProcess.cpp +++ b/ProcessLib/LIE/HydroMechanics/CreateHydroMechanicsProcess.cpp @@ -66,7 +66,7 @@ std::unique_ptr<Process> createHydroMechanicsProcess( pv_name.find("displacement_jump") != 0) { OGS_FATAL( - "Found a process variable name '%s'. It should be " + "Found a process variable name '{:s}'. It should be " "'displacement' or 'displacement_jumpN' or 'pressure'"); } auto variable = std::find_if(variables.cbegin(), variables.cend(), @@ -77,21 +77,21 @@ std::unique_ptr<Process> createHydroMechanicsProcess( if (variable == variables.end()) { OGS_FATAL( - "Could not find process variable '%s' in the provided " + "Could not find process variable '{:s}' in the provided " "variables " - "list for config tag <%s>.", + "list for config tag <{:s}>.", pv_name.c_str(), "process_variable"); } - DBUG("Found process variable '%s' for config tag <%s>.", + DBUG("Found process variable '{:s}' for config tag <{:s}>.", variable->getName().c_str(), "process_variable"); if (pv_name.find("displacement") != std::string::npos && variable->getNumberOfComponents() != GlobalDim) { OGS_FATAL( - "Number of components of the process variable '%s' is " + "Number of components of the process variable '{:s}' is " "different " - "from the displacement dimension: got %d, expected %d", + "from the displacement dimension: got {:d}, expected {:d}", variable->getName().c_str(), variable->getNumberOfComponents(), GlobalDim); @@ -142,7 +142,7 @@ std::unique_ptr<Process> createHydroMechanicsProcess( //! \ogs_file_param_special{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__intrinsic_permeability} "intrinsic_permeability", parameters, 1, &mesh); - DBUG("Use '%s' as intrinsic permeability parameter.", + DBUG("Use '{:s}' as intrinsic permeability parameter.", intrinsic_permeability.name.c_str()); // Storage coefficient @@ -151,7 +151,7 @@ std::unique_ptr<Process> createHydroMechanicsProcess( //! \ogs_file_param_special{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__specific_storage} "specific_storage", parameters, 1, &mesh); - DBUG("Use '%s' as specific storage parameter.", + DBUG("Use '{:s}' as specific storage parameter.", specific_storage.name.c_str()); // Fluid viscosity @@ -159,7 +159,7 @@ std::unique_ptr<Process> createHydroMechanicsProcess( config, //! \ogs_file_param_special{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__fluid_viscosity} "fluid_viscosity", parameters, 1, &mesh); - DBUG("Use '%s' as fluid viscosity parameter.", + DBUG("Use '{:s}' as fluid viscosity parameter.", fluid_viscosity.name.c_str()); // Fluid density @@ -167,14 +167,14 @@ std::unique_ptr<Process> createHydroMechanicsProcess( config, //! \ogs_file_param_special{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__fluid_density} "fluid_density", parameters, 1, &mesh); - DBUG("Use '%s' as fluid density parameter.", fluid_density.name.c_str()); + DBUG("Use '{:s}' as fluid density parameter.", fluid_density.name.c_str()); // Biot coefficient auto& biot_coefficient = ParameterLib::findParameter<double>( config, //! \ogs_file_param_special{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__biot_coefficient} "biot_coefficient", parameters, 1, &mesh); - DBUG("Use '%s' as Biot coefficient parameter.", + DBUG("Use '{:s}' as Biot coefficient parameter.", biot_coefficient.name.c_str()); // Porosity @@ -182,14 +182,14 @@ std::unique_ptr<Process> createHydroMechanicsProcess( config, //! \ogs_file_param_special{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__porosity} "porosity", parameters, 1, &mesh); - DBUG("Use '%s' as porosity parameter.", porosity.name.c_str()); + DBUG("Use '{:s}' as porosity parameter.", porosity.name.c_str()); // Solid density auto& solid_density = ParameterLib::findParameter<double>( config, //! \ogs_file_param_special{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__solid_density} "solid_density", parameters, 1, &mesh); - DBUG("Use '%s' as solid density parameter.", solid_density.name.c_str()); + DBUG("Use '{:s}' as solid density parameter.", solid_density.name.c_str()); // Specific body force Eigen::Matrix<double, GlobalDim, 1> specific_body_force; @@ -202,8 +202,8 @@ std::unique_ptr<Process> createHydroMechanicsProcess( { OGS_FATAL( "The size of the specific body force vector does not match the " - "displacement dimension. Vector size is %d, displacement " - "dimension is %d", + "displacement dimension. Vector size is {:d}, displacement " + "dimension is {:d}", b.size(), GlobalDim); } @@ -245,7 +245,7 @@ std::unique_ptr<Process> createHydroMechanicsProcess( { OGS_FATAL( "Cannot construct fracture constitutive relation of given type " - "'%s'.", + "'{:s}'.", frac_type.c_str()); } } @@ -278,7 +278,7 @@ std::unique_ptr<Process> createHydroMechanicsProcess( if (frac_prop->aperture0.isTimeDependent()) { OGS_FATAL( - "The initial aperture parameter '%s' must not be " + "The initial aperture parameter '{:s}' must not be " "time-dependent.", frac_prop->aperture0.name.c_str()); } @@ -297,7 +297,7 @@ std::unique_ptr<Process> createHydroMechanicsProcess( //! \ogs_file_param_special{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__initial_effective_stress} "initial_effective_stress", parameters, MathLib::KelvinVector::KelvinVectorDimensions<GlobalDim>::value, &mesh); - DBUG("Use '%s' as initial effective stress parameter.", + DBUG("Use '{:s}' as initial effective stress parameter.", initial_effective_stress.name.c_str()); // initial effective stress in fracture @@ -306,7 +306,7 @@ std::unique_ptr<Process> createHydroMechanicsProcess( config, //! \ogs_file_param_special{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__initial_fracture_effective_stress} "initial_fracture_effective_stress", parameters, GlobalDim, &mesh); - DBUG("Use '%s' as initial fracture effective stress parameter.", + DBUG("Use '{:s}' as initial fracture effective stress parameter.", initial_fracture_effective_stress.name.c_str()); // deactivation of matrix elements in flow diff --git a/ProcessLib/LIE/HydroMechanics/HydroMechanicsProcess.cpp b/ProcessLib/LIE/HydroMechanics/HydroMechanicsProcess.cpp index 69f22abdb3794dc6dcd3ef84df737164b1ef6de5..c4982bb7626432741258b7a414d8f7be850bb839 100644 --- a/ProcessLib/LIE/HydroMechanics/HydroMechanicsProcess.cpp +++ b/ProcessLib/LIE/HydroMechanics/HydroMechanicsProcess.cpp @@ -107,7 +107,7 @@ HydroMechanicsProcess<GlobalDim>::HydroMechanicsProcess( { OGS_FATAL( "Could not get minimum/maximum ranges values for the " - "MaterialIDs property in the mesh '%s'.", + "MaterialIDs property in the mesh '{:s}'.", mesh.getName().c_str()); } @@ -195,7 +195,7 @@ void HydroMechanicsProcess<GlobalDim>::constructDofTable() vec_var_elements, NumLib::ComponentOrder::BY_COMPONENT); - DBUG("created %d DoF", _local_to_global_index_map->size()); + DBUG("created {:d} DoF", _local_to_global_index_map->size()); } template <int GlobalDim> diff --git a/ProcessLib/LIE/HydroMechanics/LocalAssembler/HydroMechanicsLocalAssemblerFracture-impl.h b/ProcessLib/LIE/HydroMechanics/LocalAssembler/HydroMechanicsLocalAssemblerFracture-impl.h index e7879dcaabd72723bb996c59271a484ab7cc9824..ad016b1f60bf71674f436fa82cba1dd4946c55bb 100644 --- a/ProcessLib/LIE/HydroMechanics/LocalAssembler/HydroMechanicsLocalAssemblerFracture-impl.h +++ b/ProcessLib/LIE/HydroMechanics/LocalAssembler/HydroMechanicsLocalAssemblerFracture-impl.h @@ -239,7 +239,8 @@ void HydroMechanicsLocalAssemblerFracture<ShapeFunctionDisplacement, if (b_m < 0.0) { DBUG( - "Element %d, gp %d: Fracture aperture is %g, but it must be " + "Element {:d}, gp {:d}: Fracture aperture is {:g}, but it must " + "be " "non-negative. Setting it to zero.", _element.getID(), ip, b_m); b_m = 0; @@ -369,7 +370,7 @@ void HydroMechanicsLocalAssemblerFracture< if (b_m < 0.0) { DBUG( - "Element %d, gp %d: Fracture aperture is %g, but it is " + "Element {:d}, gp {:d}: Fracture aperture is {:g}, but it is " "expected to be non-negative.", _element.getID(), ip, b_m); } diff --git a/ProcessLib/LIE/HydroMechanics/LocalAssembler/LocalDataInitializer.h b/ProcessLib/LIE/HydroMechanics/LocalAssembler/LocalDataInitializer.h index 116eabde703feddc437a97ebee3a13e76f535185..bdc69649fae2dce1c834b51d1c74b00874c1034e 100644 --- a/ProcessLib/LIE/HydroMechanics/LocalAssembler/LocalDataInitializer.h +++ b/ProcessLib/LIE/HydroMechanics/LocalAssembler/LocalDataInitializer.h @@ -144,7 +144,7 @@ public: if (shapefunction_order != 2) { OGS_FATAL( - "The given shape function order %d is not supported.\nOnly " + "The given shape function order {:d} is not supported.\nOnly " "shape functions of order 2 are supported.", shapefunction_order); } @@ -219,7 +219,7 @@ public: { OGS_FATAL( "You are trying to build a local assembler for an unknown mesh " - "element type (%s)." + "element type ({:s})." " Maybe you have disabled this mesh element type in your build " "configuration or this process requires higher order elements.", type_idx.name()); diff --git a/ProcessLib/LIE/SmallDeformation/CreateSmallDeformationProcess.cpp b/ProcessLib/LIE/SmallDeformation/CreateSmallDeformationProcess.cpp index 6de133a5340ddd2842eb9469e572b3b1715a1fbc..9c9d673b092892e9f7318c4d390d3afde5ad7027 100644 --- a/ProcessLib/LIE/SmallDeformation/CreateSmallDeformationProcess.cpp +++ b/ProcessLib/LIE/SmallDeformation/CreateSmallDeformationProcess.cpp @@ -57,7 +57,7 @@ std::unique_ptr<Process> createSmallDeformationProcess( if (pv_name != "displacement" && pv_name.find("displacement_jump") != 0) { OGS_FATAL( - "Found a process variable name '%s'. It should be " + "Found a process variable name '{:s}'. It should be " "'displacement' or 'displacement_jumpN' or " "'displacement_junctionN'"); } @@ -74,12 +74,12 @@ std::unique_ptr<Process> createSmallDeformationProcess( if (variable == variables.end()) { OGS_FATAL( - "Could not find process variable '%s' in the provided " + "Could not find process variable '{:s}' in the provided " "variables " - "list for config tag <%s>.", + "list for config tag <{:s}>.", pv_name.c_str(), "process_variable"); } - DBUG("Found process variable '%s' for config tag <%s>.", + DBUG("Found process variable '{:s}' for config tag <{:s}>.", variable->getName().c_str(), "process_variable"); per_process_variables.emplace_back( @@ -91,15 +91,15 @@ std::unique_ptr<Process> createSmallDeformationProcess( OGS_FATAL("No displacement jump variables are specified"); } - DBUG("Associate displacement with process variable '%s'.", + DBUG("Associate displacement with process variable '{:s}'.", per_process_variables.back().get().getName().c_str()); if (per_process_variables.back().get().getNumberOfComponents() != DisplacementDim) { OGS_FATAL( - "Number of components of the process variable '%s' is different " - "from the displacement dimension: got %d, expected %d", + "Number of components of the process variable '{:s}' is different " + "from the displacement dimension: got {:d}, expected {:d}", per_process_variables.back().get().getName().c_str(), per_process_variables.back().get().getNumberOfComponents(), DisplacementDim); @@ -144,7 +144,7 @@ std::unique_ptr<Process> createSmallDeformationProcess( { OGS_FATAL( "Cannot construct fracture constitutive relation of given type " - "'%s'.", + "'{:s}'.", frac_type.c_str()); } diff --git a/ProcessLib/LIE/SmallDeformation/LocalAssembler/LocalDataInitializer.h b/ProcessLib/LIE/SmallDeformation/LocalAssembler/LocalDataInitializer.h index 8ce1b7045f12a81f9664b81afdbca02263f0116a..8ac3a2d97dd749a0f60dc436fc075cf39e982fae 100644 --- a/ProcessLib/LIE/SmallDeformation/LocalAssembler/LocalDataInitializer.h +++ b/ProcessLib/LIE/SmallDeformation/LocalAssembler/LocalDataInitializer.h @@ -248,7 +248,7 @@ public: { OGS_FATAL( "You are trying to build a local assembler for an unknown mesh " - "element type (%s)." + "element type ({:s})." " Maybe you have disabled this mesh element type in your build " "configuration or this process requires higher order elements.", type_idx.name()); diff --git a/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerFracture-impl.h b/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerFracture-impl.h index 0b9469d0b69ccaa62d5e4fc81ef3982ada641c98..e1c7c7490d6a0e54129d3f8215567f6777b43999 100644 --- a/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerFracture-impl.h +++ b/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerFracture-impl.h @@ -315,8 +315,8 @@ void SmallDeformationLocalAssemblerFracture<ShapeFunction, IntegrationMethod, if (b_m < 0.0) { OGS_FATAL( - "Element %d, gp %d: Fracture aperture is %g, but it must be " - "non-negative.", + "Element {:d}, gp {:d}: Fracture aperture is {:g}, but it must " + "be non-negative.", _element.getID(), ip, b_m); } diff --git a/ProcessLib/LIE/SmallDeformation/SmallDeformationProcess.cpp b/ProcessLib/LIE/SmallDeformation/SmallDeformationProcess.cpp index fabc61b97cca5edbdd36164853add9040d953b54..9d5bc7b2c002635a6f3bf438c42176cd42365863 100644 --- a/ProcessLib/LIE/SmallDeformation/SmallDeformationProcess.cpp +++ b/ProcessLib/LIE/SmallDeformation/SmallDeformationProcess.cpp @@ -59,9 +59,9 @@ SmallDeformationProcess<DisplacementDim>::SmallDeformationProcess( _process_data.fracture_properties.size()) { OGS_FATAL( - "The number of the given fracture properties (%d) are not " + "The number of the given fracture properties ({:d}) are not " "consistent" - " with the number of fracture groups in a mesh (%d).", + " with the number of fracture groups in a mesh ({:d}).", _process_data.fracture_properties.size(), _vec_fracture_mat_IDs.size()); } diff --git a/ProcessLib/LiquidFlow/CreateLiquidFlowProcess.cpp b/ProcessLib/LiquidFlow/CreateLiquidFlowProcess.cpp index 05e90c5f00c9abbb97cf6a9cd17b30b1eec40535..51f34df443a3d738d7f340c7bae4dda990f7129b 100644 --- a/ProcessLib/LiquidFlow/CreateLiquidFlowProcess.cpp +++ b/ProcessLib/LiquidFlow/CreateLiquidFlowProcess.cpp @@ -93,7 +93,7 @@ std::unique_ptr<Process> createLiquidFlowProcess( { OGS_FATAL( "The gravity axis must be a number between 0 and one less than the " - "mesh dimension, which is %d. Read gravity axis %d from input " + "mesh dimension, which is {:d}. Read gravity axis {:d} from input " "file.", mesh.getDimension(), gravity_axis_id_input); } diff --git a/ProcessLib/Output/CreateOutput.cpp b/ProcessLib/Output/CreateOutput.cpp index e487723329985d48c58d9176063d9ad03d9e4458..a1923fddfd9ab6555633b7f89c362f9c192b957a 100644 --- a/ProcessLib/Output/CreateOutput.cpp +++ b/ProcessLib/Output/CreateOutput.cpp @@ -89,11 +89,11 @@ std::unique_ptr<Output> createOutput( { if (output_variables.find(out_var) != output_variables.cend()) { - OGS_FATAL("output variable `%s' specified more than once.", + OGS_FATAL("output variable `{:s}' specified more than once.", out_var.c_str()); } - DBUG("adding output variable `%s'", out_var.c_str()); + DBUG("adding output variable `{:s}'", out_var.c_str()); output_variables.insert(out_var); } @@ -112,7 +112,7 @@ std::unique_ptr<Output> createOutput( { mesh_names_for_output.push_back( mesh_config.getValue<std::string>()); - INFO("Configure mesh '%s' for output.", + INFO("Configure mesh '{:s}' for output.", mesh_names_for_output.back().c_str()); } } diff --git a/ProcessLib/Output/IntegrationPointWriter.cpp b/ProcessLib/Output/IntegrationPointWriter.cpp index 8e11d1c4f2b4ab62a7e9c1af36fe84032c0be467..8bf1a417ef30e20104e8bfa586ff4e00175c3fa0 100644 --- a/ProcessLib/Output/IntegrationPointWriter.cpp +++ b/ProcessLib/Output/IntegrationPointWriter.cpp @@ -81,7 +81,7 @@ static ProcessLib::IntegrationPointMetaData extractIntegrationPointMetaData( return {name, md["number_of_components"], md["integration_order"]}; } } - OGS_FATAL("No integration point meta data with name '%s' found.", + OGS_FATAL("No integration point meta data with name '{:s}' found.", name.c_str()); } @@ -110,7 +110,7 @@ IntegrationPointMetaData getIntegrationPointMetaData(MeshLib::Mesh const& mesh, "IntegrationPointMetaData")) { OGS_FATAL( - "Integration point data '%s' is present in the vtk field " + "Integration point data '{:s}' is present in the vtk field " "data but the required 'IntegrationPointMetaData' array " "is not available.", name.c_str()); diff --git a/ProcessLib/Output/Output.cpp b/ProcessLib/Output/Output.cpp index f5f4809202f76782bd82dd0a525c1c0d10580b12..422b082cf7c49b4c245438bc0ecf75b14f3f6c5e 100644 --- a/ProcessLib/Output/Output.cpp +++ b/ProcessLib/Output/Output.cpp @@ -40,7 +40,7 @@ int convertVtkDataMode(std::string const& data_mode) return 2; } OGS_FATAL( - "Unsupported vtk output file data mode '%s'. Expected Ascii, " + "Unsupported vtk output file data mode '{:s}'. Expected Ascii, " "Binary, or Appended.", data_mode.c_str()); } @@ -180,7 +180,7 @@ void Output::outputBulkMesh(OutputFile const& output_file, MeshLib::Mesh const& mesh, double const t) const { - DBUG("output to %s", output_file.path.c_str()); + DBUG("output to {:s}", output_file.path.c_str()); process_data->pvd_file.addVTUFile(output_file.name, t); @@ -250,9 +250,8 @@ void Output::doOutputAlways(Process const& process, "Need mesh '" + mesh_output_name + "' for the output."); std::vector<MeshLib::Node*> const& nodes = mesh.getNodes(); - DBUG( - "Found %d nodes for output at mesh '%s'.", - nodes.size(), mesh.getName().c_str()); + DBUG("Found {:d} nodes for output at mesh '{:s}'.", nodes.size(), + mesh.getName().c_str()); MeshLib::MeshSubset mesh_subset(mesh, nodes); std::vector<std::unique_ptr<NumLib::LocalToGlobalIndexMap>> @@ -292,12 +291,12 @@ void Output::doOutputAlways(Process const& process, _output_file_data_mode, _output_file_compression}; - DBUG("output to %s", output_file.path.c_str()); + DBUG("output to {:s}", output_file.path.c_str()); makeOutput(output_file.path, mesh, output_file.compression, output_file.data_mode); } - INFO("[time] Output of timestep %d took %g s.", timestep, + INFO("[time] Output of timestep {:d} took {:g} s.", timestep, time_output.elapsed()); } @@ -378,9 +377,9 @@ void Output::doOutputNonlinearIteration(Process const& process, std::string const output_file_path = BaseLib::joinPaths(_output_directory, output_file_name); - DBUG("output iteration results to %s", output_file_path.c_str()); + DBUG("output iteration results to {:s}", output_file_path.c_str()); - INFO("[time] Output took %g s.", time_output.elapsed()); + INFO("[time] Output took {:g} s.", time_output.elapsed()); makeOutput(output_file_path, process.getMesh(), _output_file_compression, _output_file_data_mode); diff --git a/ProcessLib/Output/ProcessOutput.cpp b/ProcessLib/Output/ProcessOutput.cpp index 040cf0b88eb92783a847238e0c1b862cfc819e91..db6b1d9936c69cc1a265f31de8b9d144811d8fd5 100644 --- a/ProcessLib/Output/ProcessOutput.cpp +++ b/ProcessLib/Output/ProcessOutput.cpp @@ -37,7 +37,7 @@ static void addSecondaryVariableNodes( std::string const& output_name, MeshLib::Mesh& mesh) { - DBUG(" secondary variable %s", output_name.c_str()); + DBUG(" secondary variable {:s}", output_name.c_str()); auto& nodal_values_mesh = *MeshLib::getOrCreateMeshProperty<double>( mesh, output_name, MeshLib::MeshItemType::Node, @@ -46,8 +46,8 @@ static void addSecondaryVariableNodes( mesh.getNumberOfNodes() * var.fcts.num_components) { OGS_FATAL( - "Nodal property `%s' does not have the right number of " - "components. Expected: %d, actual: %d", + "Nodal property `{:s}' does not have the right number of " + "components. Expected: {:d}, actual: {:d}", output_name.c_str(), mesh.getNumberOfNodes() * var.fcts.num_components, nodal_values_mesh.size()); @@ -65,8 +65,8 @@ static void addSecondaryVariableNodes( if (nodal_values_mesh.size() != global_vector_size) { OGS_FATAL( - "Secondary variable `%s' did not evaluate to the right " - "number of components. Expected: %d, actual: %d.", + "Secondary variable `{:s}' did not evaluate to the right " + "number of components. Expected: {:d}, actual: {:d}.", var.name.c_str(), nodal_values_mesh.size(), global_vector_size); } @@ -87,7 +87,7 @@ static void addSecondaryVariableResiduals( return; } - DBUG(" secondary variable %s residual", output_name.c_str()); + DBUG(" secondary variable {:s} residual", output_name.c_str()); auto const& property_name_res = output_name + "_residual"; auto& residuals_mesh = *MeshLib::getOrCreateMeshProperty<double>( @@ -97,8 +97,9 @@ static void addSecondaryVariableResiduals( mesh.getNumberOfElements() * var.fcts.num_components) { OGS_FATAL( - "Cell property `%s' does not have the right number of components. " - "Expected: %d, actual: %d", + "Cell property `{:s}' does not have the right number of " + "components. " + "Expected: {:d}, actual: {:d}", property_name_res.c_str(), mesh.getNumberOfElements() * var.fcts.num_components, residuals_mesh.size()); @@ -116,8 +117,8 @@ static void addSecondaryVariableResiduals( if (residuals_mesh.size() != global_vector_size) { OGS_FATAL( - "The residual of secondary variable `%s' did not evaluate to the " - "right number of components. Expected: %d, actual: %d.", + "The residual of secondary variable `{:s}' did not evaluate to the " + "right number of components. Expected: {:d}, actual: {:d}.", var.name.c_str(), residuals_mesh.size(), global_vector_size); } @@ -190,7 +191,7 @@ void processOutputData( already_output.insert(pv.getName()); - DBUG(" process variable %s", pv.getName().c_str()); + DBUG(" process variable {:s}", pv.getName().c_str()); auto const num_comp = pv.getNumberOfComponents(); auto& output_data = *MeshLib::getOrCreateMeshProperty<double>( @@ -248,7 +249,7 @@ void makeOutput(std::string const& file_name, MeshLib::Mesh const& mesh, bool const compress_output, int const data_mode) { // Write output file - DBUG("Writing output to '%s'.", file_name.c_str()); + DBUG("Writing output to '{:s}'.", file_name.c_str()); MeshLib::IO::VtuInterface vtu_interface(&mesh, data_mode, compress_output); vtu_interface.writeToFile(file_name); } diff --git a/ProcessLib/Output/SecondaryVariable.cpp b/ProcessLib/Output/SecondaryVariable.cpp index 422cf24147d584593fa8d37a95e58c7ed912fcee..a05fb733d94f8e862ee9fcccb268ac5deb984e59 100644 --- a/ProcessLib/Output/SecondaryVariable.cpp +++ b/ProcessLib/Output/SecondaryVariable.cpp @@ -33,7 +33,7 @@ void SecondaryVariableCollection::addSecondaryVariable( .second) { OGS_FATAL( - "The secondary variable with internal name `%s' has already been " + "The secondary variable with internal name `{:s}' has already been " "set up.", internal_name.c_str()); } @@ -59,7 +59,8 @@ SecondaryVariable const& SecondaryVariableCollection::get( if (it == _map_external_to_internal.cend()) { OGS_FATAL( - "A secondary variable with external name '%s' has not been set up.", + "A secondary variable with external name '{:s}' has not been set " + "up.", external_name.c_str()); } @@ -69,7 +70,8 @@ SecondaryVariable const& SecondaryVariableCollection::get( if (it2 == _configured_secondary_variables.end()) { OGS_FATAL( - "A secondary variable with internal name '%s' has not been set up.", + "A secondary variable with internal name '{:s}' has not been set " + "up.", internal_name.c_str()); } diff --git a/ProcessLib/PhaseField/CreatePhaseFieldProcess.cpp b/ProcessLib/PhaseField/CreatePhaseFieldProcess.cpp index edaf50c37f81fc4c7fc2bb02439d5d50c9374f61..d73fd0a5fdba643465c087c837f31282f776bd89 100644 --- a/ProcessLib/PhaseField/CreatePhaseFieldProcess.cpp +++ b/ProcessLib/PhaseField/CreatePhaseFieldProcess.cpp @@ -78,26 +78,27 @@ std::unique_ptr<Process> createPhaseFieldProcess( variable_ph = &process_variables[1][0].get(); } - DBUG("Associate displacement with process variable '%s'.", + DBUG("Associate displacement with process variable '{:s}'.", variable_u->getName().c_str()); if (variable_u->getNumberOfComponents() != DisplacementDim) { OGS_FATAL( - "Number of components of the process variable '%s' is different " - "from the displacement dimension: got %d, expected %d", + "Number of components of the process variable '{:s}' is different " + "from the displacement dimension: got {:d}, expected {:d}", variable_u->getName().c_str(), variable_u->getNumberOfComponents(), DisplacementDim); } - DBUG("Associate phase field with process variable '%s'.", + DBUG("Associate phase field with process variable '{:s}'.", variable_ph->getName().c_str()); if (variable_ph->getNumberOfComponents() != 1) { OGS_FATAL( - "Phasefield process variable '%s' is not a scalar variable but has " - "%d components.", + "Phasefield process variable '{:s}' is not a scalar variable but " + "has " + "{:d} components.", variable_ph->getName().c_str(), variable_ph->getNumberOfComponents()); } @@ -115,42 +116,43 @@ std::unique_ptr<Process> createPhaseFieldProcess( 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.c_str()); + DBUG("Use '{:s}' as residual stiffness.", residual_stiffness.name.c_str()); // Crack resistance auto& 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.c_str()); + DBUG("Use '{:s}' as crack resistance.", crack_resistance.name.c_str()); // Crack length scale auto& 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.c_str()); + DBUG("Use '{:s}' as crack length scale.", crack_length_scale.name.c_str()); // Kinetic coefficient auto& 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.c_str()); + DBUG("Use '{:s}' as kinetic coefficient.", + kinetic_coefficient.name.c_str()); // Solid density auto& 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.c_str()); + DBUG("Use '{:s}' as solid density parameter.", solid_density.name.c_str()); // History field auto& 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); - DBUG("Use '%s' as history field.", history_field.name.c_str()); + DBUG("Use '{:s}' as history field.", history_field.name.c_str()); // Specific body force Eigen::Matrix<double, DisplacementDim, 1> specific_body_force; @@ -163,8 +165,8 @@ std::unique_ptr<Process> createPhaseFieldProcess( { OGS_FATAL( "The size of the specific body force vector does not match the " - "displacement dimension. Vector size is %d, displacement " - "dimension is %d", + "displacement dimension. Vector size is {:d}, displacement " + "dimension is {:d}", b.size(), DisplacementDim); } @@ -179,7 +181,7 @@ std::unique_ptr<Process> createPhaseFieldProcess( { OGS_FATAL( "hydro_crack_scheme must be 'propagating' or 'static' but " - "'%s' was given", + "'{:s}' was given", crack_scheme->c_str()); } diff --git a/ProcessLib/PhaseField/PhaseFieldProcess.cpp b/ProcessLib/PhaseField/PhaseFieldProcess.cpp index 1fd7ef6850d111d49d3af26d6ba7e99b7bd6f38f..3d2f3a03018ccc2a1c7fea6e34085fc9f7c4227b 100644 --- a/ProcessLib/PhaseField/PhaseFieldProcess.cpp +++ b/ProcessLib/PhaseField/PhaseFieldProcess.cpp @@ -241,7 +241,7 @@ void PhaseFieldProcess<DisplacementDim>::preTimestepConcreteProcess( std::vector<GlobalVector*> const& x, double const t, double const dt, const int process_id) { - DBUG("PreTimestep PhaseFieldProcess %d.", process_id); + DBUG("PreTimestep PhaseFieldProcess {:d}.", process_id); _process_data.injected_volume = t; @@ -281,7 +281,7 @@ void PhaseFieldProcess<DisplacementDim>::postTimestepConcreteProcess( _process_data.elastic_energy, _process_data.surface_energy, _process_data.pressure_work, _coupled_solutions); - INFO("Elastic energy: %g Surface energy: %g Pressure work: %g ", + INFO("Elastic energy: {:g} Surface energy: {:g} Pressure work: {:g} ", _process_data.elastic_energy, _process_data.surface_energy, _process_data.pressure_work); } @@ -311,7 +311,7 @@ void PhaseFieldProcess<DisplacementDim>::postNonLinearSolverConcreteProcess( pv.getActiveElementIDs(), dof_tables, x, t, _process_data.crack_volume, _coupled_solutions); - INFO("Integral of crack: %g", _process_data.crack_volume); + INFO("Integral of crack: {:g}", _process_data.crack_volume); if (_process_data.propagating_crack) { @@ -321,7 +321,7 @@ void PhaseFieldProcess<DisplacementDim>::postNonLinearSolverConcreteProcess( _process_data.pressure_error = std::fabs(_process_data.pressure_old - _process_data.pressure) / _process_data.pressure; - INFO("Internal pressure: %g and Pressure error: %.4e", + INFO("Internal pressure: {:g} and Pressure error: {:.4e}", _process_data.pressure, _process_data.pressure_error); auto& u = *_coupled_solutions->coupled_xs[0]; MathLib::LinAlg::scale(const_cast<GlobalVector&>(u), diff --git a/ProcessLib/Process.cpp b/ProcessLib/Process.cpp index c0962a92dca70876a320bc5fcf718f78d73b92cd..0c40e28cbfd343fbdb7fa04b2c942995ea0a291c 100644 --- a/ProcessLib/Process.cpp +++ b/ProcessLib/Process.cpp @@ -123,7 +123,7 @@ void Process::setInitialConditions(const int process_id, double const t, ParameterLib::SpatialPosition pos; auto const& pv = per_process_variables[variable_id]; - DBUG("Set the initial condition of variable %s of process %d.", + DBUG("Set the initial condition of variable {:s} of process {:d}.", pv.get().getName().data(), process_id); auto const& ic = pv.get().getInitialCondition(); diff --git a/ProcessLib/ProcessVariable.cpp b/ProcessLib/ProcessVariable.cpp index a36cb23f2883e7ae35efba2d48db5c69b65b452c..025c073b408a0945038807e35a421ed7982aa10d 100644 --- a/ProcessLib/ProcessVariable.cpp +++ b/ProcessLib/ProcessVariable.cpp @@ -81,7 +81,8 @@ MeshLib::Mesh const& findMeshInConfig( return mesh->getName() == mesh_name; }, "Required mesh with name '" + mesh_name + "' not found."); - DBUG("Found mesh '%s' with id %d.", mesh.getName().c_str(), mesh.getID()); + DBUG("Found mesh '{:s}' with id {:d}.", mesh.getName().c_str(), + mesh.getID()); return mesh; } @@ -107,11 +108,11 @@ ProcessVariable::ProcessVariable( config.getConfigParameter<std::string>("initial_condition"), parameters, _n_components, &mesh)) { - DBUG("Constructing process variable %s", _name.c_str()); + DBUG("Constructing process variable {:s}", _name.c_str()); if (_shapefunction_order < 1 || 2 < _shapefunction_order) { - OGS_FATAL("The given shape function order %d is not supported", + OGS_FATAL("The given shape function order {:d} is not supported", _shapefunction_order); } @@ -141,7 +142,7 @@ ProcessVariable::ProcessVariable( } else { - INFO("No boundary conditions for process variable '%s' found.", + INFO("No boundary conditions for process variable '{:s}' found.", _name.c_str()); } @@ -171,7 +172,8 @@ ProcessVariable::ProcessVariable( } else { - INFO("No source terms for process variable '%s' found.", _name.c_str()); + INFO("No source terms for process variable '{:s}' found.", + _name.c_str()); } } diff --git a/ProcessLib/RichardsComponentTransport/CreateRichardsComponentTransportProcess.cpp b/ProcessLib/RichardsComponentTransport/CreateRichardsComponentTransportProcess.cpp index 9fe62954be07a5e47b7243fcce696dcd1d428b1c..80131807a3fd8975de51fb553df8d1d4f6da7374 100644 --- a/ProcessLib/RichardsComponentTransport/CreateRichardsComponentTransportProcess.cpp +++ b/ProcessLib/RichardsComponentTransport/CreateRichardsComponentTransportProcess.cpp @@ -90,7 +90,7 @@ std::unique_ptr<Process> createRichardsComponentTransportProcess( config, //! \ogs_file_param_special{prj__processes__process__RichardsComponentTransport__fluid_reference_density} "fluid_reference_density", parameters, 1, &mesh); - DBUG("Use '%s' as fluid_reference_density parameter.", + DBUG("Use '{:s}' as fluid_reference_density parameter.", fluid_reference_density.name.c_str()); // Parameter for the longitudinal solute dispersivity. @@ -99,7 +99,7 @@ std::unique_ptr<Process> createRichardsComponentTransportProcess( config, //! \ogs_file_param_special{prj__processes__process__RichardsComponentTransport__molecular_diffusion_coefficient} "molecular_diffusion_coefficient", parameters, 1, &mesh); - DBUG("Use '%s' as molecular diffusion coefficient parameter.", + DBUG("Use '{:s}' as molecular diffusion coefficient parameter.", molecular_diffusion_coefficient.name.c_str()); // Parameter for the longitudinal solute dispersivity. @@ -108,7 +108,7 @@ std::unique_ptr<Process> createRichardsComponentTransportProcess( config, //! \ogs_file_param_special{prj__processes__process__RichardsComponentTransport__solute_dispersivity_longitudinal} "solute_dispersivity_longitudinal", parameters, 1, &mesh); - DBUG("Use '%s' as longitudinal solute dispersivity parameter.", + DBUG("Use '{:s}' as longitudinal solute dispersivity parameter.", solute_dispersivity_longitudinal.name.c_str()); // Parameter for the transverse solute dispersivity. @@ -117,7 +117,7 @@ std::unique_ptr<Process> createRichardsComponentTransportProcess( config, //! \ogs_file_param_special{prj__processes__process__RichardsComponentTransport__solute_dispersivity_transverse} "solute_dispersivity_transverse", parameters, 1, &mesh); - DBUG("Use '%s' as transverse solute dispersivity parameter.", + DBUG("Use '{:s}' as transverse solute dispersivity parameter.", solute_dispersivity_transverse.name.c_str()); // Parameter for the retardation factor. @@ -141,8 +141,8 @@ std::unique_ptr<Process> createRichardsComponentTransportProcess( if (b.size() < mesh.getDimension()) { OGS_FATAL( - "specific body force (gravity vector) has %d components, mesh " - "dimension is %d", + "specific body force (gravity vector) has {:d} components, mesh " + "dimension is {:d}", b.size(), mesh.getDimension()); } bool const has_gravity = MathLib::toVector(b).norm() > 0; diff --git a/ProcessLib/RichardsMechanics/CreateRichardsMechanicsProcess.cpp b/ProcessLib/RichardsMechanics/CreateRichardsMechanicsProcess.cpp index 94904fc36cea426086b8a5940dfa3d011357328c..fd29c02fff88f1c98b1e0fadee1e7407b1c3e319 100644 --- a/ProcessLib/RichardsMechanics/CreateRichardsMechanicsProcess.cpp +++ b/ProcessLib/RichardsMechanics/CreateRichardsMechanicsProcess.cpp @@ -109,26 +109,26 @@ std::unique_ptr<Process> createRichardsMechanicsProcess( variable_u = &process_variables[1][0].get(); } - DBUG("Associate displacement with process variable '%s'.", + DBUG("Associate displacement with process variable '{:s}'.", variable_u->getName().c_str()); if (variable_u->getNumberOfComponents() != DisplacementDim) { OGS_FATAL( - "Number of components of the process variable '%s' is different " - "from the displacement dimension: got %d, expected %d", + "Number of components of the process variable '{:s}' is different " + "from the displacement dimension: got {:d}, expected {:d}", variable_u->getName().c_str(), variable_u->getNumberOfComponents(), DisplacementDim); } - DBUG("Associate pressure with process variable '%s'.", + DBUG("Associate pressure with process variable '{:s}'.", variable_p->getName().c_str()); if (variable_p->getNumberOfComponents() != 1) { OGS_FATAL( - "Pressure process variable '%s' is not a scalar variable but has " - "%d components.", + "Pressure process variable '{:s}' is not a scalar variable but has " + "{:d} components.", variable_p->getName().c_str(), variable_p->getNumberOfComponents()); } @@ -148,8 +148,8 @@ std::unique_ptr<Process> createRichardsMechanicsProcess( { OGS_FATAL( "The size of the specific body force vector does not match the " - "displacement dimension. Vector size is %d, displacement " - "dimension is %d", + "displacement dimension. Vector size is {:d}, displacement " + "dimension is {:d}", b.size(), DisplacementDim); } diff --git a/ProcessLib/RichardsMechanics/LocalDataInitializer.h b/ProcessLib/RichardsMechanics/LocalDataInitializer.h index af6f2974b6247b66a27c5568ef070a9bcbb327d6..aa449f7fed9d34f2a01c74f29546e0ea1ab10258 100644 --- a/ProcessLib/RichardsMechanics/LocalDataInitializer.h +++ b/ProcessLib/RichardsMechanics/LocalDataInitializer.h @@ -128,7 +128,7 @@ public: : _dof_table(dof_table) { if (shapefunction_order < 1 || 2 < shapefunction_order) - OGS_FATAL("The given shape function order %d is not supported", + OGS_FATAL("The given shape function order {:d} is not supported", shapefunction_order); if (shapefunction_order == 1) @@ -288,7 +288,7 @@ public: { OGS_FATAL( "You are trying to build a local assembler for an unknown mesh " - "element type (%s)." + "element type ({:s})." " Maybe you have disabled this mesh element type in your build " "configuration.", type_idx.name()); diff --git a/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.cpp b/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.cpp index ca7bed6ffe9e4892d139bc544aee20305d56353b..0c2fbc56f1095c3ea4f7c9e793e7cc8c0bf77d94 100644 --- a/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.cpp +++ b/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.cpp @@ -50,15 +50,15 @@ std::unique_ptr<Process> createSmallDeformationProcess( {//! \ogs_file_param_special{prj__processes__process__SMALL_DEFORMATION__process_variables__process_variable} "process_variable"}); - DBUG("Associate displacement with process variable '%s'.", + DBUG("Associate displacement with process variable '{:s}'.", per_process_variables.back().get().getName().c_str()); if (per_process_variables.back().get().getNumberOfComponents() != DisplacementDim) { OGS_FATAL( - "Number of components of the process variable '%s' is different " - "from the displacement dimension: got %d, expected %d", + "Number of components of the process variable '{:s}' is different " + "from the displacement dimension: got {:d}, expected {:d}", per_process_variables.back().get().getName().c_str(), per_process_variables.back().get().getNumberOfComponents(), DisplacementDim); @@ -76,7 +76,7 @@ std::unique_ptr<Process> createSmallDeformationProcess( config, //! \ogs_file_param_special{prj__processes__process__SMALL_DEFORMATION__solid_density} "solid_density", parameters, 1, &mesh); - DBUG("Use '%s' as solid density parameter.", solid_density.name.c_str()); + DBUG("Use '{:s}' as solid density parameter.", solid_density.name.c_str()); // Specific body force Eigen::Matrix<double, DisplacementDim, 1> specific_body_force; @@ -89,8 +89,8 @@ std::unique_ptr<Process> createSmallDeformationProcess( { OGS_FATAL( "The size of the specific body force vector does not match the " - "displacement dimension. Vector size is %d, displacement " - "dimension is %d", + "displacement dimension. Vector size is {:d}, displacement " + "dimension is {:d}", b.size(), DisplacementDim); } diff --git a/ProcessLib/SmallDeformation/LocalDataInitializer.h b/ProcessLib/SmallDeformation/LocalDataInitializer.h index dfa6299c3ffdcdefe4daab064e7050c40e7af4ad..719965d966c7c4db32cb50626ed1ae159eb7ba06 100644 --- a/ProcessLib/SmallDeformation/LocalDataInitializer.h +++ b/ProcessLib/SmallDeformation/LocalDataInitializer.h @@ -229,7 +229,7 @@ public: { OGS_FATAL( "You are trying to build a local assembler for an unknown mesh " - "element type (%s)." + "element type ({:s})." " Maybe you have disabled this mesh element type in your build " "configuration or this process requires higher order elements.", type_idx.name()); diff --git a/ProcessLib/SmallDeformation/SmallDeformationFEM.h b/ProcessLib/SmallDeformation/SmallDeformationFEM.h index 0d8c4d11dc1cccab3488a4f313a3dda4b573375c..187df453018f03db4710828297ebaaa57dbd94b0 100644 --- a/ProcessLib/SmallDeformation/SmallDeformationFEM.h +++ b/ProcessLib/SmallDeformation/SmallDeformationFEM.h @@ -170,8 +170,8 @@ public: { OGS_FATAL( "Setting integration point initial conditions; The integration " - "order of the local assembler for element %d is different from " - "the integration order in the initial condition.", + "order of the local assembler for element {:d} is different " + "from the integration order in the initial condition.", _element.getID()); } @@ -181,7 +181,7 @@ public: { OGS_FATAL( "Setting initial conditions for stress from integration " - "point data and from a parameter '%s' is not possible " + "point data and from a parameter '{:s}' is not possible " "simultaneously.", _process_data.initial_stress->name.c_str()); } diff --git a/ProcessLib/SmallDeformation/SmallDeformationProcess.cpp b/ProcessLib/SmallDeformation/SmallDeformationProcess.cpp index 45378644dc36f5730a8e1cf3e01cb4b29bc5eef5..cf28cba0a1db39937e09c171c5114c4e9fe8df19 100644 --- a/ProcessLib/SmallDeformation/SmallDeformationProcess.cpp +++ b/ProcessLib/SmallDeformation/SmallDeformationProcess.cpp @@ -164,8 +164,8 @@ void SmallDeformationProcess<DisplacementDim>::initializeConcreteProcess( if (ip_meta_data.n_components != mesh_property.getNumberOfComponents()) { OGS_FATAL( - "Different number of components in meta data (%d) than in " - "the integration point field data for '%s': %d.", + "Different number of components in meta data ({:d}) than in " + "the integration point field data for '{:s}': {:d}.", ip_meta_data.n_components, name.c_str(), mesh_property.getNumberOfComponents()); } diff --git a/ProcessLib/SmallDeformationNonlocal/CreateSmallDeformationNonlocalProcess.cpp b/ProcessLib/SmallDeformationNonlocal/CreateSmallDeformationNonlocalProcess.cpp index 07f37bf827ba8a4174f4e5934d642bf5b0dbb3ad..4c362b8d90ebf353e9aa89073d6993c5d3dce0ec 100644 --- a/ProcessLib/SmallDeformationNonlocal/CreateSmallDeformationNonlocalProcess.cpp +++ b/ProcessLib/SmallDeformationNonlocal/CreateSmallDeformationNonlocalProcess.cpp @@ -50,15 +50,15 @@ std::unique_ptr<Process> createSmallDeformationNonlocalProcess( {//! \ogs_file_param_special{prj__processes__process__SMALL_DEFORMATION_NONLOCAL__process_variables__process_variable} "process_variable"}); - DBUG("Associate displacement with process variable '%s'.", + DBUG("Associate displacement with process variable '{:s}'.", per_process_variables.back().get().getName().c_str()); if (per_process_variables.back().get().getNumberOfComponents() != DisplacementDim) { OGS_FATAL( - "Number of components of the process variable '%s' is different " - "from the displacement dimension: got %d, expected %d", + "Number of components of the process variable '{:s}' is different " + "from the displacement dimension: got {:d}, expected {:d}", per_process_variables.back().get().getName().c_str(), per_process_variables.back().get().getNumberOfComponents(), DisplacementDim); @@ -76,7 +76,7 @@ std::unique_ptr<Process> createSmallDeformationNonlocalProcess( config, //! \ogs_file_param_special{prj__processes__process__SMALL_DEFORMATION_NONLOCAL__solid_density} "solid_density", parameters, 1, &mesh); - DBUG("Use '%s' as solid density parameter.", solid_density.name.c_str()); + DBUG("Use '{:s}' as solid density parameter.", solid_density.name.c_str()); // Specific body force Eigen::Matrix<double, DisplacementDim, 1> specific_body_force; @@ -89,8 +89,8 @@ std::unique_ptr<Process> createSmallDeformationNonlocalProcess( { OGS_FATAL( "The size of the specific body force vector does not match the " - "displacement dimension. Vector size is %d, displacement " - "dimension is %d", + "displacement dimension. Vector size is {:d}, displacement " + "dimension is {:d}", b.size(), DisplacementDim); } diff --git a/ProcessLib/SmallDeformationNonlocal/Damage.h b/ProcessLib/SmallDeformationNonlocal/Damage.h index e3b495d5e182c222373c0cfa4776a2cacefcc391..d1e08e32ea6eced6322b16748040d3087c8301f6 100644 --- a/ProcessLib/SmallDeformationNonlocal/Damage.h +++ b/ProcessLib/SmallDeformationNonlocal/Damage.h @@ -10,8 +10,9 @@ #pragma once +#include <spdlog/spdlog.h> + #include <Eigen/Eigenvalues> -#include <logog/include/logog.hpp> #include "MaterialLib/SolidModels/Ehlers.h" @@ -28,7 +29,7 @@ inline double calculateDamage(double const kappa_d, double const alpha_d, if (damage < 0. || damage >= 1.) { - OGS_FATAL("Damage value %g outside of [0,1) interval.", damage); + OGS_FATAL("Damage value {:g} outside of [0,1) interval.", damage); } return damage; diff --git a/ProcessLib/SmallDeformationNonlocal/SmallDeformationNonlocalFEM.h b/ProcessLib/SmallDeformationNonlocal/SmallDeformationNonlocalFEM.h index e68074db2d9c2d089da89df8f6b49ff116ac3bb2..18cf1aacdece4e81fdcbebc72e7a634a89676aa2 100644 --- a/ProcessLib/SmallDeformationNonlocal/SmallDeformationNonlocalFEM.h +++ b/ProcessLib/SmallDeformationNonlocal/SmallDeformationNonlocalFEM.h @@ -150,8 +150,8 @@ public: { OGS_FATAL( "Setting integration point initial conditions; The integration " - "order of the local assembler for element %d is different from " - "the integration order in the initial condition.", + "order of the local assembler for element {:d} is different " + "from the integration order in the initial condition.", _element.getID()); } @@ -177,7 +177,7 @@ public: { OGS_FATAL( "CellData for kappa_d initial conditions has wrong number " - "of components. 1 expected, got %d.", + "of components. 1 expected, got {:d}.", value.size()); } setKappaD(value[0]); diff --git a/ProcessLib/SmallDeformationNonlocal/SmallDeformationNonlocalProcess.cpp b/ProcessLib/SmallDeformationNonlocal/SmallDeformationNonlocalProcess.cpp index 800ec956fae7871cd0ea19f7fe031dfe5717965b..fe0ebec10689b4267adc5c6d3efc5f17d56b8ee8 100644 --- a/ProcessLib/SmallDeformationNonlocal/SmallDeformationNonlocalProcess.cpp +++ b/ProcessLib/SmallDeformationNonlocal/SmallDeformationNonlocalProcess.cpp @@ -167,8 +167,9 @@ void SmallDeformationNonlocalProcess<DisplacementDim>:: mesh_property.getNumberOfComponents()) { OGS_FATAL( - "Different number of components in meta data (%d) than in " - "the integration point field data for '%s': %d.", + "Different number of components in meta data ({:d}) than " + "in " + "the integration point field data for '{:s}': {:d}.", ip_meta_data.n_components, name.c_str(), mesh_property.getNumberOfComponents()); } @@ -327,7 +328,7 @@ SmallDeformationNonlocalProcess<DisplacementDim>::postIterationConcreteProcess( pv.getActiveElementIDs(), *_local_to_global_index_map, x, _process_data.crack_volume); - INFO("Integral of crack: %g", _process_data.crack_volume); + INFO("Integral of crack: {:g}", _process_data.crack_volume); return NumLib::IterationResult::SUCCESS; } diff --git a/ProcessLib/SourceTerms/CreateLineSourceTerm.cpp b/ProcessLib/SourceTerms/CreateLineSourceTerm.cpp index 7c35c39d8d887a42f3bcf61797c134321656cc01..e616b93b79ace99d82f87679c68a9c36f0c02ac4 100644 --- a/ProcessLib/SourceTerms/CreateLineSourceTerm.cpp +++ b/ProcessLib/SourceTerms/CreateLineSourceTerm.cpp @@ -38,7 +38,7 @@ std::unique_ptr<SourceTerm> createLineSourceTerm( auto& line_source_term = ParameterLib::findParameter<double>( line_source_term_parameter_name, parameters, 1, &source_term_mesh); - DBUG("Using '%s' as line source term parameter.", + DBUG("Using '{:s}' as line source term parameter.", line_source_term.name.c_str()); return std::make_unique<LineSourceTerm>( diff --git a/ProcessLib/SourceTerms/CreateNodalSourceTerm.cpp b/ProcessLib/SourceTerms/CreateNodalSourceTerm.cpp index 421c198323139a9f159cb485cae4fb53e2b38996..8bcd02e2c6dd27d3822451abfa6a59ada6655200 100644 --- a/ProcessLib/SourceTerms/CreateNodalSourceTerm.cpp +++ b/ProcessLib/SourceTerms/CreateNodalSourceTerm.cpp @@ -32,7 +32,7 @@ std::unique_ptr<SourceTerm> createNodalSourceTerm( //! \ogs_file_param{prj__process_variables__process_variable__source_terms__source_term__Nodal__parameter} auto const param_name = config.getConfigParameter<std::string>("parameter"); - DBUG("Using parameter %s as nodal source term.", param_name.c_str()); + DBUG("Using parameter {:s} as nodal source term.", param_name.c_str()); auto& param = ParameterLib::findParameter<double>(param_name, parameters, 1, &st_mesh); diff --git a/ProcessLib/SourceTerms/CreateSourceTerm.cpp b/ProcessLib/SourceTerms/CreateSourceTerm.cpp index 4dee77dd747d95b125b5feebde320ec1dbd88207..0f0b3c5f48a0be3ec680105a00dff588428f0a7f 100644 --- a/ProcessLib/SourceTerms/CreateSourceTerm.cpp +++ b/ProcessLib/SourceTerms/CreateSourceTerm.cpp @@ -38,8 +38,8 @@ std::unique_ptr<SourceTerm> createSourceTerm( dof_table_bulk.getNumberOfVariableComponents(variable_id)) { OGS_FATAL( - "Variable id or component id too high. Actual values: (%d, " - "%d), maximum values: (%d, %d).", + "Variable id or component id too high. Actual values: ({:d}, " + "{:d}), maximum values: ({:d}, {:d}).", variable_id, *config.component_id, dof_table_bulk.getNumberOfVariables(), dof_table_bulk.getNumberOfVariableComponents(variable_id)); @@ -50,14 +50,15 @@ std::unique_ptr<SourceTerm> createSourceTerm( { OGS_FATAL( "The required bulk node ids map does not exist in the " - "source term mesh '%s'.", + "source term mesh '{:s}'.", source_term_mesh.getName().c_str()); } std::vector<MeshLib::Node*> const& source_term_nodes = source_term_mesh.getNodes(); DBUG( - "Found %d nodes for source term at mesh '%s' for the variable %d and " - "component %d", + "Found {:d} nodes for source term at mesh '{:s}' for the variable {:d} " + "and " + "component {:d}", source_term_nodes.size(), source_term_mesh.getName().c_str(), variable_id, *config.component_id); @@ -120,7 +121,6 @@ std::unique_ptr<SourceTerm> createSourceTerm( #endif } - - OGS_FATAL("Unknown source term type: `%s'.", type.c_str()); + OGS_FATAL("Unknown source term type: `{:s}'.", type.c_str()); } } // namespace ProcessLib diff --git a/ProcessLib/SourceTerms/CreateVolumetricSourceTerm.cpp b/ProcessLib/SourceTerms/CreateVolumetricSourceTerm.cpp index aee2fc163d7e2169cae1cf5fff0e87907990f55d..127bf7c1ed40cea08516d5c7e9ad837aa2fc9d1a 100644 --- a/ProcessLib/SourceTerms/CreateVolumetricSourceTerm.cpp +++ b/ProcessLib/SourceTerms/CreateVolumetricSourceTerm.cpp @@ -38,7 +38,7 @@ std::unique_ptr<SourceTerm> createVolumetricSourceTerm( volumetric_source_term_parameter_name, parameters, 1, &source_term_mesh); - DBUG("Using '%s' as volumetric source term parameter.", + DBUG("Using '{:s}' as volumetric source term parameter.", volumetric_source_term.name.c_str()); return std::make_unique<VolumetricSourceTerm>( diff --git a/ProcessLib/SourceTerms/Python/CreatePythonSourceTerm.cpp b/ProcessLib/SourceTerms/Python/CreatePythonSourceTerm.cpp index c09eef6e82344cc395063d4311335e3d1da9a7f0..c5dc819bac6d1279c0b474fe04bfab2b3c62fe71 100644 --- a/ProcessLib/SourceTerms/Python/CreatePythonSourceTerm.cpp +++ b/ProcessLib/SourceTerms/Python/CreatePythonSourceTerm.cpp @@ -44,7 +44,8 @@ std::unique_ptr<SourceTerm> createPythonSourceTerm( if (!scope.contains(source_term_object)) { OGS_FATAL( - "Function `%s' is not defined in the python script file, or there " + "Function `{:s}' is not defined in the python script file, or " + "there " "was no python script file specified.", source_term_object.c_str()); } diff --git a/ProcessLib/SourceTerms/Python/PythonSourceTermLocalAssembler.h b/ProcessLib/SourceTerms/Python/PythonSourceTermLocalAssembler.h index 1e5c7e3316cb32dc715e23abf14cd466932a3b63..afa1c555a3fb2651c9b1a3f5140a67dd214257bc 100644 --- a/ProcessLib/SourceTerms/Python/PythonSourceTermLocalAssembler.h +++ b/ProcessLib/SourceTerms/Python/PythonSourceTermLocalAssembler.h @@ -130,7 +130,8 @@ public: { // TODO extend Python BC to mixed FEM ansatz functions OGS_FATAL( - "No d.o.f. found for (node=%d, var=%d, comp=%d). " + "No d.o.f. found for (node={:d}, var={:d}, " + "comp={:d}). " "That might be due to the use of mixed FEM ansatz " "functions, which is currently not supported by " "the implementation of Python BCs. That excludes, " @@ -172,8 +173,8 @@ public: // assembly. OGS_FATAL( "The Python source term must return the derivative of " - "the flux w.r.t. each primary variable. %d components " - "expected. %d components returned from Python.", + "the flux w.r.t. each primary variable. {:d} components " + "expected. {:d} components returned from Python.", num_comp_total, dflux.size()); } diff --git a/ProcessLib/SurfaceFlux/SurfaceFluxData.h b/ProcessLib/SurfaceFlux/SurfaceFluxData.h index 2442dfd4224af062495757b73068ae4f08c7d486..af4e21ed62bf993682bc58bff6ce74abefb88f09 100644 --- a/ProcessLib/SurfaceFlux/SurfaceFluxData.h +++ b/ProcessLib/SurfaceFlux/SurfaceFluxData.h @@ -42,8 +42,9 @@ struct SurfaceFluxData output_mesh_file_name(std::move(surfaceflux_output_mesh_file_name)) { DBUG( - "read surfaceflux meta data:\n\tsurfaceflux mesh:'%s'\n\tproperty " - "name: '%s'\n\toutput to: '%s'", + "read surfaceflux meta data:\n\tsurfaceflux " + "mesh:'{:s}'\n\tproperty " + "name: '{:s}'\n\toutput to: '{:s}'", mesh_name.c_str(), property_vector_name.c_str(), output_mesh_file_name.c_str()); } diff --git a/ProcessLib/TES/TESProcess.cpp b/ProcessLib/TES/TESProcess.cpp index b1537e7e9757923dc5362d98ef31ac0be74dc553..191f8593bd9e2085ad2ff52bd736948198c99e6b 100644 --- a/ProcessLib/TES/TESProcess.cpp +++ b/ProcessLib/TES/TESProcess.cpp @@ -65,8 +65,8 @@ TESProcess::TESProcess( //! \ogs_file_special config.getConfigParameterOptional<double>(p.first)) { - DBUG("setting parameter `%s' to value `%g'", p.first.c_str(), - *par); + DBUG("setting parameter `{:s}' to value `{:g}'", + p.first.c_str(), *par); *p.second = *par; } } @@ -88,8 +88,8 @@ TESProcess::TESProcess( //! \ogs_file_special config.getConfigParameterOptional<double>(p.first)) { - INFO("setting parameter `%s' to value `%g'", p.first.c_str(), - *par); + INFO("setting parameter `{:s}' to value `{:g}'", + p.first.c_str(), *par); *p.second = Trafo{*par}; } } @@ -102,7 +102,7 @@ TESProcess::TESProcess( { DBUG( "setting parameter `solid_hydraulic_permeability' to isotropic " - "value `%g'", + "value `{:g}'", *par); const auto dim = mesh.getDimension(); _assembly_params.solid_perm_tensor = @@ -119,7 +119,7 @@ TESProcess::TESProcess( //! \ogs_file_param{prj__processes__process__TES__output_element_matrices} config.getConfigParameterOptional<bool>("output_element_matrices")) { - DBUG("output_element_matrices: %s", (*param) ? "true" : "false"); + DBUG("output_element_matrices: {:s}", (*param) ? "true" : "false"); _assembly_params.output_element_matrices = *param; } @@ -130,7 +130,7 @@ TESProcess::TESProcess( //! \ogs_file_param{prj__processes__process__TES__output_global_matrix} config.getConfigParameterOptional<bool>("output_global_matrix")) { - DBUG("output_global_matrix: %s", (*param) ? "true" : "false"); + DBUG("output_global_matrix: {:s}", (*param) ? "true" : "false"); this->_process_output.output_global_matrix = *param; } @@ -307,7 +307,7 @@ NumLib::IterationResult TESProcess::postIterationConcreteProcess( } // TODO remove - DBUG("ts %lu iteration %lu (in current ts: %lu) try %u accepted", + DBUG("ts {:d} iteration {:d} (in current ts: {:d}) try {:d} accepted", _assembly_params.timestep, _assembly_params.total_iteration, _assembly_params.iteration_in_current_timestep, _assembly_params.number_of_try_of_iteration); diff --git a/ProcessLib/ThermalTwoPhaseFlowWithPP/CreateThermalTwoPhaseFlowWithPPProcess.cpp b/ProcessLib/ThermalTwoPhaseFlowWithPP/CreateThermalTwoPhaseFlowWithPPProcess.cpp index 5cb158103f65c469c3db49ef4c0a0cbdd90808be..8dc554241a71365df7cefef9ac2016bb84d316d0 100644 --- a/ProcessLib/ThermalTwoPhaseFlowWithPP/CreateThermalTwoPhaseFlowWithPPProcess.cpp +++ b/ProcessLib/ThermalTwoPhaseFlowWithPP/CreateThermalTwoPhaseFlowWithPPProcess.cpp @@ -89,14 +89,14 @@ std::unique_ptr<Process> createThermalTwoPhaseFlowWithPPProcess( 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.c_str()); + DBUG("Use '{:s}' as density_solid parameter.", density_solid.name.c_str()); // Parameter for the latent heat of evaporation. auto& 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); - DBUG("Use '%s' as latent_heat_evaporation parameter.", + DBUG("Use '{:s}' as latent_heat_evaporation parameter.", latent_heat_evaporation.name.c_str()); //! \ogs_file_param{prj__processes__process__TWOPHASE_FLOW_THERMAL__material_property} diff --git a/ProcessLib/ThermoHydroMechanics/CreateLocalAssemblers.h b/ProcessLib/ThermoHydroMechanics/CreateLocalAssemblers.h index 891708b2e738a0d4230782bab658290b56774de4..a4e349a62267121f06e94aa633748015fbb99f7b 100644 --- a/ProcessLib/ThermoHydroMechanics/CreateLocalAssemblers.h +++ b/ProcessLib/ThermoHydroMechanics/CreateLocalAssemblers.h @@ -9,13 +9,12 @@ #pragma once -#include <vector> - -#include <logog/include/logog.hpp> +#include <spdlog/spdlog.h> -#include "NumLib/DOF/LocalToGlobalIndexMap.h" +#include <vector> #include "LocalDataInitializer.h" +#include "NumLib/DOF/LocalToGlobalIndexMap.h" namespace ProcessLib { diff --git a/ProcessLib/ThermoHydroMechanics/CreateThermoHydroMechanicsProcess.cpp b/ProcessLib/ThermoHydroMechanics/CreateThermoHydroMechanicsProcess.cpp index a0d7118f78d1829574eb170650a125c1e22bca10..e6ff892c8f08ea122a4b7f14405c6c7c19f7a0d0 100644 --- a/ProcessLib/ThermoHydroMechanics/CreateThermoHydroMechanicsProcess.cpp +++ b/ProcessLib/ThermoHydroMechanics/CreateThermoHydroMechanicsProcess.cpp @@ -89,37 +89,37 @@ std::unique_ptr<Process> createThermoHydroMechanicsProcess( variable_u = &process_variables[2][0].get(); } - DBUG("Associate displacement with process variable '%s'.", + DBUG("Associate displacement with process variable '{:s}'.", variable_u->getName().c_str()); if (variable_u->getNumberOfComponents() != DisplacementDim) { OGS_FATAL( - "Number of components of the process variable '%s' is different " - "from the displacement dimension: got %d, expected %d", + "Number of components of the process variable '{:s}' is different " + "from the displacement dimension: got {:d}, expected {:d}", variable_u->getName().c_str(), variable_u->getNumberOfComponents(), DisplacementDim); } - DBUG("Associate pressure with process variable '%s'.", + DBUG("Associate pressure with process variable '{:s}'.", variable_p->getName().c_str()); if (variable_p->getNumberOfComponents() != 1) { OGS_FATAL( - "Pressure process variable '%s' is not a scalar variable but has " - "%d components.", + "Pressure process variable '{:s}' is not a scalar variable but has " + "{:d} components.", variable_p->getName().c_str(), variable_p->getNumberOfComponents()); } - DBUG("Associate temperature with process variable '%s'.", + DBUG("Associate temperature with process variable '{:s}'.", variable_T->getName().c_str()); if (variable_T->getNumberOfComponents() != 1) { OGS_FATAL( - "temperature process variable '%s' is not a scalar variable but " - "has %d components.", + "temperature process variable '{:s}' is not a scalar variable but " + "has {:d} components.", variable_T->getName().c_str(), variable_T->getNumberOfComponents()); } @@ -133,7 +133,7 @@ std::unique_ptr<Process> createThermoHydroMechanicsProcess( config, //! \ogs_file_param_special{prj__processes__process__THERMO_HYDRO_MECHANICS__reference_temperature} "reference_temperature", parameters, 1, &mesh); - DBUG("Use '%s' as reference temperature parameter.", + DBUG("Use '{:s}' as reference temperature parameter.", reference_temperature.name.c_str()); // Specific body force @@ -147,8 +147,8 @@ std::unique_ptr<Process> createThermoHydroMechanicsProcess( { OGS_FATAL( "The size of the specific body force vector does not match the " - "displacement dimension. Vector size is %d, displacement " - "dimension is %d", + "displacement dimension. Vector size is {:d}, displacement " + "dimension is {:d}", b.size(), DisplacementDim); } diff --git a/ProcessLib/ThermoHydroMechanics/LocalDataInitializer.h b/ProcessLib/ThermoHydroMechanics/LocalDataInitializer.h index 531230d06c640095c28971e9a2583ddc997be493..856c30309960d807721ad82189d9a443a43040c0 100644 --- a/ProcessLib/ThermoHydroMechanics/LocalDataInitializer.h +++ b/ProcessLib/ThermoHydroMechanics/LocalDataInitializer.h @@ -128,7 +128,7 @@ public: : _dof_table(dof_table) { if (shapefunction_order < 1 || 2 < shapefunction_order) - OGS_FATAL("The given shape function order %d is not supported", + OGS_FATAL("The given shape function order {:d} is not supported", shapefunction_order); if (shapefunction_order == 1) @@ -288,7 +288,7 @@ public: { OGS_FATAL( "You are trying to build a local assembler for an unknown mesh " - "element type (%s)." + "element type ({:s})." " Maybe you have disabled this mesh element type in your build " "configuration.", type_idx.name()); diff --git a/ProcessLib/ThermoMechanicalPhaseField/CreateThermoMechanicalPhaseFieldProcess.cpp b/ProcessLib/ThermoMechanicalPhaseField/CreateThermoMechanicalPhaseFieldProcess.cpp index fff64ddbad753b43ed1dff3c181604ecd7575a52..ecde722f9678187fb73a90ae82b85acdda5871d1 100644 --- a/ProcessLib/ThermoMechanicalPhaseField/CreateThermoMechanicalPhaseFieldProcess.cpp +++ b/ProcessLib/ThermoMechanicalPhaseField/CreateThermoMechanicalPhaseFieldProcess.cpp @@ -78,38 +78,39 @@ std::unique_ptr<Process> createThermoMechanicalPhaseFieldProcess( ProcessVariable* variable_ph = &process_variables[process_variables.size() - 1][0].get(); - DBUG("Associate displacement with process variable '%s'.", + DBUG("Associate displacement with process variable '{:s}'.", variable_u->getName().c_str()); if (variable_u->getNumberOfComponents() != DisplacementDim) { OGS_FATAL( - "Number of components of the process variable '%s' is different " - "from the displacement dimension: got %d, expected %d", + "Number of components of the process variable '{:s}' is different " + "from the displacement dimension: got {:d}, expected {:d}", variable_u->getName().c_str(), variable_u->getNumberOfComponents(), DisplacementDim); } - DBUG("Associate phase field with process variable '%s'.", + DBUG("Associate phase field with process variable '{:s}'.", variable_ph->getName().c_str()); if (variable_ph->getNumberOfComponents() != 1) { OGS_FATAL( - "Phasefield process variable '%s' is not a scalar variable but has " - "%d components.", + "Phasefield process variable '{:s}' is not a scalar variable but " + "has " + "{:d} components.", variable_ph->getName().c_str(), variable_ph->getNumberOfComponents()); } - DBUG("Associate temperature with process variable '%s'.", + DBUG("Associate temperature with process variable '{:s}'.", variable_T->getName().c_str()); if (variable_T->getNumberOfComponents() != 1) { OGS_FATAL( - "Temperature process variable '%s' is not a scalar variable but " + "Temperature process variable '{:s}' is not a scalar variable but " "has " - "%d components.", + "{:d} components.", variable_T->getName().c_str(), variable_T->getNumberOfComponents()); } @@ -131,35 +132,36 @@ std::unique_ptr<Process> createThermoMechanicalPhaseFieldProcess( 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.c_str()); + DBUG("Use '{:s}' as residual stiffness.", residual_stiffness.name.c_str()); // Crack resistance auto& 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.c_str()); + DBUG("Use '{:s}' as crack resistance.", crack_resistance.name.c_str()); // Crack length scale auto& 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.c_str()); + DBUG("Use '{:s}' as crack length scale.", crack_length_scale.name.c_str()); // Kinetic coefficient auto& 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.c_str()); + DBUG("Use '{:s}' as kinetic coefficient.", + kinetic_coefficient.name.c_str()); // Solid density auto& 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.c_str()); + DBUG("Use '{:s}' as solid density parameter.", solid_density.name.c_str()); // Linear thermal expansion coefficient auto& linear_thermal_expansion_coefficient = ParameterLib::findParameter< @@ -167,7 +169,7 @@ std::unique_ptr<Process> createThermoMechanicalPhaseFieldProcess( thermal_parameters_config, //! \ogs_file_param_special{prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__thermal_parameters__linear_thermal_expansion_coefficient} "linear_thermal_expansion_coefficient", parameters, 1, &mesh); - DBUG("Use '%s' as linear thermal expansion coefficient.", + DBUG("Use '{:s}' as linear thermal expansion coefficient.", linear_thermal_expansion_coefficient.name.c_str()); // Specific heat capacity @@ -175,7 +177,7 @@ std::unique_ptr<Process> createThermoMechanicalPhaseFieldProcess( 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.", + DBUG("Use '{:s}' as specific heat capacity.", specific_heat_capacity.name.c_str()); // Thermal conductivity @@ -183,14 +185,14 @@ std::unique_ptr<Process> createThermoMechanicalPhaseFieldProcess( 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.", + DBUG("Use '{:s}' as thermal conductivity parameter.", thermal_conductivity.name.c_str()); // Residual thermal conductivity auto& 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); - DBUG("Use '%s' as residual thermal conductivity parameter.", + DBUG("Use '{:s}' as residual thermal conductivity parameter.", residual_thermal_conductivity.name.c_str()); // Reference temperature const auto reference_temperature = @@ -208,8 +210,8 @@ std::unique_ptr<Process> createThermoMechanicalPhaseFieldProcess( { OGS_FATAL( "The size of the specific body force vector does not match the " - "displacement dimension. Vector size is %d, displacement " - "dimension is %d", + "displacement dimension. Vector size is {:d}, displacement " + "dimension is {:d}", specific_body_force.size(), DisplacementDim); } diff --git a/ProcessLib/ThermoMechanics/CreateThermoMechanicsProcess.cpp b/ProcessLib/ThermoMechanics/CreateThermoMechanicsProcess.cpp index 58ff41e47621c331ca382ae1b3641c0181d63afc..d870ca24a02b977e4f4d40f5f19060a086735f0d 100644 --- a/ProcessLib/ThermoMechanics/CreateThermoMechanicsProcess.cpp +++ b/ProcessLib/ThermoMechanics/CreateThermoMechanicsProcess.cpp @@ -88,26 +88,26 @@ std::unique_ptr<Process> createThermoMechanicsProcess( mechanics_process_id = 1; } - DBUG("Associate displacement with process variable '%s'.", + DBUG("Associate displacement with process variable '{:s}'.", variable_u->getName().c_str()); if (variable_u->getNumberOfComponents() != DisplacementDim) { OGS_FATAL( - "Number of components of the process variable '%s' is different " - "from the displacement dimension: got %d, expected %d", + "Number of components of the process variable '{:s}' is different " + "from the displacement dimension: got {:d}, expected {:d}", variable_u->getName().c_str(), variable_u->getNumberOfComponents(), DisplacementDim); } - DBUG("Associate temperature with process variable '%s'.", + DBUG("Associate temperature with process variable '{:s}'.", variable_T->getName().c_str()); if (variable_T->getNumberOfComponents() != 1) { OGS_FATAL( - "Pressure process variable '%s' is not a scalar variable but has " - "%d components.", + "Pressure process variable '{:s}' is not a scalar variable but has " + "{:d} components.", variable_T->getName().c_str(), variable_T->getNumberOfComponents()); } @@ -123,7 +123,7 @@ std::unique_ptr<Process> createThermoMechanicsProcess( config, //! \ogs_file_param_special{prj__processes__process__THERMO_MECHANICS__reference_solid_density} "reference_solid_density", parameters, 1, &mesh); - DBUG("Use '%s' as solid density parameter.", + DBUG("Use '{:s}' as solid density parameter.", reference_solid_density.name.c_str()); // Linear thermal expansion coefficient @@ -132,21 +132,21 @@ std::unique_ptr<Process> createThermoMechanicsProcess( 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.", + DBUG("Use '{:s}' as linear thermal expansion coefficient.", linear_thermal_expansion_coefficient.name.c_str()); // Specific heat capacity auto& 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.", + DBUG("Use '{:s}' as specific heat capacity parameter.", specific_heat_capacity.name.c_str()); // Thermal conductivity // TODO To be changed as tensor input. auto& thermal_conductivity = ParameterLib::findParameter<double>( config, //! \ogs_file_param_special{prj__processes__process__THERMO_MECHANICS__thermal_conductivity} "thermal_conductivity", parameters, 1, &mesh); - DBUG("Use '%s' as thermal conductivity parameter.", + DBUG("Use '{:s}' as thermal conductivity parameter.", thermal_conductivity.name.c_str()); // Specific body force @@ -160,8 +160,8 @@ std::unique_ptr<Process> createThermoMechanicsProcess( { OGS_FATAL( "The size of the specific body force vector does not match the " - "displacement dimension. Vector size is %d, displacement " - "dimension is %d", + "displacement dimension. Vector size is {:d}, displacement " + "dimension is {:d}", b.size(), DisplacementDim); } diff --git a/ProcessLib/ThermoMechanics/ThermoMechanicsFEM-impl.h b/ProcessLib/ThermoMechanics/ThermoMechanicsFEM-impl.h index 151519d8522ac8477629325eec94fdfcccdd6b9a..3f0da00f734a5b075fb061c6f6c4e3d2aa895f92 100644 --- a/ProcessLib/ThermoMechanics/ThermoMechanicsFEM-impl.h +++ b/ProcessLib/ThermoMechanics/ThermoMechanicsFEM-impl.h @@ -93,7 +93,7 @@ std::size_t ThermoMechanicsLocalAssembler< { OGS_FATAL( "Setting integration point initial conditions; The integration " - "order of the local assembler for element %d is different from " + "order of the local assembler for element {:d} is different from " "the integration order in the initial condition.", _element.getID()); } diff --git a/ProcessLib/ThermoMechanics/ThermoMechanicsProcess.cpp b/ProcessLib/ThermoMechanics/ThermoMechanicsProcess.cpp index aff022094cccb27c6bfb0acab3a403e5182d4926..ec56734caed55a2b9ba9fe15376bbea237cf1ed3 100644 --- a/ProcessLib/ThermoMechanics/ThermoMechanicsProcess.cpp +++ b/ProcessLib/ThermoMechanics/ThermoMechanicsProcess.cpp @@ -230,8 +230,8 @@ void ThermoMechanicsProcess<DisplacementDim>::initializeConcreteProcess( if (ip_meta_data.n_components != mesh_property.getNumberOfComponents()) { OGS_FATAL( - "Different number of components in meta data (%d) than in " - "the integration point field data for '%s': %d.", + "Different number of components in meta data ({:d}) than in " + "the integration point field data for '{:s}': {:d}.", ip_meta_data.n_components, name.c_str(), mesh_property.getNumberOfComponents()); } diff --git a/ProcessLib/TimeLoop.cpp b/ProcessLib/TimeLoop.cpp index e14acebcb78a0bce09e4c6886e856f5862ff1ede..2c58ce687992957dadee27d2a21d51e8c3c4704f 100644 --- a/ProcessLib/TimeLoop.cpp +++ b/ProcessLib/TimeLoop.cpp @@ -366,7 +366,7 @@ double TimeLoop::computeTimeStepping(const double prev_dt, double& t, std::numeric_limits<double>::epsilon()) { WARN( - "Time step %d was rejected %d times " + "Time step {:d} was rejected {:d} times " "and it will be repeated with a reduced step size.", accepted_steps + 1, _repeating_times_of_rejected_step); time_disc->popState(x); @@ -405,7 +405,7 @@ double TimeLoop::computeTimeStepping(const double prev_dt, double& t, if (_last_step_rejected) { OGS_FATAL( - "The new step size of %g is the same as that of the previous " + "The new step size of {:g} is the same as that of the previous " "rejected time step. \nPlease re-run ogs with a proper " "adjustment in the numerical settings, \ne.g those for " "time stepper, local or global non-linear solver.", @@ -413,7 +413,7 @@ double TimeLoop::computeTimeStepping(const double prev_dt, double& t, } else { - DBUG("The time stepping is stabilized with the step size of %g.", + DBUG("The time stepping is stabilized with the step size of {:g}.", dt); } } @@ -455,7 +455,7 @@ void TimeLoop::initialize() BaseLib::RunTime time_phreeqc; time_phreeqc.start(); _chemical_system->executeInitialCalculation(_process_solutions); - INFO("[time] Phreeqc took %g s.", time_phreeqc.elapsed()); + INFO("[time] Phreeqc took {:g} s.", time_phreeqc.elapsed()); } // All _per_process_data share the first process. @@ -508,8 +508,9 @@ bool TimeLoop::loop() const std::size_t timesteps = accepted_steps + 1; // TODO(wenqing): , input option for time unit. - INFO("=== Time stepping at step #%u and time %g with step size %g", - timesteps, t, dt); + INFO( + "=== Time stepping at step #{:d} and time {:g} with step size {:g}", + timesteps, t, dt); // Check element deactivation: for (auto& process_data : _per_process_data) @@ -536,7 +537,7 @@ bool TimeLoop::loop() solveUncoupledEquationSystems(t, dt, timesteps); } - INFO("[time] Time step #%u took %g s.", timesteps, + INFO("[time] Time step #{:d} took {:g} s.", timesteps, time_timestep.elapsed()); dt = computeTimeStepping(prev_dt, t, accepted_steps, rejected_steps); @@ -557,16 +558,16 @@ bool TimeLoop::loop() if (dt < std::numeric_limits<double>::epsilon()) { WARN( - "Time step size of %g is too small.\n" - "Time stepping stops at step %u and at time of %g.", + "Time step size of {:g} is too small.\n" + "Time stepping stops at step {:d} and at time of {:g}.", dt, timesteps, t); break; } } INFO( - "The whole computation of the time stepping took %u steps, in which\n" - "\t the accepted steps are %u, and the rejected steps are %u.\n", + "The whole computation of the time stepping took {:d} steps, in which\n" + "\t the accepted steps are {:d}, and the rejected steps are {:d}.\n", accepted_steps + rejected_steps, accepted_steps, rejected_steps); // output last time step @@ -605,7 +606,7 @@ static NumLib::NonlinearSolverStatus solveMonolithicProcess( auto const nonlinear_solver_status = solveOneTimeStepOneProcess(x, timestep_id, t, dt, process_data, output); - INFO("[time] Solving process #%u took %g s in time step #%u ", + INFO("[time] Solving process #{:d} took {:g} s in time step #{:d} ", process_data.process_id, time_timestep_process.elapsed(), timestep_id); return nonlinear_solver_status; @@ -655,8 +656,9 @@ NumLib::NonlinearSolverStatus TimeLoop::solveUncoupledEquationSystems( process_data->nonlinear_solver_status = nonlinear_solver_status; if (!nonlinear_solver_status.error_norms_met) { - ERR("The nonlinear solver failed in time step #%u at t = %g s for " - "process #%u.", + ERR("The nonlinear solver failed in time step #{:d} at t = {:g} s " + "for " + "process #{:d}.", timestep_id, t, process_id); if (!process_data->timestepper->canReduceTimestepSize()) @@ -725,15 +727,16 @@ TimeLoop::solveCoupledEquationSystemsByStaggeredScheme( process_data->nonlinear_solver_status = nonlinear_solver_status; INFO( - "[time] Solving process #%u took %g s in time step #%u " - " coupling iteration #%u", + "[time] Solving process #{:d} took {:g} s in time step #{:d} " + " coupling iteration #{:d}", process_id, time_timestep_process.elapsed(), timestep_id, global_coupling_iteration); if (!nonlinear_solver_status.error_norms_met) { - ERR("The nonlinear solver failed in time step #%u at t = %g s " - "for process #%u.", + ERR("The nonlinear solver failed in time step #{:d} at t = " + "{:g} s " + "for process #{:d}.", timestep_id, t, process_id); if (!process_data->timestepper->canReduceTimestepSize()) @@ -782,7 +785,7 @@ TimeLoop::solveCoupledEquationSystemsByStaggeredScheme( { WARN( "The coupling iterations reaches its maximum number in time step" - "#%u at t = %g s", + "#{:d} at t = {:g} s", timestep_id, t); } @@ -796,7 +799,7 @@ TimeLoop::solveCoupledEquationSystemsByStaggeredScheme( BaseLib::RunTime time_phreeqc; time_phreeqc.start(); _chemical_system->doWaterChemistryCalculation(_process_solutions, dt); - INFO("[time] Phreeqc took %g s.", time_phreeqc.elapsed()); + INFO("[time] Phreeqc took {:g} s.", time_phreeqc.elapsed()); } postTimestepForAllProcesses(t, dt, _per_process_data, _process_solutions); diff --git a/ProcessLib/Utils/LocalDataInitializer.h b/ProcessLib/Utils/LocalDataInitializer.h index 8b227fcbf1a7e72a21d9c9a0a0042fd459ff06fc..570d82965d1f95c9bab789a1c4b445da87e43e21 100644 --- a/ProcessLib/Utils/LocalDataInitializer.h +++ b/ProcessLib/Utils/LocalDataInitializer.h @@ -132,7 +132,7 @@ public: : _dof_table(dof_table) { if (shapefunction_order < 1 || 2 < shapefunction_order) - OGS_FATAL("The given shape function order %d is not supported", + OGS_FATAL("The given shape function order {:d} is not supported", shapefunction_order); if (shapefunction_order == 1) @@ -325,7 +325,7 @@ public: { OGS_FATAL( "You are trying to build a local assembler for an unknown mesh " - "element type (%s)." + "element type ({:s})." " Maybe you have disabled this mesh element type in your build " "configuration.", type_idx.name()); diff --git a/ProcessLib/Utils/ProcessUtils.cpp b/ProcessLib/Utils/ProcessUtils.cpp index 232a7a183b2fb074c9c3eb65ba2eb917c2f9375b..86a3d2009ceee45bcc50c11daf085361f9744d93 100644 --- a/ProcessLib/Utils/ProcessUtils.cpp +++ b/ProcessLib/Utils/ProcessUtils.cpp @@ -28,12 +28,12 @@ ProcessLib::ProcessVariable& findVariableByName( if (variable == variables.end()) { OGS_FATAL( - "There is no entry of the defined process variable '%s' in the " + "There is no entry of the defined process variable '{:s}' in the " "provided variables list (see tag <process_variables>). A " - "definition is required for config tag <%s>.", + "definition is required for config tag <{:s}>.", name.c_str(), tag.c_str()); } - DBUG("Found process variable '%s' for config tag <%s>.", + DBUG("Found process variable '{:s}' for config tag <{:s}>.", variable->getName().c_str(), tag.c_str()); // Const cast is needed because of variables argument constness. @@ -86,7 +86,7 @@ std::vector<std::reference_wrapper<ProcessVariable>> findProcessVariables( if (var_names.empty()) { - OGS_FATAL("No entity is found with config tag <%s>.", tag.c_str()); + OGS_FATAL("No entity is found with config tag <{:s}>.", tag.c_str()); } std::vector<std::string> cached_var_names; @@ -102,7 +102,7 @@ std::vector<std::reference_wrapper<ProcessVariable>> findProcessVariables( if (cached_var_names.size() != var_names.size()) { - OGS_FATAL("Found duplicates with config tag <%s>.", tag.c_str()); + OGS_FATAL("Found duplicates with config tag <{:s}>.", tag.c_str()); } return vars; diff --git a/Tests/BaseLib/TestConfigTree.cpp b/Tests/BaseLib/TestConfigTree.cpp index d001d680481aa64789c039e9d18412152a1bc288..4d5dbc15811af292a86f93bc422b35425ff344ba 100644 --- a/Tests/BaseLib/TestConfigTree.cpp +++ b/Tests/BaseLib/TestConfigTree.cpp @@ -44,7 +44,7 @@ public: // move construction/assignment EXPECT_EQ("FILENAME", filename); - DBUG("error <%s> : %s", path.c_str(), message.c_str()); + DBUG("error <{:s}> : {:s}", path.c_str(), message.c_str()); _error = true; throw Exc(); // throw in order to stop normal execution }; @@ -62,7 +62,7 @@ public: // move construction/assignment EXPECT_EQ("FILENAME", filename); - DBUG("warning <%s> : %s", path.c_str(), message.c_str()); + DBUG("warning <{:s}> : {:s}", path.c_str(), message.c_str()); _warning = true; }; } diff --git a/Tests/MathLib/TestGaussLegendreIntegration.cpp b/Tests/MathLib/TestGaussLegendreIntegration.cpp index 835747e379d58e064bf715333426bd3d7c81901e..7ee755de9db1fa90b2b667fb953841988deae9c6 100644 --- a/Tests/MathLib/TestGaussLegendreIntegration.cpp +++ b/Tests/MathLib/TestGaussLegendreIntegration.cpp @@ -417,7 +417,7 @@ std::unique_ptr<FBase> getF(unsigned polynomial_order) return std::make_unique<FQuad>(); } - OGS_FATAL("unsupported polynomial order: %d.", polynomial_order); + OGS_FATAL("unsupported polynomial order: {:d}.", polynomial_order); } } // namespace GaussLegendreTest @@ -455,7 +455,7 @@ OGS_DONT_TEST_THIS_IF_PETSC(MathLib, IntegrationGaussLegendreTet) for (unsigned integration_order : {1, 2, 3}) { - DBUG("\n==== integration order: %u.\n", integration_order); + DBUG("\n==== integration order: {:d}.\n", integration_order); GaussLegendreTest::IntegrationTestProcess pcs_tet(*mesh_tet, integration_order); @@ -466,7 +466,7 @@ OGS_DONT_TEST_THIS_IF_PETSC(MathLib, IntegrationGaussLegendreTet) break; } - DBUG(" == polynomial order: %u.", polynomial_order); + DBUG(" == polynomial order: {:d}.", polynomial_order); auto f = GaussLegendreTest::getF(polynomial_order); auto const integral_tet = pcs_tet.integrate(f->getClosure()); @@ -484,7 +484,7 @@ OGS_DONT_TEST_THIS_IF_PETSC(MathLib, IntegrationGaussLegendreHex) for (unsigned integration_order : {1, 2, 3}) { - DBUG("\n==== integration order: %u.\n", integration_order); + DBUG("\n==== integration order: {:d}.\n", integration_order); GaussLegendreTest::IntegrationTestProcess pcs_hex(*mesh_hex, integration_order); @@ -495,7 +495,7 @@ OGS_DONT_TEST_THIS_IF_PETSC(MathLib, IntegrationGaussLegendreHex) break; } - DBUG(" == polynomial order: %u.", polynomial_order); + DBUG(" == polynomial order: {:d}.", polynomial_order); auto f = GaussLegendreTest::getF(polynomial_order); auto const integral_hex = pcs_hex.integrate(f->getClosure()); @@ -516,7 +516,7 @@ OGS_DONT_TEST_THIS_IF_PETSC( for (unsigned integration_order : {1, 2, 3}) { - DBUG("\n==== integration order: %u.\n", integration_order); + DBUG("\n==== integration order: {:d}.\n", integration_order); GaussLegendreTest::IntegrationTestProcess pcs_tet(*mesh_tet, integration_order); @@ -525,7 +525,7 @@ OGS_DONT_TEST_THIS_IF_PETSC( polynomial_order < 2 * integration_order; ++polynomial_order) { - DBUG(" == polynomial order: %u.", polynomial_order); + DBUG(" == polynomial order: {:d}.", polynomial_order); GaussLegendreTest::F3DSeparablePolynomial f(polynomial_order); auto const integral_tet = pcs_tet.integrate(f.getClosure()); @@ -544,7 +544,7 @@ OGS_DONT_TEST_THIS_IF_PETSC(MathLib, for (unsigned integration_order : {1, 2, 3, 4}) { - DBUG("\n==== integration order: %u.\n", integration_order); + DBUG("\n==== integration order: {:d}.\n", integration_order); GaussLegendreTest::IntegrationTestProcess pcs_hex(*mesh_hex, integration_order); @@ -553,7 +553,7 @@ OGS_DONT_TEST_THIS_IF_PETSC(MathLib, polynomial_order < 2 * integration_order; ++polynomial_order) { - DBUG(" == polynomial order: %u.", polynomial_order); + DBUG(" == polynomial order: {:d}.", polynomial_order); GaussLegendreTest::F3DSeparablePolynomial f(polynomial_order); auto const integral_hex = pcs_hex.integrate(f.getClosure()); @@ -572,7 +572,7 @@ OGS_DONT_TEST_THIS_IF_PETSC(MathLib, for (unsigned integration_order : {1, 2, 3}) { - DBUG("\n==== integration order: %u.\n", integration_order); + DBUG("\n==== integration order: {:d}.\n", integration_order); GaussLegendreTest::IntegrationTestProcess pcs_tet(*mesh_tet, integration_order); @@ -581,7 +581,7 @@ OGS_DONT_TEST_THIS_IF_PETSC(MathLib, polynomial_order < 2 * integration_order; ++polynomial_order) { - DBUG(" == polynomial order: %u.", polynomial_order); + DBUG(" == polynomial order: {:d}.", polynomial_order); GaussLegendreTest::F3DNonseparablePolynomial f(polynomial_order); auto const integral_tet = pcs_tet.integrate(f.getClosure()); @@ -600,7 +600,7 @@ OGS_DONT_TEST_THIS_IF_PETSC(MathLib, for (unsigned integration_order : {1, 2, 3, 4}) { - DBUG("\n==== integration order: %u.\n", integration_order); + DBUG("\n==== integration order: {:d}.\n", integration_order); GaussLegendreTest::IntegrationTestProcess pcs_hex(*mesh_hex, integration_order); @@ -609,7 +609,7 @@ OGS_DONT_TEST_THIS_IF_PETSC(MathLib, polynomial_order < 2 * integration_order; ++polynomial_order) { - DBUG(" == polynomial order: %u.", polynomial_order); + DBUG(" == polynomial order: {:d}.", polynomial_order); GaussLegendreTest::F3DNonseparablePolynomial f(polynomial_order); auto const integral_hex = pcs_hex.integrate(f.getClosure()); diff --git a/Tests/MathLib/TestNonlinear1D.cpp b/Tests/MathLib/TestNonlinear1D.cpp index 13898e5a5c900d9e3627978f4d8d92a07f362811..8974cc2a7206f9ec2733781ec151fc43a13d33ec 100644 --- a/Tests/MathLib/TestNonlinear1D.cpp +++ b/Tests/MathLib/TestNonlinear1D.cpp @@ -33,7 +33,7 @@ TYPED_TEST(MathLibRegulaFalsi, QuadraticFunction) auto rf = NL::makeRegulaFalsi<TypeParam>(f, -0.1, 1.1); double old_range = rf.getRange(); - DBUG(" 0 -- x ~ %23.16g, range = %23.16g", rf.getResult(), old_range); + DBUG(" 0 -- x ~ {:23.16g}, range = {:23.16g}", rf.getResult(), old_range); for (unsigned n=0; n<10; ++n) { @@ -42,7 +42,8 @@ TYPED_TEST(MathLibRegulaFalsi, QuadraticFunction) // expect that the interval of the root search shrinks EXPECT_GT(old_range, range); old_range = range; - DBUG("%2i -- x ~ %23.16g, range = %23.16g", n+1, rf.getResult(), range); + DBUG("{:2d} -- x ~ {:23.16g}, range = {:23.16g}", n + 1, rf.getResult(), + range); if (range < std::numeric_limits<double>::epsilon()) { diff --git a/Tests/MathLib/TestODESolver.cpp b/Tests/MathLib/TestODESolver.cpp index 028fe150c687d1b7d316bafc848f46bbaea37da1..d9d0ec8ae61b1748091e70e9b46e3283576d5c80 100644 --- a/Tests/MathLib/TestODESolver.cpp +++ b/Tests/MathLib/TestODESolver.cpp @@ -99,8 +99,10 @@ std::unique_ptr<MathLib::ODE::ODESolver<NumEquations>> make_ode_solver( void check(const double time_reached, const double y, const double y_dot, const double time, const double y_ana, const double y_dot_ana) { - DBUG("t: %14.7g, y: %14.7g, diff: %14.7g, y_dot: %14.7g, diff: %14.7g", - time_reached, y, y - y_ana, y_dot, y_dot - y_dot_ana); + DBUG( + "t: {:14.7g}, y: {:14.7g}, diff: {:14.7g}, y_dot: {:14.7g}, diff: " + "{:14.7g}", + time_reached, y, y - y_ana, y_dot, y_dot - y_dot_ana); (void)y_dot_ana; // Avoid unused variable warning when DBUG output is // disabled. diff --git a/Tests/MeshGeoToolsLib/TestGeoMapper.cpp b/Tests/MeshGeoToolsLib/TestGeoMapper.cpp index e19a7748bad1bd2c2a00488b4298d143906f68d8..610910a1e60b6fc1ed68424bfd28425dc8071bd4 100644 --- a/Tests/MeshGeoToolsLib/TestGeoMapper.cpp +++ b/Tests/MeshGeoToolsLib/TestGeoMapper.cpp @@ -69,8 +69,8 @@ TEST_F(MeshGeoToolsLibGeoMapper, PointsOnSurfaceMesh) { if (std::abs(std::cos(p[0]+p[1]) - p[2]) >= eps) { - INFO("std::cos(%f + %f) = %f, %f", - p[0], p[1], cos(p[0]+p[1]), p[2]); + INFO("std::cos({:f} + {:f}) = {:f}, {:f}", p[0], p[1], + cos(p[0] + p[1]), p[2]); return false; } } diff --git a/Tests/NumLib/ODEs.h b/Tests/NumLib/ODEs.h index 5475f24f87648c0759a81b5efe4014e661e8a5b4..cf37bf1c9e9e1a9de4586defb0dfadec3df13c9a 100644 --- a/Tests/NumLib/ODEs.h +++ b/Tests/NumLib/ODEs.h @@ -305,10 +305,10 @@ public: // Eigen::MatrixXd J(Jac.getRawMatrix()); - // INFO("t: %e, x: %e, y: %e, z: %e, dxdot/dx: %e", t, x, y, z, dxdot_dx); - // std::cout << "Jacobian:\n" << J << "\n"; + // INFO("t: {:e}, x: {:e}, y: {:e}, z: {:e}, dxdot/dx: {:e}", t, x, y, + // z, dxdot_dx); std::cout << "Jacobian:\n" << J << "\n"; - // INFO("Det J: %e <<<", J.determinant()); + // INFO("Det J: {:e} <<<", J.determinant()); } MathLib::MatrixSpecifications getMatrixSpecifications( diff --git a/Tests/NumLib/TestComponentNorms.cpp b/Tests/NumLib/TestComponentNorms.cpp index a0e714120ad77523c8aef01f7d057c283634340b..5395ba7d19d56b32e20db323831750a78dd99c77 100644 --- a/Tests/NumLib/TestComponentNorms.cpp +++ b/Tests/NumLib/TestComponentNorms.cpp @@ -128,7 +128,7 @@ TEST(MPITest_NumLib, ComponentNormSingleComponent) using VNT = MathLib::VecNormType; for (auto norm_type : {VNT::NORM1, VNT::NORM2, VNT::INFINITY_N}) { - DBUG("norm type: %s.", + DBUG("norm type: {:s}.", MathLib::convertVecNormTypeToString(norm_type).c_str()); do_test(num_components, norm_type, tolerance, [](double /*n_total*/, double n) { return n; }, diff --git a/Tests/NumLib/TestExtrapolation.cpp b/Tests/NumLib/TestExtrapolation.cpp index f4e6540ca725b1e9e8fb903d4f6752f44ee988d9..e32f6867d4d8fe4c398ab8ea8c96b8393c404cd4 100644 --- a/Tests/NumLib/TestExtrapolation.cpp +++ b/Tests/NumLib/TestExtrapolation.cpp @@ -235,7 +235,7 @@ void extrapolate( ASSERT_EQ(nelements, residual.size()); auto const res_norm = LinAlg::normMax(residual); - DBUG("maximum norm of residual: %g", res_norm); + DBUG("maximum norm of residual: {:g}", res_norm); EXPECT_GT(tolerance_res, res_norm); auto delta_x = MathLib::MatrixVectorTraits<GlobalVector>::newInstance( @@ -243,7 +243,7 @@ void extrapolate( LinAlg::axpy(*delta_x, -1.0, x_extra); // delta_x = x_expected - x_extra auto const dx_norm = LinAlg::normMax(*delta_x); - DBUG("maximum norm of delta x: %g", dx_norm); + DBUG("maximum norm of delta x: {:g}", dx_norm); EXPECT_GT(tolerance_dx, dx_norm); } @@ -279,7 +279,7 @@ TEST(NumLib, DISABLED_Extrapolation) auto const nnodes = mesh->getNumberOfNodes(); auto const nelements = mesh->getNumberOfElements(); - DBUG("number of nodes: %lu, number of elements: %lu", nnodes, + DBUG("number of nodes: {:d}, number of elements: {:d}", nnodes, nelements); ExtrapolationTest::ExtrapolationTestProcess pcs(*mesh, diff --git a/Tests/NumLib/TestODEInt.cpp b/Tests/NumLib/TestODEInt.cpp index 0abb4b57bfd8eedd49465e5a43bb5995a9f7d904..aa91edc15291236f871b7de898ae1e9b5072f913 100644 --- a/Tests/NumLib/TestODEInt.cpp +++ b/Tests/NumLib/TestODEInt.cpp @@ -87,7 +87,7 @@ public: const double delta_t = (num_timesteps == 0) ? -1.0 : ((t_end-t0) / num_timesteps); - DBUG("Running test with %u timesteps of size %g s.", num_timesteps, + DBUG("Running test with {:d} timesteps of size {:g} s.", num_timesteps, delta_t); // initial condition diff --git a/Tests/NumLib/TimeLoopSingleODE.h b/Tests/NumLib/TimeLoopSingleODE.h index 16bf82f688ebb9bc365860591eee3e0ac0036908..33155d4660bbd3376e64881fa7e1b5e63e559d28 100644 --- a/Tests/NumLib/TimeLoopSingleODE.h +++ b/Tests/NumLib/TimeLoopSingleODE.h @@ -113,7 +113,7 @@ NumLib::NonlinearSolverStatus TimeLoopSingleODE<NLTag>::loop( { ++timestep; - // INFO("time: %e, delta_t: %e", t, delta_t); + // INFO("time: {:e}, delta_t: {:e}", t, delta_t); time_disc.nextTimestep(t, delta_t); int const process_id = 0; @@ -136,7 +136,8 @@ NumLib::NonlinearSolverStatus TimeLoopSingleODE<NLTag>::loop( if (!nonlinear_solver_status.error_norms_met) { - ERR("Nonlinear solver failed in timestep #%u at t = %g s", timestep, t); + ERR("Nonlinear solver failed in timestep #{:d} at t = {:g} s", timestep, + t); } return nonlinear_solver_status; } diff --git a/Tests/NumLib/TimeSteppingTestingTools.h b/Tests/NumLib/TimeSteppingTestingTools.h index afa43d6b69cafa8d0149d5b3a94213afddb03ed8..916474f930cd3cd0626551c0328a64bc509cac70 100644 --- a/Tests/NumLib/TimeSteppingTestingTools.h +++ b/Tests/NumLib/TimeSteppingTestingTools.h @@ -42,7 +42,7 @@ std::vector<double> timeStepping(T_TIME_STEPPING& algorithm, } NumLib::TimeStep t = algorithm.getTimeStep(); - //INFO("t: n=%d,t=%g,dt=%g", t.steps(), t.current(), t.dt()); + // INFO("t: n={:d},t={:g},dt={:g}", t.steps(), t.current(), t.dt()); if (obj) { (*obj)(algorithm); // do something diff --git a/Tests/ParameterLib/Parameter.cpp b/Tests/ParameterLib/Parameter.cpp index 9ab0bed879f23f9632da1612b9fae9dc0f2f0bf3..ababafa72d26265bf2b6da050bde886e4d25379a 100644 --- a/Tests/ParameterLib/Parameter.cpp +++ b/Tests/ParameterLib/Parameter.cpp @@ -138,8 +138,9 @@ bool testNodalValuesOfElement( double const expected_value = get_expected_value(e, i); if (expected_value != nodal_values(i, 0)) { - ERR("Mismatch for element %d, node %d; Expected %g, got " - "%g.", + ERR("Mismatch for element {:d}, node {:d}; Expected {:g}, " + "got " + "{:g}.", e->getID(), i, expected_value, nodal_values(i, 0)); return false; } diff --git a/Tests/ProcessLib/TestJacobianAssembler.cpp b/Tests/ProcessLib/TestJacobianAssembler.cpp index b17d1280f1eeeaf95c55cd68084b3d0af8f0405c..bab762d985ec2ed0af8b5d2ac39f59825ebde64c 100644 --- a/Tests/ProcessLib/TestJacobianAssembler.cpp +++ b/Tests/ProcessLib/TestJacobianAssembler.cpp @@ -576,7 +576,7 @@ private: ASSERT_EQ(x.size()*x.size(), Jac_data_cd.size()); ASSERT_EQ(x.size()*x.size(), Jac_data_ana.size()); for (std::size_t i=0; i<x.size()*x.size(); ++i) { - // DBUG("%lu, %g, %g", i, Jac_data_ana[i], Jac_data_cd[i]); + // DBUG("{:d}, {:g}, {:g}", i, Jac_data_ana[i], Jac_data_cd[i]); EXPECT_NEAR(Jac_data_ana[i], Jac_data_cd[i], LocAsm::getTol()); } }