From 6f106abc1ae5e043af9f4abfafdf90c31052b000 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 27 Sep 2017 08:47:57 -0600 Subject: [PATCH] Simplify some pieces of code. --- source/dofs/dof_tools_constraints.cc | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/source/dofs/dof_tools_constraints.cc b/source/dofs/dof_tools_constraints.cc index 5ad1272734..4b09056159 100644 --- a/source/dofs/dof_tools_constraints.cc +++ b/source/dofs/dof_tools_constraints.cc @@ -40,6 +40,7 @@ #include #include #include +#include DEAL_II_NAMESPACE_OPEN @@ -310,10 +311,9 @@ namespace DoFTools const FullMatrix &face_interpolation_matrix, std::shared_ptr > &master_dof_mask) { - if (master_dof_mask == std::shared_ptr >()) + if (master_dof_mask == nullptr) { - master_dof_mask = std::shared_ptr > - (new std::vector (fe1.dofs_per_face)); + master_dof_mask.reset (new std::vector (fe1.dofs_per_face)); select_master_dofs_for_face_restriction (fe1, fe2, face_interpolation_matrix, @@ -335,11 +335,10 @@ namespace DoFTools const FiniteElement &fe2, std::shared_ptr > &matrix) { - if (matrix == std::shared_ptr >()) + if (matrix == nullptr) { - matrix = std::shared_ptr > - (new FullMatrix (fe2.dofs_per_face, - fe1.dofs_per_face)); + matrix.reset (new FullMatrix (fe2.dofs_per_face, + fe1.dofs_per_face)); fe1.get_face_interpolation_matrix (fe2, *matrix); } @@ -357,11 +356,10 @@ namespace DoFTools const unsigned int subface, std::shared_ptr > &matrix) { - if (matrix == std::shared_ptr >()) + if (matrix == nullptr) { - matrix = std::shared_ptr > - (new FullMatrix (fe2.dofs_per_face, - fe1.dofs_per_face)); + matrix.reset (new FullMatrix (fe2.dofs_per_face, + fe1.dofs_per_face)); fe1.get_subface_interpolation_matrix (fe2, subface, *matrix); @@ -385,12 +383,9 @@ namespace DoFTools static_cast(face_interpolation_matrix.n()), ExcInternalError()); - if (split_matrix == - std::shared_ptr,FullMatrix > >()) + if (split_matrix == nullptr) { - split_matrix - = std::shared_ptr,FullMatrix > > - (new std::pair,FullMatrix >()); + split_matrix.reset (new std::pair,FullMatrix >()); const unsigned int n_master_dofs = face_interpolation_matrix.n(); const unsigned int n_dofs = face_interpolation_matrix.m(); -- 2.39.5