Dune Core Modules (unstable)

yaspgridentityseed.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright © 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
Describes the minimal information necessary to create a fully functional YaspEntity.
Definition: yaspgridentityseed.hh:18
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
static constexpr int codimension
codimension of entity
Definition: yaspgridentityseed.hh:24
bool isValid() const
check whether the EntitySeed refers to a valid Entity
Definition: yaspgridentityseed.hh:39
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 21, 23:30, 2024)