From: Wolfgang Bangerth Date: Wed, 27 Sep 2017 14:47:57 +0000 (-0600) Subject: Simplify some pieces of code. X-Git-Tag: v9.0.0-rc1~1016^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f106abc1ae5e043af9f4abfafdf90c31052b000;p=dealii.git Simplify some pieces of code. --- 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();