/**
* Transform the point @p p on the real cell to the corresponding point on
- * the unit cell @p cell by a Newton iteration.
+ * the unit cell @p cell by a Newton iteration. @p starting_guess is
+ * a guess for the position on the unit cell at which this function will
+ * start its Newton iteration.
*
* Takes a reference to an @p InternalData that is assumed to be previously
* created by the @p get_data function with @p UpdateFlags including @p
* update_transformation_values and @p update_transformation_gradients and a
* one point Quadrature that includes the given initial guess specified
- * through the given @p point_quadrature object.
+ * through the given @p starting_guess.
*
* @p mdata will be changed by this function.
*/
do_transform_real_to_unit_cell(
const typename Triangulation<dim, spacedim>::cell_iterator &cell,
const Point<spacedim> &p,
- Quadrature<dim> &point_quadrature,
- InternalData &mdata) const;
+ const Point<dim> &starting_guess,
+ InternalData &mdata) const;
/**
* Update internal degrees of freedom.
initial_p_unit = cell->reference_cell().closest_point(initial_p_unit);
- Quadrature<dim> point_quadrature(initial_p_unit);
-
UpdateFlags update_flags = update_quadrature_points | update_jacobians;
if (spacedim > dim)
update_flags |= update_jacobian_grads;
std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> mdata(
- get_data(update_flags, point_quadrature));
+ get_data(update_flags, Quadrature<dim>(initial_p_unit)));
Assert(dynamic_cast<InternalData *>(mdata.get()) != nullptr,
ExcInternalError());
return do_transform_real_to_unit_cell(cell,
p,
- point_quadrature,
+ initial_p_unit,
static_cast<InternalData &>(*mdata));
}
MappingFEField<dim, spacedim, VectorType>::do_transform_real_to_unit_cell(
const typename Triangulation<dim, spacedim>::cell_iterator &cell,
const Point<spacedim> &p,
- Quadrature<dim> &point_quadrature,
+ const Point<dim> &starting_guess,
InternalData &mdata) const
{
const unsigned int n_shapes = mdata.shape_values.size();
// of the mapping at this point are
// previously computed.
- AssertDimension(point_quadrature.size(), 1);
- Point<dim> p_unit = point_quadrature.point(0);
+ Point<dim> p_unit = starting_guess;
Point<dim> f;
- mdata.reinit(mdata.update_each, point_quadrature);
+ mdata.reinit(mdata.update_each, Quadrature<dim>(starting_guess));
Point<spacedim> p_real(do_transform_unit_to_real_cell(mdata));
Tensor<1, spacedim> p_minus_F = p - p_real;
p_unit_trial[i] -= step_length * delta[i];
// shape values and derivatives
// at new p_unit point
- point_quadrature.initialize(
- ArrayView<const Point<dim>>(&p_unit_trial, 1));
- mdata.reinit(mdata.update_each, point_quadrature);
+ mdata.reinit(mdata.update_each, Quadrature<dim>(p_unit_trial));
// f(x)
- Point<spacedim> p_real_trial = do_transform_unit_to_real_cell(mdata);
+ const Point<spacedim> p_real_trial =
+ do_transform_unit_to_real_cell(mdata);
const Tensor<1, spacedim> f_trial = p - p_real_trial;
// see if we are making progress with the current step length
// and if not, reduce it by a factor of two and try again