This file is indexed.

/usr/include/dune/localfunctions/lagrange/pk3d/pk3dlocalcoefficients.hh is in libdune-localfunctions-dev 2.2.1-2.

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
#ifndef DUNE_PK3DLOCALCOEFFICIENTS_HH
#define DUNE_PK3DLOCALCOEFFICIENTS_HH

#include <cstddef>
#include <iostream>
#include <vector>

#include <dune/localfunctions/common/localkey.hh>

namespace Dune
{

    /**@ingroup LocalLayoutImplementation
       \brief Please doc me!

       \nosubgrouping
     \implements Dune::LocalCoefficientsVirtualImp
    */
    template<unsigned int k>
    class Pk3DLocalCoefficients
    {
        enum {N = (k+1)*(k+2)*(k+3)/6};

    public:
        //! \brief Standard constructor
        Pk3DLocalCoefficients () : li(N)
        {
            const unsigned int vertexmap[4] = {0, 1, 2, 3};
            generate_local_keys(vertexmap);
        }

        /** Constructor for variants with permuted vertices.

            \param vertexmap The permutation of the vertices.  This
            can for instance be generated from the global indices of
            the vertices by reducing those to the integers 0...3
         */
        Pk3DLocalCoefficients (const unsigned int vertexmap[4]) : li(N)
        {
            generate_local_keys(vertexmap);
        }

        //! number of coefficients
        std::size_t size () const
        {
            return N;
        }

        //! get i'th index
        const LocalKey& localKey (std::size_t i) const
        {
            return li[i];
        }

    private:
        std::vector<LocalKey> li;

        void generate_local_keys(const unsigned int vertexmap[4])
        {
            unsigned int subindex[16];
            unsigned int codim_count[4] = {0};
            for (unsigned int m = 1; m < 16; ++m)
            {
                unsigned int codim = !(m&1) + !(m&2) + !(m&4) + !(m&8);
                subindex[m] = codim_count[codim]++;
            }

            int a1 = (3*k + 12)*k + 11;
            int a2 = -3*k - 6;
            unsigned int dof_count[16] = {0};
            unsigned int i[4];
            for (i[3] = 0; i[3] <= k; ++i[3])
                for (i[2] = 0; i[2] <= k - i[3]; ++i[2])
                    for (i[1] = 0; i[1] <= k - i[2] - i[3]; ++i[1])
                    {
                        i[0] = k - i[1] - i[2] - i[3];
                        unsigned int j[4];
                        unsigned int entity = 0;
                        unsigned int codim = 0;
                        for (unsigned int m = 0; m < 4; ++m)
                        {
                            j[m] = i[vertexmap[m]];
                            entity += !!j[m] << m;
                            codim += !j[m];
                        }
                        int local_index = j[3]*(a1 + (a2 + j[3])*j[3])/6
                            + j[2]*(2*(k - j[3]) + 3 - j[2])/2 + j[1];
                        li[local_index] = LocalKey(subindex[entity], codim, dof_count[entity]++);
                    }
        }
    };

}

#endif