libMesh
include
geom
compare_elems_by_level.h
Go to the documentation of this file.
1
// The libMesh Finite Element Library.
2
// Copyright (C) 2002-2019 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3
4
// This library is free software; you can redistribute it and/or
5
// modify it under the terms of the GNU Lesser General Public
6
// License as published by the Free Software Foundation; either
7
// version 2.1 of the License, or (at your option) any later version.
8
9
// This library is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
// Lesser General Public License for more details.
13
14
// You should have received a copy of the GNU Lesser General Public
15
// License along with this library; if not, write to the Free Software
16
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
18
19
20
#ifndef LIBMESH_COMPARE_ELEMS_BY_LEVEL_H
21
#define LIBMESH_COMPARE_ELEMS_BY_LEVEL_H
22
23
24
// Local Includes
25
#include "libmesh/elem.h"
26
27
// C++ Includes
28
#include <numeric>
29
#include <set>
30
31
32
33
34
namespace
libMesh
{
35
42
struct
CompareElemIdsByLevel
43
{
44
bool
operator()
(
const
Elem
* a,
45
const
Elem
* b)
const
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
();
53
54
return
(al == bl) ? aid < bid : al < bl;
55
}
56
};
57
58
59
}
// namespace libMesh
60
61
#endif // LIBMESH_COMPARE_ELEMS_BY_LEVEL_H
libMesh::dof_id_type
uint8_t dof_id_type
Definition:
id_types.h:67
libMesh::Elem::level
unsigned int level() const
Definition:
elem.h:2478
libMesh
The libMesh namespace provides an interface to certain functionality in the library.
Definition:
factoryfunction.C:55
libMesh::libmesh_assert
libmesh_assert(ctx)
libMesh::DofObject::id
dof_id_type id() const
Definition:
dof_object.h:767
libMesh::Elem
This is the base class from which all geometric element types are derived.
Definition:
elem.h:100
libMesh::CompareElemIdsByLevel
Specific weak ordering for Elem *'s to be used in a set.
Definition:
compare_elems_by_level.h:42
libMesh::CompareElemIdsByLevel::operator()
bool operator()(const Elem *a, const Elem *b) const
Definition:
compare_elems_by_level.h:44
Generated on Sat Jan 25 2020 12:06:53 for libMesh by
1.8.16