]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Rebased from mapping-bbox and used mapping::get_bounding_box in coupling computation.
authorWenyu Lei <lwy5515@gmail.com>
Sat, 4 May 2019 13:11:17 +0000 (15:11 +0200)
committerLuca Heltai <luca.heltai@sissa.it>
Sat, 11 May 2019 16:15:24 +0000 (18:15 +0200)
include/deal.II/non_matching/coupling.h
source/non_matching/coupling.cc

index 1894e625fc01e3bec3874670e3a042c6480dc928..1f20afcc8f0492b276fbad047b3c2a93c1f1310b 100644 (file)
@@ -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
index 16c34f830f534bc67c5fe1bcea000e6632d9cf31..61dbef7f89bd3f0204c252b9de8cebdb06124b46 100644 (file)
@@ -695,24 +695,8 @@ namespace NonMatching
           if (cell0->is_locally_owned())
             {
               intersection.resize(0);
-
-              BoundingBox<spacedim> box0;
-              if (cache0.get_mapping().preserves_vertex_locations())
-                box0 = cell0->bounding_box();
-              else
-                {
-                  const auto vertices =
-                    cache0.get_mapping().get_vertices(cell0);
-                  Point<spacedim> 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<spacedim>({p0, p1});
-                }
-
+              BoundingBox<spacedim> 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<spacedim> 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<spacedim> 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<spacedim>({p0, p1});
-                }
-
+              BoundingBox<spacedim> 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<spacedim> box0;
-              if (cache0.get_mapping().preserves_vertex_locations())
-                box0 = cell0->bounding_box();
-              else
-                {
-                  const auto vertices =
-                    cache0.get_mapping().get_vertices(cell0);
-                  Point<spacedim> 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<spacedim>({p0, p1});
-                }
-
+              BoundingBox<spacedim> 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<spacedim> box1;
-              if (cache1.get_mapping().preserves_vertex_locations())
-                box1 = cell1->bounding_box();
-              else
-                {
-                  const auto vertices =
-                    cache1.get_mapping().get_vertices(cell1);
-                  Point<spacedim> 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<spacedim>({p0, p1});
-                }
+              BoundingBox<spacedim> box1 =
+                cache1.get_mapping().get_bounding_box(cell1);
               box1.extend(epsilon);
               boost::geometry::index::query(tree0,
                                             boost::geometry::index::intersects(

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.