Reference documentation for deal.II version 8.1.0
tria_object.h
1 // ---------------------------------------------------------------------
2 // @f$Id: tria_object.h 30036 2013-07-18 16:55:32Z maier @f$
3 //
4 // Copyright (C) 1998 - 2013 by the deal.II authors
5 //
6 // This file is part of the deal.II library.
7 //
8 // The deal.II library is free software; you can use it, redistribute
9 // it, and/or modify it under the terms of the GNU Lesser General
10 // Public License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 // The full text of the license can be found in the file LICENSE at
13 // the top level of the deal.II distribution.
14 //
15 // ---------------------------------------------------------------------
16 
17 #ifndef __deal2__tria_object_h
18 #define __deal2__tria_object_h
19 
20 
21 #include <deal.II/base/config.h>
23 #include <deal.II/base/geometry_info.h>
24 
26 
27 namespace internal
28 {
29  namespace Triangulation
30  {
31 
41  template <int structdim>
42  class TriaObject
43  {
44  public:
45  static const unsigned int dimension = structdim;
46 
52  TriaObject ();
53 
62  TriaObject (const int i0, const int i1);
63 
72  TriaObject (const int i0, const int i1,
73  const int i2, const int i3);
74 
83  TriaObject (const int i0, const int i1,
84  const int i2, const int i3,
85  const int i4, const int i5);
86 
87 
92  int face (const unsigned int i) const;
93 
98  void set_face (const unsigned int i, const int index);
99 
105  static std::size_t memory_consumption ();
106 
111  template <class Archive>
112  void serialize(Archive &ar,
113  const unsigned int version);
114 
115  protected:
124  };
125 
126 //----------------------------------------------------------------------//
127 
128  template <int structdim>
129  inline
131  {
132  for (unsigned int i=0; i<GeometryInfo<structdim>::faces_per_cell; ++i)
133  faces[i] = -1;
134  }
135 
136 
137  template <int structdim>
138  inline
140  const int i1)
141  {
142  Assert (structdim==1, ExcImpossibleInDim(structdim));
143  faces[0] = i0;
144  faces[1] = i1;
145  }
146 
147 
148  template <int structdim>
149  inline
151  const int i1,
152  const int i2,
153  const int i3)
154  {
155  Assert (structdim==2, ExcImpossibleInDim(structdim));
156  faces[0] = i0;
157  faces[1] = i1;
158  faces[2] = i2;
159  faces[3] = i3;
160  }
161 
162 
163  template <int structdim>
164  inline
166  const int i1,
167  const int i2,
168  const int i3,
169  const int i4,
170  const int i5)
171  {
172  Assert (structdim==3, ExcImpossibleInDim(structdim));
173  faces[0] = i0;
174  faces[1] = i1;
175  faces[2] = i2;
176  faces[3] = i3;
177  faces[4] = i4;
178  faces[5] = i5;
179  }
180 
181 
182  template <int structdim>
183  inline
184  int TriaObject<structdim>::face (const unsigned int i) const
185  {
188  return faces[i];
189  }
190 
191 
192 
193  template <int structdim>
194  inline
195  void TriaObject<structdim>::set_face (const unsigned int i, const int index)
196  {
199  faces[i] = index;
200  }
201 
202 
203 
204  template <int structdim>
205  inline
206  std::size_t
208  {
209  return sizeof(TriaObject<structdim>);
210  }
211 
212 
213  template <int structdim>
214  template <class Archive>
216  const unsigned int)
217  {
218  ar &faces;
219  }
220 
221 
222  }
223 }
224 
225 
226 DEAL_II_NAMESPACE_CLOSE
227 
228 #endif
static std::size_t memory_consumption()
Definition: tria_object.h:207
int face(const unsigned int i) const
Definition: tria_object.h:184
int faces[GeometryInfo< structdim >::faces_per_cell]
Definition: tria_object.h:123
#define Assert(cond, exc)
Definition: exceptions.h:299
::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
::ExceptionBase & ExcImpossibleInDim(int arg1)
void set_face(const unsigned int i, const int index)
Definition: tria_object.h:195
void serialize(Archive &ar, const unsigned int version)
Definition: tria_object.h:215