dune-fem 2.8.0
Loading...
Searching...
No Matches
gridobjectstreams.hh
Go to the documentation of this file.
1#ifndef DUNE_FEM_GRIDOBJECTSTREAMS_HH
2#define DUNE_FEM_GRIDOBJECTSTREAMS_HH
3
4#include <dune/common/exceptions.hh>
5
7
8namespace Dune
9{
10
11 namespace Fem
12 {
13
14 // DummyObjectStream
15 // -----------------
16
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 >
47 {
50 };
51
52 template< class Grid >
53 struct GridObjectStreamTraits< const Grid >
54 {
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
75 // GridObjectStreamTraits for CacheItGrid
76 // --------------------------------------
77
78#if HAVE_DUNE_METAGRID
79 template< class HostGrid >
80 struct GridObjectStreamTraits< CacheItGrid< HostGrid > >
81 {
84 };
85#endif // #if HAVE_DUNE_METAGRID
86
87
88
89 // GridObjectStreamTraits for CartesianGrid
90 // ----------------------------------------
91
92#if HAVE_DUNE_METAGRID
93 template< class HostGrid >
94 struct GridObjectStreamTraits< CartesianGrid< HostGrid > >
95 {
98 };
99#endif // #if HAVE_DUNE_METAGRID
100
101
102
103 // GridObjectStreamTraits for FilteredGrid
104 // ---------------------------------------
105
106#if HAVE_DUNE_METAGRID
107 template< class HostGrid >
108 struct GridObjectStreamTraits< FilteredGrid< HostGrid > >
109 {
112 };
113#endif // #if HAVE_DUNE_METAGRID
114
115
116
117 // GridObjectStreamTraits for GeometryGrid
118 // ---------------------------------------
119
120 template< class HostGrid, class CoordFunction, class Allocator >
121 struct GridObjectStreamTraits< GeometryGrid< HostGrid, CoordFunction, Allocator > >
122 {
125 };
126
127
128
129 // GridObjectStreamTraits for IdGrid
130 // ---------------------------------
131
132#if HAVE_DUNE_METAGRID
133 template< class HostGrid >
134 struct GridObjectStreamTraits< IdGrid< HostGrid > >
135 {
138 };
139#endif // #if HAVE_DUNE_METAGRID
140
141
142
143 // GridObjectStreamTraits for ParallelGrid
144 // ---------------------------------------
145
146#if HAVE_DUNE_METAGRID
147 template< class HostGrid >
148 struct GridObjectStreamTraits< ParallelGrid< HostGrid > >
149 {
150 typedef typename ParallelGrid< HostGrid >::RankManager::ObjectStream InStreamType;
151 typedef typename ParallelGrid< HostGrid >::RankManager::ObjectStream OutStreamType;
152 };
153#endif // #if HAVE_DUNE_METAGRID
154
155
156
157 // GridObjectStreamTraits for SphereGrid
158 // -------------------------------------
159
160#if HAVE_DUNE_METAGRID
161 template< class HostGrid, class MapToSphere >
162 struct GridObjectStreamTraits< SphereGrid< HostGrid, MapToSphere > >
163 {
166 };
167#endif // #if HAVE_DUNE_METAGRID
168
169 } // namespace Fem
170
171} // namespace Dune
172
173#endif // #ifndef DUNE_FEM_GRIDOBJECTSTREAMS_HH
Definition: bindguard.hh:11
Definition: gridobjectstreams.hh:18
void writeObject(int)
Definition: gridobjectstreams.hh:36
void readObject(int)
Definition: gridobjectstreams.hh:27
void writeObject(double)
Definition: gridobjectstreams.hh:37
void readObject(T &)
Definition: gridobjectstreams.hh:25
void readObject(double)
Definition: gridobjectstreams.hh:28
void write(const T &)
Definition: gridobjectstreams.hh:31
void writeObject(T &)
Definition: gridobjectstreams.hh:34
void read(T &) const
Definition: gridobjectstreams.hh:22
Definition: gridobjectstreams.hh:19
Definition: gridobjectstreams.hh:47
DummyObjectStream InStreamType
Definition: gridobjectstreams.hh:48
DummyObjectStream OutStreamType
Definition: gridobjectstreams.hh:49
GridObjectStreamTraits< Grid >::InStreamType InStreamType
Definition: gridobjectstreams.hh:55
GridObjectStreamTraits< Grid >::OutStreamType OutStreamType
Definition: gridobjectstreams.hh:56
GridObjectStreamTraits< HostGrid >::InStreamType InStreamType
Definition: gridobjectstreams.hh:123
GridObjectStreamTraits< HostGrid >::OutStreamType OutStreamType
Definition: gridobjectstreams.hh:124