Loading...
Searching...
No Matches
gridviewentityset.hh
Go to the documentation of this file.
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH
#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH
#include <memory>
namespace Dune {
namespace Functions {
template<class GV, int cd>
class GridViewEntitySet
{
public:
typedef GV GridView;
enum {
codim = cd
};
typedef typename GridView::template Codim<codim>::Entity Element;
typedef typename Element::Geometry::LocalCoordinate LocalCoordinate;
typedef typename Element::Geometry::GlobalCoordinate GlobalCoordinate;
typedef Element value_type;
typedef typename GridView::template Codim<codim>::Iterator const_iterator;
typedef const_iterator iterator;
GridViewEntitySet(const GridView& gv) :
gv_(gv)
{}
bool contains(const Element& e) const
{
return gv_.contains(e);
}
size_t size() const
{
return gv_.size(codim);
}
const_iterator begin() const
{
return gv_.template begin<codim>();
}
const_iterator end() const
{
return gv_.template end<codim>();
}
const GridView& gridView() const
{
return gv_;
}
private:
GridView gv_;
};
} // end of namespace Dune::Functions
} // end of namespace Dune
#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH
Dune
Definition monomialset.hh:19
Dune::Functions
Definition monomialset.hh:19
Dune::Functions::GridViewEntitySet::GridViewEntitySet
GridViewEntitySet(const GridView &gv)
Construct GridViewEntitySet for a GridView.
Definition gridviewentityset.hh:51
Dune::Functions::GridViewEntitySet< GridView, 0 >::GridView
GridView GridView
Definition gridviewentityset.hh:30
Dune::Functions::GridViewEntitySet< GridView, 0 >::Element
GridView::template Codim< codim >::Entity Element
Definition gridviewentityset.hh:36
Dune::Functions::GridViewEntitySet::end
const_iterator end() const
Create an end iterator.
Definition gridviewentityset.hh:74
Dune::Functions::GridViewEntitySet< GridView, 0 >::codim
@ codim
Definition gridviewentityset.hh:32
Dune::Functions::GridViewEntitySet::gridView
const GridView & gridView() const
Return the associated GridView.
Definition gridviewentityset.hh:80
Dune::Functions::GridViewEntitySet< GridView, 0 >::value_type
Element value_type
Definition gridviewentityset.hh:42
Dune::Functions::GridViewEntitySet::begin
const_iterator begin() const
Create a begin iterator.
Definition gridviewentityset.hh:68
Dune::Functions::GridViewEntitySet< GridView, 0 >::const_iterator
GridView::template Codim< codim >::Iterator const_iterator
Definition gridviewentityset.hh:45
Dune::Functions::GridViewEntitySet< GridView, 0 >::LocalCoordinate
Element::Geometry::LocalCoordinate LocalCoordinate
Definition gridviewentityset.hh:39
Dune::Functions::GridViewEntitySet::size
size_t size() const
Return number of Elements visited by an iterator.
Definition gridviewentityset.hh:62
Dune::Functions::GridViewEntitySet< GridView, 0 >::GlobalCoordinate
Element::Geometry::GlobalCoordinate GlobalCoordinate
Definition gridviewentityset.hh:40
Dune::Functions::GridViewEntitySet::contains
bool contains(const Element &e) const
Return true if e is contained in the EntitySet.
Definition gridviewentityset.hh:56
Dune::Functions::GridViewEntitySet< GridView, 0 >::iterator
const_iterator iterator
Definition gridviewentityset.hh:48