DUNE-FEM (unstable)

gridobjectstreams.hh
1#ifndef DUNE_FEM_GRIDOBJECTSTREAMS_HH
2#define DUNE_FEM_GRIDOBJECTSTREAMS_HH
3
5
6#include <dune/fem/misc/griddeclaration.hh>
7
8namespace Dune
9{
10
11 namespace Fem
12 {
13
14 // DummyObjectStream
15 // -----------------
16
17 struct DummyObjectStream
18 {
19 class EOFException {};
20
21 template< class T >
22 void read ( T & ) const { DUNE_THROW( NotImplemented, "DummyObjectStream::read not implemented." ); }
23
24 template< class T >
25 void readObject ( T & ) { DUNE_THROW( NotImplemented, "DummyObjectStream::readObject not implemented." ); }
26
27 void readObject ( int ) { DUNE_THROW( NotImplemented, "DummyObjectStream::readObject not implemented." ); }
28 void readObject ( double ) { DUNE_THROW( NotImplemented, "DummyObjectStream::readObject not implemented." ); }
29
30 template< class T >
31 void write ( const T & ) { DUNE_THROW( NotImplemented, "DummyObjectStream::write not implemented." ); }
32
33 template< class T >
34 void writeObject ( T & ) { DUNE_THROW( NotImplemented, "DummyObjectStream::writeObject not implemented." ); }
35
36 void writeObject ( int ) { DUNE_THROW( NotImplemented, "DummyObjectStream::writeObject not implemented." ); }
37 void writeObject ( double ) { DUNE_THROW( NotImplemented, "DummyObjectStream::writeObject not implemented." ); }
38 };
39
40
41
42 // GridObjectStreamTraits
43 // ----------------------
44
45 template< class Grid >
46 struct GridObjectStreamTraits
47 {
48 typedef DummyObjectStream InStreamType;
49 typedef DummyObjectStream OutStreamType;
50 };
51
52 template< class Grid >
53 struct GridObjectStreamTraits< const Grid >
54 {
55 typedef typename GridObjectStreamTraits< Grid >::InStreamType InStreamType;
56 typedef typename GridObjectStreamTraits< Grid >::OutStreamType OutStreamType;
57 };
58
59
60
61 // GridObjectStreamTraits for ALUGrid
62 // ----------------------------------
63
64#if HAVE_DUNE_ALUGRID
65 template< int dim, int dimworld, ALUGridElementType elType, ALUGridRefinementType refineType, class Comm >
66 struct GridObjectStreamTraits< ALUGrid< dim, dimworld, elType, refineType, Comm > >
67 {
68 typedef typename ALUGrid< dim, dimworld, elType, refineType, Comm >::ObjectStreamType InStreamType;
69 typedef typename ALUGrid< dim, dimworld, elType, refineType, Comm >::ObjectStreamType OutStreamType;
70 };
71#endif // #if HAVE_DUNE_ALUGRID
72
73
74 // GridObjectStreamTraits for P4estGrid
75 // ----------------------------------
76
77#if HAVE_DUNE_P4ESTGRID
78 template< int dim, int dimworld, class ctype >
79 struct GridObjectStreamTraits< P4estGrid< dim, dimworld, ctype > >
80 {
81 typedef typename P4estGrid< dim, dimworld, ctype > :: ObjectStreamType InStreamType;
82 typedef typename P4estGrid< dim, dimworld, ctype > :: ObjectStreamType OutStreamType;
83 };
84#endif // #if HAVE_DUNE_ALUGRID
85
86
87
88 // GridObjectStreamTraits for CacheItGrid
89 // --------------------------------------
90
91#if HAVE_DUNE_METAGRID
92 template< class HostGrid >
93 struct GridObjectStreamTraits< CacheItGrid< HostGrid > >
94 {
95 typedef typename GridObjectStreamTraits< HostGrid >::InStreamType InStreamType;
96 typedef typename GridObjectStreamTraits< HostGrid >::OutStreamType OutStreamType;
97 };
98#endif // #if HAVE_DUNE_METAGRID
99
100
101
102 // GridObjectStreamTraits for CartesianGrid
103 // ----------------------------------------
104
105#if HAVE_DUNE_METAGRID
106 template< class HostGrid >
107 struct GridObjectStreamTraits< CartesianGrid< HostGrid > >
108 {
109 typedef typename GridObjectStreamTraits< HostGrid >::InStreamType InStreamType;
110 typedef typename GridObjectStreamTraits< HostGrid >::OutStreamType OutStreamType;
111 };
112#endif // #if HAVE_DUNE_METAGRID
113
114
115
116 // GridObjectStreamTraits for FilteredGrid
117 // ---------------------------------------
118
119#if HAVE_DUNE_METAGRID
120 template< class HostGrid >
121 struct GridObjectStreamTraits< FilteredGrid< HostGrid > >
122 {
123 typedef typename GridObjectStreamTraits< HostGrid >::InStreamType InStreamType;
124 typedef typename GridObjectStreamTraits< HostGrid >::OutStreamType OutStreamType;
125 };
126#endif // #if HAVE_DUNE_METAGRID
127
128
129
130 // GridObjectStreamTraits for GeometryGrid
131 // ---------------------------------------
132
133 template< class HostGrid, class CoordFunction, class Allocator >
134 struct GridObjectStreamTraits< GeometryGrid< HostGrid, CoordFunction, Allocator > >
135 {
136 typedef typename GridObjectStreamTraits< HostGrid >::InStreamType InStreamType;
137 typedef typename GridObjectStreamTraits< HostGrid >::OutStreamType OutStreamType;
138 };
139
140
141
142 // GridObjectStreamTraits for IdGrid
143 // ---------------------------------
144
145#if HAVE_DUNE_METAGRID
146 template< class HostGrid >
147 struct GridObjectStreamTraits< IdGrid< HostGrid > >
148 {
149 typedef typename GridObjectStreamTraits< HostGrid >::InStreamType InStreamType;
150 typedef typename GridObjectStreamTraits< HostGrid >::OutStreamType OutStreamType;
151 };
152#endif // #if HAVE_DUNE_METAGRID
153
154
155
156 // GridObjectStreamTraits for ParallelGrid
157 // ---------------------------------------
158
159#if HAVE_DUNE_METAGRID
160 template< class HostGrid >
161 struct GridObjectStreamTraits< ParallelGrid< HostGrid > >
162 {
163 typedef typename ParallelGrid< HostGrid >::RankManager::ObjectStream InStreamType;
164 typedef typename ParallelGrid< HostGrid >::RankManager::ObjectStream OutStreamType;
165 };
166#endif // #if HAVE_DUNE_METAGRID
167
168
169
170 // GridObjectStreamTraits for SphereGrid
171 // -------------------------------------
172
173#if HAVE_DUNE_METAGRID
174 template< class HostGrid, class MapToSphere >
175 struct GridObjectStreamTraits< SphereGrid< HostGrid, MapToSphere > >
176 {
177 typedef typename GridObjectStreamTraits< HostGrid >::InStreamType InStreamType;
178 typedef typename GridObjectStreamTraits< HostGrid >::OutStreamType OutStreamType;
179 };
180#endif // #if HAVE_DUNE_METAGRID
181
182 } // namespace Fem
183
184} // namespace Dune
185
186#endif // #ifndef DUNE_FEM_GRIDOBJECTSTREAMS_HH
A few common exception classes.
#define DUNE_THROW(E, m)
Definition: exceptions.hh:218
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 13, 23:29, 2024)