]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move get_selected_fe to the .h file to allow for making it inline.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 25 Aug 1998 16:18:33 +0000 (16:18 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 25 Aug 1998 16:18:33 +0000 (16:18 +0000)
git-svn-id: https://svn.dealii.org/trunk@517 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/dofs/dof_handler.h
deal.II/deal.II/source/dofs/dof_handler.cc

index 58634fe5bcf7bf85d9389a66b579c16c19feb350..50233197a2d8477b84521c75100693a1a02280ad 100644 (file)
@@ -482,7 +482,7 @@ class DoFHandler : public DoFDimensionInfo<dim> {
                                     /**
                                      * Destructor
                                      */
-    ~DoFHandler ();
+    virtual ~DoFHandler ();
     
                                     /**
                                      * Go through the triangulation and
@@ -499,7 +499,7 @@ class DoFHandler : public DoFDimensionInfo<dim> {
                                      * don't need them after calling this
                                      * function, or if so store them.
                                      */
-    void distribute_dofs (const FiniteElementBase<dim> &);
+    virtual void distribute_dofs (const FiniteElementBase<dim> &);
 
                                     /**
                                      * Renumber the degrees of freedom according
@@ -513,9 +513,9 @@ class DoFHandler : public DoFDimensionInfo<dim> {
                                      * See the general documentation of this
                                      * class for more details.
                                      */
-    void renumber_dofs (const RenumberingMethod method,
-                       const bool use_constraints         = false,
-                       const vector<int> &starting_points = vector<int>());
+    virtual void renumber_dofs (const RenumberingMethod method,
+                               const bool use_constraints         = false,
+                               const vector<int> &starting_points = vector<int>());
     
                                     /**
                                      * Make up the constraint matrix which
@@ -1161,7 +1161,9 @@ class DoFHandler : public DoFDimensionInfo<dim> {
 
                                     /**
                                      * Return a constant reference to the
-                                     * selected finite element object.
+                                     * selected finite element object. This
+                                     * function is inline, so it should
+                                     * be reasonably fast.
                                      */
     const FiniteElementBase<dim> & get_selected_fe () const;
 
@@ -1227,8 +1229,27 @@ class DoFHandler : public DoFDimensionInfo<dim> {
                    int, int,
                    << "The dimension " << arg1 << " of the vector is wrong. "
                    << "It should be " << arg2);
-    
+
   protected:
+    
+                                    /**
+                                     * Address of the triangulation to
+                                     * work on.
+                                     */
+    Triangulation<dim> * const tria;
+
+                                    /**
+                                     * Store a copy of the finite element given
+                                     * latest for the distribution of dofs. In
+                                     * fact, since the FE base class itself has
+                                     * not much functionality, this object only
+                                     * stores numbers such as the number of
+                                     * dofs per line, but also restriction
+                                     * and prolongation matrices, etc.
+                                     */
+    const FiniteElementBase<dim>   *selected_fe;
+
+  private:
                                     /**
                                      * Reserve enough space in the 
                                      * #levels[]# objects to store the
@@ -1288,12 +1309,6 @@ class DoFHandler : public DoFDimensionInfo<dim> {
                        const cell_iterator &new_cell,
                        dSMatrix            &transfer_matrix) const;
 
-                                    /**
-                                     * Address of the triangulation to
-                                     * work on.
-                                     */
-    Triangulation<dim> * const tria;
-
                                     /**
                                      * Space to store the DoF numbers for the
                                      * different levels. Analogous to the
@@ -1302,17 +1317,6 @@ class DoFHandler : public DoFDimensionInfo<dim> {
                                      */
     vector<DoFLevel<dim>*>    levels;
 
-                                    /**
-                                     * Store a copy of the finite element given
-                                     * latest for the distribution of dofs. In
-                                     * fact, since the FE base class itself has
-                                     * not much functionality, this object only
-                                     * stores numbers such as the number of
-                                     * dofs per line, but also restriction
-                                     * and prolongation matrices, etc.
-                                     */
-    const FiniteElementBase<dim>   *selected_fe;
-
                                     /**
                                      * Store the number of dofs created last
                                      * time.
@@ -1337,6 +1341,20 @@ class DoFHandler : public DoFDimensionInfo<dim> {
 
 
 
+/* ----------------------- Inline functions ---------------------------------- */
+
+
+template <int dim>
+inline
+const FiniteElementBase<dim> & DoFHandler<dim>::get_selected_fe () const {
+  return *selected_fe;
+};
+
+
+
+
+
+
 /*----------------------------   dof.h     ---------------------------*/
 /* end of #ifndef __dof_H */
 #endif
index e92cb404177707e4ff426f75bbbd890c1d81e23d..1ff01dda017269a4697552c9a4f80b6c39f423e4 100644 (file)
@@ -759,13 +759,6 @@ const Triangulation<dim> & DoFHandler<dim>::get_tria () const {
 
 
 
-template <int dim>
-const FiniteElementBase<dim> & DoFHandler<dim>::get_selected_fe () const {
-  return *selected_fe;
-};
-
-
-
 template <int dim>
 void DoFHandler<dim>::distribute_dofs (const FiniteElementBase<dim> &fe) {
   Assert (tria->n_levels() > 0, ExcInvalidTriangulation());

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.