From: Wenyu Lei Date: Sat, 4 May 2019 13:11:17 +0000 (+0200) Subject: Rebased from mapping-bbox and used mapping::get_bounding_box in coupling computation. X-Git-Tag: v9.2.0-rc1~382^2~4 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfbbebf1acc451a7f000c504cdc8bc513c494667;p=dealii.git Rebased from mapping-bbox and used mapping::get_bounding_box in coupling computation. --- diff --git a/include/deal.II/non_matching/coupling.h b/include/deal.II/non_matching/coupling.h index 1894e625fc..1f20afcc8f 100644 --- a/include/deal.II/non_matching/coupling.h +++ b/include/deal.II/non_matching/coupling.h @@ -288,7 +288,7 @@ namespace NonMatching const ComponentMask & comps1 = ComponentMask()); /** - * Create a coupling mass matrix for non-matching independent grids, + * Create a coupling mass matrix for non-matching independent grids, * using a convolution kernel with compact support. * * Given two non-matching triangulations, representing the domains diff --git a/source/non_matching/coupling.cc b/source/non_matching/coupling.cc index 16c34f830f..61dbef7f89 100644 --- a/source/non_matching/coupling.cc +++ b/source/non_matching/coupling.cc @@ -695,24 +695,8 @@ namespace NonMatching if (cell0->is_locally_owned()) { intersection.resize(0); - - BoundingBox box0; - if (cache0.get_mapping().preserves_vertex_locations()) - box0 = cell0->bounding_box(); - else - { - const auto vertices = - cache0.get_mapping().get_vertices(cell0); - Point p0 = vertices[0], p1 = vertices[0]; - for (unsigned int j = 1; j < vertices.size(); ++j) - for (unsigned int d = 0; d < spacedim; ++d) - { - p0[d] = std::min(p0[d], vertices[j][d]); - p1[d] = std::max(p1[d], vertices[j][d]); - } - box0 = BoundingBox({p0, p1}); - } - + BoundingBox box0 = + cache0.get_mapping().get_bounding_box(cell0); box0.extend(epsilon); boost::geometry::index::query(tree1, boost::geometry::index::intersects( @@ -747,25 +731,8 @@ namespace NonMatching if (cell1->is_locally_owned()) { intersection.resize(0); - - BoundingBox box1; - Assert(&cache1.get_mapping() != nullptr, ExcInternalError()); - if (cache1.get_mapping().preserves_vertex_locations()) - box1 = cell1->bounding_box(); - else - { - const auto vertices = - cache1.get_mapping().get_vertices(cell1); - Point p0 = vertices[0], p1 = vertices[0]; - for (unsigned int j = 1; j < vertices.size(); ++j) - for (unsigned int d = 0; d < spacedim; ++d) - { - p0[d] = std::min(p0[d], vertices[j][d]); - p1[d] = std::max(p1[d], vertices[j][d]); - } - box1 = BoundingBox({p0, p1}); - } - + BoundingBox box1 = + cache1.get_mapping().get_bounding_box(cell1); box1.extend(epsilon); boost::geometry::index::query(tree0, boost::geometry::index::intersects( @@ -928,24 +895,8 @@ namespace NonMatching if (cell0->is_locally_owned()) { intersection.resize(0); - - BoundingBox box0; - if (cache0.get_mapping().preserves_vertex_locations()) - box0 = cell0->bounding_box(); - else - { - const auto vertices = - cache0.get_mapping().get_vertices(cell0); - Point p0 = vertices[0], p1 = vertices[0]; - for (unsigned int j = 1; j < vertices.size(); ++j) - for (unsigned int d = 0; d < spacedim; ++d) - { - p0[d] = std::min(p0[d], vertices[j][d]); - p1[d] = std::max(p1[d], vertices[j][d]); - } - box0 = BoundingBox({p0, p1}); - } - + BoundingBox box0 = + cache0.get_mapping().get_bounding_box(cell0); box0.extend(epsilon); boost::geometry::index::query(tree1, boost::geometry::index::intersects( @@ -980,22 +931,8 @@ namespace NonMatching if (cell1->is_locally_owned()) { intersection.resize(0); - BoundingBox box1; - if (cache1.get_mapping().preserves_vertex_locations()) - box1 = cell1->bounding_box(); - else - { - const auto vertices = - cache1.get_mapping().get_vertices(cell1); - Point p0 = vertices[0], p1 = vertices[0]; - for (unsigned int j = 1; j < vertices.size(); ++j) - for (unsigned int d = 0; d < spacedim; ++d) - { - p0[d] = std::min(p0[d], vertices[j][d]); - p1[d] = std::max(p1[d], vertices[j][d]); - } - box1 = BoundingBox({p0, p1}); - } + BoundingBox box1 = + cache1.get_mapping().get_bounding_box(cell1); box1.extend(epsilon); boost::geometry::index::query(tree0, boost::geometry::index::intersects(