From: Daniel Arndt Date: Sat, 10 Feb 2018 16:02:23 +0000 (+0100) Subject: Use make_unique/shared in meshworker X-Git-Tag: v9.0.0-rc1~425^2~6 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe4f10f68887f2f616760b851842e9d6ba56e04a;p=dealii.git Use make_unique/shared in meshworker --- diff --git a/include/deal.II/meshworker/integration_info.h b/include/deal.II/meshworker/integration_info.h index 1b4acfc56d..dbaac81c03 100644 --- a/include/deal.II/meshworker/integration_info.h +++ b/include/deal.II/meshworker/integration_info.h @@ -557,7 +557,7 @@ namespace MeshWorker : fevalv(0), multigrid(false), - global_data(std::shared_ptr >(new VectorDataBase)), + global_data(std::make_shared >()), n_components(numbers::invalid_unsigned_int) {} @@ -583,15 +583,15 @@ namespace MeshWorker const FESubfaceValues *ps = dynamic_cast*>(&p); if (pc != nullptr) - fevalv[i] = std::shared_ptr > ( - new FEValues (pc->get_mapping(), pc->get_fe(), - pc->get_quadrature(), pc->get_update_flags())); + fevalv[i] = std::make_shared > + (pc->get_mapping(), pc->get_fe(), + pc->get_quadrature(), pc->get_update_flags()); else if (pf != nullptr) - fevalv[i] = std::shared_ptr > ( - new FEFaceValues (pf->get_mapping(), pf->get_fe(), pf->get_quadrature(), pf->get_update_flags())); + fevalv[i] = std::make_shared > + (pf->get_mapping(), pf->get_fe(), pf->get_quadrature(), pf->get_update_flags()); else if (ps != nullptr) - fevalv[i] = std::shared_ptr > ( - new FESubfaceValues (ps->get_mapping(), ps->get_fe(), ps->get_quadrature(), ps->get_update_flags())); + fevalv[i] = std::make_shared > + (ps->get_mapping(), ps->get_fe(), ps->get_quadrature(), ps->get_update_flags()); else Assert(false, ExcInternalError()); } @@ -613,17 +613,13 @@ namespace MeshWorker if (block_info == nullptr || block_info->local().size() == 0) { fevalv.resize(1); - fevalv[0] = std::shared_ptr > ( - new FEVALUES (mapping, el, quadrature, flags)); + fevalv[0] = std::make_shared(mapping, el, quadrature, flags); } else { fevalv.resize(el.n_base_elements()); for (unsigned int i=0; i > ( - new FEVALUES (mapping, el.base_element(i), quadrature, flags)); - } + fevalv[i] = std::make_shared (mapping, el.base_element(i), quadrature, flags); } n_components = el.n_components(); } @@ -788,7 +784,7 @@ namespace MeshWorker std::shared_ptr > p; VectorDataBase *pp; - p = std::shared_ptr >(new VectorData (cell_selector)); + p = std::make_shared > (cell_selector); // Public member function of parent class was not found without // explicit cast pp = &*p; @@ -796,13 +792,13 @@ namespace MeshWorker cell_data = p; cell.initialize_data(p); - p = std::shared_ptr >(new VectorData (boundary_selector)); + p = std::make_shared > (boundary_selector); pp = &*p; pp->initialize(data); boundary_data = p; boundary.initialize_data(p); - p = std::shared_ptr >(new VectorData (face_selector)); + p = std::make_shared > (face_selector); pp = &*p; pp->initialize(data); face_data = p; @@ -825,7 +821,7 @@ namespace MeshWorker std::shared_ptr > p; VectorDataBase *pp; - p = std::shared_ptr >(new MGVectorData (cell_selector)); + p = std::make_shared > (cell_selector); // Public member function of parent class was not found without // explicit cast pp = &*p; @@ -833,13 +829,13 @@ namespace MeshWorker cell_data = p; cell.initialize_data(p); - p = std::shared_ptr >(new MGVectorData (boundary_selector)); + p = std::make_shared > (boundary_selector); pp = &*p; pp->initialize(data); boundary_data = p; boundary.initialize_data(p); - p = std::shared_ptr >(new MGVectorData (face_selector)); + p = std::make_shared > (face_selector); pp = &*p; pp->initialize(data); face_data = p;