Loading [MathJax]/extensions/tex2jax.js

dune-mmesh (unstable)

entityseed.hh
Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_MMESH_GRID_ENTITYSEED_HH
4#define DUNE_MMESH_GRID_ENTITYSEED_HH
5
11namespace Dune {
12
18template <int codim, class GridImp>
20 protected:
21 // Entity type of the hostgrid
22 typedef typename GridImp::template HostGridEntity<codim> HostGridEntity;
23
24 public:
25 enum { codimension = codim };
26
31
35 MMeshEntitySeed(const HostGridEntity& hostEntity) : hostEntity_(hostEntity) {}
36
41 if (this != &seed) hostEntity_ = seed.hostEntity_;
42 return *this;
43 }
44
48 template <int cd = codim>
49 std::enable_if_t<cd != 2 || GridImp::dimension != 3, bool> isValid() const {
50 return hostEntity_ != HostGridEntity();
51 }
52
54 template <int cd = codim>
55 std::enable_if_t<cd == 2 && GridImp::dimension == 3, bool> isValid() const {
56 return hostEntity_.first != HostGridEntity().first;
57 }
58
62 const HostGridEntity& hostEntity() const { return hostEntity_; }
63
64 private:
66 HostGridEntity hostEntity_;
67};
68
69} // namespace Dune
70
71#endif
The EntitySeed class provides the minimal information needed to restore an Entity using the grid....
Definition: entityseed.hh:19
std::enable_if_t< cd !=2||GridImp::dimension !=3, bool > isValid() const
Check whether it is safe to create an Entity from this Seed.
Definition: entityseed.hh:49
MMeshEntitySeed & operator=(const MMeshEntitySeed< codim, GridImp > &seed)
Construct a seed from another seed.
Definition: entityseed.hh:40
MMeshEntitySeed()
Construct empty seed.
Definition: entityseed.hh:30
MMeshEntitySeed(const HostGridEntity &hostEntity)
Construct a seed from a host entity.
Definition: entityseed.hh:35
const HostGridEntity & hostEntity() const
Return host entity.
Definition: entityseed.hh:62
std::enable_if_t< cd==2 &&GridImp::dimension==3, bool > isValid() const
Special handling for codim 2 entities in 3d.
Definition: entityseed.hh:55
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden & Uni Heidelberg  |  generated with Hugo v0.111.3 (Mar 16, 23:47, 2025)