dune-grid 2.9.0
yaspgridentityseed.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
4// vi: set et ts=4 sw=2 sts=2:
5#ifndef DUNE_GRID_YASPGRIDENTITYSEED_HH
6#define DUNE_GRID_YASPGRIDENTITYSEED_HH
7
12namespace Dune {
13
16 template<int codim, class GridImp>
18 {
20 constexpr static int dim = GridImp::dimension;
21
22 public:
24 constexpr static int codimension = codim;
25
28 : _l(-1), _o(0)
29 {
30 std::fill(_c.begin(),_c.end(),0);
31 }
32
34 YaspEntitySeed (int level, std::array<int, dim> coord, int o = 0)
35 : _l(level), _c(coord), _o(o)
36 {}
37
39 bool isValid() const
40 {
41 return _l != -1;
42 }
43
44 int level () const { return _l; }
45 const std::array<int, dim> & coord() const { return _c; }
46 int offset () const { return _o; }
47
48 protected:
49 int _l; // grid level
50 std::array<int, dim> _c; // coord in the global grid
51 int _o; // the offset: which YGridComponent, does the entity belong to
52 };
53
54} // namespace Dune
55
56#endif // DUNE_GRID_YASPGRIDENTITYSEED_HH
Include standard header files.
Definition: agrid.hh:60
Describes the minimal information necessary to create a fully functional YaspEntity.
Definition: yaspgridentityseed.hh:18
int _o
Definition: yaspgridentityseed.hh:51
std::array< int, dim > _c
Definition: yaspgridentityseed.hh:50
int _l
Definition: yaspgridentityseed.hh:49
int level() const
Definition: yaspgridentityseed.hh:44
YaspEntitySeed()
default construct an invalid entity seed
Definition: yaspgridentityseed.hh:27
YaspEntitySeed(int level, std::array< int, dim > coord, int o=0)
constructor
Definition: yaspgridentityseed.hh:34
int offset() const
Definition: yaspgridentityseed.hh:46
static constexpr int codimension
codimension of entity
Definition: yaspgridentityseed.hh:24
const std::array< int, dim > & coord() const
Definition: yaspgridentityseed.hh:45
bool isValid() const
check whether the EntitySeed refers to a valid Entity
Definition: yaspgridentityseed.hh:39