2#ifndef model_SimplexChild_H_
3#define model_SimplexChild_H_
18 using ParentLinks = std::map<ParentSimplexIDType, std::weak_ptr<ParentSimplexType>>;
20 std::map<typename SimplexTraits<dim, order>::SimplexIDType, std::shared_ptr<SimplexType>>;
28 const auto found = parentLinks_.find(
parent->xID);
29 if (found != parentLinks_.end())
31 if (
const auto existing = found->second.lock(); existing && existing !=
parent)
33 throw std::runtime_error(
"Conflicting simplex parent identity");
46 for (
const auto &entry : parentLinks_)
48 if (
const auto parent = entry.second.lock())
60 for (
const auto &child :
parent.second->children())
62 result.emplace(child->xID, child);
84 const auto ids =
parent.second->regionIDs();
85 result.insert(ids.begin(), ids.end());
ParentContainerType parents() const
std::map< ParentSimplexIDType, std::shared_ptr< ParentSimplexType > > ParentContainerType
SiblingsContainerType siblings() const
typename SimplexTraits< dim, order >::SimplexType SimplexType
void addParent(const std::shared_ptr< ParentSimplexType > &parent)
typename SimplexTraits< dim, order+1 >::SimplexIDType ParentSimplexIDType
bool isBoundarySimplex() const
bool isRegionBoundarySimplex() const
const ParentLinks & parentLinks() const
std::map< ParentSimplexIDType, std::weak_ptr< ParentSimplexType > > ParentLinks
typename SimplexTraits< dim, order+1 >::SimplexType ParentSimplexType
std::set< size_t > regionIDs() const
std::map< typename SimplexTraits< dim, order >::SimplexIDType, std::shared_ptr< SimplexType > > SiblingsContainerType
bool isInRegion(const size_t &id) const
static bool isBoundarySimplex(const SimplexChild< dim, dim-dmo > &simplexChild)
static bool isRegionBoundarySimplex(const SimplexChild< dim, dim-dmo > &simplexChild)
Simplex< dim, order > SimplexType
SimplexID< nVertices > SimplexIDType