]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Make sure that face iterators can be copied in 1d.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 13 Nov 2010 00:42:56 +0000 (00:42 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 13 Nov 2010 00:42:56 +0000 (00:42 +0000)
git-svn-id: https://svn.dealii.org/trunk@22711 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/dofs/dof_accessor.h
deal.II/include/deal.II/dofs/dof_accessor.templates.h
deal.II/include/deal.II/grid/tria_accessor.h
deal.II/include/deal.II/grid/tria_accessor.templates.h

index eb7339ab4c5a17371d5f6f9f8cab0845b75fafaf..ba7b68c90cff92cec257a6977955f082d7d3ffa5 100644 (file)
@@ -903,7 +903,7 @@ class DoFAccessor<0,DH<1,spacedim> > : public TriaAccessor<0,1,spacedim>
                                      * but sets the object
                                      * coordinates of the TriaAccessor.
                                      */
-    void copy_from (const TriaAccessorBase<0, DH<1,spacedim>::dimension, DH<1,spacedim>::space_dimension> &da);
+    void copy_from (const TriaAccessorBase<0, 1, spacedim> &da);
 
                                     /**
                                      * Return an iterator pointing to
index b41157699b634c50b31f35eca6fe616788555b21..7c0b4244b411fd45b12226377a631f2074c520e5 100644 (file)
@@ -1930,6 +1930,51 @@ get_dof_indices (std::vector<unsigned int> &dof_indices,
 
 
 
+template <template <int, int> class DH, int spacedim>
+inline
+void
+DoFAccessor<0,DH<1,spacedim> >::copy_from (
+  const TriaAccessorBase<0,1,spacedim> &da)
+{
+  Assert (this->dof_handler != 0, ExcInvalidObject());
+  BaseClass::copy_from(da);
+}
+
+
+
+template <template <int, int> class DH, int spacedim>
+inline
+void
+DoFAccessor<0,DH<1,spacedim> >::copy_from (const DoFAccessor<0,DH<1,spacedim> > &a)
+{
+  BaseClass::copy_from (a);
+  set_dof_handler (a.dof_handler);
+}
+
+
+
+template <template <int, int> class DH, int spacedim>
+inline
+bool
+DoFAccessor<0,DH<1,spacedim> >::operator == (const DoFAccessor<0,DH<1,spacedim> > &a) const
+{
+  Assert (this->dof_handler == a.dof_handler, ExcCantCompareIterators());
+  return (BaseClass::operator == (a));
+}
+
+
+
+template <template <int, int> class DH, int spacedim>
+inline
+bool
+DoFAccessor<0,DH<1,spacedim> >::operator != (const DoFAccessor<0,DH<1,spacedim> > &a) const
+{
+  Assert (this->dof_handler == a.dof_handler, ExcCantCompareIterators());
+  return (BaseClass::operator != (a));
+}
+
+
+
 /*------------------------- Functions: DoFCellAccessor -----------------------*/
 
 
index 3f20ac219e9b3627f051bb0b68406cd368d53140..00110025e8463b1b79970fccae901b1083c3f4e6 100644 (file)
@@ -1713,6 +1713,19 @@ class TriaAccessor<0, 1, spacedim>
     template <int structdim2, int dim2, int spacedim2>
     TriaAccessor (const InvalidAccessor<structdim2,dim2,spacedim2> &);
 
+                                    /**
+                                     *  Copy operator. Since this is
+                                     *  only called from iterators,
+                                     *  do not return anything, since
+                                     *  the iterator will return
+                                     *  itself.
+                                     *
+                                     *  This method is protected,
+                                     *  since it is only to be called
+                                     *  from the iterator class.
+                                     */
+    void copy_from (const TriaAccessor &);
+
                                     /**
                                      *  Return the state of the
                                      *  iterator. Since an iterator
@@ -2005,14 +2018,14 @@ class TriaAccessor<0, 1, spacedim>
                                      * provided by the cell at the
                                      * time of creation.
                                      */
-    const VertexKind      vertex_kind;
+    VertexKind      vertex_kind;
 
                                     /**
                                      * The global vertex index of the
                                      * vertex this object corresponds
                                      * to.
                                      */
-    const unsigned int    global_vertex_index;
+    unsigned int    global_vertex_index;
 };
 
 
index 5ee77a280dc4683f1d3907d95bae98df1f34eabb..6258e1d2cc5ebf7e1cda2a6a99d3a3c6e8b8599a 100644 (file)
@@ -2023,6 +2023,18 @@ TriaAccessor (const InvalidAccessor<structdim2,dim2,spacedim2> &)
 
 
 
+template <int spacedim>
+inline
+void
+TriaAccessor<0, 1, spacedim>::copy_from (const TriaAccessor &t)
+{
+  tria = t.tria;
+  vertex_kind = t.vertex_kind;
+  global_vertex_index = t.global_vertex_index;
+}
+
+
+
 template <int spacedim>
 inline
 IteratorState::IteratorStates

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.