Commit dfd3fb49 authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[networkbuilder] increase robustness of non-embedded entity adder

parent e1903ac2
......@@ -541,8 +541,12 @@ public:
/*!
* \brief Adds an entity to the network.
* This function can be used when no sub-domain
* specifications are made. Internally, the entity
* is added to the sub-domain with index 0.
* specifications are made.
* \note Internally, the entity is added to a dummy
* sub-domain with id std::numeric_limits<std::size_t>::max().
* Thus, this could lead to clashes if users define sub-domains
* with this id. The entities will then be merged into one embedded
* network.
* \return The id of the newly added entity
*/
template<class Entity>
......@@ -555,7 +559,8 @@ public:
throw std::runtime_error("Entity dimension must be smaller than domain dimension");
this->entityDimension_ = entityDim;
return Id{this->bindEntity_(0, OCCUtilities::getShape(entity))};
const auto subDomainId = std::numeric_limits<std::size_t>::max();
return Id{this->bindEntity_(subDomainId, OCCUtilities::getShape(entity))};
}
/*!
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment