libMesh
Loading...
Searching...
No Matches
enum_order.h
Go to the documentation of this file.
1// The libMesh Finite Element Library.
2// Copyright (C) 2002-2026 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_ENUM_ORDER_H
21#define LIBMESH_ENUM_ORDER_H
22
23namespace libMesh {
24
89
90 // Standardize this so nvc++ and clang -fsanitize=integer don't
91 // complain about all the ways in which we might do it wrong
92 template <typename T>
93 inline Order operator+(Order o, T p)
94 {
95 return static_cast<Order>(static_cast<int>(o) + int(p));
96 }
97
98 template <typename T>
99 inline Order operator-(Order o, T p)
100 {
101 return static_cast<Order>(static_cast<int>(o) - int(p));
102 }
103
104 template <typename T>
105 inline Order operator+(T p, Order o)
106 {
107 return o + p;
108 }
109
110 template <typename T>
111 inline Order & operator+=(Order &o, T p)
112 {
113 o = o + p;
114 return o;
115 }
116
117 template <typename T>
118 inline Order & operator-=(Order &o, T p)
119 {
120 o = o - p;
121 return o;
122 }
123
124}
125
126#endif
The libMesh namespace provides an interface to certain functionality in the library.
Order & operator+=(Order &o, T p)
Definition enum_order.h:111
Order operator+(Order o, T p)
Definition enum_order.h:93
Order operator-(Order o, T p)
Definition enum_order.h:99
Order & operator-=(Order &o, T p)
Definition enum_order.h:118
@ TWENTYSECOND
Definition enum_order.h:64
@ THIRTYFOURTH
Definition enum_order.h:76
@ TWENTYSIXTH
Definition enum_order.h:68
@ SEVENTEENTH
Definition enum_order.h:58
@ EIGHTEENTH
Definition enum_order.h:60
@ FORTYFIRST
Definition enum_order.h:83
@ TWENTYFIRST
Definition enum_order.h:63
@ FORTYSECOND
Definition enum_order.h:84
@ TWENTYEIGHTH
Definition enum_order.h:70
@ THIRTYFIRST
Definition enum_order.h:73
@ THIRTYSECOND
Definition enum_order.h:74
@ SIXTEENTH
Definition enum_order.h:57
@ FORTYTHIRD
Definition enum_order.h:85
@ THIRTYNINTH
Definition enum_order.h:81
@ THIRTYSEVENTH
Definition enum_order.h:79
@ THIRTYSIXTH
Definition enum_order.h:78
@ THIRTYEIGHTH
Definition enum_order.h:80
@ TWENTYSEVENTH
Definition enum_order.h:69
@ TWENTIETH
Definition enum_order.h:62
@ TWENTYNINTH
Definition enum_order.h:71
@ THIRTIETH
Definition enum_order.h:72
@ TWENTYTHIRD
Definition enum_order.h:65
@ INVALID_ORDER
Definition enum_order.h:88
@ TWENTYFIFTH
Definition enum_order.h:67
@ FIFTEENTH
Definition enum_order.h:56
@ FOURTEENTH
Definition enum_order.h:55
@ THIRTYFIFTH
Definition enum_order.h:77
@ EIGHTTEENTH
Definition enum_order.h:59
@ TWENTYFOURTH
Definition enum_order.h:66
@ NINETEENTH
Definition enum_order.h:61
@ THIRTYTHIRD
Definition enum_order.h:75
@ THIRTEENTH
Definition enum_order.h:54