]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add a way to retrieve the respective grids from an intergrid map, and use this way...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 17 Apr 2000 15:54:49 +0000 (15:54 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 17 Apr 2000 15:54:49 +0000 (15:54 +0000)
git-svn-id: https://svn.dealii.org/trunk@2737 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/grid/intergrid_map.h
deal.II/deal.II/source/dofs/dof_tools.cc
deal.II/deal.II/source/grid/intergrid_map.cc

index bc0bd22ddf41c32b14eee4f9fdac941d04e955cb..cdd90bd5a3758947c5ca8659d0f89fb97b071733 100644 (file)
@@ -156,6 +156,18 @@ class InterGridMap
                                      * Delete all data of this class.
                                      */
     void clear ();
+
+                                    /**
+                                     * Return a pointer to the source
+                                     * grid.
+                                     */
+    const GridClass<dim> & get_source_grid () const;
+    
+                                    /**
+                                     * Return a pointer to the
+                                     * destination grid.
+                                     */
+    const GridClass<dim> & get_destination_grid () const;
     
                                     /**
                                      * Exception
@@ -176,6 +188,16 @@ class InterGridMap
                                      */
     vector<vector<cell_iterator> > mapping;
 
+                                    /**
+                                     * Store a pointer to the source grid.
+                                     */
+    SmartPointer<const GridClass<dim> > source_grid;
+
+                                    /**
+                                     * Likewise for the destination grid.
+                                     */
+    SmartPointer<const GridClass<dim> > destination_grid;
+
                                     /**
                                      * Set the mapping for the pair of
                                      * cells given. These shall match
index e7f1a757537fb96384fbbb411d06e088d0b680da..8562018d88bc2db64ca7e7fadf3e68b5d5e6d970 100644 (file)
@@ -823,6 +823,14 @@ DoFTools::compute_intergrid_constraints (const DoFHandler<dim>              &coa
                                   // test, but better than nothing
   Assert (coarse_grid.get_tria().n_cells(0) == fine_grid.get_tria().n_cells(0),
          ExcGridsDontMatch());
+
+                                  // check whether the map correlates
+                                  // the right objects
+  Assert (&coarse_to_fine_grid_map.get_source_grid() == &coarse_grid,
+         ExcGridsDontMatch ());
+  Assert (&coarse_to_fine_grid_map.get_destination_grid() == &fine_grid,
+         ExcGridsDontMatch ());
+  
   
                                   // check whether component numbers
                                   // are valid
index cd34c03abe9d01eaba85817824a4cde8689bc2a9..6c20a2bad747f17b9d824fb2e19ee9485f1d516e 100644 (file)
@@ -56,6 +56,9 @@ void InterGridMap<GridClass,dim>::make_mapping (const GridClass<dim> &source_gri
                                   // first delete all contents
   clear ();
 
+                                  // next store pointers to grids
+  this->source_grid      = &source_grid;
+  this->destination_grid = &destination_grid;
 
                                   // then set up the containers from
                                   // scratch and fill them with end-iterators
@@ -102,6 +105,7 @@ void InterGridMap<GridClass,dim>::make_mapping (const GridClass<dim> &source_gri
 };
 
 
+
 template <template <int> class GridClass, int dim>
 void
 InterGridMap<GridClass,dim>::set_mapping (const cell_iterator &src_cell,
@@ -132,6 +136,7 @@ InterGridMap<GridClass,dim>::set_mapping (const cell_iterator &src_cell,
 };
 
 
+
 template <template <int> class GridClass, int dim>
 void
 InterGridMap<GridClass,dim>::set_entries_to_cell (const cell_iterator &src_cell,
@@ -164,13 +169,36 @@ InterGridMap<GridClass,dim>::operator [] (const cell_iterator &source_cell) cons
 };
 
 
+
 template <template <int> class GridClass, int dim>
 void InterGridMap<GridClass,dim>::clear () 
 {
   mapping.clear ();
+  source_grid      = 0;
+  destination_grid = 0;
+};
+
+
+
+template <template <int> class GridClass, int dim>
+const GridClass<dim> &
+InterGridMap<GridClass,dim>::get_source_grid () const
+{
+  return *source_grid;
+};
+
+
+
+template <template <int> class GridClass, int dim>
+const GridClass<dim> &
+InterGridMap<GridClass,dim>::get_destination_grid () const
+{
+  return *destination_grid;
 };
 
+  
 
+  
 // explicit instantiations
 template class InterGridMap<Triangulation, deal_II_dimension>;
 template class InterGridMap<DoFHandler, deal_II_dimension>;

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.