1#ifndef DUNE_FEM_STREAMS_INLINE_HH
2#define DUNE_FEM_STREAMS_INLINE_HH
7#include <dune/common/fvector.hh>
17 template<
class Traits >
22 out.writeDouble( value );
26 template<
class Traits >
31 out.writeFloat( value );
35 template<
class Traits >
40 out.writeInt( value );
44 template<
class Traits >
49 out.writeChar( value );
53 template<
class Traits >
58 out.writeBool( value );
62 template<
class Traits >
65 const std :: string &s )
71 template<
class Traits >
74 const unsigned int value )
76 out.writeUnsignedInt( value );
80 template<
class Traits,
class T >
83 const std::complex<T> value )
90 template <
class u
longint,
class u
int64>
96 template <
class Traits >
102 assert(
sizeof(ulongint) <=
sizeof(uint64) );
103 uint64 value64 = value ;
104 out.writeUnsignedInt64( value64 );
107 template <
class Traits >
111 assert(
sizeof(ulongint) <=
sizeof(uint64) );
114 in.readUnsignedInt64( value64 );
120 template <
class u
longint>
124 template <
class Traits >
128 DUNE_THROW(NotImplemented,
"method not implemented");
131 template <
class Traits >
135 DUNE_THROW(NotImplemented,
"method not implemented");
139 template<
class Traits >
140 inline OutStreamInterface< Traits > &
142 const uint64_t value )
144 out.writeUnsignedInt64( value );
148 template<
class Traits >
149 inline OutStreamInterface< Traits > &
157 template<
class Traits,
class T, std::
size_t N >
158 inline OutStreamInterface< Traits > &
159 operator<< ( OutStreamInterface< Traits > &
out,
const std::array< T, N > &value )
161 for( std::size_t i = 0; i < N; ++i )
166 template<
class Traits,
class T,
int N >
167 inline OutStreamInterface< Traits > &
168 operator<< ( OutStreamInterface< Traits > &
out,
const Dune::FieldVector< T, N > &value )
170 for(
int i = 0; i < N; ++i )
175 template<
class Traits,
class T,
class A >
176 inline OutStreamInterface< Traits > &
178 const std::vector< T, A > & value )
180 const size_t size = value.size();
182 for(
size_t i = 0; i < size; ++i )
187 template<
class Traits >
188 inline InStreamInterface< Traits > &
192 in.readDouble( value );
196 template<
class Traits >
197 inline InStreamInterface< Traits > &
201 in.readFloat( value );
205 template<
class Traits >
206 inline InStreamInterface< Traits > &
214 template<
class Traits >
215 inline InStreamInterface< Traits > &
219 in.readChar( value );
223 template<
class Traits >
224 inline InStreamInterface< Traits > &
228 in.readBool( value );
232 template<
class Traits >
233 inline InStreamInterface< Traits > &
241 template<
class Traits >
242 inline InStreamInterface< Traits > &
244 unsigned int &value )
246 in.readUnsignedInt( value );
250 template<
class Traits >
251 inline InStreamInterface< Traits > &
255 in.readUnsignedInt64( value );
259 template<
class Traits >
260 inline InStreamInterface< Traits > &
268 template<
class Traits,
class T, std::
size_t N >
269 inline InStreamInterface< Traits > &
272 for( std::size_t i = 0; i < N; ++i )
277 template<
class Traits,
class T,
int N >
278 inline InStreamInterface< Traits > &
281 for(
int i = 0; i < N; ++i )
286 template<
class Traits,
class T >
287 inline InStreamInterface< Traits > &
289 std::complex<T> &value )
294 value = std::complex<T>(r,i);
298 template<
class Traits,
class T,
class A >
299 inline InStreamInterface< Traits > &
301 std::vector< T, A > & value )
305 value.resize( size );
306 for(
size_t i = 0; i < size; ++i )
double imag(const complex< Dune::Fem::Double > &x)
Definition: double.hh:995
double real(const complex< Dune::Fem::Double > &x)
Definition: double.hh:983
Definition: bindguard.hh:11
OutStreamInterface< StreamTraits > & operator<<(OutStreamInterface< StreamTraits > &out, const DiscreteFunctionInterface< Impl > &df)
write a discrete function into an output stream
Definition: discretefunction_inline.hh:396
InStreamInterface< StreamTraits > & operator>>(InStreamInterface< StreamTraits > &in, DiscreteFunctionInterface< Impl > &df)
read a discrete function from an input stream
Definition: discretefunction_inline.hh:416
abstract interface for an output stream
Definition: streams.hh:46
abstract interface for an input stream
Definition: streams.hh:179
Definition: streams_inline.hh:92
static void write(OutStreamInterface< Traits > &out, const UnsignedLongIntType &value)
Definition: streams_inline.hh:97
ulongint UnsignedLongIntType
Definition: streams_inline.hh:94
static void read(InStreamInterface< Traits > &in, UnsignedLongIntType &value)
Definition: streams_inline.hh:108
static void write(OutStreamInterface< Traits > &out, const UnsignedLongIntType value)
Definition: streams_inline.hh:125
static void read(InStreamInterface< Traits > &in, UnsignedLongIntType &value)
Definition: streams_inline.hh:132