]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make sure interfaces of CellAccessor and DoFCellAccessor match.
authorLuca Heltai <luca.heltai@sissa.it>
Sat, 12 Aug 2017 16:30:29 +0000 (10:30 -0600)
committerLuca Heltai <luca.heltai@sissa.it>
Sat, 12 Aug 2017 16:30:29 +0000 (10:30 -0600)
include/deal.II/grid/tria_accessor.h
include/deal.II/grid/tria_accessor.templates.h
include/deal.II/meshworker/mesh_loop.h

index dc5531a53428d3dd22847ce80fd6159ffd613a77..b8bb58f7e18cf1280e5aa198c27f10d270fc40ff 100644 (file)
@@ -2613,6 +2613,11 @@ public:
    */
   unsigned int neighbor_face_no (const unsigned int neighbor) const;
 
+  /**
+   * Compatibility interface with DoFCellAccessor. Returns always false.
+   */
+  static bool is_level_cell();
+
   /**
    * @}
    */
index 6529d22ab9a37cbb1b82e7ca0d7546027ef80a5d..9bcac428b4e699a3d19a0329aa23eb4151489f49 100644 (file)
@@ -3679,6 +3679,13 @@ CellAccessor<dim,spacedim>::neighbor_face_no (const unsigned int neighbor) const
 
 
 
+template <int dim, int spacedim>
+inline
+bool
+CellAccessor<dim,spacedim>::is_level_cell()
+{
+  return false;
+}
 
 
 DEAL_II_NAMESPACE_CLOSE
index 2036c7ded4d2bf660dd13849fa686a49d50abfd5..63dfe3ca99c5543b803a0d5a14a13c520b7d2be6 100644 (file)
@@ -73,9 +73,9 @@ namespace MeshWorker
       const bool ignore_subdomain = (cell->get_triangulation().locally_owned_subdomain()
                                      == numbers::invalid_subdomain_id);
 
-      types::subdomain_id current_subdomain_id = /*(cell->is_level_cell())
-                                 ? cell->level_subdomain_id()
-                                 : */cell->subdomain_id();
+      types::subdomain_id current_subdomain_id = (cell->is_level_cell()
+                                                  ? cell->level_subdomain_id()
+                                                  : cell->subdomain_id());
 
       const bool own_cell = ignore_subdomain || (current_subdomain_id == cell->get_triangulation().locally_owned_subdomain());
 
@@ -105,10 +105,10 @@ namespace MeshWorker
                 TriaIterator<typename CellIteratorType::AccessorType> neighbor = cell->neighbor_or_periodic_neighbor(face_no);
 
                 types::subdomain_id neighbor_subdomain_id = numbers::artificial_subdomain_id;
-//                if (neighbor->is_level_cell())
-//                  neighbid = neighbor->level_subdomain_id();
+                if (neighbor->is_level_cell())
+                  neighbor_subdomain_id = neighbor->level_subdomain_id();
                 //subdomain id is only valid for active cells
-                /*else */if (neighbor->active())
+                else if (neighbor->active())
                   neighbor_subdomain_id = neighbor->subdomain_id();
 
                 const bool own_neighbor = ignore_subdomain ||

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.