38 n_duplicated_nodes_(0)
62 for (
unsigned int i=0; i<
edge.side(0)->dim()+1; ++i)
63 obj.
nodes[i] =
edge.side(0)->node(i).idx();
76 for (
unsigned int i=0; i<ele->dim()+1; i++)
77 l.
nodes[i] = ele->node_idx(i);
79 for (
unsigned int i=0; i<ele->dim()+1; i++)
108 while (node_elements.size() > 0)
111 std::queue<unsigned int> q;
112 q.push(*node_elements.begin());
113 node_elements.erase(node_elements.begin());
114 std::set<unsigned int> component;
115 while (q.size() > 0) {
117 component.insert(elem.idx());
119 for (
unsigned int sid=0; sid<elem->n_sides(); ++sid) {
120 auto side = elem.
side(sid);
121 for (
unsigned int esid=0; esid < side->edge().n_sides(); ++esid) {
123 if (adj_el_idx != elem.idx())
125 auto it = std::find(node_elements.begin(), node_elements.end(), adj_el_idx);
126 if (
it != node_elements.end()) {
127 node_elements.erase(
it);
135 components.push_back(component);
141 if (components.size() > 0) {
143 components.erase(components.begin());
145 for (
auto component : components) {
148 for (
auto el_idx : component) {
153 for (
unsigned int i=0; i<el_dim+1; i++)
154 if (elem->
nodes[i] == n.idx())
155 elem->
nodes[i] = new_nid;
156 for (
unsigned int fi=0; fi<el_dim+1; fi++)
157 for (
unsigned int ni=0; ni<el_dim; ni++)
158 if (
objects_[el_dim-1][elem->
faces[fi]].nodes[ni] == n.idx())
std::vector< unsigned int > obj_4_el_
unsigned int n_duplicated_nodes_
Number of nodes (including duplicated ones).
void duplicate_nodes()
Duplicate nodes that are lying on interfaces with fractures.
void init_nodes()
Initialize the vector of nodes from mesh.
std::vector< unsigned int > node_dim_
Vector of space dimensions of elements using the particular duplicated node.
MeshBase * mesh_
The mesh object.
std::vector< unsigned int > obj_4_edg_
Vector of object indices for each mesh edge.
void init_from_elements()
Initialize objects from mesh elements.
void init_from_edges()
Initialize objects from mesh edges.
DuplicateNodes(MeshBase *mesh)
std::vector< MeshObject > objects_[4]
Array of n-faces by their dimension.
SideIter side(const unsigned int i) const
Gets side iterator of the i -th side.
SideIter side(const unsigned int loc_index)
Base class for Mesh and BCMesh.
Range< Edge > edge_range() const
Return range of edges.
unsigned int n_nodes() const
vector< vector< unsigned int > > const & node_elements()
Range< ElementAccessor< 3 > > elements_range() const
Returns range of mesh elements.
Range< NodeAccessor< 3 > > node_range() const
Returns range of nodes.
ElementAccessor< 3 > element_accessor(unsigned int idx) const
Create and return ElementAccessor to element of given idx.
MeshObject(unsigned int dim)
unsigned int faces[4]
Indices of (dim-1)-dimensional faces within the global vector of objects with given dimension.
unsigned int nodes[4]
Indices of nodes.
unsigned int elem_idx() const
Returns index of element in Mesh::element_vec_.
Edge edge() const
Returns pointer to the edge connected to the side.
#define END_TIMER(tag)
Ends a timer with specified tag.
#define START_TIMER(tag)
Starts a timer with specified tag.