]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
removed marking of artifical cells; Introduced bones of the new policy class; put...
authordenis.davydov <denis.davydov@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 21 Mar 2014 13:44:45 +0000 (13:44 +0000)
committerdenis.davydov <denis.davydov@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 21 Mar 2014 13:44:45 +0000 (13:44 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_sharedtria@32680 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/distributed/tria.h
deal.II/include/deal.II/dofs/dof_handler_policy.h
deal.II/source/distributed/tria.cc
deal.II/source/dofs/dof_handler_policy.cc
deal.II/source/dofs/dof_tools.cc

index 2e3bd67ed6362a283f013765c97175fd9bc5bd91..a54ae632678c9705888827655f6630b99cd896a2 100644 (file)
@@ -939,6 +939,9 @@ namespace parallel
     class Triangulation : public dealii::Triangulation<dim,spacedim>
     {
     public:
+      typedef typename dealii::Triangulation<dim,spacedim>::active_cell_iterator active_cell_iterator;
+      typedef typename dealii::Triangulation<dim,spacedim>::cell_iterator        cell_iterator;
+
       /**
        * Constructor.
        */
@@ -967,8 +970,6 @@ namespace parallel
       MPI_Comm mpi_communicator;
       types::subdomain_id my_subdomain;
       types::subdomain_id num_subdomains;
-      
-      void mark_artificial();
     };
   }
 }
index 42eecf8afa2ea9c73299017ccbe98e34b326b301..16ef98281bb8d20f4f31ae49864d4443ce554166 100644 (file)
@@ -127,6 +127,25 @@ namespace internal
                        dealii::DoFHandler<dim,spacedim> &dof_handler) const;
       };
 
+      template <int dim, int spacedim>
+      class ParallelShared : public Sequential<dim,spacedim>
+      {
+      public:
+         virtual
+         NumberCache
+         distribute_dofs (dealii::DoFHandler<dim,spacedim> &dof_handler) const;
+
+         virtual
+         void
+         distribute_mg_dofs (dealii::DoFHandler<dim,spacedim> &dof_handler,
+                             std::vector<NumberCache> &number_caches) const;
+
+         virtual
+         NumberCache
+         renumber_dofs (const std::vector<types::global_dof_index>  &new_numbers,
+                        dealii::DoFHandler<dim,spacedim> &dof_handler) const;
+      };
+
 
       /**
        * This class implements the
index ef29d175dab7ad03ad735fc09391269aef18dff2..75aeab6d02ab4188e09e7b5f8b8c952a59257936 100644 (file)
@@ -4151,7 +4151,6 @@ namespace parallel
     Triangulation<dim,spacedim>::execute_coarsening_and_refinement () {
          dealii::Triangulation<dim,spacedim>::execute_coarsening_and_refinement ();
          dealii::GridTools::partition_triangulation (num_subdomains, *this);
-         mark_artificial();
     }
     
     template <int dim, int spacedim>
@@ -4171,7 +4170,6 @@ namespace parallel
           AssertThrow (false, ExcInternalError());
         }
       dealii::GridTools::partition_triangulation (num_subdomains, *this);
-      mark_artificial();
     }
 
 
@@ -4181,40 +4179,6 @@ namespace parallel
     {
       return mpi_communicator;
     }
-    
-    template <int dim, int spacedim>
-    void
-    Triangulation<dim,spacedim>::mark_artificial() 
-    {
-    
-       std::vector<bool > marked_vertices(this->n_vertices(),false);
-        for (typename dealii::Triangulation<dim,spacedim>::active_cell_iterator
-                   cell = this->begin_active();
-                   cell != this->end(); ++cell)
-            if (cell->subdomain_id() == this->locally_owned_subdomain())
-                for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
-                    marked_vertices[cell->vertex_index(v)] = true;
-                    
-                    
-                    
-        for (typename dealii::Triangulation<dim,spacedim>::active_cell_iterator
-                   cell = this->begin_active();
-                   cell != this->end(); ++cell)
-            if (cell->subdomain_id() != this->locally_owned_subdomain()) {
-               bool is_ghost = false;
-               for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
-                       if (marked_vertices[cell->vertex_index(v)] == true)
-                       {
-                               is_ghost = true;
-                               break;
-                               }
-                       if (is_ghost)
-                               continue;
-                               
-                       cell->set_subdomain_id(numbers::artificial_subdomain_id);       
-               }                   
-    }
-    
 
   }
 }
index 3af161ec679fb65ec30b308fbf88e6487a30aa39..30926ebeba0c12eae3a76091bcba815ef879c72f 100644 (file)
@@ -963,7 +963,41 @@ namespace internal
         return number_cache;
       }
 
+      /* --------------------- class ParallelSequential ---------------- */
+      template <int dim, int spacedim>
+      NumberCache
+      ParallelShared<dim,spacedim>::
+      distribute_dofs (DoFHandler<dim,spacedim> &dof_handler) const
+      {
+         NumberCache number_cache = Sequential<dim,spacedim>::distribute_dofs (dof_handler);
+         //correct number_cache:
+
 
+         return number_cache;
+      }
+
+      template <int dim, int spacedim>
+      void
+      ParallelShared<dim,spacedim>::
+      distribute_mg_dofs (DoFHandler<dim,spacedim> &dof_handler,
+                          std::vector<NumberCache> &number_caches) const
+      {
+         NumberCache number_cache = Sequential<dim,spacedim>:: distribute_mg_dofs (dof_handler, number_caches);
+         Assert(false,ExcMessage("Not implemented"));
+         return number_cache;
+      }
+
+      template <int dim, int spacedim>
+      NumberCache
+      ParallelShared<dim,spacedim>::
+      renumber_dofs (const std::vector<types::global_dof_index> &new_numbers,
+                     dealii::DoFHandler<dim,spacedim> &dof_handler) const
+      {
+         NumberCache number_cache = Sequential<dim,spacedim>::renumber_dofs (new_numbers,dof_handler);
+         //correct number_cache:
+
+         return number_cache;
+      }
 
       /* --------------------- class ParallelDistributed ---------------- */
 
index 14020557203c3a6d6a66f185073c3fc188df9ee9..3ea549933447ed05ab9bf7388230f450e8851844 100644 (file)
@@ -1096,10 +1096,9 @@ namespace DoFTools
     endc = dof_handler.end();
     for (; cell!=endc; ++cell)
       {
-        //can comment it since the case of distributed triangulations is handled above.
-        //Assert (cell->is_artificial() == false,
-        //        ExcMessage ("You can't call this function for meshes that "
-        //                    "have artificial cells."));
+        Assert (cell->is_artificial() == false,
+                ExcMessage ("You can't call this function for meshes that "
+                            "have artificial cells."));
 
         const types::subdomain_id subdomain_id = cell->subdomain_id();
         const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell;

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.