<h3>deal.II</h3>
<ol>
+ <li><p>Fixed: For DoF iterators, it was previously possible to write
+ code like <code>*it1 = *it2</code>, presumably with the intent to
+ copy the entire cell pointed to on the right hand side onto the cell
+ pointed to at the left. However, this is not what happens since
+ iterators are not pointers but only point to accessor classes. The
+ assignment operator has therefore been removed.
+ <br>
+ (WB, 2010/11/12)
+ </p></li>
+
<li><p>New: There is now a class TriaAccessor<0,1,spacedim> that allows
to write things like
@code
const DH &
get_dof_handler () const;
- /**
- * Copy operator.
- */
- DoFAccessor<structdim,DH> &
- operator = (const DoFAccessor<structdim,DH> &da);
-
/**
* Implement the copy operator needed
* for the iterator classes.
template <typename> friend class TriaRawIterator;
+ private:
+ /**
+ * Copy operator. This is normally used
+ * in a context like <tt>iterator a,b;
+ * *a=*b;</tt>. Presumably, the intent
+ * here is to copy the object pointed to
+ * by @p b to the object pointed to by
+ * @p a. However, the result of
+ * dereferencing an iterator is not an
+ * object but an accessor; consequently,
+ * this operation is not useful for
+ * iterators on triangulations. We
+ * declare this function here private,
+ * thus it may not be used from outside.
+ * Furthermore it is not implemented and
+ * will give a linker error if used
+ * anyway.
+ */
+ DoFAccessor<structdim,DH> &
+ operator = (const DoFAccessor<structdim,DH> &da);
+
/**
* Make the DoFHandler class a friend so
* that it can call the set_xxx()
}
-//TODO: This seems to set only the DH, not the other data.
-
-template <int structdim, class DH>
-inline
-DoFAccessor<structdim,DH> &
-DoFAccessor<structdim,DH>::operator = (const DoFAccessor<structdim,DH> &da)
-{
- this->set_dof_handler (da.dof_handler);
- return *this;
-}
-
-
template <int structdim, class DH>
inline
--- /dev/null
+//---------------------------- dof_accessor_01.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2010 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- dof_accessor_01.cc ---------------------------
+
+// verify that iterators can be copied. when you just copy the
+// iterator itself, everything is alright: the copy operator of the
+// iterator calls Accessor::copy_from.
+//
+// the test was originally written because at that time it was
+// possible to do something like *it1 = *it2 for DoF iterators --
+// likely not what the author intended since it does not copy the
+// cell2 into the cell1, only the accessor. furthermore, the operator=
+// was wrongly implemented, so it was removed in the process
+
+
+#include "../tests.h"
+#include <grid/tria.h>
+#include <grid/tria_iterator.h>
+#include <grid/tria_accessor.h>
+#include <grid/grid_generator.h>
+
+#include <fe/fe_system.h>
+#include <fe/fe_q.h>
+#include <dofs/dof_handler.h>
+#include <dofs/dof_accessor.h>
+
+#include <fstream>
+
+
+template <int dim>
+void test ()
+{
+ Triangulation<dim> tria;
+ GridGenerator::hyper_cube (tria);
+ tria.refine_global (2);
+
+ FE_Q<dim> fe(1);
+ DoFHandler<dim> dof_handler (tria);
+ dof_handler.distribute_dofs (fe);
+
+ typename DoFHandler<dim>::active_cell_iterator
+ cell = dof_handler.begin_active();
+ ++cell;
+
+ typename DoFHandler<dim>::face_iterator
+ face = dof_handler.begin_active()->face(0);
+ face = cell->face(0);
+ deallog << cell->face(0) << ' ' << face << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("dof_accessor_01/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+
+ test<1> ();
+ test<2> ();
+ test<3> ();
+
+ return 0;
+}
--- /dev/null
+
+DEAL::-1 -1
+DEAL::40 40
+DEAL::281 281