dune-grid
2.11
Toggle main menu visibility
Loading...
Searching...
No Matches
dune
grid
yaspgrid
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
11
12
namespace
Dune
{
13
16
template
<
int
codim,
class
Gr
id
Imp>
17
class
YaspEntitySeed
18
{
20
constexpr
static
int
dim = GridImp::dimension;
21
22
public
:
24
constexpr
static
int
codimension
= codim;
25
27
YaspEntitySeed
()
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
Dune
Include standard header files.
Definition
agrid.hh:60
Dune::YaspEntitySeed::_o
int _o
Definition
yaspgridentityseed.hh:51
Dune::YaspEntitySeed::_c
std::array< int, dim > _c
Definition
yaspgridentityseed.hh:50
Dune::YaspEntitySeed::_l
int _l
Definition
yaspgridentityseed.hh:49
Dune::YaspEntitySeed::level
int level() const
Definition
yaspgridentityseed.hh:44
Dune::YaspEntitySeed::YaspEntitySeed
YaspEntitySeed()
default construct an invalid entity seed
Definition
yaspgridentityseed.hh:27
Dune::YaspEntitySeed::YaspEntitySeed
YaspEntitySeed(int level, std::array< int, dim > coord, int o=0)
constructor
Definition
yaspgridentityseed.hh:34
Dune::YaspEntitySeed::offset
int offset() const
Definition
yaspgridentityseed.hh:46
Dune::YaspEntitySeed::codimension
static constexpr int codimension
codimension of entity
Definition
yaspgridentityseed.hh:24
Dune::YaspEntitySeed::coord
const std::array< int, dim > & coord() const
Definition
yaspgridentityseed.hh:45
Dune::YaspEntitySeed::isValid
bool isValid() const
check whether the EntitySeed refers to a valid Entity
Definition
yaspgridentityseed.hh:39
Generated by
1.17.0