dune-pdelab  2.7-git
p0ghost.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil -*-
2 #ifndef DUNE_PDELAB_CONSTRAINTS_P0GHOST_HH
3 #define DUNE_PDELAB_CONSTRAINTS_P0GHOST_HH
4 
5 #include "../common/geometrywrapper.hh"
6 #include<dune/grid/common/gridenums.hh>
7 
8 #include <dune/typetree/typetree.hh>
9 
10 namespace Dune {
11  namespace PDELab {
12 
16 
19  : public TypeTree::LeafNode
20  {
21  public:
22  enum{doBoundary=false};
23  enum{doProcessor=false};
24  enum{doSkeleton=false};
25  enum{doVolume=true};
26 
28 
34  template<typename P, typename EG, typename LFS, typename T>
35  void volume (const P& param, const EG& eg, const LFS& lfs, T& trafo) const
36  {
37  // nothing to do for interior entities
38  if (eg.entity().partitionType()==Dune::InteriorEntity)
39  return;
40 
41  // constrain ghost entities
42  else if (eg.entity().partitionType()==Dune::GhostEntity){
43  typename T::RowType empty;
44  typedef typename LFS::Traits::SizeType size_type;
45  for (size_type i=0; i<lfs.size(); i++){
46  trafo[lfs.dofIndex(i)] = empty;
47  }
48  }
49 
50  }
51  };
53 
54  }
55 }
56 
57 #endif // DUNE_PDELAB_CONSTRAINTS_P0GHOST_HH
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
Parallel P0 constraints for nonoverlapping grids with ghosts.
Definition: p0ghost.hh:20
void volume(const P &param, const EG &eg, const LFS &lfs, T &trafo) const
volume constraints
Definition: p0ghost.hh:35
@ doBoundary
Definition: p0ghost.hh:22
@ doProcessor
Definition: p0ghost.hh:23
@ doVolume
Definition: p0ghost.hh:25
@ doSkeleton
Definition: p0ghost.hh:24