This file is indexed.

/usr/include/dune/grid/albertagrid/entity.cc is in libdune-grid-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
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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_ALBERTA_ENTITY_CC
#define DUNE_ALBERTA_ENTITY_CC

namespace Dune
{

  // AlbertaGridEntity (for codim > 0)
  // ---------------------------------

  template<int codim, int dim, class Grid>
  inline AlbertaGridEntity< codim, dim, Grid >
    ::AlbertaGridEntity ( const Grid &grid, const ElementInfo &elementInfo, int subEntity )
  : grid_( &grid ),
    elementInfo_( elementInfo ),
    subEntity_( subEntity )
  {}

  template<int codim, int dim, class Grid>
  inline AlbertaGridEntity< codim, dim, Grid >
    ::AlbertaGridEntity ( const Grid &grid )
  : grid_( &grid ),
    elementInfo_(),
    subEntity_( -1 )
  {}

  template<int codim, int dim, class Grid>
  inline AlbertaGridEntity< codim, dim, Grid >
    ::AlbertaGridEntity ()
  : grid_( NULL ),
    elementInfo_(),
    subEntity_( -1 )
  {}

  template< int codim, int dim, class Grid >
  inline PartitionType
  AlbertaGridEntity< codim,dim,Grid >::partitionType () const
  {
    return InteriorEntity;
  }


  template< int codim, int dim, class Grid >
  inline bool
  AlbertaGridEntity< codim, dim, Grid >::equals ( const This &other ) const
  {
    const Alberta::Element *e1 = elementInfo().el();
    const Alberta::Element *e2 = other.elementInfo().el();

    // if both element null then they are equal
    if( (e1 == NULL) && (e2 == NULL) )
      return true;
    return ((e1 == e2) && (subEntity_ == other.subEntity_));
  }


  template< int codim, int dim, class Grid >
  inline ALBERTA EL_INFO *
  AlbertaGridEntity< codim, dim, Grid >::getElInfo () const
  {
    return &(elementInfo_.elInfo());
  }


  template< int codim, int dim, class Grid >
  inline void
  AlbertaGridEntity< codim, dim, Grid >::clearElement ()
  {
    elementInfo_ = ElementInfo();
  }


  template< int codim, int dim, class Grid >
  inline void AlbertaGridEntity< codim, dim, Grid >
    ::setElement ( const ElementInfo &elementInfo, int subEntity )
  {
    elementInfo_ = elementInfo;
    subEntity_ = subEntity;
  }


  template< int codim, int dim, class Grid >
  inline void
  AlbertaGridEntity< codim, dim, Grid >::setEntity ( const This &other )
  {
    setElement( other.elementInfo_, other.subEntity_ );
  }


  template< int codim, int dim, class Grid >
  inline int AlbertaGridEntity< codim, dim, Grid >::level() const
  {
    assert( elementInfo_.level() == grid().levelProvider() ( elementInfo_ ) );
    return elementInfo_.level();
  }


  template< int codim, int dim, class Grid >
  inline typename AlbertaGridEntity< codim, dim, Grid >::Geometry
  AlbertaGridEntity< codim, dim, Grid >::geometry () const
  {
    typedef AlbertaGridCoordinateReader< codim, Grid > CoordReader;

    assert( elementInfo_ );
    const CoordReader coordReader( grid(), elementInfo_, subEntity_ );
    return Geometry( GeometryImpl( coordReader ) );
  }


  template< int codim, int dim, class Grid >
  inline GeometryType AlbertaGridEntity< codim, dim, Grid >::type () const
  {
    typedef typename Impl::SimplexTopology< mydimension >::type Topology;
    return GeometryType( Topology() );
  }



  // AlbertaGridEntity (for codim = 0)
  // ---------------------------------

  template< int dim, class Grid >
  inline AlbertaGridEntity< 0, dim, Grid >
    ::AlbertaGridEntity ( const Grid &grid, const ElementInfo &elementInfo, int subEntity )
  : grid_( &grid ),
    elementInfo_( elementInfo )
  {
    assert( subEntity == 0 );
  }

  template< int dim, class Grid >
  inline AlbertaGridEntity< 0, dim, Grid >
    ::AlbertaGridEntity( const Grid &grid )
  : grid_( &grid ),
    elementInfo_()
  {}

  template< int dim, class Grid >
  inline AlbertaGridEntity< 0, dim, Grid >
    ::AlbertaGridEntity ()
  : grid_( NULL ),
    elementInfo_()
  {}


  template< int dim, class Grid >
  inline int AlbertaGridEntity< 0, dim, Grid >::boundaryId() const
  {
    // elements are always inside of our Domain
    return 0;
  }


  template< int dim, class Grid >
  inline bool AlbertaGridEntity< 0, dim, Grid >::isNew () const
  {
    return grid().levelProvider().isNew( elementInfo_ );
  }


  template< int dim, class Grid >
  inline bool AlbertaGridEntity< 0, dim, Grid >::mightVanish () const
  {
    return elementInfo_.mightVanish();
  }


  template< int dim, class Grid >
  inline bool
  AlbertaGridEntity< 0, dim, Grid >::hasBoundaryIntersections () const
  {
    assert( elementInfo_ );
    bool isBoundary = false;
    for( int i = 0; i < dim+1; ++i )
      isBoundary |= elementInfo_.isBoundary( i );
    return isBoundary;
  }


  template< int dim, class Grid >
  inline PartitionType
  AlbertaGridEntity< 0, dim, Grid >::partitionType () const
  {
    return InteriorEntity;
  }


  template< int dim, class Grid >
  inline bool AlbertaGridEntity< 0, dim,Grid >::isLeaf () const
  {
    return elementInfo_.isLeaf();
  }


  template< int dim, class Grid >
  inline bool
  AlbertaGridEntity< 0, dim, Grid >::equals ( const This &other ) const
  {
    // element pointers are unique
    return (elementInfo().el() == other.elementInfo().el());
  }


  template< int dim, class Grid >
  template< int codim >
  inline typename Grid::template Codim< codim >::Entity
  AlbertaGridEntity< 0, dim, Grid >::subEntity ( int i ) const
  {
    typedef AlbertaGridEntity< codim, dim, Grid > EntityImpl;
    return EntityImpl( grid(), elementInfo_, grid().generic2alberta( codim, i ) );
  }


  template< int dim, class Grid >
  inline ALBERTA EL_INFO *
  AlbertaGridEntity< 0, dim, Grid >::getElInfo () const
  {
    return &(elementInfo_.elInfo());
  }


  template< int dim, class Grid >
  inline int AlbertaGridEntity< 0, dim, Grid >::level () const
  {
    assert( elementInfo_.level() == grid().levelProvider() ( elementInfo_ ) );
    return elementInfo_.level();
  }


  template< int dim, class Grid >
  inline void
  AlbertaGridEntity< 0, dim, Grid >::clearElement ()
  {
    elementInfo_ = ElementInfo();
  }


  template< int dim, class Grid >
  inline void AlbertaGridEntity< 0, dim, Grid >
    ::setElement ( const ElementInfo &elementInfo, int subEntity )
  {
    elementInfo_ = elementInfo;
  }


  template< int dim, class Grid >
  inline void
  AlbertaGridEntity< 0, dim, Grid >::setEntity( const This &other )
  {
    setElement( other.elementInfo_, 0 );
  }


  template< int dim, class Grid >
  inline typename AlbertaGridEntity< 0, dim, Grid >::Geometry
  AlbertaGridEntity< 0, dim, Grid >::geometry () const
  {
    typedef AlbertaGridCoordinateReader< 0, Grid > CoordReader;

    assert( elementInfo_ );
    const CoordReader coordReader( grid(), elementInfo_, 0 );
    return Geometry( GeometryImpl( coordReader ) );
  }


  template< int dim, class Grid >
  inline GeometryType AlbertaGridEntity< 0, dim, Grid>::type () const
  {
    typedef typename Impl::SimplexTopology< mydimension >::type Topology;
    return GeometryType( Topology() );
  }


  template< int dim, class Grid >
  inline typename Grid::template Codim< 0 >::Entity
  AlbertaGridEntity< 0, dim, Grid >::father () const
  {
    typedef AlbertaGridEntity< 0, dim, Grid > EntityImpl;

    assert( elementInfo_ );
    const ElementInfo fatherInfo = elementInfo_.father();

    return EntityImpl( grid(), fatherInfo, 0 );
  }


  template< int dim, class Grid >
  inline int AlbertaGridEntity< 0, dim, Grid >::nChild () const
  {
    return elementInfo_.indexInFather();
  }


  template< int dim, class Grid >
  inline typename AlbertaGridEntity< 0, dim, Grid >::LocalGeometry
  AlbertaGridEntity< 0, dim, Grid >::geometryInFather() const
  {
    typedef AlbertaGridLocalGeometryProvider< Grid > LocalGeoProvider;
    const int indexInFather = elementInfo_.indexInFather();
    const int orientation = (elementInfo_.type() == 1 ? -1 : 1);
    return LocalGeometry( LocalGeoProvider::instance().geometryInFather( indexInFather, orientation ) );
  }


  template< int dim, class Grid >
  inline typename AlbertaGridEntity< 0, dim, Grid >::HierarchicIterator
  AlbertaGridEntity< 0, dim, Grid >::hbegin( int maxlevel ) const
  {
    assert( elementInfo_ );
    typedef AlbertaGridHierarchicIterator< Grid > IteratorImp;
    return IteratorImp( grid(), elementInfo_, maxlevel );
  }


  template< int dim, class Grid >
  inline typename AlbertaGridEntity< 0, dim, Grid >::HierarchicIterator
  AlbertaGridEntity< 0, dim, Grid>::hend( int maxlevel ) const
  {
    assert( elementInfo_ );
    typedef AlbertaGridHierarchicIterator< Grid > IteratorImp;
    return IteratorImp( grid(), level(), maxlevel );
  }


  template< int dim, class Grid >
  inline typename AlbertaGridEntity< 0, dim, Grid >::AlbertaGridLeafIntersectionIterator
  AlbertaGridEntity< 0, dim, Grid >::ileafbegin() const
  {
    assert( elementInfo_ );

#ifndef NDEBUG
    for( int i = 0; i <= dimension; ++i )
    {
      // std::cout << "Opposite vertex " << i << ": "
      //           << (int)(getElInfo()->opp_vertex[ i ]) << std::endl;
      if( getElInfo()->opp_vertex[ i ] == 127 )
      {
        assert( false );
        DUNE_THROW( NotImplemented, "AlbertaGrid: Intersections on outside "
                    "entities are not fully implemented, yet." );
      }
    }
#endif // #ifndef NDEBUG

    typename AlbertaGridLeafIntersectionIterator::Begin begin;
    return AlbertaGridLeafIntersectionIterator( *this, begin );
  }


  template< int dim, class Grid >
  inline typename AlbertaGridEntity< 0, dim, Grid >::AlbertaGridLeafIntersectionIterator
  AlbertaGridEntity< 0, dim, Grid >::ileafend() const
  {
    assert( elementInfo_ );
    typename AlbertaGridLeafIntersectionIterator::End end;
    return AlbertaGridLeafIntersectionIterator( *this, end );
  }

} // namespace Dune

#endif // #ifndef DUNE_ALBERTA_ENTITY_CC