From 0f93c1a21e308b62b6fb0f25b8c4c2d0d68edfa3 Mon Sep 17 00:00:00 2001 From: David Wells Date: Wed, 2 May 2018 15:12:40 -0400 Subject: [PATCH] Use nullptr instead of 0. --- include/deal.II/matrix_free/mapping_info.templates.h | 8 ++++---- include/deal.II/matrix_free/matrix_free.h | 4 ++-- include/deal.II/matrix_free/matrix_free.templates.h | 2 +- source/grid/grid_in.cc | 4 ++-- source/lac/petsc_solver.cc | 2 +- source/matrix_free/task_info.cc | 6 +++--- source/non_matching/coupling.cc | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/deal.II/matrix_free/mapping_info.templates.h b/include/deal.II/matrix_free/mapping_info.templates.h index f68b58acf8..e27f3730ed 100644 --- a/include/deal.II/matrix_free/mapping_info.templates.h +++ b/include/deal.II/matrix_free/mapping_info.templates.h @@ -1190,11 +1190,11 @@ namespace internal faces[face].cells_exterior[0] == numbers::invalid_unsigned_int; if (is_boundary_face && - fe_boundary_face_values_container[my_q][0].get() == 0) + fe_boundary_face_values_container[my_q][0] == nullptr) fe_boundary_face_values_container[my_q][0].reset (new FEFaceValues (mapping, dummy_fe, quadrature, update_flags_boundary)); - else if (fe_face_values_container[my_q][0].get() == 0) + else if (fe_face_values_container[my_q][0] == nullptr) fe_face_values_container[my_q][0].reset (new FEFaceValues (mapping, dummy_fe, quadrature, update_flags_inner)); @@ -1306,7 +1306,7 @@ namespace internal cell_it (&tria, cells[faces[face].cells_exterior[v]].first, cells[faces[face].cells_exterior[v]].second); - const FEValuesBase *actual_fe_face_values = 0; + const FEValuesBase *actual_fe_face_values = nullptr; if (faces[face].subface_index >= GeometryInfo::max_children_per_cell) { @@ -1315,7 +1315,7 @@ namespace internal } else { - if (fe_subface_values_container[my_q][0].get() == 0) + if (fe_subface_values_container[my_q][0] == nullptr) fe_subface_values_container[my_q][0].reset (new FESubfaceValues (mapping, dummy_fe, quadrature, update_flags_inner)); diff --git a/include/deal.II/matrix_free/matrix_free.h b/include/deal.II/matrix_free/matrix_free.h index dc35f09d7d..f6519b45d6 100644 --- a/include/deal.II/matrix_free/matrix_free.h +++ b/include/deal.II/matrix_free/matrix_free.h @@ -2638,7 +2638,7 @@ namespace internal this->requests[component_in_block_vector]); matrix_free.release_scratch_data_non_threadsafe(tmp_data[component_in_block_vector]); - tmp_data[component_in_block_vector] = 0; + tmp_data[component_in_block_vector] = nullptr; #endif } } @@ -2717,7 +2717,7 @@ namespace internal this->requests[component_in_block_vector]); matrix_free.release_scratch_data_non_threadsafe(tmp_data[component_in_block_vector]); - tmp_data[component_in_block_vector] = 0; + tmp_data[component_in_block_vector] = nullptr; #endif } } diff --git a/include/deal.II/matrix_free/matrix_free.templates.h b/include/deal.II/matrix_free/matrix_free.templates.h index dca6f90436..7bda30fd67 100644 --- a/include/deal.II/matrix_free/matrix_free.templates.h +++ b/include/deal.II/matrix_free/matrix_free.templates.h @@ -150,7 +150,7 @@ MatrixFree::get_cell_iterator(const unsigned int macro_cell_number, AssertIndexRange (macro_cell_number, task_info.cell_partition_data.back()); AssertIndexRange (vector_number, n_components_filled(macro_cell_number)); - const DoFHandler *dofh = 0; + const DoFHandler *dofh = nullptr; if (dof_handlers.active_dof_handler == DoFHandlers::usual) { AssertDimension (dof_handlers.dof_handler.size(), diff --git a/source/grid/grid_in.cc b/source/grid/grid_in.cc index f7ad20c141..a13e19e531 100644 --- a/source/grid/grid_in.cc +++ b/source/grid/grid_in.cc @@ -1640,7 +1640,7 @@ void GridIn<2>::read_netcdf (const std::string &filename) #else const unsigned int dim=2; const unsigned int spacedim=2; - Assert (tria != 0, ExcNoTriangulationSelected()); + Assert (tria != nullptr, ExcNoTriangulationSelected()); // this function assumes the TAU // grid format. // @@ -1877,7 +1877,7 @@ void GridIn<3>::read_netcdf (const std::string &filename) #else const unsigned int dim=3; const unsigned int spacedim=3; - Assert (tria != 0, ExcNoTriangulationSelected()); + Assert (tria != nullptr, ExcNoTriangulationSelected()); // this function assumes the TAU // grid format. diff --git a/source/lac/petsc_solver.cc b/source/lac/petsc_solver.cc index 5774b3c757..32549c019f 100644 --- a/source/lac/petsc_solver.cc +++ b/source/lac/petsc_solver.cc @@ -697,7 +697,7 @@ namespace PETScWrappers /** * creating a solver object if this is necessary */ - if (solver_data.get() == 0) + if (solver_data == nullptr) { solver_data = std_cxx14::make_unique(); diff --git a/source/matrix_free/task_info.cc b/source/matrix_free/task_info.cc index 8ef9e0b814..aac1c06235 100644 --- a/source/matrix_free/task_info.cc +++ b/source/matrix_free/task_info.cc @@ -75,8 +75,8 @@ namespace internal void operator() () const { - MFWorkerInterface *used_worker = worker != 0 ? worker : *worker_pointer; - Assert(used_worker != 0, ExcInternalError()); + MFWorkerInterface *used_worker = worker != nullptr ? worker : *worker_pointer; + Assert(used_worker != nullptr, ExcInternalError()); used_worker->cell(std::make_pair(task_info.cell_partition_data[partition], task_info.cell_partition_data[partition+1])); @@ -305,7 +305,7 @@ namespace internal worker.vector_update_ghosts_finish(); else worker.vector_compress_start(); - return 0; + return nullptr; } private: diff --git a/source/non_matching/coupling.cc b/source/non_matching/coupling.cc index bd4ae01cc6..681925ebb3 100644 --- a/source/non_matching/coupling.cc +++ b/source/non_matching/coupling.cc @@ -58,7 +58,7 @@ namespace NonMatching AssertDimension(sparsity.n_cols(), immersed_dh.n_dofs()); static_assert(dim1 <= dim0, "This function can only work if dim1 <= dim0"); Assert((dynamic_cast *> - (&immersed_dh.get_triangulation()) == 0), ExcNotImplemented()); + (&immersed_dh.get_triangulation()) == nullptr), ExcNotImplemented()); const auto &space_fe = space_dh.get_fe(); const auto &immersed_fe = immersed_dh.get_fe(); @@ -158,7 +158,7 @@ namespace NonMatching AssertDimension(matrix.n(), immersed_dh.n_dofs()); static_assert(dim1 <= dim0, "This function can only work if dim1 <= dim0"); Assert((dynamic_cast*> - (&immersed_dh.get_triangulation()) == 0), ExcNotImplemented()); + (&immersed_dh.get_triangulation()) == nullptr), ExcNotImplemented()); const auto &space_fe = space_dh.get_fe(); const auto &immersed_fe = immersed_dh.get_fe(); -- 2.39.5