* {
* double length = std::numeric_limits<double>::max();
* for (const auto &cell : tria.active_cell_iterators())
- * for (unsigned int n = 0; n < GeometryInfo<dim>::lines_per_cell; ++n)
+ * for (const auto n : cell->line_indices())
* length = std::min(length, (cell->line(n)->vertex(0) -
* cell->line(n)->vertex(1)).norm());
* return length;
* @endcode
*
* This will merge any vertices that are closer than any pair of vertices on
- * the input meshes.
+ * the input meshes. If the tolerance is set to zero, vertices are not merged.
*
* @note The two input triangulations must be
* @ref GlossCoarseMesh "coarse meshes",
* vertices.
*
* Two vertices are considered equal if their difference in each coordinate
- * direction is less than @p tol.
+ * direction is less than @p tol. This implies that nothing happens if
+ * the tolerance is set to zero.
*/
template <int dim, int spacedim>
void
GridTools::consistently_order_cells(cells);
result.clear();
result.create_triangulation(vertices, cells, subcell_data);
+
+ Assert(duplicated_vertex_tolerance > 0.0 ||
+ n_accumulated_vertices == result.n_vertices(),
+ ExcInternalError());
}
std::vector<unsigned int> & considered_vertices,
const double tol)
{
+ if (tol == 0.0)
+ return; // nothing to do per definition
+
AssertIndexRange(2, vertices.size());
std::vector<unsigned int> new_vertex_numbers(vertices.size());
std::iota(new_vertex_numbers.begin(), new_vertex_numbers.end(), 0);