feat(quadrature): quadrature system brought over

Ported and dramatically cleaned up the quadrature system. This includes centralizing all field definitions
This commit is contained in:
2026-09-19 07:35:57 -04:00
parent 7b4f30d945
commit c44584c1e7
75 changed files with 8936 additions and 172 deletions

View File

@@ -0,0 +1,24 @@
#pragma once
// TODO: Sort out how to get this from a meson option and ideally not use any macros or at least resolve them to type safe compile time values
#define DISABLE_WARNING 0
#include <string_view>
#include <format>
#include <print>
#include <cstdio>
#include "serif/utils/misc/terminal/colors.hpp"
// We may want to do a similar thing to what we did with errors and introduce a SERiFWarningCode enum and a serif_warning function that takes a warning code and a message. This would allow us to have more structured warnings and potentially allow users to filter or handle warnings based on their codes. However, for now, we will keep it simple with just a message.
namespace serif::utils::warnings {
void serif_warning(const std::string_view message, auto... args) {
if constexpr (DISABLE_WARNING == 0) { // This is a constexpr so that the compiler can optimize out the warnings to a no-op
if (misc::terminal::supports_ansi(stderr)) {
std::println(stderr, "{}{}{}: {}", misc::terminal::a_yellow, "Warning", misc::terminal::a_reset, std::vformat(message, std::make_format_args(args...)));
} else {
std::println(stderr, "Warning: {}", std::vformat(message, std::make_format_args(args...)));
}
}
}
}