1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2020 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_NODE_H
20 #define LIBMESH_PARALLEL_NODE_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 Node;
35 
36 namespace Parallel
37 {
38 
39 template <>
40 class Packing<const Node *>
41 {
42 public:
43   typedef largest_id_type buffer_type;
44 
45   template <typename OutputIter, typename Context>
46   static void pack(const Node * const & object,
47                    OutputIter data_out,
48                    const Context * context);
49 
50   template <typename Context>
51   static unsigned int packable_size(const Node * 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 Node * unpack(BufferIter in, Context * ctx);
59 };
60 
61 
62 template <>
63 class Packing<Node *>
64 {
65 public:
66   typedef largest_id_type buffer_type;
67 
68   template <typename OutputIter, typename Context>
pack(Node * const & object,OutputIter data_out,const Context * context)69   static void pack(Node * const & object,
70                    OutputIter data_out,
71                    const Context * context)
72   { return Packing<const Node *>::pack(object, data_out, context); }
73 
74   template <typename Context>
packable_size(Node * const & object,const Context * context)75   static unsigned int packable_size(Node * const & object,
76                                     const Context * context)
77   { return Packing<const Node*>::packable_size(object, context); }
78 
79   template <typename BufferIter>
packed_size(BufferIter iter)80   static unsigned int packed_size(BufferIter iter)
81   { return Packing<const Node *>::packed_size(iter); }
82 
83   template <typename BufferIter, typename Context>
84   static Node * unpack(BufferIter in, Context * ctx);
85 };
86 
87 
88 template <typename BufferIter, typename Context>
89 inline const Node *
unpack(BufferIter in,Context * ctx)90 Packing<const Node *>::unpack(BufferIter in, Context * ctx)
91 { return Packing<Node *>::unpack(in, ctx); }
92 
93 
94 
95 } // namespace Parallel
96 } // namespace libMesh
97 
98 #endif // LIBMESH_PARALLEL_NODE_H
99