libMesh
parallel_elem.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2019 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 // libMesh includes
23 #include "libmesh/id_types.h"
24 #include "libmesh/libmesh_config.h"
25 
26 // TIMPI includes
27 #include "timpi/packing.h"
28 
29 
30 namespace libMesh
31 {
32 
33 // Forward declarations
34 class Elem;
35 
36 namespace Parallel
37 {
38 
39 template <>
40 class Packing<const Elem *>
41 {
42 public:
44 
45  template <typename OutputIter, typename Context>
46  static void pack(const Elem * const & object,
47  OutputIter data_out,
48  const Context * context);
49 
50  template <typename Context>
51  static unsigned int packable_size(const Elem * const & object,
52  const Context * context);
53 
54  template <typename BufferIter>
55  static unsigned int packed_size(BufferIter iter);
56 
57  template <typename BufferIter, typename Context>
58  static const Elem * unpack(BufferIter in, Context * ctx);
59 };
60 
61 
62 template <>
63 class Packing<Elem *>
64 {
65 public:
67 
68  template <typename OutputIter, typename Context>
69  static void pack(Elem * const & object,
70  OutputIter data_out,
71  const Context * context)
72  { return Packing<const Elem *>::pack(object, data_out, context); }
73 
74  template <typename Context>
75  static unsigned int packable_size(Elem * const & object,
76  const Context * context)
77  { return Packing<const Elem *>::packable_size(object, context); }
78 
79  template <typename BufferIter>
80  static unsigned int packed_size(BufferIter iter)
81  { return Packing<const Elem *>::packed_size(iter); }
82 
83  template <typename BufferIter, typename Context>
84  static Elem * unpack(BufferIter in, Context * ctx);
85 };
86 
87 
88 template <typename BufferIter, typename Context>
89 inline const Elem*
90 Packing<const Elem*>::unpack(BufferIter in, Context * ctx)
91 { return Packing<Elem*>::unpack(in, ctx); }
92 
93 } // namespace Parallel
94 } // namespace libMesh
95 
96 #endif // LIBMESH_PARALLEL_ELEM_H
libMesh::Parallel::Packing< Elem * >::packed_size
static unsigned int packed_size(BufferIter iter)
Definition: parallel_elem.h:80
libMesh::Parallel::Packing< const Elem * >::packable_size
static unsigned int packable_size(const Elem *const &object, const Context *context)
libMesh::Parallel::Packing< Elem * >::packable_size
static unsigned int packable_size(Elem *const &object, const Context *context)
Definition: parallel_elem.h:75
libMesh
The libMesh namespace provides an interface to certain functionality in the library.
Definition: factoryfunction.C:55
libMesh::Parallel::Packing< const Elem * >::packed_size
static unsigned int packed_size(BufferIter iter)
libMesh::largest_id_type
uint64_t largest_id_type
Definition: id_types.h:148
libMesh::Parallel::Packing< Elem * >::unpack
static Elem * unpack(BufferIter in, Context *ctx)
libMesh::Parallel::Packing< Elem * >::buffer_type
largest_id_type buffer_type
Definition: parallel_elem.h:66
libMesh::Parallel::Packing< const Elem * >::pack
static void pack(const Elem *const &object, OutputIter data_out, const Context *context)
libMesh::Parallel::Packing< const Elem * >::unpack
static const Elem * unpack(BufferIter in, Context *ctx)
Definition: parallel_elem.h:90
libMesh::Parallel::Packing< const Elem * >::buffer_type
largest_id_type buffer_type
Definition: parallel_elem.h:43
libMesh::ctx
void * ctx
Definition: petsc_dm_wrapper.C:71
libMesh::Elem
This is the base class from which all geometric element types are derived.
Definition: elem.h:100
packing.h
libMesh::Parallel::Packing< Elem * >::pack
static void pack(Elem *const &object, OutputIter data_out, const Context *context)
Definition: parallel_elem.h:69