Line data Source code
1 : // The libMesh Finite Element Library.
2 : // Copyright (C) 2002-2025 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>
69 51570 : static void pack(Node * const & object,
70 : OutputIter data_out,
71 : const Context * context)
72 14079514 : { return Packing<const Node *>::pack(object, data_out, context); }
73 :
74 : template <typename Context>
75 103140 : static unsigned int packable_size(Node * const & object,
76 : const Context * context)
77 14131084 : { return Packing<const Node*>::packable_size(object, context); }
78 :
79 : template <typename BufferIter>
80 107380 : static unsigned int packed_size(BufferIter iter)
81 100538098 : { 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 *
90 20148 : Packing<const Node *>::unpack(BufferIter in, Context * ctx)
91 51298436 : { return Packing<Node *>::unpack(in, ctx); }
92 :
93 :
94 : template <>
95 : class Packing<Node * const>
96 : {
97 : public:
98 : typedef largest_id_type buffer_type;
99 :
100 : template <typename OutputIter, typename Context>
101 : static void pack(Node * const & object,
102 : OutputIter data_out,
103 : const Context * context)
104 : { return Packing<const Node *>::pack(object, data_out, context); }
105 :
106 : template <typename Context>
107 : static unsigned int packable_size(Node * const & object,
108 : const Context * context)
109 : { return Packing<const Node*>::packable_size(object, context); }
110 :
111 : template <typename BufferIter>
112 : static unsigned int packed_size(BufferIter iter)
113 : { return Packing<const Node *>::packed_size(iter); }
114 :
115 : template <typename BufferIter, typename Context>
116 : static Node * unpack(BufferIter in, Context * ctx)
117 : { return Packing<Node *>::unpack(in, ctx); }
118 : };
119 :
120 :
121 : template <>
122 : class Packing<const Node * const>
123 : {
124 : public:
125 : typedef largest_id_type buffer_type;
126 :
127 : template <typename OutputIter, typename Context>
128 : static void pack(Node * const & object,
129 : OutputIter data_out,
130 : const Context * context)
131 : { return Packing<const Node *>::pack(object, data_out, context); }
132 :
133 : template <typename Context>
134 : static unsigned int packable_size(Node * const & object,
135 : const Context * context)
136 : { return Packing<const Node*>::packable_size(object, context); }
137 :
138 : template <typename BufferIter>
139 : static unsigned int packed_size(BufferIter iter)
140 : { return Packing<const Node *>::packed_size(iter); }
141 :
142 : template <typename BufferIter, typename Context>
143 : static Node * unpack(BufferIter in, Context * ctx)
144 : { return Packing<Node *>::unpack(in, ctx); }
145 : };
146 :
147 :
148 : } // namespace Parallel
149 : } // namespace libMesh
150 :
151 : #endif // LIBMESH_PARALLEL_NODE_H
|