NeoN
A framework for CFD software
Loading...
Searching...
No Matches
exceptions.hpp File Reference
#include <stdexcept>
#include <utility>
#include <source_location>
#include <sstream>
#include <string_view>
#include "NeoN/core/primitives/label.hpp"
#include "NeoN/core/error.hpp"

Go to the source code of this file.

Classes

class  NeoN::Error
 Base class for consistent error representation. More...
class  NeoN::DimensionMismatch
 Error for handling two containers of incompatible lengths. More...

Namespaces

namespace  NeoN
 Integer types used throughout NeoN.

Macros

#define NeoN_ASSERT_EQUAL_LENGTH(_op1, _op2)

Functions

void NeoN::validateRange (std::pair< localIdx, localIdx > range, sizeType size)
localIdx NeoN::toLocalIdx (sizeType value)
void NeoN::validateInput (bool condition, std::string_view message, const std::source_location location=std::source_location::current())

Macro Definition Documentation

◆ NeoN_ASSERT_EQUAL_LENGTH

#define NeoN_ASSERT_EQUAL_LENGTH ( _op1,
_op2 )
Value:
auto s1 = static_cast<localIdx>(_op1.size()); \
auto s2 = static_cast<localIdx>(_op2.size()); \
if (s1 != s2) \
{ \
throw ::NeoN::DimensionMismatch( \
__FILE__, __LINE__, __func__, s1, s2, "expected equal dimensions" \
); \
}

Asserts that _op1 and _op2 have the same length.

Exceptions
DimensionMismatchif _op1 and _op2 differ in the number of rows or columns

Definition at line 106 of file exceptions.hpp.