dune-alugrid  2.6-git
bndprojection.hh
Go to the documentation of this file.
1 #ifndef DUNE_ALU_BNDPROJECTION_HH
2 #define DUNE_ALU_BNDPROJECTION_HH
3 
4 namespace Dune {
5 
8  template <class GridImp, class ctype = double >
10  : public GridImp :: ALUGridVertexProjectionType
11  {
12  typedef GridImp GridType;
13  // type of double coordinate vector
14  typedef ctype coord_t[ 3 ];
15  protected:
16 
18  const GridType& grid_;
19  public:
21  typedef typename GridType :: DuneBoundaryProjectionType DuneBoundaryProjectionType;
22 
24  typedef typename DuneBoundaryProjectionType :: CoordinateType CoordinateType;
25 
27  ALUGridBoundaryProjection(const GridType& grid)
28  : grid_( grid )
29  {
30  }
31 
33  int operator () (const coord_t &orig,
34  coord_t &prj) const
35  {
36  return this->operator()( orig, 0, prj);
37  }
38 
40  int operator () (const coord_t &orig,
41  const int segmentId,
42  coord_t &prj) const
43  {
44  // get boundary projection
45  const DuneBoundaryProjectionType* bndPrj =
46  grid_.boundaryProjection( segmentId );
47 
48  // if pointer is zero we do nothing, i.e. identity mapping
49  if( bndPrj )
50  {
51  // call projection operator
52  reinterpret_cast<CoordinateType &> (* (&prj[0])) =
53  (*bndPrj)( reinterpret_cast<const CoordinateType &> (* (&orig[0])) );
54  }
55 
56  // return 1 for success
57  return 1;
58  }
59  };
60 
61 } // end namespace Dune
62 #endif
Definition: alu3dinclude.hh:80
ALUGrid boundary projection implementation DuneBndProjection has to fulfil the DuneBoundaryProjection...
Definition: bndprojection.hh:11
int operator()(const coord_t &orig, coord_t &prj) const
(old) method projection vertices defaults to segment 0
Definition: bndprojection.hh:33
ALUGridBoundaryProjection(const GridType &grid)
constructor storing reference to boundary projection implementation
Definition: bndprojection.hh:27
const GridType & grid_
reference to boundary projection implementation
Definition: bndprojection.hh:18
GridType ::DuneBoundaryProjectionType DuneBoundaryProjectionType
type of boundary projection
Definition: bndprojection.hh:21
DuneBoundaryProjectionType ::CoordinateType CoordinateType
type of coordinate vector
Definition: bndprojection.hh:24