24 #ifndef OPM_EVALUATION_FORMAT_HPP 25 #define OPM_EVALUATION_FORMAT_HPP 29 #include <fmt/format.h> 30 #include <fmt/ranges.h> 32 template<
class ValueT,
int numDerivs,
unsigned staticSize>
33 struct fmt::formatter<
Opm::DenseAd::Evaluation<ValueT,numDerivs,staticSize>>
36 constexpr
auto parse(fmt::format_parse_context& ctx)
38 auto it = ctx.begin();
39 spec = (it != ctx.end() && *it !=
'}') ?
"{:" :
"{";
40 while (it != ctx.end() && *it !=
'}')
46 template<
class FormatContext>
48 FormatContext& ctx)
const 50 std::vector<ValueT> tmp(e.
size());
51 for (
int i = 0; i < e.
size(); ++i)
52 tmp[i] = e.derivative(i);
53 return fmt::format_to(ctx.out(), fmt::runtime(
"v: "+ spec +
" / d: [" + spec +
"]"),
54 e.value(), fmt::join(tmp,
", "));
58 #endif // OPM_EVALUATION_FORMAT_HPP This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
OPM_HOST_DEVICE constexpr int size() const
number of derivatives
Definition: Evaluation.hpp:73
Represents a function evaluation and its derivatives w.r.t.
Definition: Evaluation.hpp:62
Representation of an evaluation of a function and its derivatives w.r.t.