// times_and_names is declared static, so it will retain the entries
// from the previous timesteps.
static std::vector<std::pair<double, std::string>> times_and_names;
- times_and_names.push_back(
- std::pair<double, std::string>(present_time, pvtu_filename));
+ times_and_names.emplace_back(present_time, pvtu_filename);
std::ofstream pvd_output("solution.pvd");
DataOutBase::write_pvd_record(pvd_output, times_and_names);
}
Particles::DataOut<dim, dim> particle_output;
std::vector<std::string> solution_names(dim, "velocity");
- solution_names.push_back("process_id");
+ solution_names.emplace_back("process_id");
std::vector<DataComponentInterpretation::DataComponentInterpretation>
data_component_interpretation(
/* We wire up the slot InitialValues<dim>::parse_parameters_callback to
the ParameterAcceptor::parse_parameters_call_back signal: */
ParameterAcceptor::parse_parameters_call_back.connect(
- std::bind(&InitialValues<dim>::parse_parameters_callback, this));
+ [&]() { this->parse_parameters_callback(); });
initial_direction[0] = 1.;
add_parameter("initial direction",
mpi_communicator);
static std::vector<std::pair<double, std::string>> times_and_names;
- times_and_names.push_back(std::make_pair(time, filename));
+ times_and_names.emplace_back(time, filename);
std::ofstream ofile(par.output_directory + "/" + "solution.pvd");
DataOutBase::write_pvd_record(ofile, times_and_names);
}
StokesImmersedProblem<2, 3> problem(par);
problem.run();
}
- else if (prm_file.find("3") != std::string::npos)
+ else if (prm_file.find('3') != std::string::npos)
{
StokesImmersedProblemParameters<3> par;
ParameterAcceptor::initialize(prm_file);
// the same process, so we have to only look at the unique set of
// destinations:
std::vector<types::subdomain_id> destinations;
+ destinations.reserve(cells_to_send.size());
for (const auto &cell : cells_to_send)
destinations.emplace_back(cell.receiver);
std::sort(destinations.begin(), destinations.end());
// We will send all locally active dofs that are not locally owned for
// checking. Note that we allow constraints to differ on locally_relevant (and
// not active) DoFs.
+ // NOLINTNEXTLINE(performance-unnecessary-copy-initialization)
IndexSet non_owned = locally_active_dofs;
non_owned.subtract_set(locally_owned_dofs[myid]);
for (unsigned int owner = 0; owner < nproc; ++owner)
* Constructor. Does nothing, so you have to call @p decompose sometimes
* afterwards.
*/
- SparseMIC();
+ SparseMIC() = default;
/**
* Destructor.
DEAL_II_NAMESPACE_OPEN
-template <typename number>
-SparseMIC<number>::SparseMIC()
- : diag(0)
- , inv_diag(0)
- , inner_sums(0)
-{}
-
-
-
template <typename number>
SparseMIC<number>::~SparseMIC()
{
// ------------------------- inline functions --------------------------
+ // NOLINTNEXTLINE(modernize-use-equals-default)
template <typename Number>
ConstraintValues<Number>::ConstraintValues()
: constraints(FloatingPointComparator<Number>(
task_info.create_blocks_serial(
dummy, 1, false, dummy, false, dummy, dummy, dummy2);
+ // NOLINTNEXTLINE(modernize-loop-convert)
for (unsigned int i = 0; i < dof_info.size(); ++i)
{
Assert(dof_handler[i]->get_fe_collection().size() == 1,
hp::FEFaceValues<dim, spacedim> & x_fe_face_values,
const IndexSet & refinement_edge_indices,
const unsigned int level,
- std::map<internal::FaceDoFInfo, std::array<unsigned int, dim>>
- &dof_to_vector_dof)
+ std::map<FaceDoFInfo, std::array<unsigned int, dim>> &dof_to_vector_dof)
{
std::set<types::boundary_id>::iterator b_id;
for (const unsigned int face_no : cell->face_indices())
if (level == numbers::invalid_unsigned_int ||
!refinement_edge_indices.is_element(face_dofs[i]))
{
- local_vector_indices[0] = i;
- const internal::FaceDoFInfo local_face_dof_info = {
+ local_vector_indices[0] = i;
+ const FaceDoFInfo local_face_dof_info = {
{cell->active_fe_index(), face_no, i}};
for (unsigned int k = 0; k < fe.n_dofs_per_face(face_no);
++k)
const IndexSet & refinement_edge_indices,
const unsigned int level,
std::multimap<
- internal::VectorDoFTuple<dim>,
+ VectorDoFTuple<dim>,
std::pair<Tensor<1, dim>,
typename DoFHandler<dim, spacedim>::cell_iterator>>
- &dof_to_normals_map,
- std::map<internal::VectorDoFTuple<dim>, Vector<double>>
- &dof_vector_to_b_values)
+ & dof_to_normals_map,
+ std::map<VectorDoFTuple<dim>, Vector<double>> &dof_vector_to_b_values)
{
// mapping from (active_fe_index, face_no and local
// dof index) to dim vector indices of the same
// supporting point.
- std::map<internal::FaceDoFInfo, std::array<unsigned int, dim>>
- dof_to_vector_dof;
- internal::map_face_dof_to_vector_dof<dim, spacedim>(
- cell,
- first_vector_component,
- boundary_ids,
- x_fe_face_values,
- refinement_edge_indices,
- level,
- dof_to_vector_dof);
+ std::map<FaceDoFInfo, std::array<unsigned int, dim>> dof_to_vector_dof;
+ map_face_dof_to_vector_dof<dim, spacedim>(cell,
+ first_vector_component,
+ boundary_ids,
+ x_fe_face_values,
+ refinement_edge_indices,
+ level,
+ dof_to_vector_dof);
std::set<types::boundary_id>::iterator b_id;
if (level == numbers::invalid_unsigned_int ||
!refinement_edge_indices.is_element(face_dofs[i]))
{
- const internal::FaceDoFInfo face_dof_info = {
+ const FaceDoFInfo face_dof_info = {
{cell->active_fe_index(), face_no, i}};
const auto it = dof_to_vector_dof.find(face_dof_info);
Assert(it != dof_to_vector_dof.end(), ExcInternalError());
"Error: the finite element does not have enough components "
"to define a normal direction."));
- internal::VectorDoFTuple<dim> vector_dofs;
+ VectorDoFTuple<dim> vector_dofs;
for (unsigned int d = 0; d < dim; ++d)
{
vector_dofs.dof_indices[d] =
// directions* we find). consequently, we also have to store which cell a
// normal vector was computed on
using DoFToNormalsMap = std::multimap<
- internal::VectorDoFTuple<dim>,
+ VectorDoFTuple<dim>,
std::pair<Tensor<1, dim>,
typename DoFHandler<dim, spacedim>::cell_iterator>>;
- std::map<internal::VectorDoFTuple<dim>, Vector<double>>
- dof_vector_to_b_values;
+ std::map<VectorDoFTuple<dim>, Vector<double>> dof_vector_to_b_values;
DoFToNormalsMap dof_to_normals_map;
for (const auto &cell : dof_handler.active_cell_iterators())
if (!cell->is_artificial())
{
- internal::map_dofs_to_normal_vectors_and_normal_fluxes(
+ map_dofs_to_normal_vectors_and_normal_fluxes(
cell,
first_vector_component,
boundary_ids,
numbers::artificial_subdomain_id &&
cell->level_subdomain_id() != numbers::invalid_subdomain_id)
{
- internal::map_dofs_to_normal_vectors_and_normal_fluxes(
+ map_dofs_to_normal_vectors_and_normal_fluxes(
cell,
first_vector_component,
boundary_ids,
psub_objects[r * n + c] = this->sub_objects[r][c]->petsc_matrix();
ierr = MatCreateNest(get_mpi_communicator(),
m,
- NULL,
+ nullptr,
n,
- NULL,
+ nullptr,
psub_objects.data(),
&petsc_nest_matrix);
AssertThrow(ierr == 0, ExcPETScError(ierr));
ierr = ISDestroy(&is_glob_row);
AssertThrow(ierr == 0, ExcPETScError(ierr));
ierr =
- ISLocalToGlobalMappingViewFromOptions(l2gmap_row, NULL, "-view_map");
+ ISLocalToGlobalMappingViewFromOptions(l2gmap_row, nullptr, "-view_map");
AssertThrow(ierr == 0, ExcPETScError(ierr));
// Create column index set
ierr = ISDestroy(&is_glob_col);
AssertThrow(ierr == 0, ExcPETScError(ierr));
ierr =
- ISLocalToGlobalMappingViewFromOptions(l2gmap_col, NULL, "-view_map");
+ ISLocalToGlobalMappingViewFromOptions(l2gmap_col, nullptr, "-view_map");
AssertThrow(ierr == 0, ExcPETScError(ierr));
// create the matrix with the IS constructor.
else
{
set_option_value("-pc_bddc_corner_selection", "false");
- ierr = PCSetCoordinates(pc, 0, 0, NULL);
+ ierr = PCSetCoordinates(pc, 0, 0, nullptr);
AssertThrow(ierr == 0, ExcPETScError(ierr));
}
SparsityPattern::SparsityPattern(SparsityPattern &&other) noexcept
- : SparsityPatternBase(other)
+ : SparsityPatternBase(std::move(other))
, column_space_map(std::move(other.column_space_map))
, graph(std::move(other.graph))
, nonlocal_graph(std::move(other.nonlocal_graph))