Table<2,double> support_point_weights_on_hex;
/**
- * An interface that derived classes have to implement and that
- * computes the locations of support points for the mapping. For
- * example, for MappingQ1 these are the vertices. However, other
+ * Return the locations of support points for the mapping. For
+ * example, for $Q_1$ mappings these are the vertices, and for higher
+ * order polynomial mappings they are the vertices plus interior
+ * points on edges, faces, and the cell interior that are placed
+ * in consultation with the Manifold description of the domain and
+ * its boundary. However, other
* classes may override this function differently. In particular,
* the MappingQ1Eulerian class does exactly this by not computing
* the support points from the geometry of the current cell but
* the locations of interior points.
*/
virtual
- void
- compute_mapping_support_points (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
- std::vector<Point<spacedim> > &a) const;
+ std::vector<Point<spacedim> >
+ compute_mapping_support_points (const typename Triangulation<dim,spacedim>::cell_iterator &cell) const;
/**
* Transforms the point @p p on the real cell to the corresponding point on
(const typename Triangulation<dim,spacedim>::cell_iterator &cell) const
{
// get the vertices as the first 2^dim mapping support points
- std::vector<Point<spacedim> > a;
- compute_mapping_support_points(cell, a);
+ const std::vector<Point<spacedim> > a = compute_mapping_support_points(cell);
std_cxx11::array<Point<spacedim>, GeometryInfo<dim>::vertices_per_cell> vertex_locations;
std::copy (a.begin(),
template <int dim, class EulerVectorType, int spacedim>
-void
+std::vector<Point<spacedim> >
MappingQEulerian<dim, EulerVectorType, spacedim>::
-compute_mapping_support_points (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
- std::vector<Point<spacedim> > &a) const
+compute_mapping_support_points (const typename Triangulation<dim,spacedim>::cell_iterator &cell) const
{
// first, basic assertion with respect to vector size,
// and finally compute the positions of the support points in the deformed
// configuration.
- a.resize(n_support_pts);
+ std::vector<Point<spacedim> > a(n_support_pts);
for (unsigned int q=0; q<n_support_pts; ++q)
{
a[q] = fe_values.quadrature_point(q);
for (unsigned int d=0; d<spacedim; ++d)
a[q](d) += shift_vector[q](d);
}
+
+ return a;
}
FiniteElementData<dim> (get_dpo_vector<dim>(polynomial_degree), 1,
polynomial_degree)));
- std::vector<Point<spacedim> > support_points (tensor_pols.n());
- this->compute_mapping_support_points(cell, support_points);
+ const std::vector<Point<spacedim> > support_points
+ = this->compute_mapping_support_points(cell);
Point<spacedim> mapped_point;
for (unsigned int i=0; i<tensor_pols.n(); ++i)
std_cxx11::unique_ptr<InternalData> mdata (get_data(update_flags,
point_quadrature));
- this->compute_mapping_support_points (cell, mdata->mapping_support_points);
+ mdata->mapping_support_points = this->compute_mapping_support_points (cell);
// dispatch to the various specializations for spacedim=dim,
// spacedim=dim+1, etc
std_cxx11::unique_ptr<InternalData> mdata (get_data(update_flags,
point_quadrature));
- this->compute_mapping_support_points (cell, mdata->mapping_support_points);
+ mdata->mapping_support_points = this->compute_mapping_support_points (cell);
// dispatch to the various specializations for spacedim=dim,
// spacedim=dim+1, etc
std_cxx11::unique_ptr<InternalData> mdata (get_data(update_flags,
point_quadrature));
- this->compute_mapping_support_points (cell, mdata->mapping_support_points);
+ mdata->mapping_support_points = this->compute_mapping_support_points (cell);
// dispatch to the various specializations for spacedim=dim,
// spacedim=dim+1, etc
std_cxx11::unique_ptr<InternalData> mdata (get_data(update_flags,
point_quadrature));
- this->compute_mapping_support_points (cell, mdata->mapping_support_points);
+ mdata->mapping_support_points = this->compute_mapping_support_points (cell);
// dispatch to the various specializations for spacedim=dim,
// spacedim=dim+1, etc
std_cxx11::unique_ptr<InternalData> mdata (get_data(update_flags,
point_quadrature));
- this->compute_mapping_support_points (cell, mdata->mapping_support_points);
+ mdata->mapping_support_points = this->compute_mapping_support_points (cell);
// dispatch to the various specializations for spacedim=dim,
// spacedim=dim+1, etc
// Find the initial value for the Newton iteration by a normal
// projection to the least square plane determined by the vertices
// of the cell
- std::vector<Point<spacedim> > a;
- this->compute_mapping_support_points (cell,a);
+ const std::vector<Point<spacedim> > a
+ = this->compute_mapping_support_points (cell);
Assert(a.size() == GeometryInfo<dim>::vertices_per_cell,
ExcInternalError());
initial_p_unit = internal::MappingQ1::transform_real_to_unit_cell_initial_guess<dim,spacedim>(a,p);
// we do this by first getting all support points, then
// throwing away all but the vertices, and finally calling
// the same function as above
- std::vector<Point<spacedim> > a;
- this->compute_mapping_support_points (cell,a);
+ std::vector<Point<spacedim> > a
+ = this->compute_mapping_support_points (cell);
a.resize(GeometryInfo<dim>::vertices_per_cell);
initial_p_unit = internal::MappingQ1::transform_real_to_unit_cell_initial_guess<dim,spacedim>(a,p);
}
||
(cell != data.cell_of_current_support_points))
{
- this->compute_mapping_support_points(cell, data.mapping_support_points);
+ data.mapping_support_points = this->compute_mapping_support_points(cell);
data.cell_of_current_support_points = cell;
}
||
(cell != data.cell_of_current_support_points))
{
- this->compute_mapping_support_points(cell, data.mapping_support_points);
+ data.mapping_support_points = this->compute_mapping_support_points(cell);
data.cell_of_current_support_points = cell;
}
||
(cell != data.cell_of_current_support_points))
{
- this->compute_mapping_support_points(cell, data.mapping_support_points);
+ data.mapping_support_points = this->compute_mapping_support_points(cell);
data.cell_of_current_support_points = cell;
}
template<int dim, int spacedim>
-void
+std::vector<Point<spacedim> >
MappingQGeneric<dim,spacedim>::
-compute_mapping_support_points(const typename Triangulation<dim,spacedim>::cell_iterator &cell,
- std::vector<Point<spacedim> > &a) const
+compute_mapping_support_points(const typename Triangulation<dim,spacedim>::cell_iterator &cell) const
{
// get the vertices first
- a.resize(GeometryInfo<dim>::vertices_per_cell);
+ std::vector<Point<spacedim> > a(GeometryInfo<dim>::vertices_per_cell);
for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
a[i] = cell->vertex(i);
Assert(false, ExcNotImplemented());
break;
}
+
+ return a;
}