This file is indexed.

/usr/include/dune/localfunctions/dualmortarbasis/dualpq1factory.hh is in libdune-localfunctions-dev 2.4.1-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_LOCALFUNCTIONS_DUAL_P1_Q1_FACTORY_HH
#define DUNE_LOCALFUNCTIONS_DUAL_P1_Q1_FACTORY_HH

#include <map>

#include <dune/localfunctions/common/virtualinterface.hh>
#include <dune/localfunctions/common/virtualwrappers.hh>

#include <dune/localfunctions/dualmortarbasis.hh>

namespace Dune {

template<class D, class R, int dim, bool faceDual=false>
class DualPQ1LocalFiniteElementCache
{
protected:
  typedef Dune::DualP1LocalFiniteElement<D,R,dim,faceDual> DualP1;
  typedef Dune::DualQ1LocalFiniteElement<D,R,dim,faceDual> DualQ1;
  typedef typename Dune::FixedOrderLocalBasisTraits<typename DualP1::Traits::LocalBasisType::Traits,0>::Traits T;
  typedef Dune::LocalFiniteElementVirtualInterface<T> FE;
  typedef std::map<Dune::GeometryType,FE*> FEMap;

public:
  /** \brief Type of the finite elements stored in this cache */
  typedef FE FiniteElementType;

  ~DualPQ1LocalFiniteElementCache()
  {
    typename FEMap::iterator it = cache_.begin();
    typename FEMap::iterator end = cache_.end();
    for(; it!=end; ++it)
      delete it->second;
  }

  //! create finite element for given GeometryType
  static FE* create(const Dune::GeometryType& gt)
  {
    if (gt.isSimplex())
      return new Dune::LocalFiniteElementVirtualImp<DualP1>(DualP1());
    if (gt.isCube())
      return new Dune::LocalFiniteElementVirtualImp<DualQ1>(DualQ1());
    return 0;
  }

  //! Get local finite element for given GeometryType
  const FiniteElementType& get(const Dune::GeometryType& gt) const
  {
    typename FEMap::const_iterator it = cache_.find(gt);
    if (it==cache_.end())
    {
      FiniteElementType* fe = create(gt);

      if (fe==0)
        DUNE_THROW(Dune::NotImplemented,"No Dual P/Q1 like local finite element available for geometry type " << gt);

      cache_[gt] = fe;
      return *fe;
    }
    return *(it->second);
  }

protected:
  mutable FEMap cache_;
};

}  // namespace Dune

#endif   // DUNE_LOCALFUNCTIONS_DUAL_P1_Q1_FACTORY_HH