Public Member Functions | List of all members
libMesh::CompareElemIdsByLevel Struct Reference

Specific weak ordering for Elem *'s to be used in a set. More...

#include <compare_elems_by_level.h>

Public Member Functions

bool operator() (const Elem *a, const Elem *b) const

Detailed Description

Specific weak ordering for Elem *'s to be used in a set.

We use the id, but first sort by level. This guarantees when traversing the set from beginning to end the lower level (parent) elements are encountered first.

Definition at line 42 of file compare_elems_by_level.h.

Member Function Documentation

bool libMesh::CompareElemIdsByLevel::operator() ( const Elem a,
const Elem b 
) const

Definition at line 44 of file compare_elems_by_level.h.

References libMesh::DofObject::id(), libMesh::Elem::level(), and libMesh::libmesh_assert().

46  {
47  libmesh_assert (a);
48  libmesh_assert (b);
49  const unsigned int
50  al = a->level(), bl = b->level();
51  const dof_id_type
52  aid = a->id(), bid = b->id();
54  return (al == bl) ? aid < bid : al < bl;
55  }
uint8_t dof_id_type
Definition: id_types.h:64

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