Commit 493a7246 authored by Praetorius, Simon's avatar Praetorius, Simon

Added fmt as output formatting library

parent c57c5580
Pipeline #1233 failed with stage
in 12 minutes and 55 seconds
...@@ -19,12 +19,7 @@ add_subdirectory("test") ...@@ -19,12 +19,7 @@ add_subdirectory("test")
add_subdirectory("examples" EXCLUDE_FROM_ALL) add_subdirectory("examples" EXCLUDE_FROM_ALL)
add_subdirectory("doc") add_subdirectory("doc")
add_subdirectory("cmake/modules") add_subdirectory("cmake/modules")
add_subdirectory("externals" EXCLUDE_FROM_ALL) add_subdirectory("externals")
target_include_directories(amdis PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src>)
target_compile_definitions(amdis PUBLIC AMDIS_BACKEND_MTL=1)
target_compile_options(amdis PUBLIC -Wall -pedantic -Wno-unused-parameter) #-ftemplate-backtrace-limit=0
# finalize the dune project, e.g. generating config.h etc. # finalize the dune project, e.g. generating config.h etc.
finalize_dune_project(GENERATE_CONFIG_H_CMAKE) finalize_dune_project(GENERATE_CONFIG_H_CMAKE)
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2016 Simon Praetorius Copyright (c) 2016-2018 Simon Praetorius
2018 Felix Müller
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
......
...@@ -2,10 +2,8 @@ ...@@ -2,10 +2,8 @@
# Dune module information file # # Dune module information file #
################################ ################################
#Name of the module
Module: amdis Module: amdis
Version: 0.1 Version: 0.1
Maintainer: simon.praetorius@tu-dresden.de Maintainer: simon.praetorius@tu-dresden.de
#depending on
Depends: dune-common (>= 2.6) dune-geometry (>= 2.6) dune-localfunctions (>= 2.6) dune-typetree (>= 2.6) dune-grid (>= 2.6) dune-functions (>= 2.6) Depends: dune-common (>= 2.6) dune-geometry (>= 2.6) dune-localfunctions (>= 2.6) dune-typetree (>= 2.6) dune-grid (>= 2.6) dune-functions (>= 2.6)
#Suggests: dune-uggrid dune-alugrid dune-foamgrid Suggests: dune-uggrid dune-alugrid dune-foamgrid
...@@ -6,7 +6,7 @@ foreach(project ${projects2d}) ...@@ -6,7 +6,7 @@ foreach(project ${projects2d})
add_executable(${project}.2d ${project}.cc) add_executable(${project}.2d ${project}.cc)
add_dune_alberta_flags(GRIDDIM 2 WORLDDIM 2 ${project}.2d) add_dune_alberta_flags(GRIDDIM 2 WORLDDIM 2 ${project}.2d)
target_link_dune_default_libraries(${project}.2d) target_link_dune_default_libraries(${project}.2d)
target_link_libraries(${project}.2d amdis fmt) target_link_libraries(${project}.2d amdis)
target_compile_definitions(${project}.2d PRIVATE AMDIS_DIM=2 AMDIS_DOW=2) target_compile_definitions(${project}.2d PRIVATE AMDIS_DIM=2 AMDIS_DOW=2)
add_dependencies(examples ${project}.2d) add_dependencies(examples ${project}.2d)
endforeach() endforeach()
...@@ -17,7 +17,7 @@ foreach(project ${projects3d}) ...@@ -17,7 +17,7 @@ foreach(project ${projects3d})
add_executable(${project}.3d ${project}.cc) add_executable(${project}.3d ${project}.cc)
add_dune_alberta_flags(GRIDDIM 3 WORLDDIM 3 ${project}.3d) add_dune_alberta_flags(GRIDDIM 3 WORLDDIM 3 ${project}.3d)
target_link_dune_default_libraries(${project}.3d) target_link_dune_default_libraries(${project}.3d)
target_link_libraries(${project}.3d amdis fmt) target_link_libraries(${project}.3d amdis)
target_compile_definitions(${project}.3d PRIVATE AMDIS_DIM=3 AMDIS_DOW=3) target_compile_definitions(${project}.3d PRIVATE AMDIS_DIM=3 AMDIS_DOW=3)
add_dependencies(examples ${project}.3d) add_dependencies(examples ${project}.3d)
endforeach() endforeach()
\ No newline at end of file
...@@ -3,8 +3,6 @@ ...@@ -3,8 +3,6 @@
#endif #endif
#include <iostream> #include <iostream>
#include <fmt/core.h>
#include <amdis/AMDiS.hpp> #include <amdis/AMDiS.hpp>
#include <amdis/ProblemStat.hpp> #include <amdis/ProblemStat.hpp>
#include <amdis/Operators.hpp> #include <amdis/Operators.hpp>
...@@ -79,9 +77,9 @@ int main(int argc, char** argv) ...@@ -79,9 +77,9 @@ int main(int argc, char** argv)
} }
std::cout << "\n"; std::cout << "\n";
fmt::print("{:5} | {:12} | {:12} | {:12} | {:12} | {:12}\n", msg("{:5} | {:12} | {:12} | {:12} | {:12} | {:12}\n",
"level", "h", "|u - u*|_L2","|u - u*|_H1","eoc_L2","eoc_H1"); "level", "h", "|u - u*|_L2","|u - u*|_H1","eoc_L2","eoc_H1");
fmt::print("{0:->7}{0:->15}{0:->15}{0:->15}{0:->15}{1:->14}","+","\n"); msg("{0:->7}{0:->15}{0:->15}{0:->15}{0:->15}{1:->14}","+","\n");
std::vector<double> eocL2(numLevels, 0.0), eocH1(numLevels, 0.0); std::vector<double> eocL2(numLevels, 0.0), eocH1(numLevels, 0.0);
for (int i = 1; i < numLevels; ++i) { for (int i = 1; i < numLevels; ++i) {
...@@ -90,8 +88,8 @@ int main(int argc, char** argv) ...@@ -90,8 +88,8 @@ int main(int argc, char** argv)
} }
for (int i = 0; i < numLevels; ++i) for (int i = 0; i < numLevels; ++i)
fmt::print("{:<5} | {:<12} | {:<12} | {:<12} | {:<12} | {:<12}\n", msg("{:<5} | {:<12} | {:<12} | {:<12} | {:<12} | {:<12}\n",
i+1, widths[i], errL2[i], errH1[i], eocL2[i], eocH1[i]); i+1, widths[i], errL2[i], errH1[i], eocL2[i], eocH1[i]);
AMDiS::finalize(); AMDiS::finalize();
return 0; return 0;
......
add_subdirectory(fmt) target_include_directories(amdis PUBLIC
\ No newline at end of file $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/externals/fmt/include>)
dune_library_add_sources(amdis SOURCES
fmt/src/format.cc
fmt/src/posix.cc)
install(FILES
fmt/include/fmt/core.h
fmt/include/fmt/format-inl.h
fmt/include/fmt/format.h
fmt/include/fmt/ostream.h
fmt/include/fmt/posix.h
fmt/include/fmt/printf.h
fmt/include/fmt/ranges.h
fmt/include/fmt/time.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/fmt)
\ No newline at end of file
add_subdirectory(amdis) add_subdirectory(amdis)
\ No newline at end of file
target_include_directories(amdis PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src>)
target_compile_options(amdis PUBLIC -Wall -pedantic -Wno-unused-parameter) #-ftemplate-backtrace-limit=0
...@@ -41,7 +41,7 @@ namespace AMDiS ...@@ -41,7 +41,7 @@ namespace AMDiS
problemTime->setTime(adaptInfo); problemTime->setTime(adaptInfo);
msg("time = ", adaptInfo.getTime(), ", timestep = ", adaptInfo.getTimestep()); msg("time = {}, timestep = {}", adaptInfo.getTime(), adaptInfo.getTimestep());
adaptInfo.setSpaceIteration(0); adaptInfo.setSpaceIteration(0);
...@@ -62,7 +62,7 @@ namespace AMDiS ...@@ -62,7 +62,7 @@ namespace AMDiS
adaptInfo.setTime(adaptInfo.getTime() + adaptInfo.getTimestep()); adaptInfo.setTime(adaptInfo.getTime() + adaptInfo.getTimestep());
problemTime->setTime(adaptInfo); problemTime->setTime(adaptInfo);
msg("time = ", adaptInfo.getTime(), ", timestep = ", adaptInfo.getTimestep()); msg("time = {}, timestep = {}", adaptInfo.getTime(), adaptInfo.getTimestep());
problemIteration->oneIteration(adaptInfo, NO_ADAPTION); problemIteration->oneIteration(adaptInfo, NO_ADAPTION);
...@@ -153,7 +153,7 @@ namespace AMDiS ...@@ -153,7 +153,7 @@ namespace AMDiS
adaptInfo.setTime(adaptInfo.getTime() + adaptInfo.getTimestep()); adaptInfo.setTime(adaptInfo.getTime() + adaptInfo.getTimestep());
problemTime->setTime(adaptInfo); problemTime->setTime(adaptInfo);
msg("time = ", adaptInfo.getTime(), ", timestep = ", adaptInfo.getTimestep()); msg("time = {}, timestep = {}", adaptInfo.getTime(), adaptInfo.getTimestep());
problemIteration->oneIteration(adaptInfo, FULL_ITERATION); problemIteration->oneIteration(adaptInfo, FULL_ITERATION);
...@@ -189,7 +189,7 @@ namespace AMDiS ...@@ -189,7 +189,7 @@ namespace AMDiS
simpleAdaptiveTimeStrategy(); simpleAdaptiveTimeStrategy();
break; break;
default: default:
error_exit("Unknown strategy = ", strategy); error_exit("Unknown strategy = {}", strategy);
} }
adaptInfo.incTimestepNumber(); adaptInfo.incTimestepNumber();
......
...@@ -95,7 +95,7 @@ void Assembler<Traits>::assemble( ...@@ -95,7 +95,7 @@ void Assembler<Traits>::assemble(
// 4. finish matrix insertion and apply dirichlet boundary conditions // 4. finish matrix insertion and apply dirichlet boundary conditions
std::size_t nnz = finishMatrixVector(matrix, solution, rhs, asmMatrix, asmVector); std::size_t nnz = finishMatrixVector(matrix, solution, rhs, asmMatrix, asmVector);
msg("fill-in of assembled matrix: ", nnz); msg("fill-in of assembled matrix: {}", nnz);
} }
...@@ -142,7 +142,7 @@ void Assembler<Traits>::initMatrixVector( ...@@ -142,7 +142,7 @@ void Assembler<Traits>::initMatrixVector(
{ {
#ifdef HAVE_EXTENDED_DUNE_FUNCTIONS #ifdef HAVE_EXTENDED_DUNE_FUNCTIONS
if (rowNode.isLeaf) if (rowNode.isLeaf)
msg(globalBasis_.dimension(rowTreePath), " DOFs for Basis[", to_string(rowTreePath), "]"); msg("{} DOFs for Basis[{}]",globalBasis_.dimension(rowTreePath), to_string(rowTreePath));
#endif #endif
auto rowBasis = Dune::Functions::subspaceBasis(globalBasis_, rowTreePath); auto rowBasis = Dune::Functions::subspaceBasis(globalBasis_, rowTreePath);
...@@ -155,7 +155,7 @@ void Assembler<Traits>::initMatrixVector( ...@@ -155,7 +155,7 @@ void Assembler<Traits>::initMatrixVector(
bc->init(matrix, solution, rhs, rowBasis, colBasis); bc->init(matrix, solution, rhs, rowBasis, colBasis);
}); });
}); });
msg(globalBasis_.dimension(), " total DOFs"); msg("{} total DOFs", globalBasis_.dimension());
} }
......
...@@ -36,7 +36,7 @@ namespace AMDiS ...@@ -36,7 +36,7 @@ namespace AMDiS
static void addCreator(std::string key, CreatorInterface<BaseClass>* creator) static void addCreator(std::string key, CreatorInterface<BaseClass>* creator)
{ {
init(); init();
test_exit(!creatorMap[key], "There is already a creator for key ", key); test_exit(!creatorMap[key], "There is already a creator for key {}", key);
creatorMap[key] = creator; creatorMap[key] = creator;
} }
...@@ -50,7 +50,7 @@ namespace AMDiS ...@@ -50,7 +50,7 @@ namespace AMDiS
key = "default"; key = "default";
auto creator = creatorMap[key]; auto creator = creatorMap[key];
test_exit(creator, "No creator for key `", key, "` defined in init file for parameter `", initFileStr, "`"); test_exit(creator, "No creator for key `{}` defined in init file for parameter `{}`", key, initFileStr);
return creator; return creator;
} }
......
...@@ -94,7 +94,7 @@ namespace AMDiS ...@@ -94,7 +94,7 @@ namespace AMDiS
/// Implements \ref FileWriterInterface::writeFiles /// Implements \ref FileWriterInterface::writeFiles
virtual void writeFiles(AdaptInfo& adaptInfo, bool force) override virtual void writeFiles(AdaptInfo& adaptInfo, bool force) override
{ {
test_exit(filesystem::exists(dir_), "Output directory '",dir_,"' does not exist!"); test_exit(filesystem::exists(dir_), "Output directory '{}' does not exist!",dir_);
if (vtkSeqWriter_) if (vtkSeqWriter_)
vtkSeqWriter_->write(adaptInfo.getTime(), mode_); vtkSeqWriter_->write(adaptInfo.getTime(), mode_);
......
...@@ -9,7 +9,7 @@ namespace AMDiS { ...@@ -9,7 +9,7 @@ namespace AMDiS {
void InitfileParser::readInitfile(std::string fn, Dune::ParameterTree& pt, bool overwrite) void InitfileParser::readInitfile(std::string fn, Dune::ParameterTree& pt, bool overwrite)
{ {
test_exit(filesystem::exists(fn), test_exit(filesystem::exists(fn),
"init-file '", fn, "' cannot be opened for reading"); "init-file '{}' cannot be opened for reading", fn);
// read file if its not parsed already // read file if its not parsed already
auto ins = includeList().insert(fn); auto ins = includeList().insert(fn);
......
...@@ -52,8 +52,8 @@ void Marker<Traits>::initMarking(AdaptInfo& adaptInfo) ...@@ -52,8 +52,8 @@ void Marker<Traits>::initMarking(AdaptInfo& adaptInfo)
template <class Traits> template <class Traits>
void Marker<Traits>::finishMarking(AdaptInfo& adaptInfo) void Marker<Traits>::finishMarking(AdaptInfo& adaptInfo)
{ {
msg(elMarkRefine_, " elements marked for refinement"); msg("{} elements marked for refinement", elMarkRefine_);
msg(elMarkCoarsen_, " elements marked for coarsening"); msg("{} elements marked for coarsening", elMarkCoarsen_);
} }
...@@ -110,7 +110,8 @@ void MSMarker<Traits>::initMarking(AdaptInfo& adaptInfo) ...@@ -110,7 +110,8 @@ void MSMarker<Traits>::initMarking(AdaptInfo& adaptInfo)
this->markRLimit_ = msGammaP * adaptInfo.getEstMax(this->component_); this->markRLimit_ = msGammaP * adaptInfo.getEstMax(this->component_);
this->markCLimit_ = msGammaCP * adaptInfo.getEstMax(this->component_); this->markCLimit_ = msGammaCP * adaptInfo.getEstMax(this->component_);
msg("start max_est: ", adaptInfo.getEstMax(this->component_), ", mark_limits: ", this->markRLimit_, ", " , this->markCLimit_); msg("start max_est: {}, mark_limits: {}, {}",
adaptInfo.getEstMax(this->component_), this->markRLimit_ , this->markCLimit_);
} }
...@@ -131,7 +132,7 @@ void ESMarker<Traits>::initMarking(AdaptInfo& adaptInfo) ...@@ -131,7 +132,7 @@ void ESMarker<Traits>::initMarking(AdaptInfo& adaptInfo)
this->markRLimit_ = esThetaP * epsP / nLeaves; this->markRLimit_ = esThetaP * epsP / nLeaves;
this->markCLimit_ = esThetaCP * epsP / nLeaves; this->markCLimit_ = esThetaCP * epsP / nLeaves;
msg("start mark_limits: ", this->markRLimit_, ", " , this->markCLimit_, "; nt = ", nLeaves); msg("start mark_limits: {}, {}; nt = {}", this->markRLimit_, this->markCLimit_, nLeaves);
} }
...@@ -156,7 +157,7 @@ Flag GERSMarker<Traits>::markGrid(AdaptInfo& adaptInfo) ...@@ -156,7 +157,7 @@ Flag GERSMarker<Traits>::markGrid(AdaptInfo& adaptInfo)
if (redfac < 1.0) { if (redfac < 1.0) {
LTheta *= redfac; LTheta *= redfac;
msg("GERS: use extrapolated theta_star = ", std::pow(LTheta, 1.0 / this->p_)); msg("GERS: use extrapolated theta_star = {}", std::pow(LTheta, 1.0 / this->p_));
} }
} }
...@@ -176,7 +177,7 @@ Flag GERSMarker<Traits>::markGrid(AdaptInfo& adaptInfo) ...@@ -176,7 +177,7 @@ Flag GERSMarker<Traits>::markGrid(AdaptInfo& adaptInfo)
} while((GERSGamma > 0) && (gersSum_ < LTheta * this->estSum_)); } while((GERSGamma > 0) && (gersSum_ < LTheta * this->estSum_));
} }
msg("GERS refinement with gamma = ", GERSGamma); msg("GERS refinement with gamma = {}", GERSGamma);
} }
if (this->coarsenAllowed_) { if (this->coarsenAllowed_) {
...@@ -191,10 +192,10 @@ Flag GERSMarker<Traits>::markGrid(AdaptInfo& adaptInfo) ...@@ -191,10 +192,10 @@ Flag GERSMarker<Traits>::markGrid(AdaptInfo& adaptInfo)
for (const auto& elem : Dune::elements(this->grid_->leafGridView())) for (const auto& elem : Dune::elements(this->grid_->leafGridView()))
markElementForCoarsening(adaptInfo, elem); markElementForCoarsening(adaptInfo, elem);
msg("coarse loop: gamma = ", GERSGamma, ", sum = ", gersSum_, ", limit = ", LTheta); msg("coarse loop: gamma = {}, sum = {}, limit = {}", GERSGamma, gersSum_, LTheta);
} while(gersSum_ > LTheta); } while(gersSum_ > LTheta);
msg("GERS coarsening with gamma = ", GERSGamma); msg("GERS coarsening with gamma = {}", GERSGamma);
} }
Super::finishMarking(adaptInfo); Super::finishMarking(adaptInfo);
......
...@@ -145,8 +145,6 @@ namespace AMDiS ...@@ -145,8 +145,6 @@ namespace AMDiS
Dune::FieldVector<double, dim> L; L = 1.0; // extension of the domain Dune::FieldVector<double, dim> L; L = 1.0; // extension of the domain
Parameters::get(meshName + "->dimension", L); Parameters::get(meshName + "->dimension", L);
msg("L = ", L);
auto s = Dune::filledArray<std::size_t(dim)>(1); // number of cells on coarse mesh in each direction auto s = Dune::filledArray<std::size_t(dim)>(1); // number of cells on coarse mesh in each direction
Parameters::get(meshName + "->num cells", s); Parameters::get(meshName + "->num cells", s);
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <fmt/core.h>
/** /**
* \def AMDIS_NO_THROW * \def AMDIS_NO_THROW
* \brief The preprocessor constant sets whether to use c-asserts (if defined) or * \brief The preprocessor constant sets whether to use c-asserts (if defined) or
...@@ -37,10 +39,6 @@ ...@@ -37,10 +39,6 @@
#endif #endif
#endif #endif
#define AMDIS_STATIC_ASSERT(...) \
static_assert(__VA_ARGS__, #__VA_ARGS__)
#define AMDIS_UNUSED(var) __attribute__((unused)) var #define AMDIS_UNUSED(var) __attribute__((unused)) var
#define AMDIS_FUNCNAME(nn) AMDIS_UNUSED(const char *funcName); funcName = nn; #define AMDIS_FUNCNAME(nn) AMDIS_UNUSED(const char *funcName); funcName = nn;
...@@ -58,23 +56,6 @@ namespace AMDiS ...@@ -58,23 +56,6 @@ namespace AMDiS
{ {
namespace Impl namespace Impl
{ {
template <class OStream>
OStream& concat(OStream& out) { return out; }
template <class OStream, class Arg0, class... Args>
OStream& concat(OStream& out, Arg0&& arg0, Args&&... args)
{
out << arg0; concat(out, std::forward<Args>(args)...);
return out;
}
template <class... Args>
std::string to_string(Args&&... args)
{
std::stringstream ss; concat(ss, std::forward<Args>(args)...);
return ss.str();
}
template <class OStream, class... Args> template <class OStream, class... Args>
OStream& msg(OStream& out, Args&&... args) OStream& msg(OStream& out, Args&&... args)
{ {
...@@ -84,12 +65,12 @@ namespace AMDiS ...@@ -84,12 +65,12 @@ namespace AMDiS
MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &num_ranks); MPI_Comm_size(MPI_COMM_WORLD, &num_ranks);
if (num_ranks > 1 && rank == 0) { if (num_ranks > 1 && rank == 0) {
concat(out, "[0] ",std::forward<Args>(args)...); out << "[0] " << fmt::format(std::forward<Args>(args)...);
} else if (num_ranks == 1) { } else if (num_ranks == 1) {
concat(out, std::forward<Args>(args)...); out << fmt::format(std::forward<Args>(args)...);
} }
#else #else
concat(out, std::forward<Args>(args)...); out << fmt::format(std::forward<Args>(args)...);
#endif #endif
return out; return out;
} }
...@@ -107,7 +88,7 @@ namespace AMDiS ...@@ -107,7 +88,7 @@ namespace AMDiS
template <class... Args> template <class... Args>
void msg(Args&&... args) void msg(Args&&... args)
{ {
Impl::msg(std::cout, std::forward<Args>(args)..., "\n"); Impl::msg(std::cout, std::forward<Args>(args)...) << std::endl;
} }
...@@ -135,14 +116,14 @@ namespace AMDiS ...@@ -135,14 +116,14 @@ namespace AMDiS
void error_exit(Args&&... args) void error_exit(Args&&... args)
{ {
#ifdef AMDIS_NO_THROW #ifdef AMDIS_NO_THROW
Impl::msg(std::cerr, "ERROR: ", std::forward<Args>(args)..., "\n"); Impl::msg(std::cerr << "ERROR: ", std::forward<Args>(args)...) << std::endl;
#ifndef NDEBUG #ifndef NDEBUG
assert(false); assert(false);
#else #else
std::exit(EXIT_FAILURE); std::exit(EXIT_FAILURE);
#endif #endif
#else #else
throw std::runtime_error( Impl::to_string("ERROR: ", std::forward<Args>(args)...) ); throw std::runtime_error( std::string("ERROR: ") + fmt::format(std::forward<Args>(args)...));
#endif #endif
} }
...@@ -166,7 +147,7 @@ namespace AMDiS ...@@ -166,7 +147,7 @@ namespace AMDiS
template <class... Args> template <class... Args>
void warning(Args&&... args) void warning(Args&&... args)
{ {
msg("WARNING: ", std::forward<Args>(args)...); Impl::msg(std::cout << "WARNING: ", std::forward<Args>(args)...) << std::endl;
} }
......
...@@ -253,14 +253,14 @@ namespace AMDiS ...@@ -253,14 +253,14 @@ namespace AMDiS
{ {
gridName_ = ""; gridName_ = "";
Parameters::get(name_ + "->mesh", gridName_); Parameters::get(name_ + "->mesh", gridName_);
test_exit(!gridName_.empty(), "No grid name specified for '", name_, "->mesh'!"); test_exit(!gridName_.empty(), "No grid name specified for '{}->mesh'!", name_);
grid_ = MeshCreator<Grid>::create(gridName_); grid_ = MeshCreator<Grid>::create(gridName_);
msg("Create grid:"); msg("Create grid:");
msg("#elements = " , grid_->size(0)); msg("#elements = {}" , grid_->size(0));
msg("#faces/edges = ", grid_->size(1)); msg("#faces/edges = {}", grid_->size(1));
msg("#vertices = " , grid_->size(dim)); msg("#vertices = {}" , grid_->size(dim));
msg(""); msg("");
} }
......
...@@ -285,14 +285,14 @@ solve(AdaptInfo& adaptInfo, bool createMatrixData, bool storeMatrixData) ...@@ -285,14 +285,14 @@ solve(AdaptInfo& adaptInfo, bool createMatrixData, bool storeMatrixData)
solverInfo); solverInfo);
if (solverInfo.getInfo() > 0) { if (solverInfo.getInfo() > 0) {
msg("solution of discrete system needed ", t.elapsed(), " seconds"); msg("solution of discrete system needed {} seconds", t.elapsed());
if (solverInfo.getAbsResidual() >= 0.0) { if (solverInfo.getAbsResidual() >= 0.0) {
if (solverInfo.getRelResidual() >= 0.0) if (solverInfo.getRelResidual() >= 0.0)
msg("Residual norm: ||b-Ax|| = ", solverInfo.getAbsResidual(), msg("Residual norm: ||b-Ax|| = {}, ||b-Ax||/||b|| = {}",
", ||b-Ax||/||b|| = ", solverInfo.getRelResidual()); solverInfo.getAbsResidual(), solverInfo.getRelResidual());
else else
msg("Residual norm: ||b-Ax|| = ", solverInfo.getAbsResidual()); msg("Residual norm: ||b-Ax|| = {}", solverInfo.getAbsResidual());
} }
} }
...@@ -304,7 +304,7 @@ solve(AdaptInfo& adaptInfo, bool createMatrixData, bool storeMatrixData) ...@@ -304,7 +304,7 @@ solve(AdaptInfo& adaptInfo, bool createMatrixData, bool storeMatrixData)
if (solverInfo.getRelTolerance() > 0 if (solverInfo.getRelTolerance() > 0
&& solverInfo.getRelResidual() > solverInfo.getRelTolerance()) && solverInfo.getRelResidual() > solverInfo.getRelTolerance())
tol_str << "relTol = " << solverInfo.getRelTolerance() << " "; tol_str << "relTol = " << solverInfo.getRelTolerance() << " ";
error_exit("Tolerance ", tol_str.str(), " could not be reached!"); error_exit("Tolerance {} could not be reached!", tol_str.str());
} }
} }
...@@ -318,7 +318,7 @@ Flag ProblemStat<Traits>::markElements(AdaptInfo& adaptInfo) ...@@ -318,7 +318,7 @@ Flag ProblemStat<Traits>::markElements(AdaptInfo& adaptInfo)
for (auto& currentMarker : marker_) for (auto& currentMarker : marker_)
markFlag |= currentMarker->markGrid(adaptInfo); markFlag |= currentMarker->markGrid(adaptInfo);
msg("markElements needed ", t.elapsed(), " seconds"); msg("markElements needed {} seconds", t.elapsed());
return markFlag; return markFlag;
} }
...@@ -335,7 +335,7 @@ buildAfterCoarsen(AdaptInfo& /*adaptInfo*/, Flag /*flag*/, bool asmMatrix, bool ...@@ -335,7 +335,7 @@ buildAfterCoarsen(AdaptInfo& /*adaptInfo*/, Flag /*flag*/, bool asmMatrix, bool
globalBasis_->update(gv); globalBasis_->update(gv);
assembler.assemble(*systemMatrix_, *solution_, *rhs_, asmMatrix, asmVector); assembler.assemble(*systemMatrix_, *solution_, *rhs_, asmMatrix, asmVector);
msg(