11 #include <nlohmann/json.hpp> 18 extern template class nlohmann::basic_json<>;
23 using Point = Eigen::Vector3d;
25 using json = nlohmann::json;
38 std::ranges::range<T> && std::is_same_v<std::ranges::range_value_t<T>,
Point>;
46 extern std::shared_ptr<spdlog::logger> faunus_logger;
47 extern std::shared_ptr<spdlog::logger> mcloop_logger;
57 template <
class... Args>
58 explicit GenericError(std::format_string<Args...> fmt, Args&&... args)
59 : std::runtime_error(std::format(fmt, std::forward<Args>(args)...))
67 using GenericError::GenericError;
68 [[nodiscard]]
const json& attachedJson()
const;
78 using GenericError::GenericError;
88 void displayError(spdlog::logger& logger,
const std::exception& e,
int level = 0);
nlohmann::json json
JSON object.
Definition: json_support.h:10
Eigen::Vector3d Point
3D vector used for positions, velocities, forces etc.
Definition: coordinates.h:7
std::function< Point(const Point &, const Point &)> DistanceFunction
Function to calculate the (minimum) distance between two points.
Definition: core.h:32
Random number generator.
Definition: random.h:34
std::vector< Point > PointVector
Vector of 3D vectors.
Definition: core.h:24
Exception to be thrown when parsing json configuration.
Definition: core.h:65
Exception to be thrown on IO errors.
Definition: core.h:76
Common ancestor of Faunus specific runtime errors.
Definition: core.h:50
std::function< void(Point &)> BoundaryFunction
Function to apply PBC to a position.
Definition: core.h:30
Cell list class templates.
Definition: actions.cpp:11
void displayError(spdlog::logger &logger, const std::exception &e, int level=0)
Nicely displays nested exceptions using a logger.
concept RequirePointIterator
Concept for an iterator to a Point
Definition: core.h:42
concept RequirePoints
Concept for a range of points.
Definition: core.h:37