This file is indexed.

/usr/include/dune/localfunctions/test/geometries.hh is in libdune-localfunctions-dev 2.5.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
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:

// This header is not part of the official Dune API and might be subject
// to change.  You can use this header to test external finite element
// implementations, but be warned that your tests might break with future
// Dune versions.

#ifndef DUNE_LOCALFUNCTIONS_TEST_GEOMETRIES_HH
#define DUNE_LOCALFUNCTIONS_TEST_GEOMETRIES_HH

#include <cstddef>
#include <vector>

#include <dune/common/exceptions.hh>
#include <dune/common/fvector.hh>

#include <dune/geometry/type.hh>
#include <dune/geometry/multilineargeometry.hh>

template<class ctype, std::size_t dim>
class TestGeometries;

template<class ctype>
class TestGeometries<ctype, 0> :
  public std::vector<Dune::MultiLinearGeometry<ctype, 0, 0> >
{
  static const std::size_t dim = 0;

public:
  typedef Dune::MultiLinearGeometry<ctype, dim, dim> Geometry;

  TestGeometries() {
    Dune::GeometryType gt;
    std::vector<Dune::FieldVector<ctype, dim> > coords;

    gt.makeVertex();
    coords.resize(1);
    this->push_back(Geometry(gt, coords));
  }

  const Geometry &get(const Dune::GeometryType &gt) const {
    for(std::size_t i = 0; i < this->size(); ++i)
      if((*this)[i].type() == gt) return (*this)[i];
    DUNE_THROW(Dune::NotImplemented, "No predefined test-geometry in "
               "dimension " << dim << " for GeometryType " << gt);
  }
};

template<class ctype>
class TestGeometries<ctype, 1> :
  public std::vector<Dune::MultiLinearGeometry<ctype, 1, 1> >
{
  static const std::size_t dim = 1;

public:
  typedef Dune::MultiLinearGeometry<ctype, dim, dim> Geometry;

  TestGeometries() {
    Dune::GeometryType gt;
    std::vector<Dune::FieldVector<ctype, dim> > coords;

    gt.makeLine();
    coords.resize(2);
    coords[0][0] = -.3;
    coords[1][0] =  .7;
    this->push_back(Geometry(gt, coords));
  }

  const Geometry &get(const Dune::GeometryType &gt) const {
    for(std::size_t i = 0; i < this->size(); ++i)
      if((*this)[i].type() == gt) return (*this)[i];
    DUNE_THROW(Dune::NotImplemented, "No predefined test-geometry in "
               "dimension " << dim << " for GeometryType " << gt);
  }
};

template<class ctype>
class TestGeometries<ctype, 2> :
  public std::vector<Dune::MultiLinearGeometry<ctype, 2, 2> >
{
  static const std::size_t dim = 2;

public:
  typedef Dune::MultiLinearGeometry<ctype, dim, dim> Geometry;

  TestGeometries() {
    Dune::GeometryType gt;
    std::vector<Dune::FieldVector<ctype, dim> > coords;

    gt.makeTriangle();
    coords.resize(3);
    coords[0][0] = -.5; coords[0][1] = -.5;
    coords[1][0] =  .5; coords[1][1] = -.5;
    coords[2][0] = 0  ; coords[2][1] =  .5;
    this->push_back(Geometry(gt, coords));

    gt.makeQuadrilateral();
    coords.resize(4);
    coords[0][0] = -.5; coords[0][1] = 0;
    coords[1][0] = 0  ; coords[1][1] = -.5;
    coords[2][0] =  .5; coords[2][1] = 0;
    coords[3][0] = 0  ; coords[3][1] =  .5;
    this->push_back(Geometry(gt, coords));
  }

  const Geometry &get(const Dune::GeometryType &gt) const {
    for(std::size_t i = 0; i < this->size(); ++i)
      if((*this)[i].type() == gt) return (*this)[i];
    DUNE_THROW(Dune::NotImplemented, "No predefined test-geometry in "
               "dimension " << dim << " for GeometryType " << gt);
  }
};

template<class ctype>
class TestGeometries<ctype, 3> :
  public std::vector<Dune::MultiLinearGeometry<ctype, 3, 3> >
{
  static const std::size_t dim = 3;

public:
  typedef Dune::MultiLinearGeometry<ctype, dim, dim> Geometry;

  TestGeometries() {
    Dune::GeometryType gt;
    std::vector<Dune::FieldVector<ctype, dim> > coords;

    gt.makeTetrahedron();
    coords.resize(4);
    coords[0][0] = -.5; coords[0][1] = -.5; coords[0][2] = -.5;
    coords[1][0] =  .5; coords[1][1] = -.5; coords[1][2] = -.5;
    coords[2][0] = 0  ; coords[2][1] =  .5; coords[2][2] = -.5;
    coords[3][0] = 0  ; coords[3][1] =  0 ; coords[3][2] =  .5;
    this->push_back(Geometry(gt, coords));

    gt.makePyramid();
    coords.resize(5);
    coords[0][0] = -.5; coords[0][1] = 0;   coords[0][2] = -.5;
    coords[1][0] = 0  ; coords[1][1] = -.5; coords[1][2] = -.5;
    coords[2][0] =  .5; coords[2][1] = 0;   coords[2][2] = -.5;
    coords[3][0] = 0  ; coords[3][1] =  .5; coords[3][2] = -.5;
    coords[4][0] =  .1; coords[4][1] =  .1; coords[4][2] =  .1;
    this->push_back(Geometry(gt, coords));

    gt.makePrism();
    coords.resize(6);
    coords[0][0] = -.6; coords[0][1] = -.5; coords[0][2] = -.4;
    coords[1][0] =  .5; coords[1][1] = -.6; coords[1][2] = -.5;
    coords[2][0] =  .1; coords[2][1] =  .5; coords[2][2] = -.6;
    coords[3][0] = -.5; coords[3][1] = -.4; coords[3][2] =  .5;
    coords[4][0] =  .4; coords[4][1] = -.5; coords[4][2] =  .6;
    coords[5][0] = 0  ; coords[5][1] =  .4; coords[5][2] =  .5;
    this->push_back(Geometry(gt, coords));

    gt.makeHexahedron();
    coords.resize(8);
    coords[0][0] = -.7; coords[0][1] = -.6; coords[0][2] = -.5;
    coords[1][0] =  .4; coords[1][1] = -.3; coords[1][2] = -.7;
    coords[2][0] = -.6; coords[2][1] =  .5; coords[2][2] = -.4;
    coords[3][0] =  .3; coords[3][1] =  .7; coords[3][2] = -.6;
    coords[4][0] = -.5; coords[4][1] = -.4; coords[4][2] =  .3;
    coords[5][0] =  .7; coords[5][1] = -.6; coords[5][2] =  .5;
    coords[6][0] = -.4; coords[6][1] =  .3; coords[6][2] =  .7;
    coords[7][0] =  .6; coords[7][1] =  .5; coords[7][2] =  .4;
    this->push_back(Geometry(gt, coords));
  }

  const Geometry &get(const Dune::GeometryType &gt) const {
    for(std::size_t i = 0; i < this->size(); ++i)
      if((*this)[i].type() == gt) return (*this)[i];
    DUNE_THROW(Dune::NotImplemented, "No predefined test-geometry in "
               "dimension " << dim << " for GeometryType " << gt);
  }
};

#endif // DUNE_LOCALFUNCTIONS_TEST_GEOMETRIES_HH