Dune Core Modules (2.9.0)

identitygridentityseed.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_IDENTITY_GRID_ENTITY_SEED_HH
6#define DUNE_IDENTITY_GRID_ENTITY_SEED_HH
7
14namespace Dune {
15
16
22 template<int codim, class GridImp>
24 {
25 protected:
26
27 // Entity type of the hostgrid
28 typedef typename GridImp::HostGridType::Traits::template Codim<codim>::Entity HostEntity;
29
30 // EntitySeed type of the hostgrid
31 typedef typename GridImp::HostGridType::Traits::template Codim<codim>::EntitySeed HostEntitySeed;
32
33 public:
34
35 constexpr static int codimension = codim;
36
41 {}
42
49 IdentityGridEntitySeed(const HostEntity& hostEntity) :
50 hostEntitySeed_(hostEntity.seed())
51 {}
52
56 const HostEntitySeed& hostEntitySeed() const
57 {
58 return hostEntitySeed_;
59 }
60
64 bool isValid() const
65 {
66 return hostEntitySeed_.isValid();
67 }
68 private:
69
70 HostEntitySeed hostEntitySeed_;
71 };
72
73} // namespace Dune
74
75#endif // #define DUNE_IDENTITY_GRID_ENTITY_SEED_HH
The EntitySeed class provides the minimal information needed to restore an Entity using the grid.
Definition: identitygridentityseed.hh:24
IdentityGridEntitySeed()
Construct an empty (i.e. isValid() == false) seed.
Definition: identitygridentityseed.hh:40
bool isValid() const
Check whether it is safe to create an Entity from this Seed.
Definition: identitygridentityseed.hh:64
IdentityGridEntitySeed(const HostEntity &hostEntity)
Create EntitySeed from hostgrid Entity.
Definition: identitygridentityseed.hh:49
const HostEntitySeed & hostEntitySeed() const
Get stored HostEntitySeed.
Definition: identitygridentityseed.hh:56
Dune namespace.
Definition: alignedallocator.hh:13
Static tag representing a codimension.
Definition: dimension.hh:24
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 21, 23:30, 2024)