Skip to content

Commit 896f7d2

Browse files
committed
insert_any_extra_boundary_points contiguously
This fixes Triangle unit tests on distributed meshes for me. ... which means we really ought to be finding whatever it is in our Triangle interface that doesn't support non-contiguous node numbering, but I couldn't find it on a quick glance, so "don't trigger the bug in my other code" is the best I can do right now.
1 parent e98bc0c commit 896f7d2

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/mesh/triangulator_interface.C

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ void TriangulatorInterface::insert_any_extra_boundary_points()
170170
const int n_interpolated = this->get_interpolate_boundary_points();
171171
if ((_triangulation_type==PSLG) && n_interpolated)
172172
{
173+
// If we were lucky enough to start with contiguous node ids,
174+
// let's keep them that way.
175+
dof_id_type nn = _mesh.max_node_id();
176+
173177
std::vector<std::pair<unsigned int, unsigned int>> old_segments =
174178
std::move(this->segments);
175179

@@ -195,7 +199,7 @@ void TriangulatorInterface::insert_any_extra_boundary_points()
195199
((n_interpolated-i) * *(Point *)(begin_node) +
196200
(i+1) * *(Point *)(end_node)) /
197201
(n_interpolated + 1);
198-
Node * next_node = _mesh.add_point(new_point);
202+
Node * next_node = _mesh.add_point(new_point, nn++);
199203
this->segments.emplace_back(current_id,
200204
next_node->id());
201205
current_id = next_node->id();

0 commit comments

Comments
 (0)