25 _element_status(mesh->getNumberOfElements(), true),
26 _hasAnyInactive(hasAnyInactive)
29 std::transform(begin(nodes), end(nodes), back_inserter(
_active_nodes),
30 [
this](
Node const*
const n)
35 std::vector<int>
const& vec_inactive_matIDs)
40 auto*
const materialIds =
42 for (
auto material_id : vec_inactive_matIDs)
46 if ((*materialIds)[e->getID()] == material_id)
56 for (std::size_t i = 0; i < nElems; ++i)
67 for (std::size_t i = 0; i < nNodes; ++i)
77 "Deactivated {:d} materials and resulting active {:d} nodes and {:d} "
79 vec_inactive_matIDs.size(),
112 return static_cast<std::size_t
>(
120 const int change = (status) ? 1 : -1;
125 for (
unsigned j = 0; j < nElemNodes; ++j)
Definition of the ElementStatus class.
Definition of the Element class.
void DBUG(char const *fmt, Args const &... args)
Definition of the Mesh class.
Definition of the Node class.
std::size_t getID() const
std::vector< MeshLib::Element * > _vec_active_eles
bool isActiveNode(MeshLib::Node const *node) const
Returns the status of the given node.
void setElementStatus(std::size_t i, bool status)
Sets the status of element i.
MeshLib::Mesh const *const _mesh
The mesh for which the element status is administrated.
bool const _hasAnyInactive
std::vector< bool > _element_status
Element status for each mesh element (active/inactive = true/false)
ElementStatus(MeshLib::Mesh const *const mesh, bool hasAnyInactive=false)
Constructor assuming all nodes and elements.
std::size_t getNumberOfActiveElements() const
Returns the total number of active elements.
std::vector< MeshLib::Node * > const & getActiveNodes() const
Returns a vector of active node IDs.
std::vector< MeshLib::Element * > const & getActiveElements() const
Returns a vector of active element IDs.
std::size_t getNumberOfActiveNodes() const
Returns the total number of active nodes.
std::vector< MeshLib::Node * > _vec_active_nodes
std::vector< unsigned char > _active_nodes
Node status for each mesh node (value = number of active elements connected to node,...
virtual Node *const * getNodes() const =0
Get array of element nodes.
virtual unsigned getNumberOfNodes() const =0
std::vector< Node * > const & getNodes() const
Get the nodes-vector for the mesh.
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
Properties & getProperties()
std::size_t getNumberOfNodes() const
Get the number of nodes.
std::vector< Element const * > const & getElementsConnectedToNode(std::size_t node_id) const
const Element * getElement(std::size_t idx) const
Get the element with the given index.
const Node * getNode(std::size_t idx) const
Get the node with the given index.
std::size_t getNumberOfElements() const
Get the number of elements.
PropertyVector< T > const * getPropertyVector(std::string const &name) const
bool existsPropertyVector(std::string const &name) const