Skip to content

Commit

Permalink
Merge pull request #7060 from bangerth/brace-initializers
Browse files Browse the repository at this point in the history
Use brace initializers for default arguments.
  • Loading branch information
drwells committed Aug 14, 2018
2 parents 2f8387d + aacdd98 commit 465a996
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 55 deletions.
13 changes: 6 additions & 7 deletions include/deal.II/dofs/dof_tools.h
Expand Up @@ -1943,12 +1943,11 @@ namespace DoFTools
*/
template <int dim, int spacedim>
void
make_cell_patches(
SparsityPattern & block_list,
const DoFHandler<dim, spacedim> &dof_handler,
const unsigned int level,
const std::vector<bool> & selected_dofs = std::vector<bool>(),
const types::global_dof_index offset = 0);
make_cell_patches(SparsityPattern & block_list,
const DoFHandler<dim, spacedim> &dof_handler,
const unsigned int level,
const std::vector<bool> & selected_dofs = {},
const types::global_dof_index offset = 0);

/**
* Create an incidence matrix that for every vertex on a given level of a
Expand Down Expand Up @@ -2156,7 +2155,7 @@ namespace DoFTools
const DoFHandlerType & dof_handler,
std::vector<types::global_dof_index> &dofs_per_component,
const bool vector_valued_once = false,
std::vector<unsigned int> target_component = std::vector<unsigned int>());
std::vector<unsigned int> target_component = {});

/**
* Count the degrees of freedom in each block. This function is similar to
Expand Down
11 changes: 5 additions & 6 deletions include/deal.II/grid/grid_generator.h
Expand Up @@ -484,12 +484,11 @@ namespace GridGenerator
*/
template <int dim, int spacedim>
void
subdivided_parallelepiped(
Triangulation<dim, spacedim> & tria,
const Point<spacedim> & origin,
const std::array<Tensor<1, spacedim>, dim> &edges,
const std::vector<unsigned int> &subdivisions = std::vector<unsigned int>(),
const bool colorize = false);
subdivided_parallelepiped(Triangulation<dim, spacedim> & tria,
const Point<spacedim> & origin,
const std::array<Tensor<1, spacedim>, dim> &edges,
const std::vector<unsigned int> &subdivisions = {},
const bool colorize = false);

/**
* Hypercube with a layer of hypercubes around it. The first two parameters
Expand Down
43 changes: 20 additions & 23 deletions include/deal.II/grid/grid_tools.h
Expand Up @@ -889,10 +889,9 @@ namespace GridTools
*/
template <int dim, template <int, int> class MeshType, int spacedim>
unsigned int
find_closest_vertex(
const MeshType<dim, spacedim> &mesh,
const Point<spacedim> & p,
const std::vector<bool> & marked_vertices = std::vector<bool>());
find_closest_vertex(const MeshType<dim, spacedim> &mesh,
const Point<spacedim> & p,
const std::vector<bool> & marked_vertices = {});

/**
* Find and return the index of the used vertex (or marked vertex) in a
Expand Down Expand Up @@ -921,11 +920,10 @@ namespace GridTools
*/
template <int dim, template <int, int> class MeshType, int spacedim>
unsigned int
find_closest_vertex(
const Mapping<dim, spacedim> & mapping,
const MeshType<dim, spacedim> &mesh,
const Point<spacedim> & p,
const std::vector<bool> & marked_vertices = std::vector<bool>());
find_closest_vertex(const Mapping<dim, spacedim> & mapping,
const MeshType<dim, spacedim> &mesh,
const Point<spacedim> & p,
const std::vector<bool> & marked_vertices = {});


/**
Expand Down Expand Up @@ -992,13 +990,13 @@ namespace GridTools
# ifndef _MSC_VER
typename MeshType<dim, spacedim>::active_cell_iterator
# else
typename dealii::internal::
ActiveCellIterator<dim, spacedim, MeshType<dim, spacedim>>::type
typename dealii::internal::ActiveCellIterator<dim,
spacedim,
MeshType<dim, spacedim>>::type
# endif
find_active_cell_around_point(
const MeshType<dim, spacedim> &mesh,
const Point<spacedim> & p,
const std::vector<bool> & marked_vertices = std::vector<bool>());
find_active_cell_around_point(const MeshType<dim, spacedim> &mesh,
const Point<spacedim> & p,
const std::vector<bool> &marked_vertices = {});

/**
* Find and return an iterator to the active cell that surrounds a given
Expand Down Expand Up @@ -1094,11 +1092,10 @@ namespace GridTools
ActiveCellIterator<dim, spacedim, MeshType<dim, spacedim>>::type,
Point<dim>>
# endif
find_active_cell_around_point(
const Mapping<dim, spacedim> & mapping,
const MeshType<dim, spacedim> &mesh,
const Point<spacedim> & p,
const std::vector<bool> & marked_vertices = std::vector<bool>());
find_active_cell_around_point(const Mapping<dim, spacedim> & mapping,
const MeshType<dim, spacedim> &mesh,
const Point<spacedim> & p,
const std::vector<bool> &marked_vertices = {});

/**
* A version of the previous function that exploits an already existing
Expand Down Expand Up @@ -1127,7 +1124,7 @@ namespace GridTools
const std::vector<std::vector<Tensor<1, spacedim>>> &vertex_to_cell_centers,
const typename MeshType<dim, spacedim>::active_cell_iterator &cell_hint =
typename MeshType<dim, spacedim>::active_cell_iterator(),
const std::vector<bool> &marked_vertices = std::vector<bool>());
const std::vector<bool> &marked_vertices = {});

/**
* A version of the previous function where we use that mapping on a given
Expand Down Expand Up @@ -1172,7 +1169,7 @@ namespace GridTools
const Point<spacedim> & p,
const typename Triangulation<dim, spacedim>::active_cell_iterator &
cell_hint = typename Triangulation<dim, spacedim>::active_cell_iterator(),
const std::vector<bool> &marked_vertices = std::vector<bool>());
const std::vector<bool> &marked_vertices = {});

/**
* A variant of the previous find_active_cell_around_point() function that,
Expand Down Expand Up @@ -1206,7 +1203,7 @@ namespace GridTools
const MeshType<dim, spacedim> &mesh,
const Point<spacedim> & p,
const double tolerance = 1e-12,
const std::vector<bool> & marked_vertices = std::vector<bool>());
const std::vector<bool> & marked_vertices = {});

/**
* Return a list of all descendants of the given cell that are active. For
Expand Down
6 changes: 3 additions & 3 deletions include/deal.II/multigrid/mg_tools.h
Expand Up @@ -169,7 +169,7 @@ namespace MGTools
count_dofs_per_block(
const DoFHandlerType & dof_handler,
std::vector<std::vector<types::global_dof_index>> &dofs_per_block,
std::vector<unsigned int> target_block = std::vector<unsigned int>());
std::vector<unsigned int> target_block = {});

/**
* Count the dofs component-wise on each level.
Expand All @@ -183,8 +183,8 @@ namespace MGTools
count_dofs_per_component(
const DoFHandler<dim, spacedim> & mg_dof,
std::vector<std::vector<types::global_dof_index>> &result,
const bool only_once = false,
std::vector<unsigned int> target_component = std::vector<unsigned int>());
const bool only_once = false,
std::vector<unsigned int> target_component = {});

/**
* Generate a list of those degrees of freedom at the boundary of the domain
Expand Down
16 changes: 8 additions & 8 deletions include/deal.II/numerics/matrix_tools.h
Expand Up @@ -410,8 +410,8 @@ namespace MatrixCreator
& boundary_functions,
Vector<number> & rhs_vector,
std::vector<types::global_dof_index> & dof_to_boundary_mapping,
const Function<spacedim, number> *const weight = 0,
std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
const Function<spacedim, number> *const weight = 0,
std::vector<unsigned int> component_mapping = {});


/**
Expand All @@ -428,8 +428,8 @@ namespace MatrixCreator
& boundary_functions,
Vector<number> & rhs_vector,
std::vector<types::global_dof_index> & dof_to_boundary_mapping,
const Function<spacedim, number> *const a = nullptr,
std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
const Function<spacedim, number> *const a = nullptr,
std::vector<unsigned int> component_mapping = {});

/**
* Same function as above, but for hp objects.
Expand All @@ -445,8 +445,8 @@ namespace MatrixCreator
& boundary_functions,
Vector<number> & rhs_vector,
std::vector<types::global_dof_index> & dof_to_boundary_mapping,
const Function<spacedim, number> *const a = nullptr,
std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
const Function<spacedim, number> *const a = nullptr,
std::vector<unsigned int> component_mapping = {});

/**
* Same function as above, but for hp objects.
Expand All @@ -461,8 +461,8 @@ namespace MatrixCreator
& boundary_functions,
Vector<number> & rhs_vector,
std::vector<types::global_dof_index> & dof_to_boundary_mapping,
const Function<spacedim, number> *const a = nullptr,
std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
const Function<spacedim, number> *const a = nullptr,
std::vector<unsigned int> component_mapping = {});

/**
* Assemble the Laplace matrix. If no coefficient is given (i.e., if the
Expand Down
15 changes: 7 additions & 8 deletions include/deal.II/numerics/vector_tools.h
Expand Up @@ -1356,7 +1356,7 @@ namespace VectorTools
& boundary_functions,
const Quadrature<dim - 1> & q,
std::map<types::global_dof_index, number> &boundary_values,
std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
std::vector<unsigned int> component_mapping = {});

/**
* Call the project_boundary_values() function, see above, with
Expand All @@ -1370,7 +1370,7 @@ namespace VectorTools
& boundary_function,
const Quadrature<dim - 1> & q,
std::map<types::global_dof_index, number> &boundary_values,
std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
std::vector<unsigned int> component_mapping = {});

/**
* Same as above, but for objects of type hp::DoFHandler
Expand All @@ -1384,7 +1384,7 @@ namespace VectorTools
& boundary_functions,
const hp::QCollection<dim - 1> & q,
std::map<types::global_dof_index, number> &boundary_values,
std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
std::vector<unsigned int> component_mapping = {});

/**
* Call the project_boundary_values() function, see above, with
Expand All @@ -1398,7 +1398,7 @@ namespace VectorTools
& boundary_function,
const hp::QCollection<dim - 1> & q,
std::map<types::global_dof_index, number> &boundary_values,
std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
std::vector<unsigned int> component_mapping = {});

/**
* Project a function to the boundary of the domain, using the given
Expand Down Expand Up @@ -1447,7 +1447,7 @@ namespace VectorTools
& boundary_functions,
const Quadrature<dim - 1> &q,
AffineConstraints<number> &constraints,
std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
std::vector<unsigned int> component_mapping = {});

/**
* Call the project_boundary_values() function, see above, with
Expand All @@ -1463,7 +1463,7 @@ namespace VectorTools
& boundary_function,
const Quadrature<dim - 1> &q,
AffineConstraints<number> &constraints,
std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
std::vector<unsigned int> component_mapping = {});


/**
Expand Down Expand Up @@ -3054,8 +3054,7 @@ namespace VectorTools
*/
template <typename VectorType>
void
subtract_mean_value(VectorType & v,
const std::vector<bool> &p_select = std::vector<bool>());
subtract_mean_value(VectorType &v, const std::vector<bool> &p_select = {});


/**
Expand Down

0 comments on commit 465a996

Please sign in to comment.