*/
template <typename Number>
using ComparisonFunction =
- std::function<bool(const typename identity<Number>::type &,
- const typename identity<Number>::type &)>;
+ std::function<bool(const Number &, const Number &)>;
/**
* @name Setting p-adaptivity flags
const Vector<Number> & criteria,
const Number p_refine_threshold,
const Number p_coarsen_threshold,
- const ComparisonFunction<Number> &compare_refine = std::greater<Number>(),
- const ComparisonFunction<Number> &compare_coarsen = std::less<Number>());
+ const ComparisonFunction<typename identity<Number>::type>
+ &compare_refine = std::greater<Number>(),
+ const ComparisonFunction<typename identity<Number>::type>
+ &compare_coarsen = std::less<Number>());
/**
* Adapt which finite element to use on cells whose criteria meet a certain
const Vector<Number> & criteria,
const double p_refine_fraction = 0.5,
const double p_coarsen_fraction = 0.5,
- const ComparisonFunction<Number> &compare_refine = std::greater<Number>(),
- const ComparisonFunction<Number> &compare_coarsen = std::less<Number>());
+ const ComparisonFunction<typename identity<Number>::type>
+ &compare_refine = std::greater<Number>(),
+ const ComparisonFunction<typename identity<Number>::type>
+ &compare_coarsen = std::less<Number>());
/**
* Adapt which finite element to use on cells based on the regularity of the
template <int dim, typename Number, int spacedim>
void
p_adaptivity_from_reference(
- const hp::DoFHandler<dim, spacedim> &dof_handler,
- const Vector<Number> & criteria,
- const Vector<Number> & references,
- const ComparisonFunction<Number> & compare_refine,
- const ComparisonFunction<Number> & compare_coarsen);
+ const hp::DoFHandler<dim, spacedim> & dof_handler,
+ const Vector<Number> & criteria,
+ const Vector<Number> & references,
+ const ComparisonFunction<typename identity<Number>::type> &compare_refine,
+ const ComparisonFunction<typename identity<Number>::type>
+ &compare_coarsen);
/**
* @}
*/
const Vector<Number> & criteria,
const Number p_refine_threshold,
const Number p_coarsen_threshold,
- const ComparisonFunction<Number> & compare_refine,
- const ComparisonFunction<Number> & compare_coarsen)
+ const ComparisonFunction<typename identity<Number>::type> &compare_refine,
+ const ComparisonFunction<typename identity<Number>::type>
+ &compare_coarsen)
{
AssertDimension(dof_handler.get_triangulation().n_active_cells(),
criteria.size());
const Vector<Number> & criteria,
const double p_refine_fraction,
const double p_coarsen_fraction,
- const ComparisonFunction<Number> & compare_refine,
- const ComparisonFunction<Number> & compare_coarsen)
+ const ComparisonFunction<typename identity<Number>::type> &compare_refine,
+ const ComparisonFunction<typename identity<Number>::type>
+ &compare_coarsen)
{
AssertDimension(dof_handler.get_triangulation().n_active_cells(),
criteria.size());
template <int dim, typename Number, int spacedim>
void
p_adaptivity_from_reference(
- const hp::DoFHandler<dim, spacedim> &dof_handler,
- const Vector<Number> & criteria,
- const Vector<Number> & references,
- const ComparisonFunction<Number> & compare_refine,
- const ComparisonFunction<Number> & compare_coarsen)
+ const hp::DoFHandler<dim, spacedim> & dof_handler,
+ const Vector<Number> & criteria,
+ const Vector<Number> & references,
+ const ComparisonFunction<typename identity<Number>::type> &compare_refine,
+ const ComparisonFunction<typename identity<Number>::type>
+ &compare_coarsen)
{
AssertDimension(dof_handler.get_triangulation().n_active_cells(),
criteria.size());
const Vector<S> &,
const S,
const S,
- const std::function<bool(const S &, const S &)> &,
- const std::function<bool(const S &, const S &)> &);
+ const ComparisonFunction<typename identity<S>::type> &,
+ const ComparisonFunction<typename identity<S>::type> &);
template void
p_adaptivity_from_relative_threshold<deal_II_dimension,
const Vector<S> &,
const double,
const double,
- const std::function<bool(const S &, const S &)> &,
- const std::function<bool(const S &, const S &)> &);
+ const ComparisonFunction<typename identity<S>::type> &,
+ const ComparisonFunction<typename identity<S>::type> &);
template void
p_adaptivity_from_regularity<deal_II_dimension,
const hp::DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
const Vector<S> &,
const Vector<S> &,
- const std::function<bool(const S &, const S &)> &,
- const std::function<bool(const S &, const S &)> &);
+ const ComparisonFunction<typename identity<S>::type> &,
+ const ComparisonFunction<typename identity<S>::type> &);
template void
predict_error<deal_II_dimension, S, deal_II_space_dimension>(