Reference documentation for deal.II version 9.1.0-pre
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.md at
12 // the top level directory of deal.II.
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 {
36  {
41 
47 
54 
60 
65 
69  update_all = 0xFF,
70  };
71 
72 
78  template <class StreamType>
79  inline StreamType &
80  operator<<(StreamType &s, const CacheUpdateFlags u)
81  {
82  s << " CacheUpdateFlags";
84  s << "|vertex_to_cell_map";
86  s << "|vertex_to_cells_centers_directions";
87 #ifdef DEAL_II_WITH_NANOFLANN
88  if (u & update_vertex_kdtree)
89  s << "|vertex_kdtree";
90 #endif
91  return s;
92  }
93 
94 
104  inline CacheUpdateFlags
106  {
107  return static_cast<CacheUpdateFlags>(static_cast<unsigned int>(f1) |
108  static_cast<unsigned int>(f2));
109  }
110 
120  inline CacheUpdateFlags
122  {
123  return static_cast<CacheUpdateFlags>(static_cast<unsigned int>(f1) ^
124  static_cast<unsigned int>(update_all));
125  }
126 
127 
128 
135  inline CacheUpdateFlags &
137  {
138  f1 = f1 | f2;
139  return f1;
140  }
141 
142 
153  const CacheUpdateFlags f2)
154  {
155  return static_cast<CacheUpdateFlags>(static_cast<unsigned int>(f1) &
156  static_cast<unsigned int>(f2));
157  }
158 
159 
166  inline CacheUpdateFlags &
168  {
169  f1 = f1 & f2;
170  return f1;
171  }
172 
173 } // namespace GridTools
174 DEAL_II_NAMESPACE_CLOSE
175 
176 #endif
CacheUpdateFlags & operator&=(CacheUpdateFlags &f1, const CacheUpdateFlags f2)
StreamType & operator<<(StreamType &s, const CacheUpdateFlags u)
Definition: tria.h:81
CacheUpdateFlags operator&(const 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)