Dune Core Modules (2.4.2)

bndprojection.hh
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_ALU_BNDPROJECTION_HH
4#define DUNE_ALU_BNDPROJECTION_HH
5
6namespace Dune {
7
10 template <class GridImp, class ctype = double >
12#ifdef ALUGRID_VERTEX_PROJECTION
13 : public GridImp :: ALUGridVertexProjectionType
14#endif
15 {
16 typedef GridImp GridType;
17 // type of double coordinate vector
18 typedef ctype coord_t[ GridType :: dimensionworld ];
19 protected:
20
22 const GridType& grid_;
23 public:
25 typedef typename GridType :: DuneBoundaryProjectionType DuneBoundaryProjectionType;
26
28 typedef typename DuneBoundaryProjectionType :: CoordinateType CoordinateType;
29
31 ALUGridBoundaryProjection(const GridType& grid)
32 : grid_( grid )
33 {}
34
36 int operator () (const coord_t &orig,
37 coord_t &prj) const
38 {
39 return this->operator()( orig, 0, prj);
40 }
41
43 int operator () (const coord_t &orig,
44 const int segmentIndex,
45 coord_t &prj) const
46 {
47#ifdef ALUGRID_VERTEX_PROJECTION
48 // get boundary projection
49 const DuneBoundaryProjectionType* bndPrj =
50 grid_.boundaryProjection( segmentIndex );
51
52 // if pointer is zero we do nothing, i.e. identity mapping
53 if( bndPrj )
54 {
55 // call projection operator
56 reinterpret_cast<CoordinateType &> (* (&prj[0])) =
57 (*bndPrj)( reinterpret_cast<const CoordinateType &> (* (&orig[0])) );
58 }
59#endif
60
61 // return 1 for success
62 return 1;
63 }
64 };
65
66} // end namespace Dune
67#endif
ALUGrid boundary projection implementation DuneBndProjection has to fulfil the DuneBoundaryProjection...
Definition: bndprojection.hh:15
int operator()(const coord_t &orig, coord_t &prj) const
(old) method projection vertices defaults to segment 0
Definition: bndprojection.hh:36
ALUGridBoundaryProjection(const GridType &grid)
constructor storing reference to boundary projection implementation
Definition: bndprojection.hh:31
GridType::DuneBoundaryProjectionType DuneBoundaryProjectionType
type of boundary projection
Definition: bndprojection.hh:25
const GridType & grid_
reference to boundary projection implementation
Definition: bndprojection.hh:22
DuneBoundaryProjectionType::CoordinateType CoordinateType
type of coordinate vector
Definition: bndprojection.hh:28
Dune namespace.
Definition: alignment.hh:10
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 21, 23:30, 2024)