dune-fem  2.4.1-rc
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 
8 namespace 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_ALUGRID || 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_ALUGRID || HAVE_DUNE_ALUGRID
72 
73 
74 
75  // GridObjectStreamTraits for ALUConformGrid
76  // -----------------------------------------
77 
78 #if HAVE_ALUGRID
79  template< int dim, int dimworld >
80  struct GridObjectStreamTraits< ALUConformGrid< dim, dimworld> >
81  {
82  typedef typename ALUConformGrid< dim, dimworld >::ObjectStreamType InStreamType;
83  typedef typename ALUConformGrid< dim, dimworld >::ObjectStreamType OutStreamType;
84  };
85 #endif // #if HAVE_ALUGRID
86 
87 
88 
89  // GridObjectStreamTraits for ALUCubeGrid
90  // --------------------------------------
91 
92 #if HAVE_ALUGRID
93  template< int dim, int dimworld >
94  struct GridObjectStreamTraits< ALUCubeGrid< dim, dimworld> >
95  {
96  typedef typename ALUCubeGrid< dim, dimworld >::ObjectStreamType InStreamType;
97  typedef typename ALUCubeGrid< dim, dimworld >::ObjectStreamType OutStreamType;
98  };
99 #endif // #if HAVE_ALUGRID
100 
101 
102 
103  // GridObjectStreamTraits for ALUSimplexGrid
104  // -----------------------------------------
105 
106 #if HAVE_ALUGRID
107  template< int dim, int dimworld >
108  struct GridObjectStreamTraits< ALUSimplexGrid< dim, dimworld> >
109  {
110  typedef typename ALUSimplexGrid< dim, dimworld >::ObjectStreamType InStreamType;
111  typedef typename ALUSimplexGrid< dim, dimworld >::ObjectStreamType OutStreamType;
112  };
113 #endif // #if HAVE_ALUGRID
114 
115 
116 
117  // GridObjectStreamTraits for CacheItGrid
118  // --------------------------------------
119 
120 #if HAVE_DUNE_METAGRID
121  template< class HostGrid >
122  struct GridObjectStreamTraits< CacheItGrid< HostGrid > >
123  {
126  };
127 #endif // #if HAVE_DUNE_METAGRID
128 
129 
130 
131  // GridObjectStreamTraits for CartesianGrid
132  // ----------------------------------------
133 
134 #if HAVE_DUNE_METAGRID
135  template< class HostGrid >
136  struct GridObjectStreamTraits< CartesianGrid< HostGrid > >
137  {
140  };
141 #endif // #if HAVE_DUNE_METAGRID
142 
143 
144 
145  // GridObjectStreamTraits for FilteredGrid
146  // ---------------------------------------
147 
148 #if HAVE_DUNE_METAGRID
149  template< class HostGrid >
150  struct GridObjectStreamTraits< FilteredGrid< HostGrid > >
151  {
154  };
155 #endif // #if HAVE_DUNE_METAGRID
156 
157 
158 
159  // GridObjectStreamTraits for GeometryGrid
160  // ---------------------------------------
161 
162  template< class HostGrid, class CoordFunction, class Allocator >
163  struct GridObjectStreamTraits< GeometryGrid< HostGrid, CoordFunction, Allocator > >
164  {
167  };
168 
169 
170 
171  // GridObjectStreamTraits for IdGrid
172  // ---------------------------------
173 
174 #if HAVE_DUNE_METAGRID
175  template< class HostGrid >
176  struct GridObjectStreamTraits< IdGrid< HostGrid > >
177  {
180  };
181 #endif // #if HAVE_DUNE_METAGRID
182 
183 
184 
185  // GridObjectStreamTraits for ParallelGrid
186  // ---------------------------------------
187 
188 #if HAVE_DUNE_METAGRID
189  template< class HostGrid >
190  struct GridObjectStreamTraits< ParallelGrid< HostGrid > >
191  {
192  typedef typename ParallelGrid< HostGrid >::RankManager::ObjectStream InStreamType;
193  typedef typename ParallelGrid< HostGrid >::RankManager::ObjectStream OutStreamType;
194  };
195 #endif // #if HAVE_DUNE_METAGRID
196 
197 
198 
199  // GridObjectStreamTraits for SphereGrid
200  // -------------------------------------
201 
202 #if HAVE_DUNE_METAGRID
203  template< class HostGrid, class MapToSphere >
204  struct GridObjectStreamTraits< SphereGrid< HostGrid, MapToSphere > >
205  {
208  };
209 #endif // #if HAVE_DUNE_METAGRID
210 
211  } // namespace Fem
212 
213 } // namespace Dune
214 
215 #endif // #ifndef DUNE_FEM_GRIDOBJECTSTREAMS_HH
void write(const T &)
Definition: gridobjectstreams.hh:31
GridObjectStreamTraits< HostGrid >::OutStreamType OutStreamType
Definition: gridobjectstreams.hh:166
GridObjectStreamTraits< Grid >::OutStreamType OutStreamType
Definition: gridobjectstreams.hh:56
void read(T &) const
Definition: gridobjectstreams.hh:22
Definition: gridobjectstreams.hh:46
Definition: gridobjectstreams.hh:19
void writeObject(double)
Definition: gridobjectstreams.hh:37
void readObject(int)
Definition: gridobjectstreams.hh:27
DummyObjectStream InStreamType
Definition: gridobjectstreams.hh:48
Definition: coordinate.hh:4
DummyObjectStream OutStreamType
Definition: gridobjectstreams.hh:49
void writeObject(int)
Definition: gridobjectstreams.hh:36
void readObject(double)
Definition: gridobjectstreams.hh:28
GridObjectStreamTraits< HostGrid >::InStreamType InStreamType
Definition: gridobjectstreams.hh:165
Definition: gridobjectstreams.hh:17
void writeObject(T &)
Definition: gridobjectstreams.hh:34
GridObjectStreamTraits< Grid >::InStreamType InStreamType
Definition: gridobjectstreams.hh:55
void readObject(T &)
Definition: gridobjectstreams.hh:25