* The function that runs on the thread.
*/
static
- void thread_entry_point (const std::function<RT ()> function,
+ void thread_entry_point (const std::function<RT ()> &function,
std::shared_ptr<return_value<RT> > ret_val)
{
// call the function in question. since an exception that is
* evolve_one_time_step returns the time at the end of the time step.
*/
virtual double evolve_one_time_step
- (std::function<VectorType (const double, const VectorType &)> f,
- std::function<VectorType (const double, const double, const VectorType &)> id_minus_tau_J_inverse,
+ (const std::function<VectorType (const double, const VectorType &)> &f,
+ const std::function<VectorType (const double, const double, const VectorType &)> &id_minus_tau_J_inverse,
double t,
double delta_t,
VectorType &y) = 0;
* end of the time step.
*/
double evolve_one_time_step
- (std::function<VectorType (const double, const VectorType &)> f,
- std::function<VectorType (const double, const double, const VectorType &)> id_minus_tau_J_inverse,
+ (const std::function<VectorType (const double, const VectorType &)> &f,
+ const std::function<VectorType (const double, const double, const VectorType &)> &id_minus_tau_J_inverse,
double t,
double delta_t,
VectorType &y);
* step.
*/
double evolve_one_time_step
- (std::function<VectorType (const double, const VectorType &)> f,
+ (const std::function<VectorType (const double, const VectorType &)> &f,
double t,
double delta_t,
VectorType &y);
* Compute the different stages needed.
*/
void compute_stages
- (std::function<VectorType (const double, const VectorType &)> f,
+ (const std::function<VectorType (const double, const VectorType &)> &f,
const double t,
const double delta_t,
const VectorType &y,
* returns the time at the end of the time step.
*/
double evolve_one_time_step
- (std::function<VectorType (const double, const VectorType &)> f,
- std::function<VectorType (const double, const double, const VectorType &)> id_minus_tau_J_inverse,
- double t,
- double delta_t,
- VectorType &y);
+ (const std::function<VectorType (const double, const VectorType &)> &f,
+ const std::function<VectorType (const double, const double, const VectorType &)> &id_minus_tau_J_inverse,
+ double t,
+ double delta_t,
+ VectorType &y);
/**
* Set the maximum number of iterations and the tolerance used by the
* Compute the different stages needed.
*/
void compute_stages
- (std::function<VectorType (const double, const VectorType &)> f,
- std::function<VectorType (const double, const double, const VectorType &)> id_minus_tau_J_inverse,
- double t,
- double delta_t,
- VectorType &y,
+ (const std::function<VectorType (const double, const VectorType &)> &f,
+ const std::function<VectorType (const double, const double, const VectorType &)> &id_minus_tau_J_inverse,
+ double t,
+ double delta_t,
+ VectorType &y,
std::vector<VectorType> &f_stages);
/**
* Newton solver used for the implicit stages.
*/
- void newton_solve(std::function<void (const VectorType &,VectorType &)> get_residual,
- std::function<VectorType (const VectorType &)> id_minus_tau_J_inverse,
- VectorType &y);
+ void newton_solve(const std::function<void (const VectorType &,VectorType &)> &get_residual,
+ const std::function<VectorType (const VectorType &)> &id_minus_tau_J_inverse,
+ VectorType &y);
/**
* Compute the residual needed by the Newton solver.
*/
- void compute_residual(std::function<VectorType (const double, const VectorType &)> f,
- double t,
- double delta_t,
- const VectorType &new_y,
- const VectorType &y,
- VectorType &tendency,
- VectorType &residual) const;
+ void compute_residual(const std::function<VectorType (const double, const VectorType &)> &f,
+ double t,
+ double delta_t,
+ const VectorType &new_y,
+ const VectorType &y,
+ VectorType &tendency,
+ VectorType &residual) const;
/**
* When using SDIRK, there is no need to compute the linear combination of
* at the end of the time step.
*/
double evolve_one_time_step
- (std::function<VectorType (const double, const VectorType &)> f,
- std::function<VectorType (const double, const double, const VectorType &)> id_minus_tau_J_inverse,
+ (const std::function<VectorType (const double, const VectorType &)> &f,
+ const std::function<VectorType (const double, const double, const VectorType &)> &id_minus_tau_J_inverse,
double t,
double delta_t,
VectorType &y);
* step.
*/
double evolve_one_time_step
- (std::function<VectorType (const double, const VectorType &)> f,
+ (const std::function<VectorType (const double, const VectorType &)> &f,
double t,
double delta_t,
VectorType &y);
/**
* Compute the different stages needed.
*/
- void compute_stages(std::function<VectorType (const double, const VectorType &)> f,
+ void compute_stages(const std::function<VectorType (const double, const VectorType &)> &f,
const double t,
const double delta_t,
const VectorType &y,
template <typename VectorType>
double ExplicitRungeKutta<VectorType>::evolve_one_time_step
- (std::function<VectorType (const double, const VectorType &)> f,
- std::function<VectorType (const double, const double, const VectorType &)> /*id_minus_tau_J_inverse*/,
+ (const std::function<VectorType (const double, const VectorType &)> &f,
+ const std::function<VectorType (const double, const double, const VectorType &)> &/*id_minus_tau_J_inverse*/,
double t,
double delta_t,
VectorType &y)
template <typename VectorType>
double ExplicitRungeKutta<VectorType>::evolve_one_time_step
- (std::function<VectorType (const double, const VectorType &)> f,
+ (const std::function<VectorType (const double, const VectorType &)> &f,
double t,
double delta_t,
VectorType &y)
template <typename VectorType>
void ExplicitRungeKutta<VectorType>::compute_stages
- (std::function<VectorType (const double, const VectorType &)> f,
+ (const std::function<VectorType (const double, const VectorType &)> &f,
const double t,
const double delta_t,
const VectorType &y,
template <typename VectorType>
double ImplicitRungeKutta<VectorType>::evolve_one_time_step
- (std::function<VectorType (const double, const VectorType &)> f,
- std::function<VectorType (const double, const double, const VectorType &)> id_minus_tau_J_inverse,
+ (const std::function<VectorType (const double, const VectorType &)> &f,
+ const std::function<VectorType (const double, const double, const VectorType &)> &id_minus_tau_J_inverse,
double t,
double delta_t,
VectorType &y)
template <typename VectorType>
void ImplicitRungeKutta<VectorType>::compute_stages(
- std::function<VectorType (const double, const VectorType &)> f,
- std::function<VectorType (const double, const double, const VectorType &)> id_minus_tau_J_inverse,
+ const std::function<VectorType (const double, const VectorType &)> &f,
+ const std::function<VectorType (const double, const double, const VectorType &)> &id_minus_tau_J_inverse,
double t,
double delta_t,
VectorType &y,
template <typename VectorType>
void ImplicitRungeKutta<VectorType>::newton_solve(
- std::function<void (const VectorType &,VectorType &)> get_residual,
- std::function<VectorType (const VectorType &)> id_minus_tau_J_inverse,
+ const std::function<void (const VectorType &,VectorType &)> &get_residual,
+ const std::function<VectorType (const VectorType &)> &id_minus_tau_J_inverse,
VectorType &y)
{
VectorType residual(y);
template <typename VectorType>
void ImplicitRungeKutta<VectorType>::compute_residual
- (std::function<VectorType (const double, const VectorType &)> f,
+ (const std::function<VectorType (const double, const VectorType &)> &f,
double t,
double delta_t,
const VectorType &old_y,
template <typename VectorType>
double EmbeddedExplicitRungeKutta<VectorType>::evolve_one_time_step(
- std::function<VectorType (const double, const VectorType &)> f,
- std::function<VectorType (const double, const double, const VectorType &)> /*id_minus_tau_J_inverse*/,
+ const std::function<VectorType (const double, const VectorType &)> &f,
+ const std::function<VectorType (const double, const double, const VectorType &)> &/*id_minus_tau_J_inverse*/,
double t,
double delta_t,
VectorType &y)
template <typename VectorType>
double EmbeddedExplicitRungeKutta<VectorType>::evolve_one_time_step(
- std::function<VectorType (const double, const VectorType &)> f,
+ const std::function<VectorType (const double, const VectorType &)> &f,
double t, double delta_t, VectorType &y)
{
bool done = false;
template <typename VectorType>
void EmbeddedExplicitRungeKutta<VectorType>::compute_stages(
- std::function<VectorType (const double, const VectorType &)> f,
+ const std::function<VectorType (const double, const VectorType &)> &f,
const double t,
const double delta_t,
const VectorType &y,
template <typename DataType, typename MeshType>
void
exchange_cell_data_to_ghosts (const MeshType &mesh,
- std::function<boost::optional<DataType> (const typename MeshType::active_cell_iterator &)> pack,
- std::function<void (const typename MeshType::active_cell_iterator &, const DataType &)> unpack);
+ const std::function<boost::optional<DataType> (const typename MeshType::active_cell_iterator &)> &pack,
+ const std::function<void (const typename MeshType::active_cell_iterator &, const DataType &)> &unpack);
}
template <typename DataType, typename MeshType>
void
exchange_cell_data_to_ghosts (const MeshType &mesh,
- std::function<boost::optional<DataType> (const typename MeshType::active_cell_iterator &)> pack,
- std::function<void (const typename MeshType::active_cell_iterator &, const DataType &)> unpack)
+ const std::function<boost::optional<DataType> (const typename MeshType::active_cell_iterator &)> &pack,
+ const std::function<void (const typename MeshType::active_cell_iterator &, const DataType &)> &unpack)
{
#ifndef DEAL_II_WITH_MPI
(void)mesh;
const DoFHandler<dim,spacedim> &dof,
const ConstraintMatrix &constraints,
const Quadrature<dim> &quadrature,
- const std::function< typename VectorType::value_type (const typename DoFHandler<dim, spacedim>::active_cell_iterator &, const unsigned int)> func,
+ const std::function< typename VectorType::value_type (const typename DoFHandler<dim, spacedim>::active_cell_iterator &, const unsigned int)> &func,
VectorType &vec_result);
/**
void project (std::shared_ptr<const MatrixFree<dim,typename VectorType::value_type> > data,
const ConstraintMatrix &constraints,
const unsigned int n_q_points_1d,
- const std::function< VectorizedArray<typename VectorType::value_type> (const unsigned int, const unsigned int)> func,
+ const std::function< VectorizedArray<typename VectorType::value_type> (const unsigned int, const unsigned int)> &func,
VectorType &vec_result);
/**
template <int dim, typename VectorType>
void project (std::shared_ptr<const MatrixFree<dim,typename VectorType::value_type> > data,
const ConstraintMatrix &constraints,
- const std::function< VectorizedArray<typename VectorType::value_type> (const unsigned int, const unsigned int)> func,
+ const std::function< VectorizedArray<typename VectorType::value_type> (const unsigned int, const unsigned int)> &func,
VectorType &vec_result);
/**
const DoFHandler<dim,spacedim> &dof,
const ConstraintMatrix &constraints,
const Quadrature<dim> &quadrature,
- const std::function< typename VectorType::value_type (const typename DoFHandler<dim, spacedim>::active_cell_iterator &, const unsigned int)> func,
+ const std::function< typename VectorType::value_type (const typename DoFHandler<dim, spacedim>::active_cell_iterator &, const unsigned int)> &func,
VectorType &vec_result)
{
typedef typename VectorType::value_type Number;
template <int dim, typename VectorType, int spacedim, int fe_degree, int n_q_points_1d>
void project_parallel (std::shared_ptr<const MatrixFree<dim,typename VectorType::value_type> > matrix_free,
const ConstraintMatrix &constraints,
- const std::function< VectorizedArray<typename VectorType::value_type> (const unsigned int, const unsigned int)> func,
+ const std::function< VectorizedArray<typename VectorType::value_type> (const unsigned int, const unsigned int)> &func,
VectorType &vec_result)
{
const DoFHandler<dim,spacedim> &dof = matrix_free->get_dof_handler();
const DoFHandler<dim,spacedim> &dof,
const ConstraintMatrix &constraints,
const Quadrature<dim> &quadrature,
- const std::function< typename VectorType::value_type (const typename DoFHandler<dim, spacedim>::active_cell_iterator &, const unsigned int)> func,
+ const std::function< typename VectorType::value_type (const typename DoFHandler<dim, spacedim>::active_cell_iterator &, const unsigned int)> &func,
VectorType &vec_result)
{
switch (dof.get_fe().degree)
void project (std::shared_ptr<const MatrixFree<dim,typename VectorType::value_type> > matrix_free,
const ConstraintMatrix &constraints,
const unsigned int n_q_points_1d,
- const std::function< VectorizedArray<typename VectorType::value_type> (const unsigned int, const unsigned int)> func,
+ const std::function< VectorizedArray<typename VectorType::value_type> (const unsigned int, const unsigned int)> &func,
VectorType &vec_result)
{
(void) n_q_points_1d;
template <int dim, typename VectorType>
void project (std::shared_ptr<const MatrixFree<dim,typename VectorType::value_type> > matrix_free,
const ConstraintMatrix &constraints,
- const std::function< VectorizedArray<typename VectorType::value_type> (const unsigned int, const unsigned int)> func,
+ const std::function< VectorizedArray<typename VectorType::value_type> (const unsigned int, const unsigned int)> &func,
VectorType &vec_result)
{
project (matrix_free,
const DoFHandler<deal_II_dimension,deal_II_dimension> &,
const ConstraintMatrix &,
const Quadrature<deal_II_dimension> &,
- const std::function<VEC::value_type (const DoFHandler<deal_II_dimension, deal_II_dimension>::active_cell_iterator &, const unsigned int)>,
+ const std::function<VEC::value_type (const DoFHandler<deal_II_dimension, deal_II_dimension>::active_cell_iterator &, const unsigned int)> &,
VEC &);
\}
void project<deal_II_dimension, VEC>(
std::shared_ptr<const MatrixFree<deal_II_dimension,VEC::value_type> > matrix_free,
const ConstraintMatrix &constraints,
- const std::function< VectorizedArray<VEC::value_type> (const unsigned int, const unsigned int)>,
+ const std::function< VectorizedArray<VEC::value_type> (const unsigned int, const unsigned int)> &,
VEC &);
template
std::shared_ptr<const MatrixFree<deal_II_dimension,VEC::value_type> > matrix_free,
const ConstraintMatrix &constraints,
const unsigned int,
- const std::function< VectorizedArray<VEC::value_type> (const unsigned int, const unsigned int)>,
+ const std::function< VectorizedArray<VEC::value_type> (const unsigned int, const unsigned int)> &,
VEC &);
\}