Reference documentation for deal.II version 9.0.0
grid_tools_cache_update_flags.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2017 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_grid_tria_info_cache_update_flags_h
17 #define dealii_grid_tria_info_cache_update_flags_h
18 
19 
20 #include <deal.II/base/config.h>
21 
22 DEAL_II_NAMESPACE_OPEN
23 
24 namespace GridTools
25 {
26 
37  {
42 
47 
53 
58 
63 
67  update_all = 0xFF,
68  };
69 
70 
76  template <class StreamType>
77  inline
78  StreamType &operator << (StreamType &s,
79  const CacheUpdateFlags u)
80  {
81  s << " CacheUpdateFlags";
82  if (u & update_vertex_to_cell_map) s << "|vertex_to_cell_map";
83  if (u & update_vertex_to_cell_centers_directions) s << "|vertex_to_cells_centers_directions";
84 #ifdef DEAL_II_WITH_NANOFLANN
85  if (u & update_vertex_kdtree) s << "|vertex_kdtree";
86 #endif
87  return s;
88  }
89 
90 
100  inline
103  const CacheUpdateFlags f2)
104  {
105  return static_cast<CacheUpdateFlags> (
106  static_cast<unsigned int> (f1) |
107  static_cast<unsigned int> (f2));
108  }
109 
119  inline
122  {
123  return static_cast<CacheUpdateFlags> (
124  static_cast<unsigned int> (f1) ^
125  static_cast<unsigned int> (update_all));
126  }
127 
128 
129 
136  inline
139  const CacheUpdateFlags f2)
140  {
141  f1 = f1 | f2;
142  return f1;
143  }
144 
145 
155  inline
158  const CacheUpdateFlags f2)
159  {
160  return static_cast<CacheUpdateFlags> (
161  static_cast<unsigned int> (f1) &
162  static_cast<unsigned int> (f2));
163  }
164 
165 
172  inline
175  const CacheUpdateFlags f2)
176  {
177  f1 = f1 & f2;
178  return f1;
179  }
180 
181 }
182 DEAL_II_NAMESPACE_CLOSE
183 
184 #endif
StreamType & operator<<(StreamType &s, const CacheUpdateFlags u)
CacheUpdateFlags operator&(const CacheUpdateFlags f1, const CacheUpdateFlags f2)
Definition: tria.h:76
CacheUpdateFlags & operator&=(CacheUpdateFlags &f1, const CacheUpdateFlags f2)
CacheUpdateFlags & operator|=(CacheUpdateFlags &f1, const CacheUpdateFlags f2)
CacheUpdateFlags operator|(const CacheUpdateFlags f1, const CacheUpdateFlags f2)
CacheUpdateFlags operator~(const CacheUpdateFlags f1)