PRISMS-PF Manual v3.0-pre
All Classes Functions Variables Enumerations Pages
exceptions.h
1// SPDX-FileCopyrightText: © 2025 PRISMS Center at the University of Michigan
2// SPDX-License-Identifier: GNU Lesser General Public Version 2.1
3
4#ifndef exceptions_h
5#define exceptions_h
6
7#include <deal.II/base/exceptions.h>
8
9#include <prismspf/config.h>
10#include <prismspf/core/types.h>
11
12PRISMS_PF_BEGIN_NAMESPACE
13
18#ifdef DEBUG
19template <typename Condition, typename Exception>
20constexpr void
21AssertThrowDebug(const Condition &cond, const Exception &exc)
22{
23 AssertThrow(cond, exc);
24}
25#else
26template <typename Condition, typename Exception>
27constexpr void
28AssertThrowDebug(const Condition &, const Exception &)
29{
30 // Do nothing in release mode
31}
32#endif
33
34// NOLINTBEGIN
35
40DeclException1(
41 FeatureNotImplemented,
42 std::string,
43 << "The following feature has yet to be implemented in PRISMS-PF:\n " << arg1
44 << "\nCheck the issues section of PRISMS-PF's github to see if this feature is under "
45 "development. Additionally, please considering provided a patch to PRISMS-PF if you "
46 "feel that feature is worthwhile for yourself and others.");
47
52DeclExceptionMsg(UnreachableCode, "This code should not have been reached.");
53
58DeclException2(DependencyNotFound,
59 types::index,
60 std::string,
61 << "Attemped access of the variable with index " << arg1
62 << " and dependency type " << arg2
63 << " that was not marked as needed. Please check customAttributeLoader.");
64
65// NOLINTEND
66
67PRISMS_PF_END_NAMESPACE
68
69#endif