parallel_elem.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2018 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 #ifndef LIBMESH_PARALLEL_ELEM_H
20 #define LIBMESH_PARALLEL_ELEM_H
21 
22 // Local Includes
23 #include "libmesh/libmesh_config.h"
24 
25 #include "libmesh/elem.h"
26 #include "libmesh/id_types.h"
27 
28 namespace libMesh
29 {
30 namespace Parallel
31 {
32 
33 template <>
34 class Packing<const Elem *>
35 {
36 public:
38 
39  template <typename OutputIter, typename Context>
40  static void pack(const Elem * const & object,
41  OutputIter data_out,
42  const Context * context);
43 
44  template <typename Context>
45  static unsigned int packable_size(const Elem * const & object,
46  const Context * context);
47 
48  template <typename BufferIter>
49  static unsigned int packed_size(BufferIter iter);
50 
51  template <typename BufferIter, typename Context>
52  static const Elem * unpack(BufferIter in, Context * ctx);
53 };
54 
55 
56 template <>
57 class Packing<Elem *>
58 {
59 public:
61 
62  template <typename OutputIter, typename Context>
63  static void pack(Elem * const & object,
64  OutputIter data_out,
65  const Context * context)
66  { return Packing<const Elem *>::pack(object, data_out, context); }
67 
68  template <typename Context>
69  static unsigned int packable_size(Elem * const & object,
70  const Context * context)
71  { return Packing<const Elem *>::packable_size(object, context); }
72 
73  template <typename BufferIter>
74  static unsigned int packed_size(BufferIter iter)
75  { return Packing<const Elem *>::packed_size(iter); }
76 
77  template <typename BufferIter, typename Context>
78  static Elem * unpack(BufferIter in, Context * ctx);
79 };
80 
81 
82 template <typename BufferIter, typename Context>
83 inline const Elem*
84 Packing<const Elem*>::unpack(BufferIter in, Context * ctx)
85 { return Packing<Elem*>::unpack(in, ctx); }
86 
87 } // namespace Parallel
88 } // namespace libMesh
89 
90 #endif // LIBMESH_PARALLEL_ELEM_H
The base class for all geometric element types.
Definition: elem.h:100
uint64_t largest_id_type
Definition: id_types.h:139
static void pack(Elem *const &object, OutputIter data_out, const Context *context)
Definition: parallel_elem.h:63
static unsigned int packed_size(BufferIter iter)
Definition: parallel_elem.h:74
static unsigned int packable_size(Elem *const &object, const Context *context)
Definition: parallel_elem.h:69
static unsigned int packable_size(const T &object, const Context *context)
static unsigned int packed_size(BufferIter iter)
static void pack(const T &object, OutputIter data_out, const Context *context)
static T unpack(BufferIter in, Context *ctx)