dune-grid  2.11
identitygridentityseed.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_IDENTITY_GRID_ENTITY_SEED_HH
6 #define DUNE_IDENTITY_GRID_ENTITY_SEED_HH
7 
14 namespace 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 
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
concept Entity
Model of a grid entity.
Definition: concepts/entity.hh:119
IdentityGridEntitySeed(const HostEntity &hostEntity)
Create EntitySeed from hostgrid Entity.
Definition: identitygridentityseed.hh:49
GridImp::HostGridType::Traits::template Codim< codim >::EntitySeed HostEntitySeed
Definition: identitygridentityseed.hh:31
static constexpr int codimension
Definition: identitygridentityseed.hh:35
const HostEntitySeed & hostEntitySeed() const
Get stored HostEntitySeed.
Definition: identitygridentityseed.hh:56
GridImp::HostGridType::Traits::template Codim< codim >::Entity HostEntity
Definition: identitygridentityseed.hh:28
Include standard header files.
Definition: agrid.hh:59
The EntitySeed class provides the minimal information needed to restore an Entity using the grid...
Definition: identitygridentityseed.hh:23
bool isValid() const
Check whether it is safe to create an Entity from this Seed.
Definition: identitygridentityseed.hh:64
concept EntitySeed
Model of an entity seed.
Definition: concepts/entity.hh:25
IdentityGridEntitySeed()
Construct an empty (i.e. isValid() == false) seed.
Definition: identitygridentityseed.hh:40