Reference documentation for deal.II version 8.4.2
Functions
StandardExceptions Namespace Reference

Functions

 DeclExceptionMsg (ExcDivideByZero, "A piece of code is attempting a division by zero. This is " "likely going to lead to results that make no sense.")
 
::ExceptionBaseExcNumberNotFinite (std::complex< double > arg1) throw (errortext << "In a significant number of places, deal.II checks that some intermediate " << "value is a finite number (as opposed to plus or minus infinity, or " << "NaN/Not a Number). In the current function, we encountered a number " << "that is not finite (its value is " << arg1 << " and therefore " << "violates the current assertion.\n\n" << "This may be due to the fact that some operation in this function " << "created such a value, or because one of the arguments you passed " << "to the function already had this value from some previous " << "operation. In the latter case, this function only triggered the " << "error but may not actually be responsible for the computation of " << "the number that is not finite.\n\n" << "There are two common cases where this situation happens. First, your " << "code (or something in deal.II) divides by zero in a place where this " << "should not happen. Or, you are trying to solve a linear system " << "with an unsuitable solver (such as an indefinite or non-symmetric " << "linear system using a Conjugate Gradient solver); such attempts " << "oftentimes yield an operation somewhere that tries to divide " << "by zero or take the square root of a negative value.\n\n" << "In any case, when trying to find the source of the error, " << "recall that the location where you are getting this error is " << "simply the first place in the program where there is a check " << "that a number (e.g., an element of a solution vector) is in fact " << "finite, but that the actual error that computed the number " << "may have happened far earlier. To find this location, you " << "may want to add checks for finiteness in places of your " << "program visited before the place where this error is produced." << "One way to check for finiteness is to use the 'AssertIsFinite' " << "macro." ); DeclExceptionMsg (ExcOutOfMemory, "Your program tried to allocate some memory but this " "allocation failed. Typically, this either means that " "you simply do not have enough memory in your system, " "or that you are (erroneously) trying to allocate " "a chunk of memory that is simply beyond all reasonable " "size, for example because the size of the object has " "been computed incorrectly."); static ::ExceptionBase& ExcMemoryLeak ( int arg1) throw (errortext << "Destroying memory handler while " << arg1 << " objects are still allocated" ); DeclExceptionMsg (ExcIO, "An input/output error has occurred. There are a number of " "reasons why this may be happening, both for reading and " "writing operations." "\n\n" "If this happens during an operation that tries to read " "data: First, you may be " "trying to read from a file that doesn't exist or that is " "not readable given its file permissions. Second, deal.II " "uses this error at times if it tries to " "read information from a file but where the information " "in the file does not correspond to the expected format. " "An example would be a truncated file, or a mesh file " "that contains not only sections that describe the " "vertices and cells, but also sections for additional " "data that deal.II does not understand." "\n\n" "If this happens during an operation that tries to write " "data: you may be trying to write to a file to which file " "or directory permissions do not allow you to write. A " "typical example is where you specify an output file in " "a directory that does not exist."); static ::ExceptionBase& ExcFileNotOpen ( char * arg1) throw (errortext << "Could not open file " << arg1 ); DeclExceptionMsg (ExcNotImplemented, "You are trying to use functionality in deal.II that is " "currently not implemented. In many cases, this indicates " "that there simply didn't appear much of a need for it, or " "that the author of the original code did not have the " "time to implement a particular case. If you hit this " "exception, it is therefore worth the time to look into " "the code to find out whether you may be able to " "implement the missing functionality. If you do, please " "consider providing a patch to the deal.II development " "sources (see the deal.II website on how to contribute)."); DeclExceptionMsg (ExcInternalError, "This exception -- which is used in many places in the " "library -- usually indicates that some condition which " "the author of the code thought must be satisfied at a " "certain point in an algorithm, is not fulfilled. An " "example would be that the first part of an algorithm " "sorts elements of an array in ascending order, and " "a second part of the algorithm later encounters an " "an element that is not larger than the previous one." "\n\n" "There is usually not very much you can do if you " "encounter such an exception since it indicates an error " "in deal.II, not in your own program. Try to come up with " "the smallest possible program that still demonstrates " "the error and contact the deal.II mailing lists with it " "to obtain help."); DeclExceptionMsg (ExcPureFunctionCalled, "You (or a place in the library) are trying to call a " "function that is declared as a virtual function in a " "base class but that has not been overridden in your " "derived class." "\n\n" "This exception happens in cases where the base class " "cannot provide a useful default implementation for " "the virtual function, but where we also do not want " "to mark the function as abstract (i.e., with '=0' at the end) " "because the function is not essential to the class in many " "contexts. In cases like this, the base class provides " "a dummy implementation that makes the compiler happy, but " "that then throws the current exception." "\n\n" "A concrete example would be the 'Function' class. It declares " "the existence of 'value()' and 'gradient()' member functions, " "and both are marked as 'virtual'. Derived classes have to " "override these functions for the values and gradients of a " "particular function. On the other hand, not every function " "has a gradient, and even for those that do, not every program " "actually needs to evaluate it. Consequently, there is no " "*requirement* that a derived class actually override the " "'gradient()' function (as there would be had it been marked " "as abstract). But, since the base class cannot know how to " "compute the gradient, if a derived class does not override " "the 'gradient()' function and it is called anyway, then the " "default implementation in the base class will simply throw " "an exception." "\n\n" "The exception you see is what happens in cases such as the " "one just illustrated. To fix the problem, you need to " "investigate whether the function being called should indeed have " "been called; if the answer is 'yes', then you need to " "implement the missing override in your class."); static ::ExceptionBase& ExcInvalidConstructorCall (); static ::ExceptionBase& ExcNotInitialized (); static ::ExceptionBase& ExcInvalidState (); static ::ExceptionBase& ExcImpossibleInDim ( int arg1) throw (errortext << "You are trying to execute functionality that is " << "impossible in " << arg1 << "d or simply does not make any sense." ); DeclExceptionMsg(ExcZero, "In a check in the code, deal.II encountered a zero in " "a place where this does not make sense. See the condition " "that was being checked and that is printed further up " "in the error message to get more information on what " "the erroneous zero corresponds to."); DeclExceptionMsg(ExcEmptyObject, "The object you are trying to access is empty but it makes " "no sense to attempt the operation you are trying on an " "empty object."); static ::ExceptionBase& ExcDimensionMismatch ( std::size_t arg1, std::size_t arg2) throw (errortext << "Dimension " << arg1 << " not equal to " << arg2 ); static ::ExceptionBase& ExcDimensionMismatch2 ( int arg1, int arg2, int arg3) throw (errortext << "Dimension " << arg1 << " neither equal to " << arg2 << " nor to " << arg3 ); static ::ExceptionBase& ExcIndexRange ( int arg1, int arg2, int arg3) throw (errortext << "Index " << arg1 << " is not in the half-open range [" << arg2 << "," << arg3 << ")." << (arg2==arg3 ? " In the current case, this half-open range is in fact empty, " "suggesting that you are accessing an element of an empty " "collection such as a vector that has not been set to the " "correct size." : "") )
 
template<typename T >
::ExceptionBaseExcIndexRangeType (T arg1, T arg2, T arg3)." << (arg2 throw (errortext << "Index " << arg1 << " is not in the half-open range [" << arg2 << "," << arg3 << ")
 
::ExceptionBaseExcLowerRange (int arg1, int arg2)." ) throw (errortext << "Number " << arg1 << " must be larger than or equal " << arg2 << ")
 
template<typename T >
::ExceptionBaseExcLowerRangeType (T arg1, T arg2) throw (errortext << "Number " << arg1 << " must be larger than or equal " << arg2 << "." )
 
::ExceptionBaseExcNotMultiple (int arg1, int arg2) throw (errortext << "Division " << arg1 << " by " << arg2 << " has remainder different from zero" )
 
 DeclExceptionMsg (ExcInvalidIterator, "You are trying to use an iterator, but the iterator is " "in an invalid state. This may indicate that the iterator " "object has not been initialized, or that it has been " "moved beyond the end of the range of valid elements.")
 
 DeclExceptionMsg (ExcIteratorPastEnd, "You are trying to use an iterator, but the iterator is " "pointing past the end of the range of valid elements. " "It is not valid to dereference the iterator in this " "case.")
 
::ExceptionBaseExcMessage (std::string arg1) throw (errortext << arg1 )
 
 DeclExceptionMsg (ExcGhostsPresent, "You are trying an operation on a vector that is only " "allowed if the vector has no ghost elements, but the " "vector you are operating on does have ghost elements. " "Specifically, vectors with ghost elements are read-only " "and cannot appear in operations that write into these " "vectors." "\" "See the glossary entry on 'Ghosted vectors' for more " "information.")
 
 DeclExceptionMsg (ExcScalarAssignmentOnlyForZeroValue, "You are trying an operation of the form 'vector=s' with " "a nonzero scalar value 's'. However, such assignments " "are only allowed if the right hand side is zero.")
 
::ExceptionBaseExcNeedsLAPACK ()
 
::ExceptionBaseExcNeedsNetCDF ()
 
::ExceptionBaseExcNeedsFunctionparser ()
 

Detailed Description

Declare some exceptions that occur over and over. This way, you can simply use these exceptions, instead of having to declare them locally in your class. The namespace in which these exceptions are declared is later included into the global namespace by

using namespace StandardExceptions;