const typename Triangulation<dim,spacedim>::line_iterator line = cell->line(line_no);
ps[0] = line->vertex(0);
ps[1] = line->vertex(1);
- a.push_back(line->get_manifold().get_new_point(ps,ws));
+ const Manifold<spacedim> &manifold =
+ ( dim != spacedim ? cell->get_boundary() : line->get_manifold());
+ a.push_back(manifold.get_new_point(ps,ws));
};
}
else
ps[0] = line->vertex(0);
ps[1] = line->vertex(1);
- get_intermediate_points (line->get_manifold(), ps, line_points);
+ const Manifold<spacedim> &manifold =
+ ( dim != spacedim ? cell->get_boundary() : line->get_manifold());
+
+ get_intermediate_points (manifold, ps, line_points);
if (dim==3)
{
ExcTooFewVerticesAllocated());
triangulation.vertices_used[next_unused_vertex] = true;
- // Ask the manifold
- // where to put the
- // new line
+ // Ask the manifold where to put the new point. To
+ // maintain backward compatibility, if the line does
+ // not have a manifold id, query the cell boundary
+ // instead
get_default_points_and_weights(sp, wp, line);
- triangulation.vertices[next_unused_vertex] =
- line->get_manifold().get_new_point(sp, wp);
-
+ if(dim < spacedim && line->manifold_id() == numbers::invalid_manifold_id)
+ triangulation.vertices[next_unused_vertex] =
+ triangulation.get_manifold(line->user_index()).get_new_point(sp, wp);
+ else
+ triangulation.vertices[next_unused_vertex] =
+ line->get_manifold().get_new_point(sp, wp);
// if (spacedim == dim)
// {
// this one.
get_default_points_and_weights(sp,wp,face);
const Point<spacedim> new_bound
- = face->get_boundary().get_new_point(sp,wp);
+ = face->get_manifold().get_new_point(sp,wp);
// triangulation.get_boundary(face->boundary_indicator())
// .get_new_point_on_face (face);
// to check it,
Triangulation<dim, spacedim>::set_boundary (const types::manifold_id m_number,
const Manifold<spacedim> &boundary_object)
{
- types::boundary_id number = static_cast<types::boundary_id>(m_number);
- Assert(number < numbers::internal_face_boundary_id,
- ExcIndexRange(number,0,numbers::internal_face_boundary_id));
-
- boundary[m_number] = &boundary_object;
+ set_manifold(m_number, boundary_object);
}
void
Triangulation<dim, spacedim>::set_boundary (const types::manifold_id m_number)
{
- types::boundary_id number = static_cast<types::boundary_id>(m_number);
- Assert(number < numbers::internal_face_boundary_id, ExcIndexRange(number,0,numbers::internal_face_boundary_id));
-
- //delete the entry located at number.
- boundary.erase(m_number);
+ set_manifold(m_number);
}
const Manifold<spacedim> &
Triangulation<dim, spacedim>::get_boundary (const types::manifold_id m_number) const
{
- //look, if there is a boundary stored at
- //boundary_id number.
- typename std::map<types::manifold_id,
- SmartPointer<const Manifold<spacedim>, Triangulation<dim, spacedim> > >::const_iterator it
- = boundary.find(m_number);
-
- if (it != boundary.end())
- {
- //if we have found an entry, return it
- return *(it->second);
- }
- else
- {
- //if we have not found an entry
- //connected with number, we return
- //straight_boundary
- return straight_boundary;
- }
+ return get_manifold(m_number);
}