deal.II version GIT relicensing-6809-ge913b9bb34 2026-09-25 17:20:01+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
exceptions.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 1998 - 2026 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13#ifndef dealii_exceptions_h
14#define dealii_exceptions_h
15
16#include <deal.II/base/config.h>
17
18// The exception machinery (including the macros defined in
19// exception_macros.h) references Kokkos functions. The places that
20// use exceptions must know about these functions, and to avoid them
21// all having to include Kokkos headers, we have to do it here:
23#include <Kokkos_Macros.hpp>
24#if DEAL_II_KOKKOS_VERSION_GTE(4, 2, 0)
25# include <Kokkos_Abort.hpp>
26#else
27# include <Kokkos_Core.hpp>
28#endif
30
31
33
34#include <exception>
35#include <ostream>
36#include <string>
37#include <type_traits>
38
40
41
55class ExceptionBase : public std::exception
56{
57public:
62
67
71 virtual ~ExceptionBase() noexcept override = default;
72
78 operator=(const ExceptionBase &) = delete;
79
85 void
86 set_fields(const char *file,
87 const int line,
88 const char *function,
89 const char *cond,
90 const char *exc_name);
91
92
96 virtual const char *
97 what() const noexcept override;
98
102 const char *
103 get_exc_name() const;
104
108 void
109 print_exc_data(std::ostream &out) const;
110
115 virtual void
116 print_info(std::ostream &out) const;
117
122 void
123 print_stack_trace(std::ostream &out) const;
124
125protected:
129 const char *file;
130
134 unsigned int line;
135
139 const char *function;
140
144 const char *cond;
145
149 const char *exc;
150
156
157#ifdef DEAL_II_HAVE_GLIBC_STACKTRACE
161 void *raw_stacktrace[25];
162#endif
163
164private:
168 void
169 generate_message() const;
170
175 mutable std::string what_str;
176};
177
178
191{
201 "A piece of code is attempting a division by zero. This is "
202 "likely going to lead to results that make no sense.");
203
211 template <typename Number>
214 Number,
215 << "In a significant number of places, deal.II checks that some intermediate "
216 << "value is a finite number (as opposed to plus or minus infinity, or "
217 << "NaN/Not a Number). In the current function, we encountered a number "
218 << "that is not finite (its value is " << arg1 << " and therefore "
219 << "violates the current assertion).\n\n"
220 << "This may be due to the fact that some operation in this function "
221 << "created such a value, or because one of the arguments you passed "
222 << "to the function already had this value from some previous "
223 << "operation. In the latter case, this function only triggered the "
224 << "error but may not actually be responsible for the computation of "
225 << "the number that is not finite.\n\n"
226 << "There are two common cases where this situation happens. First, your "
227 << "code (or something in deal.II) divides by zero in a place where this "
228 << "should not happen. Or, you are trying to solve a linear system "
229 << "with an unsuitable solver (such as an indefinite or non-symmetric "
230 << "linear system using a Conjugate Gradient solver); such attempts "
231 << "oftentimes yield an operation somewhere that tries to divide "
232 << "by zero or take the square root of a negative value.\n\n"
233 << "In any case, when trying to find the source of the error, "
234 << "recall that the location where you are getting this error is "
235 << "simply the first place in the program where there is a check "
236 << "that a number (e.g., an element of a solution vector) is in fact "
237 << "finite, but that the actual error that computed the number "
238 << "may have happened far earlier. To find this location, you "
239 << "may want to add checks for finiteness in places of your "
240 << "program visited before the place where this error is produced. "
241 << "One way to check for finiteness is to use the 'AssertIsFinite' "
242 << "macro.");
243
248 std::size_t,
249 "Your program tried to allocate some memory but this "
250 "allocation failed. Typically, this either means that "
251 "you simply do not have enough memory in your system, "
252 "or that you are (erroneously) trying to allocate "
253 "a chunk of memory that is simply beyond all reasonable "
254 "size, for example because the size of the object has "
255 "been computed incorrectly."
256 "\n\n"
257 "In the current case, the request was for "
258 << arg1 << " bytes.");
259
265 int,
266 << "Destroying memory handler while " << arg1
267 << " objects are still allocated.");
268
273 "An input/output error has occurred. There are a number of "
274 "reasons why this may be happening, both for reading and "
275 "writing operations."
276 "\n\n"
277 "If this happens during an operation that tries to read "
278 "data: First, you may be "
279 "trying to read from a file that doesn't exist or that is "
280 "not readable given its file permissions. Second, deal.II "
281 "uses this error at times if it tries to "
282 "read information from a file but where the information "
283 "in the file does not correspond to the expected format. "
284 "An example would be a truncated file, or a mesh file "
285 "that contains not only sections that describe the "
286 "vertices and cells, but also sections for additional "
287 "data that deal.II does not understand."
288 "\n\n"
289 "If this happens during an operation that tries to write "
290 "data: you may be trying to write to a file to which file "
291 "or directory permissions do not allow you to write. A "
292 "typical example is where you specify an output file in "
293 "a directory that does not exist.");
294
302 std::string,
303 << "Could not open file " << arg1
304 << "."
305 "\n\n"
306 "If this happens during an operation that tries to read "
307 "data: you may be "
308 "trying to read from a file that doesn't exist or that is "
309 "not readable given its file permissions."
310 "\n\n"
311 "If this happens during an operation that tries to write "
312 "data: you may be trying to write to a file to which file "
313 "or directory permissions do not allow you to write. A "
314 "typical example is where you specify an output file in "
315 "a directory that does not exist.");
316
326 "You are trying to use functionality in deal.II that is "
327 "currently not implemented. In many cases, this indicates "
328 "that there simply didn't appear much of a need for it, or "
329 "that the author of the original code did not have the "
330 "time to implement a particular case. If you hit this "
331 "exception, it is therefore worth the time to look into "
332 "the code to find out whether you may be able to "
333 "implement the missing functionality. If you do, please "
334 "consider providing a patch to the deal.II development "
335 "sources (see the deal.II website on how to contribute).");
336
358 "This exception -- which is used in many places in the "
359 "library -- usually indicates that some condition which "
360 "the author of the code thought must be satisfied at a "
361 "certain point in an algorithm, is not fulfilled. An "
362 "example would be that the first part of an algorithm "
363 "sorts elements of an array in ascending order, and "
364 "a second part of the algorithm later encounters an "
365 "element that is not larger than the previous one."
366 "\n\n"
367 "There is usually not very much you can do if you "
368 "encounter such an exception since it indicates an error "
369 "in deal.II, not in your own program. Try to come up with "
370 "the smallest possible program that still demonstrates "
371 "the error and contact the deal.II mailing lists with it "
372 "to obtain help.");
373
382 "You (or a place in the library) are trying to call a "
383 "function that is declared as a virtual function in a "
384 "base class but that has not been overridden in your "
385 "derived class."
386 "\n\n"
387 "This exception happens in cases where the base class "
388 "cannot provide a useful default implementation for "
389 "the virtual function, but where we also do not want "
390 "to mark the function as abstract (i.e., with '=0' at the end) "
391 "because the function is not essential to the class in many "
392 "contexts. In cases like this, the base class provides "
393 "a dummy implementation that makes the compiler happy, but "
394 "that then throws the current exception."
395 "\n\n"
396 "A concrete example would be the 'Function' class. It declares "
397 "the existence of 'value()' and 'gradient()' member functions, "
398 "and both are marked as 'virtual'. Derived classes have to "
399 "override these functions for the values and gradients of a "
400 "particular function. On the other hand, not every function "
401 "has a gradient, and even for those that do, not every program "
402 "actually needs to evaluate it. Consequently, there is no "
403 "*requirement* that a derived class actually override the "
404 "'gradient()' function (as there would be had it been marked "
405 "as abstract). But, since the base class cannot know how to "
406 "compute the gradient, if a derived class does not override "
407 "the 'gradient()' function and it is called anyway, then the "
408 "default implementation in the base class will simply throw "
409 "an exception."
410 "\n\n"
411 "The exception you see is what happens in cases such as the "
412 "one just illustrated. To fix the problem, you need to "
413 "investigate whether the function being called should indeed have "
414 "been called; if the answer is 'yes', then you need to "
415 "implement the missing override in your class.");
416
421 std::string,
422 << "Please provide an implementation for the function \""
423 << arg1 << "\"");
424
430 std::string,
431 int,
432 << "The function \"" << arg1 << "\" returned the nonzero value " << arg2
433 << ", but the calling site expected the return value to be zero. "
434 "This error often happens when the function in question is a 'callback', "
435 "that is a user-provided function called from somewhere within deal.II "
436 "or within an external library such as PETSc, Trilinos, SUNDIALS, etc., "
437 "that expect these callbacks to indicate errors via nonzero return "
438 "codes.");
439
444
449
457 int,
458 << "You are trying to execute functionality that is "
459 << "impossible in " << arg1
460 << "d or simply does not make any sense.");
461
470 int,
471 int,
472 << "You are trying to execute functionality that is "
473 << "impossible in dimensions <" << arg1 << ',' << arg2
474 << "> or simply does not make any sense.");
475
476
481 "In a check in the code, deal.II encountered a zero in "
482 "a place where this does not make sense. See the condition "
483 "that was being checked and that is printed further up "
484 "in the error message to get more information on what "
485 "the erroneous zero corresponds to.");
486
492 "The object you are trying to access is empty but it makes "
493 "no sense to attempt the operation you are trying on an "
494 "empty object.");
495
504 std::size_t,
505 std::size_t,
506 << "Two sizes or dimensions were supposed to be equal, "
507 << "but aren't. They are " << arg1 << " and " << arg2 << '.');
508
515 long long,
516 long long,
517 << "Two integers should be equal to each other after a type conversion but "
518 << "aren't. A typical cause of this problem is that the integral types "
519 << "used by deal.II and an external library are different (e.g., one uses "
520 << "32-bit integers and the other uses 64-bit integers). The integers are "
521 << arg1 << " and " << arg2 << '.');
522
528 std::size_t,
529 std::size_t,
530 std::size_t,
531 << "The size or dimension of one object, " << arg1
532 << " was supposed to be "
533 << "equal to one of two values, but isn't. The two possible "
534 << "values are " << arg2 << " and " << arg3 << '.');
535
550 std::size_t,
551 std::size_t,
552 std::size_t,
553 << "Index " << arg1 << " is not in the half-open range [" << arg2 << ','
554 << arg3 << ")."
555 << (arg2 == arg3 ?
556 " In the current case, this half-open range is in fact empty, "
557 "suggesting that you are accessing an element of an empty "
558 "collection such as a vector that has not been set to the "
559 "correct size." :
560 ""));
561
577 template <typename T>
580 T,
581 T,
582 T,
583 << "Index " << arg1 << " is not in the half-open range [" << arg2 << ','
584 << arg3 << ")."
585 << (arg2 == arg3 ?
586 " In the current case, this half-open range is in fact empty, "
587 "suggesting that you are accessing an element of an empty "
588 "collection such as a vector that has not been set to the "
589 "correct size." :
590 ""));
591
596 int,
597 int,
598 << "Number " << arg1 << " must be larger than or equal "
599 << arg2 << '.');
600
604 template <typename T>
606 T,
607 T,
608 << "Number " << arg1 << " must be larger than or equal "
609 << arg2 << '.');
610
616 int,
617 int,
618 << "Division " << arg1 << " by " << arg2
619 << " has remainder different from zero.");
620
630 "You are trying to use an iterator, but the iterator is "
631 "in an invalid state. This may indicate that the iterator "
632 "object has not been initialized, or that it has been "
633 "moved beyond the end of the range of valid elements.");
634
640 "You are trying to use an iterator, but the iterator is "
641 "pointing past the end of the range of valid elements. "
642 "It is not valid to dereference the iterator in this "
643 "case.");
644
658 DeclException1(ExcMessage, std::string, << arg1);
659
664 "You are trying an operation on a vector that is only "
665 "allowed if the vector has no ghost elements, but the "
666 "vector you are operating on does have ghost elements."
667 "\n\n"
668 "Specifically, there are two kinds of operations that "
669 "are typically not allowed on vectors with ghost elements. "
670 "First, vectors with ghost elements are read-only "
671 "and cannot appear in operations that write into these "
672 "vectors with the exception of setting the entire vector "
673 "to zero. Second, reduction operations (such as computing "
674 "the norm of a vector, or taking dot products between "
675 "vectors) are not allowed to ensure that each vector "
676 "element is counted only once (as opposed to once for "
677 "the owner of the element plus once for each process "
678 "on which the element is stored as a ghost copy)."
679 "\n\n"
680 "See the glossary entry on 'Ghosted vectors' for more "
681 "information.");
682
688 int,
689 << "Something went wrong when making cell " << arg1
690 << ". Read the docs and the source code "
691 << "for more information.");
692
702 "A cell is flagged for coarsening, but either not all of its siblings "
703 "are active or flagged for coarsening as well. Please clean up all "
704 "coarsen flags on your triangulation via "
705 "Triangulation::prepare_coarsening_and_refinement() beforehand!");
706
715 "You are trying an operation of the form 'vector = C', "
716 "'matrix = C', or 'tensor = C' with a nonzero scalar value "
717 "'C'. However, such assignments are only allowed if the "
718 "C is zero, since the semantics for assigning any other "
719 "value are not clear. For example: one could interpret "
720 "assigning a matrix a value of 1 to mean the matrix has a "
721 "norm of 1, the matrix is the identity matrix, or the "
722 "matrix contains only 1s. Similar problems exist with "
723 "vectors and tensors. Hence, to avoid this ambiguity, such "
724 "assignments are not permitted.");
725
731 "You are attempting to use functionality that is only available "
732 "if deal.II was configured to use LAPACK, but when you configured "
733 "the library, cmake did not find a valid LAPACK library."
734 "\n\n"
735 "You will have to ensure that your system has a usable LAPACK "
736 "installation and re-install deal.II, making sure that cmake "
737 "finds the LAPACK installation. You can check this by "
738 "looking at the summary printed at the end of the cmake "
739 "output.");
740
746 "You are attempting to use functionality that requires that deal.II is configured "
747 "with HDF5 support. However, when you called 'cmake', HDF5 support "
748 "was not detected."
749 "\n\n"
750 "You will have to ensure that your system has a usable HDF5 "
751 "installation and re-install deal.II, making sure that cmake "
752 "finds the HDF5 installation. You can check this by "
753 "looking at the summary printed at the end of the cmake "
754 "output.");
755
761 "You are attempting to use functionality that requires that deal.II is configured "
762 "with NetCDF support. However, when you called 'cmake', NetCDF support "
763 "was not detected."
764 "\n\n"
765 "You will have to ensure that your system has a usable NetCDF "
766 "installation and re-install deal.II, making sure that cmake "
767 "finds the NetCDF installation. You can check this by "
768 "looking at the summary printed at the end of the cmake "
769 "output.");
770
776 "You are attempting to use functionality that is only available "
777 "if deal.II was configured to use MPI."
778 "\n\n"
779 "You will have to ensure that your system has a usable MPI "
780 "installation and re-install deal.II, making sure that cmake "
781 "finds the MPI installation. You can check this by "
782 "looking at the summary printed at the end of the cmake "
783 "output.");
784
790 "You are attempting to use functionality that is only available "
791 "if deal.II was configured to use the function parser which "
792 "relies on the muparser library, but cmake did not "
793 "find a valid muparser library on your system and also did "
794 "not choose the one that comes bundled with deal.II."
795 "\n\n"
796 "You will have to ensure that your system has a usable muparser "
797 "installation and re-install deal.II, making sure that cmake "
798 "finds the muparser installation. You can check this by "
799 "looking at the summary printed at the end of the cmake "
800 "output.");
801
802
808 "You are attempting to use functionality that is only available "
809 "if deal.II was configured to use Assimp, but cmake did not "
810 "find a valid Assimp library."
811 "\n\n"
812 "You will have to ensure that your system has a usable Assimp "
813 "installation and re-install deal.II, making sure that cmake "
814 "finds the Assimp installation. You can check this by "
815 "looking at the summary printed at the end of the cmake "
816 "output.");
817
823 "You are attempting to use functionality that is only available if deal.II "
824 "was configured to use Trilinos' SEACAS library (which provides ExodusII), "
825 "but cmake did not find a valid SEACAS library."
826 "\n\n"
827 "You will have to ensure that your system has a usable ExodusII "
828 "installation and re-install deal.II, making sure that cmake "
829 "finds the ExodusII installation. You can check this by "
830 "looking at the summary printed at the end of the cmake "
831 "output.");
832
838 "You are attempting to use functionality that is only available "
839 "if deal.II was configured to use CGAL, but cmake did not "
840 "find a valid CGAL library."
841 "\n\n"
842 "You will have to ensure that your system has a usable CGAL "
843 "installation and re-install deal.II, making sure that cmake "
844 "finds the CGAL installation. You can check this by "
845 "looking at the summary printed at the end of the cmake "
846 "output.");
847
853 "You are attempting to use functionality that is only available if deal.II "
854 "was configured to use GMSH's API, but cmake did not find a valid GMSH "
855 "library."
856 "\n\n"
857 "You will have to ensure that your system has a usable GMSH "
858 "installation (including both the gmsh executable and the GMSH library) "
859 "and re-install deal.II, making sure that cmake finds the GMSH "
860 "installation. You can check this by looking at the summary printed at the "
861 "end of the cmake output.");
862
863#ifdef DEAL_II_WITH_MPI
885 class ExcMPI : public ::ExceptionBase
886 {
887 public:
888 ExcMPI(const int error_code);
889
890 virtual void
891 print_info(std::ostream &out) const override;
892
893 const int error_code;
894 };
895#endif // DEAL_II_WITH_MPI
896
897
898
899#ifdef DEAL_II_TRILINOS_WITH_SEACAS
909 {
910 public:
916 ExcExodusII(const int error_code);
917
921 virtual void
922 print_info(std::ostream &out) const override;
923
927 const int error_code;
928 };
929#endif // DEAL_II_TRILINOS_WITH_SEACAS
930
937 "A user call-back function encountered a recoverable error, "
938 "but the underlying library that called the call-back did not "
939 "manage to recover from the error and aborted its operation."
940 "\n\n"
941 "See the glossary entry on user call-back functions for more "
942 "information.");
943
946} /*namespace StandardExceptions*/
947
948
949
957{
958 namespace internals
959 {
967 extern bool allow_abort_on_exception;
968 } // namespace internals
969
988 void
989 set_additional_assert_output(const char *const p);
990
1001 void
1003
1018 void
1020
1029 void
1031
1039 namespace internals
1040 {
1045 [[noreturn]] void
1046 abort(const ExceptionBase &exc) noexcept;
1047
1064
1082 template <typename ExceptionType>
1083 [[noreturn]] void
1085 const char *file,
1086 int line,
1087 const char *function,
1088 const char *cond,
1089 const char *exc_name,
1090 ExceptionType e)
1091 {
1092 static_assert(std::is_base_of_v<ExceptionBase, ExceptionType>,
1093 "The provided exception must inherit from ExceptionBase.");
1094 // Fill the fields of the exception object
1095 e.set_fields(file, line, function, cond, exc_name);
1096
1097 switch (handling)
1098 {
1100 {
1101 if (::deal_II_exceptions::internals::
1104 else
1105 {
1106 // We are not allowed to abort, so just throw the error:
1107 throw e;
1108 }
1109 }
1111 throw e;
1112 // this function should never return (and AssertNothrow can);
1113 // something must have gone wrong in the error handling code for us
1114 // to get this far, so throw an exception.
1115 default:
1116 throw ::StandardExceptions::ExcInternalError();
1117 }
1118 }
1119
1124 [[noreturn]] DEAL_II_HOST_DEVICE inline void
1125 do_unreachable(const char *file,
1126 int line,
1127 const char *function,
1128 const char *msg)
1129 {
1130#if DEAL_II_KOKKOS_VERSION_GTE(3, 6, 0)
1131 (void)file;
1132 (void)line;
1133 (void)function;
1134 KOKKOS_IF_ON_DEVICE(({ Kokkos::abort(msg); }))
1135 KOKKOS_IF_ON_HOST(({
1136 issue_error_noreturn(::deal_II_exceptions::internals::
1138 file,
1139 line,
1140 function,
1141 nullptr,
1142 nullptr,
1144 }))
1145#else
1146 // KOKKOS_IF_ON_DEVICE is only supported in 3.6 or newer. We require 3.7
1147 // on device though, so this means we won't be on device here:
1148 issue_error_noreturn(::deal_II_exceptions::internals::
1150 file,
1151 line,
1152 function,
1153 nullptr,
1154 nullptr,
1156#endif
1157 // This workaround is necessary, otherwise nvcc will complain that we
1158 // might return from this function, even though we will never get here (we
1159 // will throw or abort above).
1160 while (true)
1161 {
1162 }
1163 }
1164
1165
1166
1171 [[noreturn]] DEAL_II_HOST_DEVICE inline void
1172 do_not_implemented(const char *file, int line, const char *function)
1173 {
1174#if DEAL_II_KOKKOS_VERSION_GTE(3, 6, 0)
1175 (void)file;
1176 (void)line;
1177 (void)function;
1178 KOKKOS_IF_ON_DEVICE(
1179 ({ Kokkos::abort("DEAL_II_NOT_IMPLEMENTED reached."); }))
1180 KOKKOS_IF_ON_HOST(({
1181 issue_error_noreturn(::deal_II_exceptions::internals::
1183 file,
1184 line,
1185 function,
1186 nullptr,
1187 nullptr,
1189 }))
1190#else
1191 // KOKKOS_IF_ON_DEVICE is only supported in 3.6 or newer. We require 3.7
1192 // on device though, so this means we won't be on device here:
1193 issue_error_noreturn(::deal_II_exceptions::internals::
1195 file,
1196 line,
1197 function,
1198 nullptr,
1199 nullptr,
1201#endif
1202 // This workaround is necessary, otherwise nvcc will complain that we
1203 // might return from this function, even though we will never get here (we
1204 // will throw or abort above).
1205 while (true)
1206 {
1207 }
1208 }
1209
1210
1211
1215 void
1216 do_issue_error_nothrow(const ExceptionBase &e) noexcept;
1217
1226 template <typename ExceptionType>
1227 void
1228 issue_error_nothrow(const char *file,
1229 int line,
1230 const char *function,
1231 const char *cond,
1232 const char *exc_name,
1233 ExceptionType e) noexcept
1234 {
1235 static_assert(std::is_base_of_v<ExceptionBase, ExceptionType>,
1236 "The provided exception must inherit from ExceptionBase.");
1237 // Fill the fields of the exception object
1238 e.set_fields(file, line, function, cond, exc_name);
1239 // avoid moving a bunch of code into the header by dispatching to
1240 // another function:
1242 }
1243 } /*namespace internals*/
1244
1245} /*namespace deal_II_exceptions*/
1246
1247
1248
1249namespace deal_II_exceptions
1250{
1251 namespace internals
1252 {
1267 template <typename T, typename U>
1268 inline DEAL_II_HOST_DEVICE constexpr bool
1269 compare_for_equality(const T t, const U u)
1270 {
1271 using common_type = std::common_type_t<T, U>;
1272 return static_cast<common_type>(t) == static_cast<common_type>(u);
1273 }
1274
1275
1290 template <typename T, typename U>
1291 inline DEAL_II_HOST_DEVICE constexpr bool
1292 compare_less_than(const T t, const U u)
1293 {
1294 using common_type = std::common_type_t<T, U>;
1295 return (static_cast<common_type>(t) < static_cast<common_type>(u));
1296 }
1297 } // namespace internals
1298} // namespace deal_II_exceptions
1299
1300
1301
1302namespace internal
1303{
1304 // Workaround to allow for commas in template parameter lists
1305 // in preprocessor macros as found in
1306 // https://stackoverflow.com/questions/13842468/comma-in-c-c-macro
1307 template <typename F>
1309
1310 template <typename T, typename U>
1311 struct argument_type<T(U)>
1312 {
1313 using type = U;
1314 };
1315
1316 template <typename F>
1318} // namespace internal
1319
1320
1321using namespace StandardExceptions;
1322
1324
1325#endif
void generate_message() const
void print_stack_trace(std::ostream &out) const
const char * file
Definition exceptions.h:129
std::string what_str
Definition exceptions.h:175
const char * get_exc_name() const
virtual ~ExceptionBase() noexcept override=default
int n_stacktrace_frames
Definition exceptions.h:155
void set_fields(const char *file, const int line, const char *function, const char *cond, const char *exc_name)
virtual void print_info(std::ostream &out) const
virtual const char * what() const noexcept override
const char * exc
Definition exceptions.h:149
const char * function
Definition exceptions.h:139
void print_exc_data(std::ostream &out) const
unsigned int line
Definition exceptions.h:134
void * raw_stacktrace[25]
Definition exceptions.h:161
const char * cond
Definition exceptions.h:144
virtual void print_info(std::ostream &out) const override
virtual void print_info(std::ostream &out) const override
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
Definition config.h:636
#define DEAL_II_HOST_DEVICE
Definition config.h:171
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
#define DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
Definition config.h:680
static ::ExceptionBase & ExcIndexRangeType(T arg1, T arg2, T arg3)
static ::ExceptionBase & ExcImpossibleInDimSpacedim(int arg1, int arg2)
#define DeclException0(Exception0)
static ::ExceptionBase & ExcInvalidIterator()
static ::ExceptionBase & ExcOutOfMemory(std::size_t arg1)
static ::ExceptionBase & ExcIO()
static ::ExceptionBase & ExcGhostsPresent()
static ::ExceptionBase & ExcFileNotOpen(std::string arg1)
static ::ExceptionBase & ExcNumberNotFinite(Number arg1)
static ::ExceptionBase & ExcZero()
static ::ExceptionBase & ExcNeedsAssimp()
static ::ExceptionBase & ExcNeedsFunctionparser()
static ::ExceptionBase & ExcNotMultiple(int arg1, int arg2)
static ::ExceptionBase & ExcNotImplemented()
static ::ExceptionBase & ExcNeedsMPI()
static ::ExceptionBase & ExcFunctionNotProvided(std::string arg1)
static ::ExceptionBase & ExcEmptyObject()
static ::ExceptionBase & ExcScalarAssignmentOnlyForZeroValue()
static ::ExceptionBase & ExcMemoryLeak(int arg1)
static ::ExceptionBase & ExcLowerRangeType(T arg1, T arg2)
static ::ExceptionBase & ExcImpossibleInDim(int arg1)
static ::ExceptionBase & ExcIteratorPastEnd()
static ::ExceptionBase & ExcNeedsGMSHAPI()
static ::ExceptionBase & ExcNeedsExodusII()
static ::ExceptionBase & ExcDimensionMismatch2(std::size_t arg1, std::size_t arg2, std::size_t arg3)
static ::ExceptionBase & ExcNeedsNetCDF()
#define DeclException2(Exception2, type1, type2, outsequence)
static ::ExceptionBase & ExcLowerRange(int arg1, int arg2)
static ::ExceptionBase & ExcGridHasInvalidCell(int arg1)
static ::ExceptionBase & ExcPureFunctionCalled()
#define DeclExceptionMsg(Exception, defaulttext)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDivideByZero()
static ::ExceptionBase & ExcNeedsHDF5()
static ::ExceptionBase & ExcNeedsLAPACK()
#define DeclException3(Exception3, type1, type2, type3, outsequence)
static ::ExceptionBase & ExcNeedsCGAL()
static ::ExceptionBase & ExcIndexRange(std::size_t arg1, std::size_t arg2, std::size_t arg3)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcNotInitialized()
static ::ExceptionBase & ExcInvalidState()
#define DeclException1(Exception1, type1, outsequence)
static ::ExceptionBase & RecoverableUserCallbackError()
static ::ExceptionBase & ExcInvalidIntegerConversion(long long arg1, long long arg2)
static ::ExceptionBase & ExcMessage(std::string arg1)
static ::ExceptionBase & ExcFunctionNonzeroReturn(std::string arg1, int arg2)
static ::ExceptionBase & ExcInconsistentCoarseningFlags()
constexpr bool compare_less_than(const T t, const U u)
void issue_error_noreturn(ExceptionHandling handling, const char *file, int line, const char *function, const char *cond, const char *exc_name, ExceptionType e)
void abort(const ExceptionBase &exc) noexcept
void do_unreachable(const char *file, int line, const char *function, const char *msg)
void do_not_implemented(const char *file, int line, const char *function)
void do_issue_error_nothrow(const ExceptionBase &e) noexcept
constexpr bool compare_for_equality(const T t, const U u)
void issue_error_nothrow(const char *file, int line, const char *function, const char *cond, const char *exc_name, ExceptionType e) noexcept
void enable_abort_on_exception()
Definition exceptions.cc:90
void disable_abort_on_exception()
Definition exceptions.cc:82
void set_additional_assert_output(const char *const p)
void suppress_stacktrace_in_exceptions()
Definition exceptions.cc:74
typename argument_type< F >::type argument_type_t
STL namespace.