Loading [MathJax]/extensions/tex2jax.js

dune-mmesh (1.4)

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{
13
19 template<int codim, class GridImp>
21 {
22 protected:
23 // Entity type of the hostgrid
24 typedef typename GridImp::template HostGridEntity<codim> HostGridEntity;
25
26 public:
27 enum {codimension = codim};
28
33
37 MMeshEntitySeed(const HostGridEntity& hostEntity)
38 : hostEntity_( hostEntity )
39 {}
40
45 {
46 if( this != &seed )
47 hostEntity_ = seed.hostEntity_;
48 return *this;
49 }
50
54 template< int cd = codim >
55 std::enable_if_t< cd != 2 || GridImp::dimension != 3, bool >
56 isValid() const
57 {
58 return hostEntity_ != HostGridEntity();
59 }
60
62 template< int cd = codim >
63 std::enable_if_t< cd == 2 && GridImp::dimension == 3, bool >
64 isValid() const
65 {
66 return hostEntity_.first != HostGridEntity().first;
67 }
68
72 const HostGridEntity& hostEntity() const
73 {
74 return hostEntity_;
75 }
76
77 private:
79 HostGridEntity hostEntity_;
80 };
81
82} // namespace Dune
83
84#endif
The EntitySeed class provides the minimal information needed to restore an Entity using the grid....
Definition: entityseed.hh:21
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:56
MMeshEntitySeed & operator=(const MMeshEntitySeed< codim, GridImp > &seed)
Construct a seed from another seed.
Definition: entityseed.hh:44
MMeshEntitySeed()
Construct empty seed.
Definition: entityseed.hh:32
MMeshEntitySeed(const HostGridEntity &hostEntity)
Construct a seed from a host entity.
Definition: entityseed.hh:37
const HostGridEntity & hostEntity() const
Return host entity.
Definition: entityseed.hh:72
std::enable_if_t< cd==2 &&GridImp::dimension==3, bool > isValid() const
Special handling for codim 2 entities in 3d.
Definition: entityseed.hh:64
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden & Uni Heidelberg  |  generated with Hugo v0.111.3 (Apr 6, 22:49, 2025)