if (dim == spacedim)
{
// triangulation.vertices[next_unused_vertex] = new_point;
- triangulation.vertices[next_unused_vertex] =
- cell->get_manifold().get_new_point
- (Manifolds::get_default_quadrature(cell));
+ triangulation.vertices[next_unused_vertex] = cell->center(true);
// if the user_flag is set, i.e. if the
// cell is at the boundary, use a
// user flag is set or not
cell->clear_user_flag();
-
-
// An assert to make sure that the static_cast in the
// next line has the chance to give reasonable
// results.
// new vertex is placed on the surface according to
// the information stored in the boundary class
- const Manifold<dim,spacedim> &manifold = cell->get_manifold();
-
triangulation.vertices[next_unused_vertex] =
- manifold.get_new_point_on_quad (cell);
+ cell->center(true);
}
}
Assert (next_unused_vertex < triangulation.vertices.size(),
ExcTooFewVerticesAllocated());
- // Now we always ask the manifold where to put the
- // new point. The get_manifold function will return
- // a flat boundary if invalid_manifold_id is set,
- // behaving as before in the flat case. Backward
- // compatibility requires us to use the material id
- // of the cell in the codimension one case, however
- // we only do this if the manifold_id is the invalid
- // one, otherwise use the material id. This is done
- // internally in the get_manifold() function.
+ // Now we always ask the cell itself where to put
+ // the new point. The cell in turn will query the
+ // maifold object internally.
triangulation.vertices[next_unused_vertex] =
- cell->get_manifold().get_new_point_on_line(cell);
+ cell->center(true);
+
triangulation.vertices_used[next_unused_vertex] = true;
// search for next two unused cell (++ takes care of
// lines we can compute the midpoint as the mean
// of the two vertices: if (line->at_boundary())
triangulation.vertices[next_unused_vertex]
- = line->get_manifold().get_new_point_on_line (line);
+ = line->center(true);
}
else
// however, if spacedim>dim, we always have to ask
= triangulation.get_manifold(line->user_index()).get_new_point_on_line (line);
else
triangulation.vertices[next_unused_vertex]
- = line->get_manifold().get_new_point_on_line (line);
+ = line->center(true);
// now that we created the right point, make up the
// two child lines. To this end, find a pair of
triangulation.vertices_used[next_unused_vertex] = true;
triangulation.vertices[next_unused_vertex]
- = line->get_manifold().get_new_point_on_line (line);
+ = line->center(true);
// now that we created the right point, make up the
// two child lines (++ takes care of the end of the
// of the domain, so we need not care
// about boundary quads here
triangulation.vertices[next_unused_vertex]
- = middle_line->get_manifold().get_new_point_on_line(middle_line);
+ = middle_line->center(true);
triangulation.vertices_used[next_unused_vertex] = true;
// now search a slot for the two
if (quad->at_boundary() ||
(quad->manifold_id() != numbers::invalid_manifold_id) )
triangulation.vertices[next_unused_vertex]
- = quad->get_manifold().get_new_point_on_quad (quad);
+ = quad->center(true);
else
{
// it might be that the quad itself is not at
// the @p{MappingQ::set_laplace_on_vector}
// function
triangulation.vertices[next_unused_vertex] =
- quad->get_manifold().get_new_point
- (Manifolds::get_default_quadrature(quad, true));
+ quad->center(true, true);
}
triangulation.vertices_used[next_unused_vertex] = true;
// now that we created the right point, make up
triangulation.vertices_used[next_unused_vertex] = true;
// the new vertex is definitely in the interior,
- // so we need not worry about the boundary. let
- // it be the average of the 26 vertices
- // surrounding it. weight these vertices in the
- // same way as they are weighted in the
- // @p{MappingQ::set_laplace_on_hex_vector}
- // function, and like the new vertex at the
- // center of the quad is weighted (see above)
-
+ // so we need not worry about the
+ // boundary. However we need to worry about
+ // Manifolds. Let the cell compute its own
+ // center, by querying the underlying manifold
+ // object.
triangulation.vertices[next_unused_vertex] =
- hex->get_manifold().get_new_point_on_hex(hex);
+ hex->center(true, true);
// set the data of the six lines. first collect
// the indices of the seven vertices (consider
// the new point on the boundary would be this
// one.
const Point<spacedim> new_bound
- = face->get_manifold().get_new_point_on_face (face);
+ = face->center(true);
// to check it, transform to the unit cell
// with Q1Mapping
const Point<dim> new_unit
return std::numeric_limits<double>::quiet_NaN();
}
+
template <int dim, int spacedim>
Point<spacedim> get_new_point_on_object(const TriaAccessor<1, dim, spacedim> &obj)
{
TriaIterator<TriaAccessor<3,dim,spacedim> > it(obj);
return obj.get_manifold().get_new_point_on_hex(it);
}
+
+ template <int structdim, int dim, int spacedim>
+ Point<spacedim> get_new_point_on_object(const TriaAccessor<structdim, dim, spacedim> &obj,
+ const bool use_laplace)
+ {
+ if (use_laplace == false)
+ return get_new_point_on_object(obj);
+ else
+ {
+ TriaRawIterator<TriaAccessor<structdim, dim, spacedim> > it(obj);
+ Quadrature<spacedim> quadrature = Manifolds::get_default_quadrature(it, use_laplace);
+ return obj.get_manifold().get_new_point(quadrature);
+ }
+ }
}
return p/GeometryInfo<structdim>::vertices_per_cell;
}
else
- {
- TriaRawIterator<TriaAccessor<structdim, dim, spacedim> > it(*this);
- Quadrature<spacedim> quadrature = Manifolds::get_default_quadrature(it, use_laplace);
- return this->get_manifold().get_new_point(quadrature);
- }
+ return get_new_point_on_object(*this, use_laplace);
}