Commit ffa6d36f authored by Timo Koch's avatar Timo Koch
Browse files

Merge branch 'fix/fmt-for-use-with-opm' into 'master'

Move fmt to Dumux namespace

Closes #1150

See merge request !3099
parents 579772a7 27942de6
Pipeline #16292 passed with stages
in 0 seconds
......@@ -36,10 +36,10 @@
//! Formatting tools in the style of std::format (C++20)
namespace Dumux::Fmt {
using fmt::format;
using fmt::format_to;
using fmt::format_to_n;
using fmt::formatted_size;
using Dumux::Detail::fmt::format;
using Dumux::Detail::fmt::format_to;
using Dumux::Detail::fmt::format_to_n;
using Dumux::Detail::fmt::formatted_size;
} // end namespace Dumux::Fmt
......
......@@ -5,8 +5,8 @@
//
// For the license information refer to format.h.
#ifndef FMT_CORE_H_
#define FMT_CORE_H_
#ifndef DUMUX_FMT_CORE_H_
#define DUMUX_FMT_CORE_H_
#include <cstdio> // std::FILE
#include <cstring>
......@@ -201,7 +201,7 @@
}
# endif
# define FMT_BEGIN_NAMESPACE \
namespace fmt { \
namespace Dumux::Detail::fmt { \
FMT_INLINE_NAMESPACE v7 {
#endif
......@@ -292,7 +292,7 @@ FMT_NORETURN FMT_API void assert_fail(const char* file, int line,
# define FMT_ASSERT(condition, message) \
((condition) /* void() fails with -Winvalid-constexpr on clang 4.0.1 */ \
? (void)0 \
: ::fmt::detail::assert_fail(__FILE__, __LINE__, (message)))
: Dumux::Detail::fmt::detail::assert_fail(__FILE__, __LINE__, (message)))
# endif
#endif
......
......@@ -5,8 +5,8 @@
//
// For the license information refer to format.h.
#ifndef FMT_FORMAT_INL_H_
#define FMT_FORMAT_INL_H_
#ifndef DUMUX_FMT_FORMAT_INL_H_
#define DUMUX_FMT_FORMAT_INL_H_
#include <cassert>
#include <cctype>
......@@ -29,8 +29,8 @@
// Dummy implementations of strerror_r and strerror_s called if corresponding
// system functions are not available.
inline fmt::detail::null<> strerror_r(int, char*, ...) { return {}; }
inline fmt::detail::null<> strerror_s(char*, size_t, ...) { return {}; }
inline Dumux::Detail::fmt::detail::null<> strerror_r(int, char*, ...) { return {}; }
inline Dumux::Detail::fmt::detail::null<> strerror_s(char*, size_t, ...) { return {}; }
FMT_BEGIN_NAMESPACE
namespace detail {
......
......@@ -30,8 +30,8 @@
without including the above copyright and permission notices.
*/
#ifndef FMT_FORMAT_H_
#define FMT_FORMAT_H_
#ifndef DUMUX_FMT_FORMAT_H_
#define DUMUX_FMT_FORMAT_H_
#include <algorithm>
#include <cerrno>
......
......@@ -9,8 +9,8 @@
// All Rights Reserved
// {fmt} support for ranges, containers and types tuple interface.
#ifndef FMT_RANGES_H_
#define FMT_RANGES_H_
#ifndef DUMUX_FMT_RANGES_H_
#define DUMUX_FMT_RANGES_H_
#include <initializer_list>
#include <type_traits>
......
......@@ -48,6 +48,7 @@
#include <dumux/io/vtkoutputmodule.hh>
#include <dumux/io/grid/cpgridmanager.hh>
#include <dumux/io/format.hh>
#include "properties.hh"
......@@ -80,6 +81,8 @@ int main(int argc, char** argv)
// we compute on the leaf grid view
const auto& leafGridView = gridManager.grid().leafGridView();
std::cout << Fmt::format("Initialized cornerpoint grid with {} elements\n", leafGridView.size(0));
// create the finite volume grid geometry
using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
auto gridGeometry = std::make_shared<GridGeometry>(leafGridView);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment