5#ifndef DUNE_LOCALFUNCTIONS_UTILITY_FIELD_HH
6#define DUNE_LOCALFUNCTIONS_UTILITY_FIELD_HH
8#include <dune/common/deprecated.hh>
9#include <dune/common/gmpfield.hh>
10#include <dune/common/fvector.hh>
11#include <dune/common/fmatrix.hh>
29 template<
class Field >
32 operator Field ()
const
38 template<
class Field >
44 template<
class Field >
50 template<
class Field >
56 template<
class Field >
78 template<
class Field >
81 operator Field ()
const
92 template<
unsigned int precision >
93 struct Zero< GMPField< precision > >
95 typedef GMPField< precision > Field;
96 operator Field ()
const
107 template<
class Field >
113 template<
class Field >
119 template<
class Field >
125 template<
class Field >
131 template<
class Field >
137 template<
class Field >
159 template<
class F2,
class F1 >
166 template<
unsigned int precision >
167 inline void field_cast (
const Dune::GMPField< precision > &f1,
double &f2 )
172 template<
unsigned int precision >
173 inline void field_cast (
const Dune::GMPField< precision > &f1,
long double &f2 )
179 template<
class F2,
class F1,
int dim >
180 inline void field_cast (
const Dune::FieldVector< F1, dim > &f1, Dune::FieldVector< F2, dim > &f2 )
182 for(
int d = 0; d < dim; ++d )
185 template<
class F2,
class F1 >
186 inline void field_cast (
const Dune::FieldVector< F1, 1 > &f1, F2 &f2 )
190 template<
class F2,
class F1 >
191 inline void field_cast (
const F1 &f1, Dune::FieldVector< F2, 1 > &f2 )
196 template<
class F2,
class F1,
int rdim,
int cdim >
197 inline void field_cast (
const Dune::FieldMatrix< F1, rdim, cdim > &f1, Dune::FieldMatrix< F2, rdim, cdim > &f2 )
199 for(
int r = 0; r < rdim; ++r )
202 template<
class F2,
class F1 >
203 inline void field_cast (
const Dune::FieldMatrix<F1,1,1> &f1, Dune::FieldMatrix< F2, 1,1 > &f2 )
207 template<
class F2,
class F1 >
208 inline void field_cast (
const Dune::FieldMatrix< F1, 1,1 > &f1, F2 &f2 )
212 template<
class F2,
class F1 >
213 inline void field_cast (
const F1 &f1, Dune::FieldMatrix< F2, 1,1 > &f2 )
217 template<
class F2,
class F1 >
218 inline void field_cast (
const Dune::FieldVector<F1,1> &f1, Dune::FieldMatrix< F2, 1,1 > &f2 )
222 template<
class F2,
class F1 >
223 inline void field_cast (
const Dune::FieldMatrix<F1,1,1> &f1, Dune::FieldVector< F2, 1 > &f2 )
228 template<
class F2,
class F1 >
229 inline void field_cast (
const Dune::FieldVector< F1, 1 > &f1, Dune::FieldVector<F2, 1> &f2 )
234 template<
class F2,
class V >
239 template<
class F2,
class F1,
int dim >
242 typedef Dune::FieldVector<F2,dim>
type;
244 template<
class F2,
class F1,
int dim1,
int dim2>
247 typedef Dune::FieldMatrix<F2,dim1,dim2>
type;
249 template<
class F2,
class V >
264 template <
class Field>
265 struct [[deprecated(
"This class is deprecated and will be removed after 2.11. Use std::numeric_limits<>::digits instead")]]
Precision;
267DUNE_NO_DEPRECATED_BEGIN
272 static const unsigned int value = 64;
278 static const unsigned int value = 80;
284 static const unsigned int value = 32;
288 template<
unsigned int precision >
289 struct Precision< GMPField< precision > >
291 static const unsigned int value = precision;
295DUNE_NO_DEPRECATED_END
300 template <
class Field,
unsigned int sum>
307 template<
unsigned int precision,
unsigned int sum >
310 typedef GMPField<precision+sum>
Type;
Definition bdfmcube.hh:18
Field operator-(const Unity< Field > &u, const Field &f)
Definition field.hh:45
void field_cast(const F1 &f1, F2 &f2)
a helper class to cast from one field to another
Definition field.hh:160
bool operator<(const Zero< Field > &, const Field &f)
Definition field.hh:120
bool operator==(const Zero< Field > &, const Field &f)
Definition field.hh:108
bool operator>(const Zero< Field > &z, const Field &f)
Definition field.hh:132
Field operator+(const Unity< Field > &u, const Field &f)
Definition field.hh:39
Field operator/(const Unity< Field > &u, const Field &f)
Definition field.hh:57
Field operator*(const Unity< Field > &u, const Field &f)
Definition field.hh:51
A class representing the unit of a given Field.
Definition field.hh:31
A class representing the zero of a given Field.
Definition field.hh:80
static const Field epsilon()
Definition field.hh:85
F2 type
Definition field.hh:237
Dune::FieldVector< F2, dim > type
Definition field.hh:242
Dune::FieldMatrix< F2, dim1, dim2 > type
Definition field.hh:247
static const unsigned int value
Definition field.hh:272
static const unsigned int value
Definition field.hh:278
static const unsigned int value
Definition field.hh:284
Field Type
Definition field.hh:303