]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add a function to get at the DoFHandler of an accessor. Move the implementation funct...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 22 May 2000 08:28:51 +0000 (08:28 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 22 May 2000 08:28:51 +0000 (08:28 +0000)
git-svn-id: https://svn.dealii.org/trunk@2915 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/dofs/dof_accessor.h
deal.II/deal.II/include/dofs/dof_accessor.templates.h
deal.II/deal.II/source/dofs/dof_accessor.cc

index 574117bab09fff6490a58bc9512fadb197838657..ffbd26e55d4bbfda5d8ee23c5bad8fe838759ce3 100644 (file)
@@ -60,9 +60,7 @@ class DoFAccessor
                                     /**
                                      * Constructor
                                      */
-    DoFAccessor () : dof_handler(0) {
-      Assert (false, ExcInvalidObject());
-    };
+    DoFAccessor ();
 
                                     /**
                                      * This should be the default constructor.
@@ -74,24 +72,26 @@ class DoFAccessor
                                      * non-const, even if they preserve
                                      * constness.
                                      */
-    DoFAccessor (const DoFHandler<dim> *dof_handler) :
-                   dof_handler(const_cast<DoFHandler<dim>*>(dof_handler)) {};
+    DoFAccessor (const DoFHandler<dim> *dof_handler);
 
                                     /**
                                      * Reset the DoF handler pointer.
                                      */
-    void set_dof_handler (DoFHandler<dim> *dh) {
-      Assert (dh != 0, ExcInvalidObject());
-      dof_handler = dh;
-    };
+    void set_dof_handler (DoFHandler<dim> *dh);
+
+                                    /**
+                                     * Return a handle on the
+                                     * #DoFHandler# object which we
+                                     * are using.
+                                     */
+    const DoFHandler<dim> &
+    get_dof_handler () const;
 
                                     /**
                                      * Copy operator.
                                      */
-    DoFAccessor<dim> & operator = (const DoFAccessor<dim> &da) {
-      set_dof_handler (da.dof_handler);
-      return *this;
-    };
+    DoFAccessor<dim> &
+    operator = (const DoFAccessor<dim> &da);
     
                                     /**
                                      * Exception for child classes
index ece1ad920f42d0e929fcec5328ddf22e2e636642..9731e925139e460e8a15a6805e03e1a2e07de08b 100644 (file)
 #include <vector>
 
 
+/*------------------------- Functions: DoFAccessor ---------------------------*/
+
+
+template <int dim>
+DoFAccessor<dim>::DoFAccessor () :
+               dof_handler(0)
+{
+  Assert (false, ExcInvalidObject());
+};
+
+
+
+template <int dim>
+inline
+DoFAccessor<dim>::DoFAccessor (const DoFHandler<dim> *dof_handler) :
+               dof_handler(const_cast<DoFHandler<dim>*>(dof_handler))
+{};
+
+
+
+template <int dim>
+void
+DoFAccessor<dim>::set_dof_handler (DoFHandler<dim> *dh)
+{
+  Assert (dh != 0, ExcInvalidObject());
+  dof_handler = dh;
+};
+
+
+
+template <int dim>
+const DoFHandler<dim> &
+DoFAccessor<dim>::get_dof_handler () const
+{
+  return *dof_handler;
+};
+
+
+
+template <int dim>
+inline
+DoFAccessor<dim> &
+DoFAccessor<dim>::operator = (const DoFAccessor<dim> &da)
+{
+  set_dof_handler (da.dof_handler);
+  return *this;
+};
+
+
+
+
 /*------------------------- Functions: DoFLineAccessor -----------------------*/
 
 template <int dim>
index 717425fda90d1b1995f50f0088afc4de37fecf4c..191e4c861f795fdcfd9e6ddf0449adb87c2276e6 100644 (file)
@@ -46,6 +46,7 @@ void DoFObjectAccessor<1, dim>::set_dof_index (const unsigned int i,
 };
 
 
+
 template <int dim>
 void DoFObjectAccessor<1, dim>::set_vertex_dof_index (const unsigned int vertex,
                                                      const unsigned int i,
@@ -64,6 +65,7 @@ void DoFObjectAccessor<1, dim>::set_vertex_dof_index (const unsigned int vertex,
 };
 
 
+
 template <int dim>
 void DoFObjectAccessor<1, dim>::
 distribute_local_to_global (const Vector<double> &local_source,
@@ -88,6 +90,7 @@ distribute_local_to_global (const Vector<double> &local_source,
 };
 
 
+
 template <int dim>
 void DoFObjectAccessor<1, dim>::
 distribute_local_to_global (const FullMatrix<double> &local_source,
@@ -117,6 +120,7 @@ distribute_local_to_global (const FullMatrix<double> &local_source,
 };
 
 
+
 template <int dim>
 template <class InputVector, typename number>
 void
@@ -147,6 +151,7 @@ DoFObjectAccessor<1,dim>::get_dof_values (const InputVector &values,
 };
 
 
+
 template <int dim>
 template <class OutputVector, typename number>
 void
@@ -196,6 +201,7 @@ void DoFObjectAccessor<2, dim>::set_dof_index (const unsigned int i,
 };
 
 
+
 template <int dim>
 void
 DoFObjectAccessor<2, dim>::set_vertex_dof_index (const unsigned int vertex,
@@ -215,6 +221,7 @@ DoFObjectAccessor<2, dim>::set_vertex_dof_index (const unsigned int vertex,
 };
 
 
+
 template <int dim>
 void DoFObjectAccessor<2, dim>::
 distribute_local_to_global (const Vector<double> &local_source,
@@ -240,6 +247,7 @@ distribute_local_to_global (const Vector<double> &local_source,
 };
 
 
+
 template <int dim>
 void DoFObjectAccessor<2, dim>::
 distribute_local_to_global (const FullMatrix<double> &local_source,
@@ -270,6 +278,7 @@ distribute_local_to_global (const FullMatrix<double> &local_source,
 };
 
 
+
 template <int dim>
 template <class InputVector, typename number>
 void
@@ -304,6 +313,7 @@ DoFObjectAccessor<2,dim>::get_dof_values (const InputVector &values,
 };
 
 
+
 template <int dim>
 template <class OutputVector, typename number>
 void
@@ -357,6 +367,7 @@ void DoFObjectAccessor<3, dim>::set_dof_index (const unsigned int i,
 };
 
 
+
 template <int dim>
 void DoFObjectAccessor<3, dim>::set_vertex_dof_index (const unsigned int vertex,
                                                      const unsigned int i,
@@ -375,6 +386,7 @@ void DoFObjectAccessor<3, dim>::set_vertex_dof_index (const unsigned int vertex,
 };
 
 
+
 template <int dim>
 void DoFObjectAccessor<3, dim>::
 distribute_local_to_global (const Vector<double> &local_source,
@@ -401,6 +413,7 @@ distribute_local_to_global (const Vector<double> &local_source,
 };
 
 
+
 template <int dim>
 void DoFObjectAccessor<3, dim>::
 distribute_local_to_global (const FullMatrix<double> &local_source,
@@ -433,6 +446,7 @@ distribute_local_to_global (const FullMatrix<double> &local_source,
 };
 
 
+
 template <int dim>
 template <class InputVector, typename number>
 void
@@ -471,6 +485,7 @@ DoFObjectAccessor<3,dim>::get_dof_values (const InputVector &values,
 };
 
 
+
 template <int dim>
 template <class OutputVector, typename number>
 void
@@ -509,6 +524,7 @@ DoFObjectAccessor<3,dim>::set_dof_values (const Vector<number> &local_values,
 };
 
 
+
 /*------------------------- Functions: DoFCellAccessor -----------------------*/
 
 
@@ -611,6 +627,7 @@ DoFCellAccessor<dim>::get_interpolated_dof_values (const InputVector &values,
 };
 
 
+
 template <int dim>
 template <class OutputVector, typename number>
 void
@@ -858,6 +875,8 @@ set_dof_values_by_interpolation(const Vector<double> &,
                                BlockVector<3,double> &) const;
 
 
+template class DoFAccessor<deal_II_dimension>;
+
 #if deal_II_dimension == 1
 template class DoFObjectAccessor<1, 1>;
 #endif

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.