35 std::vector<int>
const& vec_inactive_matIDs)
40 auto* const materialIds =
41 mesh->getProperties().getPropertyVector<int>(
"MaterialIDs");
42 for (auto material_id : vec_inactive_matIDs)
44 for (auto e : _mesh->getElements())
46 if ((*materialIds)[e->getID()] == material_id)
48 setElementStatus(e->getID(), false);
54 _vec_active_eles.reserve(getNumberOfActiveElements());
55 const std::size_t nElems(_mesh->getNumberOfElements());
56 for (std::size_t i = 0; i < nElems; ++i)
58 if (_element_status[i])
60 _vec_active_eles.push_back(
65 _vec_active_nodes.reserve(this->getNumberOfActiveNodes());
66 const std::size_t nNodes(_mesh->getNumberOfNodes());
67 for (std::size_t i = 0; i < nNodes; ++i)
69 if (_active_nodes[i] > 0)
71 _vec_active_nodes.push_back(
77 "Deactivated {:d} materials and resulting active {:d} nodes and {:d} "
79 vec_inactive_matIDs.size(),
80 _vec_active_nodes.size(),
81 _vec_active_eles.size());
116void ElementStatus::setElementStatus(std::size_t i,
bool status)
118 if (_element_status[i] != status)
120 const int change = (status) ? 1 : -1;
121 _element_status[i] = status;
122 const unsigned nElemNodes(_mesh->getElement(i)->getNumberOfNodes());
124 _mesh->getElement(i)->getNodes();
125 for (
unsigned j = 0; j < nElemNodes; ++j)
127 assert(_active_nodes[j] < 255);
130 _active_nodes[nodes[j]->
getID()] += change;