This file is indexed.

/usr/include/dolfin/function/FunctionSpace.h is in libdolfin1.0-dev 1.0.0-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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
// Copyright (C) 2008-2011 Anders Logg
//
// This file is part of DOLFIN.
//
// DOLFIN is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DOLFIN is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
//
// Modified by Garth N. Wells, 2008-2011.
// Modified by Kent-Andre Mardal, 2009.
// Modified by Ola Skavhaug, 2009.
//
// First added:  2008-09-11
// Last changed: 2011-05-15

#ifndef __FUNCTION_SPACE_H
#define __FUNCTION_SPACE_H

#include <map>
#include <vector>
#include <boost/shared_ptr.hpp>
#include <boost/unordered_map.hpp>
#include <dolfin/common/types.h>
#include <dolfin/common/Array.h>
#include <dolfin/common/Variable.h>
#include <dolfin/common/Hierarchical.h>
#include <dolfin/mesh/Mesh.h>
#include <dolfin/fem/FiniteElement.h>

namespace dolfin
{

  class Mesh;
  class Cell;
  class GenericDofMap;
  class Function;
  class GenericFunction;
  class GenericVector;
  template <typename T> class MeshFunction;

  /// This class represents a finite element function space defined by
  /// a mesh, a finite element, and a local-to-global mapping of the
  /// degrees of freedom (dofmap).

  class FunctionSpace : public Variable, public Hierarchical<FunctionSpace>
  {
  public:

    /// Create function space for given mesh, element and dofmap
    /// (shared data)
    ///
    /// *Arguments*
    ///     mesh (_Mesh_)
    ///         The mesh.
    ///     element (_FiniteElement_)
    ///         The element.
    ///     dofmap (_GenericDofMap_)
    ///         The dofmap.
    FunctionSpace(boost::shared_ptr<const Mesh> mesh,
                  boost::shared_ptr<const FiniteElement> element,
                  boost::shared_ptr<const GenericDofMap> dofmap);

  protected:

    /// Create empty function space for later initialization. This
    /// constructor is intended for use by any sub-classes which need
    /// to construct objects before the initialisation of the base
    /// class. Data can be attached to the base class using
    /// FunctionSpace::attach(...).
    ///
    /// *Arguments*
    ///     mesh (_Mesh_)
    ///         The mesh.
    explicit FunctionSpace(boost::shared_ptr<const Mesh> mesh);

  public:

    /// Copy constructor
    ///
    /// *Arguments*
    ///     V (_FunctionSpace_)
    ///         The object to be copied.
    FunctionSpace(const FunctionSpace& V);

    /// Destructor
    virtual ~FunctionSpace();

  protected:

    /// Attach data to an empty function space
    ///
    /// *Arguments*
    ///     element (_FiniteElement_)
    ///         The element.
    ///     dofmap (_GenericDofMap_)
    ///         The dofmap.
    void attach(boost::shared_ptr<const FiniteElement> element,
                boost::shared_ptr<const GenericDofMap> dofmap);

  public:

    /// Assignment operator
    ///
    /// *Arguments*
    ///     V (_FunctionSpace_)
    ///         Another function space.
    const FunctionSpace& operator= (const FunctionSpace& V);

    /// Equality operator
    ///
    /// *Arguments*
    ///     V (_FunctionSpace_)
    ///         Another function space.
    bool operator== (const FunctionSpace& V) const;

    /// Unequality operator
    ///
    /// *Arguments*
    ///     V (_FunctionSpace_)
    ///         Another function space.
    bool operator!= (const FunctionSpace& V) const;

    /// Return mesh
    ///
    /// *Returns*
    ///     _Mesh_
    ///         The mesh.
    boost::shared_ptr<const Mesh> mesh() const;

    /// Return finite element
    ///
    /// *Returns*
    ///     _FiniteElement_
    ///         The finite element.
    boost::shared_ptr<const FiniteElement> element() const;

    /// Return dofmap
    ///
    /// *Returns*
    ///     _GenericDofMap_
    ///         The dofmap.
    boost::shared_ptr<const GenericDofMap> dofmap() const;

    /// Return dimension of function space
    ///
    /// *Returns*
    ///     uint
    ///         The dimension of the function space.
    uint dim() const;

    /// Interpolate function v into function space, returning the
    /// vector of expansion coefficients
    ///
    /// *Arguments*
    ///     expansion_coefficients (_GenericVector_)
    ///         The expansion coefficients.
    ///     v (_GenericFunction_)
    ///         The function to be interpolated.
    void interpolate(GenericVector& expansion_coefficients,
                     const GenericFunction& v) const;

    /// Extract subspace for component
    ///
    /// *Arguments*
    ///     i (uint)
    ///         Index of the subspace.
    /// *Returns*
    ///     _FunctionSpace_
    ///         The subspace.
    boost::shared_ptr<FunctionSpace> operator[] (uint i) const;

    /// Extract subspace for component
    ///
    /// *Arguments*
    ///     component (std::vector<uint>)
    ///         The component.
    ///
    /// *Returns*
    ///     _FunctionSpace_
    ///         The subspace.
    boost::shared_ptr<FunctionSpace>
    extract_sub_space(const std::vector<uint>& component) const;

    /// Collapse a subspace and return a new function space
    ///
    /// *Returns*
    ///     _FunctionSpace_
    ///         The new function space.
    boost::shared_ptr<FunctionSpace> collapse() const;

    /// Collapse a subspace and return a new function space and a map
    /// from new to old dofs
    ///
    /// *Arguments*
    ///     collapsed_dofs (boost::unordered_map<uint, uint>)
    ///         The map from new to old dofs.
    ///
    /// *Returns*
    ///     _FunctionSpace_
    ///       The new function space.
    boost::shared_ptr<FunctionSpace>
    collapse(boost::unordered_map<uint, uint>& collapsed_dofs) const;

    /// Check if function space has given cell
    ///
    /// *Arguments*
    ///     cell (_Cell_)
    ///         The cell.
    ///
    /// *Returns*
    ///     bool
    ///         True if the function space has the given cell.
    bool has_cell(const Cell& cell) const
    { return &cell.mesh() == &(*_mesh); }

    /// Check if function space has given element
    ///
    /// *Arguments*
    ///     element (_FiniteElement_)
    ///         The finite element.
    ///
    /// *Returns*
    ///     bool
    ///         True if the function space has the given element.
    bool has_element(const FiniteElement& element) const
    { return element.hash() == _element->hash(); }

    /// Return component
    ///
    /// *Returns*
    ///     std::vector<uint>
    ///         The component (relative to superspace).
    std::vector<uint> component() const;

    /// Return informal string representation (pretty-print)
    ///
    /// *Arguments*
    ///     verbose (bool)
    ///         Flag to turn on additional output.
    ///
    /// *Returns*
    ///     std::string
    ///         An informal representation of the function space.
    std::string str(bool verbose) const;

    /// Print dofmap (useful for debugging)
    void print_dofmap() const;

  private:

    // The mesh
    boost::shared_ptr<const Mesh> _mesh;

    // The finite element
    boost::shared_ptr<const FiniteElement> _element;

    // The dofmap
    boost::shared_ptr<const GenericDofMap> _dofmap;

    // The component (for sub spaces)
    std::vector<uint> _component;

    // Cache of sub spaces
    mutable std::map<std::vector<uint>, boost::shared_ptr<FunctionSpace> > subspaces;

  };

}

#endif