34 for (
unsigned int i=0; i<4; i++)
41 n_duplicated_nodes_(0)
65 for (
unsigned int i=0; i<
edge.side(0)->dim()+1; ++i)
66 obj.
nodes[i] =
edge.side(0)->node(i).idx();
79 for (
unsigned int i=0; i<ele->dim()+1; i++)
80 l.
nodes[i] = ele->node_idx(i);
81 for (
unsigned int i=0; i<ele->dim()+1; i++)
110 while (node_elements.size() > 0)
113 std::queue<unsigned int> q;
114 q.push(*node_elements.begin());
115 node_elements.erase(node_elements.begin());
116 std::set<unsigned int> component;
117 while (q.size() > 0) {
119 component.insert(elem.idx());
121 for (
unsigned int sid=0; sid<elem->n_sides(); ++sid) {
122 auto side = elem.
side(sid);
123 for (
unsigned int esid=0; esid < side->edge().n_sides(); ++esid) {
125 if (adj_el_idx != elem.idx())
127 auto it = std::find(node_elements.begin(), node_elements.end(), adj_el_idx);
128 if (
it != node_elements.end()) {
129 node_elements.erase(
it);
137 components.push_back(component);
143 if (components.size() > 0) {
145 components.erase(components.begin());
147 for (
auto component : components) {
150 for (
auto el_idx : component) {
155 if (elem->
nodes[i] == n.idx())
156 elem->
nodes[i] = new_nid;
vector< vector< unsigned int > > const & node_elements()
std::vector< unsigned int > node_dim_
Vector of space dimensions of elements using the particular duplicated node.
MeshObject * faces[4]
(dim-1)-dimensional faces
Edge edge() const
Returns pointer to the edge connected to the side.
unsigned int n_duplicated_nodes_
Number of nodes (including duplicated ones).
Mesh * mesh_
The mesh object.
SideIter side(const unsigned int loc_index)
virtual unsigned int n_nodes() const
void init_from_edges()
Initialize objects from mesh edges.
virtual ElementAccessor< 3 > element_accessor(unsigned int idx) const
Create and return ElementAccessor to element of given idx.
void duplicate_nodes()
Duplicate nodes that are lying on interfaces with fractures.
MeshObject(unsigned int dim)
void init_nodes()
Initialize the vector of nodes from mesh.
std::vector< unsigned int > obj_4_el_
std::vector< MeshObject > objects_[4]
Array of n-faces by their dimension.
#define START_TIMER(tag)
Starts a timer with specified tag.
virtual Range< ElementAccessor< 3 > > elements_range() const
Returns range of bulk elements.
unsigned int nodes[4]
Indices of nodes.
std::vector< unsigned int > obj_4_edg_
Vector of object indices for each mesh edge.
void init_from_elements()
Initialize objects from mesh elements.
#define END_TIMER(tag)
Ends a timer with specified tag.
DuplicateNodes(Mesh *mesh)
Range< NodeAccessor< 3 > > node_range() const
Returns range of nodes.
unsigned int elem_idx() const
Returns index of element in Mesh::element_vec_.
SideIter side(const unsigned int i) const
Gets side iterator of the i -th side.
Range< Edge > edge_range() const
Returns range of edges.