dune-grid  2.8.0
yaspgridgeometry.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 #ifndef DUNE_GRID_YASPGRIDGEOMETRY_HH
4 #define DUNE_GRID_YASPGRIDGEOMETRY_HH
5 
21 namespace Dune {
22 
27  template<int mydim,int cdim, class GridImp>
28  class YaspGeometry : public AxisAlignedCubeGeometry<typename GridImp::ctype,mydim,cdim>
29  {
30  public:
32  typedef typename GridImp::ctype ctype;
33 
35  YaspGeometry (const FieldVector<ctype, cdim>& ll, const FieldVector<ctype, cdim>& ur, const std::bitset<cdim>& shift)
36  : AxisAlignedCubeGeometry<ctype,mydim,cdim>(ll,ur,shift)
37  {
38  assert(mydim == shift.count());
39  }
40  };
41 
43  template<int mydim, class GridImp>
44  class YaspGeometry<mydim,mydim,GridImp> : public AxisAlignedCubeGeometry<typename GridImp::ctype,mydim,mydim>
45  {
46  public:
47  typedef typename GridImp::ctype ctype;
48 
50  YaspGeometry (const FieldVector<ctype, mydim>& ll, const FieldVector<ctype, mydim>& ur)
51  : AxisAlignedCubeGeometry<ctype,mydim,mydim>(ll,ur)
52  {}
53 
55  YaspGeometry (const YaspGeometry& other)
56  : AxisAlignedCubeGeometry<ctype,mydim,mydim>(other)
57  {}
58  };
59 
61  template<int cdim, class GridImp>
62  class YaspGeometry<0,cdim,GridImp> : public AxisAlignedCubeGeometry<typename GridImp::ctype,0,cdim>
63  {
64  public:
65  typedef typename GridImp::ctype ctype;
66 
68  explicit YaspGeometry ( const FieldVector< ctype, cdim > &p )
69  : AxisAlignedCubeGeometry<typename GridImp::ctype,0,cdim>( p )
70  {}
71 
72  YaspGeometry ( const FieldVector< ctype, cdim > &p, const FieldVector< ctype, cdim > &, const std::bitset<cdim> &)
73  : AxisAlignedCubeGeometry<typename GridImp::ctype,0,cdim>( p )
74  {}
75  };
76 } // namespace Dune
77 
78 #endif // DUNE_GRID_YASPGRIDGEOMETRY_HH
Include standard header files.
Definition: agrid.hh:58
The general version that handles all codimensions but 0 and dim.
Definition: yaspgridgeometry.hh:29
YaspGeometry(const FieldVector< ctype, cdim > &ll, const FieldVector< ctype, cdim > &ur, const std::bitset< cdim > &shift)
constructor from midpoint and extension and a bitset defining which unit vectors span the entity
Definition: yaspgridgeometry.hh:35
GridImp::ctype ctype
define type used for coordinates in grid module
Definition: yaspgridgeometry.hh:32
YaspGeometry(const YaspGeometry &other)
copy constructor (skipping temporary variables)
Definition: yaspgridgeometry.hh:55
GridImp::ctype ctype
Definition: yaspgridgeometry.hh:47
YaspGeometry(const FieldVector< ctype, mydim > &ll, const FieldVector< ctype, mydim > &ur)
constructor from midpoint and extension
Definition: yaspgridgeometry.hh:50
YaspGeometry(const FieldVector< ctype, cdim > &p, const FieldVector< ctype, cdim > &, const std::bitset< cdim > &)
Definition: yaspgridgeometry.hh:72
YaspGeometry(const FieldVector< ctype, cdim > &p)
constructor
Definition: yaspgridgeometry.hh:68
GridImp::ctype ctype
Definition: yaspgridgeometry.hh:65