ElementErrorCode Class Reference

Detailed Description

Collects error flags for mesh elements.

Definition at line 33 of file ElementErrorCode.h.

#include <ElementErrorCode.h>

Inheritance diagram for ElementErrorCode:
Collaboration diagram for ElementErrorCode:

Public Member Functions

bool get (ElementErrorFlag e) const
 Get value for a specific flag.
void set (ElementErrorFlag e)
 Set a specific flag.
void reset (ElementErrorFlag e)
 Reset a specific flag.
reference operator[] (const ElementErrorFlag e)
bool operator[] (const ElementErrorFlag e) const

Static Public Member Functions

static std::string toString (const ElementErrorFlag e)
 Returns a string output for a specific error flag.

Member Function Documentation

◆ get()

bool ElementErrorCode::get ( ElementErrorFlag  e) const

Get value for a specific flag.

Definition at line 37 of file ElementErrorCode.h.

37{ return test(static_cast<std::size_t>(e)); }

◆ operator[]() [1/2]

reference ElementErrorCode::operator[] ( const ElementErrorFlag  e)

Definition at line 43 of file ElementErrorCode.h.

43{ return std::bitset<static_cast<std::size_t>(ElementErrorFlag::MaxValue)>::operator[](static_cast<std::size_t>(e)); }

◆ operator[]() [2/2]

bool ElementErrorCode::operator[] ( const ElementErrorFlag  e) const

Definition at line 44 of file ElementErrorCode.h.

44{ return std::bitset<static_cast<std::size_t>(ElementErrorFlag::MaxValue)>::operator[](static_cast<std::size_t>(e)); }

◆ reset()

void ElementErrorCode::reset ( ElementErrorFlag  e)

Reset a specific flag.

Definition at line 41 of file ElementErrorCode.h.

41{ std::bitset<static_cast<std::size_t>(ElementErrorFlag::MaxValue)>::set(static_cast<std::size_t>(e), false); }
void set(ElementErrorFlag e)
Set a specific flag.

References set().

◆ set()

void ElementErrorCode::set ( ElementErrorFlag  e)

Set a specific flag.

Definition at line 39 of file ElementErrorCode.h.

39{ std::bitset<static_cast<std::size_t>(ElementErrorFlag::MaxValue)>::set(static_cast<std::size_t>(e), true); }

References set().

Referenced by reset(), set(), MeshLib::PrismRule::validate(), and MeshLib::PyramidRule::validate().

◆ toString()

static std::string ElementErrorCode::toString ( const ElementErrorFlag  e)

Returns a string output for a specific error flag.

Definition at line 47 of file ElementErrorCode.h.

48 {
49 if (e == ElementErrorFlag::ZeroVolume)
50 {
51 return "zero volume";
52 }
53 if (e == ElementErrorFlag::NonCoplanar)
54 {
55 return "non coplanar nodes";
56 }
57 if (e == ElementErrorFlag::NonConvex)
58 {
59 return "non-convex geometry";
60 }
61 if (e == ElementErrorFlag::NodeOrder)
62 {
63 return "wrong node order";
64 }
65 return "nonspecified error";
66 }

Referenced by MeshToolsLib::MeshValidation::ElementErrorCodeOutput(), and MeshToolsLib::MeshValidation::testElementGeometry().

The documentation for this class was generated from the following file: