]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
changes for system elements
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 15 Feb 1999 16:40:14 +0000 (16:40 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 15 Feb 1999 16:40:14 +0000 (16:40 +0000)
git-svn-id: https://svn.dealii.org/trunk@806 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/fe/fe.h
deal.II/deal.II/include/fe/fe_values.h
deal.II/deal.II/source/dofs/dof_accessor.cc
deal.II/deal.II/source/dofs/dof_handler.cc
deal.II/deal.II/source/dofs/mg_dof_handler.cc
deal.II/deal.II/source/fe/fe.cc
deal.II/deal.II/source/fe/fe_lib.criss_cross.cc
deal.II/deal.II/source/fe/fe_linear_mapping.cc
deal.II/deal.II/source/fe/fe_values.cc
deal.II/deal.II/source/multigrid/mg_dof_handler.cc
deal.II/deal.II/source/numerics/matrices.cc

index 0579249e6454440642f39b20ddbd59a154a2228d..a7ac0c29303e65b06e363a0020140660f8a8d4cd 100644 (file)
 
 
 template <int dim> class Boundary;
-template <int dim> struct FiniteElementData;
+template <int dim> class FiniteElementData;
 
 
 
 /**
- * Dimension dependent data for finite elements. See the #FiniteElementBase#
+ * Dimension independent data for finite elements. See the #FiniteElementBase#
  * class for more information.
  */
-struct FiniteElementData<1> {
+template<int dim>
+class FiniteElementData
+{
+  public:
                                     /**
                                      * Number of degrees of freedom on
                                      * a vertex.
@@ -36,6 +39,16 @@ struct FiniteElementData<1> {
                                      */
     const unsigned int dofs_per_line;
 
+                                    /** Number of degrees of freedom
+                                     *  on a quadrilateral.
+                                     */
+    const unsigned int dofs_per_quad;
+
+                                    /** Number of degrees of freedom
+                                     *  on a hexahedron.
+                                     */
+    const unsigned int dofs_per_hex;
+
                                     /**
                                      * Number of degrees of freedom on a
                                      * face. This information is
@@ -47,98 +60,19 @@ struct FiniteElementData<1> {
     const unsigned int dofs_per_face;
     
                                     /**
-                                     * Total number of degrees of freedom
-                                     * on a cell. This information is
-                                     * redundant to some fields in the
-                                     * derived classes but makes
-                                     * writing dimension independant
-                                     * programs easier.
-                                     */
-    const unsigned int total_dofs;
-
-                                    /**
-                                     * Number of basis functions used for the
-                                     * transformation from unit cell to real
-                                     * cell. For a linear mapping, this number
-                                     * equals the number of vertices.
+                                     * First index of dof on a line.
                                      */
-    const unsigned int n_transform_functions;
+    const unsigned int first_line_index;
     
-                                  /**
-                                   * Number of components.
-                                   */
-    const unsigned int n_components;
-
-                                    /**
-                                     * Default constructor. Constructs an element
-                                     * which is not so useful. Checking
-                                     * #total_dofs# is therefore a good way to
-                                     * check if something went wrong.
-                                     */
-    FiniteElementData ();
-
-                                    /**
-                                     * A more useful version to construct
-                                     * an object of this type.
-                                     */
-    FiniteElementData (const unsigned int dofs_per_vertex,
-                      const unsigned int dofs_per_line,
-                      const unsigned int n_transform_functions,
-                      const unsigned int n_components = 1);
-
-                                    /**
-                                     * Another frequently used useful
-                                     * constructor, copying the data from
-                                     * another object.
-                                     */
-    FiniteElementData (const FiniteElementData<1> &fe_data);
-
-                                    /**
-                                     * Comparison operator. It is not clear to
-                                     * me why we have to declare and implement
-                                     * this one explicitely.
-                                     */
-    bool operator == (const FiniteElementData<1> &) const;
-
-                                    /**
-                                     * Exception
-                                     */
-    DeclException0 (ExcInternalError);
-};
-
-
-
-
-/**
- * Dimension dependent data for finite elements. See the #FiniteElementBase#
- * class for more information.
- */
-struct FiniteElementData<2> {
                                     /**
-                                     * Number of degrees of freedom on
-                                     * a vertex.
-                                     */
-    const unsigned int dofs_per_vertex;
-
-                                    /** Number of degrees of freedom
-                                     *  on a line.
-                                     */
-    const unsigned int dofs_per_line;
-
-                                    /** Number of degrees of freedom
-                                     *  on a quad.
+                                     * First index of dof on a quad.
                                      */
-    const unsigned int dofs_per_quad;
-
+    const unsigned int first_quad_index;
+    
                                     /**
-                                     * Number of degrees of freedom on a
-                                     * face. This information is
-                                     * redundant to some fields in the
-                                     * derived classes but makes
-                                     * writing dimension independant
-                                     * programs easier.
+                                     * First index of dof on a hexahedron.
                                      */
-    const unsigned int dofs_per_face;
+    const unsigned int first_hex_index;
     
                                     /**
                                      * Total number of degrees of freedom
@@ -172,21 +106,41 @@ struct FiniteElementData<2> {
     FiniteElementData ();
 
                                     /**
-                                     * A more useful version to construct
-                                     * an object of this type.
+                                     * Constructor for a 1-dimensional
+                                     * object.
+                                     */
+    FiniteElementData (const unsigned int dofs_per_vertex,
+                      const unsigned int dofs_per_line,
+                      const unsigned int n_transform_functions,
+                      const unsigned int n_components);
+
+                                    /**
+                                     * Constructor for a 2-dimensional
+                                     * object.
                                      */
     FiniteElementData (const unsigned int dofs_per_vertex,
                       const unsigned int dofs_per_line,
                       const unsigned int dofs_per_quad,
                       const unsigned int n_transform_functions,
-                      const unsigned int n_components = 1);
+                      const unsigned int n_components);
 
-                                    /**
-                                     * Another frequently used useful
-                                     * constructor, copying the data from
-                                     * another object.
+                                    /**
+                                     * Constructor for a 3-dimensional
+                                     * object.
                                      */
-    FiniteElementData (const FiniteElementData<2> &fe_data);
+    FiniteElementData (const unsigned int dofs_per_vertex,
+                      const unsigned int dofs_per_line,
+                      const unsigned int dofs_per_quad,
+                      const unsigned int dofs_per_hex,
+                      const unsigned int n_transform_functions,
+                      const unsigned int n_components);
+
+//                                          /**
+//                                   * Another frequently used useful
+//                                   * constructor, copying the data from
+//                                   * another object.
+//                                   */
+//     FiniteElementData (const FiniteElementData<2> &fe_data);
 
                                     /**
                                      * Comparison operator. It is not clear to
@@ -198,7 +152,8 @@ struct FiniteElementData<2> {
                                     /**
                                      * Exception
                                      */
-    DeclException0 (ExcInternalError);
+    DeclException2 (ExcDimensionMismatch, int, int,
+                   << "used " << arg1 << "-d constructor for " << arg2 << "-d object");
 };
 
     
@@ -1175,7 +1130,7 @@ class FiniteElement : public FiniteElementBase<dim> {
 
 template <int dim>
 inline unsigned
-FiniteElementBase<dim>::component_to_system_index (unsigned component,
+FiniteElementBase<dim>::component_to_system_index (unsigned /*component*/,
                                                   unsigned component_index) const
 {
   Assert(false, ExcNotImplemented());
index 06c5d119b69f791fc0c0b6187fabb74d145351c8..273e0fbeb71fae407dca321c861c87666b860a3b 100644 (file)
@@ -248,7 +248,7 @@ class FEValuesBase {
                                      */
     FEValuesBase (const unsigned int n_q_points,
                  const unsigned int n_support_points,
-                 const unsigned int n_dofs,
+                 const unsigned int total_dofs,
                  const unsigned int n_transform_functions,
                  const unsigned int n_values_array,
                  const UpdateFlags         update_flags,
@@ -879,7 +879,7 @@ class FEFaceValuesBase : public FEValuesBase<dim> {
                                      */
     FEFaceValuesBase (const unsigned int n_q_points,
                      const unsigned int n_support_points,
-                     const unsigned int n_dofs,
+                     const unsigned int total_dofs,
                      const unsigned int n_transform_functions,
                      const unsigned int n_faces_or_subfaces,
                      const UpdateFlags         update_flags,
index c55ffbac34a259892f1a83c497401a5ff5a52cac..d8a664ddfeb00468c07c9ff011927a05ec121f0e 100644 (file)
@@ -565,11 +565,11 @@ template <int dim>
 void
 DoFCellAccessor<dim>::get_interpolated_dof_values (const dVector &values,
                                                   dVector       &interpolated_values) const {
-  const unsigned int total_dofs = dof_handler->get_fe().total_dofs;
+  const unsigned int n_dofs = dof_handler->get_fe().total_dofs;
   
   Assert (dof_handler != 0, ExcInvalidObject());
   Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
-  Assert (interpolated_values.size() == total_dofs,
+  Assert (interpolated_values.size() == n_dofs,
          ExcVectorDoesNotMatch());
   Assert (values.size() == dof_handler->n_dofs(),
          ExcVectorDoesNotMatch());
@@ -581,8 +581,8 @@ DoFCellAccessor<dim>::get_interpolated_dof_values (const dVector &values,
   else
                                     // otherwise clobber them from the children
     {
-      dVector tmp1(total_dofs);
-      dVector tmp2(total_dofs);
+      dVector tmp1(n_dofs);
+      dVector tmp2(n_dofs);
       
       interpolated_values.clear ();
 
@@ -605,7 +605,7 @@ DoFCellAccessor<dim>::get_interpolated_dof_values (const dVector &values,
                                           // end in adding up the contribution
                                           // from nodes on boundaries of
                                           // children more than once.
-         for (unsigned int i=0; i<total_dofs; ++i)
+         for (unsigned int i=0; i<n_dofs; ++i)
            if (tmp2(i) != 0)
              interpolated_values(i) = tmp2(i);
        };
@@ -618,11 +618,11 @@ template <int dim>
 void
 DoFCellAccessor<dim>::set_dof_values_by_interpolation (const dVector &local_values,
                                                       dVector       &values) const {
-  const unsigned int total_dofs = dof_handler->get_fe().total_dofs;
+  const unsigned int n_dofs = dof_handler->get_fe().total_dofs;
   
   Assert (dof_handler != 0, ExcInvalidObject());
   Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
-  Assert (local_values.size() == total_dofs,
+  Assert (local_values.size() == n_dofs,
          ExcVectorDoesNotMatch());
   Assert (values.size() == dof_handler->n_dofs(),
          ExcVectorDoesNotMatch());
@@ -634,7 +634,7 @@ DoFCellAccessor<dim>::set_dof_values_by_interpolation (const dVector &local_valu
   else
                                     // otherwise distribute them to the children
     {
-      dVector tmp(total_dofs);
+      dVector tmp(n_dofs);
       
       for (unsigned int child=0; child<GeometryInfo<dim>::children_per_cell;
           ++child)
index b8eab582f3bb0d9d79e5bf4e2303597b074f4b14..5ea73946f1ae24bc13d680a3058a0a990be3ba07 100644 (file)
@@ -1037,7 +1037,7 @@ void DoFHandler<dim>::renumber_dofs (const RenumberingMethod method,
       constraints.condense (sparsity);
     };
     
-  int n_dofs = sparsity.n_rows();
+  int total_dofs = sparsity.n_rows();
                                   // store the new dof numbers; -1 means
                                   // that no new number was chosen yet
                                   //
@@ -1056,7 +1056,7 @@ void DoFHandler<dim>::renumber_dofs (const RenumberingMethod method,
   
                                   // delete disallowed elements
   for (unsigned int i=0; i<last_round_dofs.size(); ++i)
-    if ((last_round_dofs[i]<0) || (last_round_dofs[i]>=n_dofs))
+    if ((last_round_dofs[i]<0) || (last_round_dofs[i]>=total_dofs))
       last_round_dofs[i] = -1;
   
   remove_if (last_round_dofs.begin(), last_round_dofs.end(),
@@ -1069,8 +1069,8 @@ void DoFHandler<dim>::renumber_dofs (const RenumberingMethod method,
   if (last_round_dofs.size() == 0)
     {
       int          starting_point   = -1;
-      unsigned int min_coordination = n_dofs;
-      for (int row=0; row<n_dofs; ++row) 
+      unsigned int min_coordination = total_dofs;
+      for (int row=0; row<total_dofs; ++row) 
        {
          unsigned int j;
          for (j=sparsity.get_rowstart_indices()[row];
@@ -1179,7 +1179,7 @@ void DoFHandler<dim>::renumber_dofs (const RenumberingMethod method,
                                   //  test for all indices numbered
   if (find (new_number.begin(), new_number.end(), -1) != new_number.end())
     Assert (false, ExcRenumberingIncomplete());
-  Assert (next_free_number == n_dofs,
+  Assert (next_free_number == total_dofs,
          ExcRenumberingIncomplete());
 #endif
 
@@ -1190,7 +1190,7 @@ void DoFHandler<dim>::renumber_dofs (const RenumberingMethod method,
       case reverse_Cuthill_McKee:
       {
        for (vector<int>::iterator i=new_number.begin(); i!=new_number.end(); ++i)
-         *i = n_dofs-*i;
+         *i = total_dofs-*i;
        break;
       };
       default:
index c1ce677a99cc40215dde75fe3be2ba364be5d8df..097382612d03f51f2fe26c5d93447f591ac3a9ea 100644 (file)
@@ -1009,16 +1009,16 @@ void MGDoFHandler<dim>::make_sparsity_pattern (const unsigned int  level,
   Assert (sparsity.n_cols() == n_dofs(level),
          ExcDifferentDimensions (sparsity.n_cols(), n_dofs(level)));
 
-  const unsigned int total_dofs = selected_fe->total_dofs;
-  vector<int> dofs_on_this_cell(total_dofs);
+  const unsigned int n_dofs = selected_fe->total_dofs;
+  vector<int> dofs_on_this_cell(n_dofs);
   cell_iterator cell = begin_active(level),
                endc = end(level);
   for (; cell!=endc; ++cell) 
     {
       cell->get_mg_dof_indices (dofs_on_this_cell);
                                       // make sparsity pattern for this cell
-      for (unsigned int i=0; i<total_dofs; ++i)
-       for (unsigned int j=0; j<total_dofs; ++j)
+      for (unsigned int i=0; i<n_dofs; ++i)
+       for (unsigned int j=0; j<n_dofs; ++j)
          sparsity.add (dofs_on_this_cell[i],
                        dofs_on_this_cell[j]);
     };
index c0c7901767f009283814385ff720a3b4e3017d7c..f8e488b8fd54b3dc70f6d45b7138ac9c7ff2894d 100644 (file)
 #include <grid/tria_boundary.h>
 
 
-
+#define UNDEF 0
 
 
 /*------------------------------- FiniteElementData ----------------------*/
 
-#if deal_II_dimension == 1
-
-FiniteElementData<1>::FiniteElementData () :
-               dofs_per_vertex(0),
-               dofs_per_line(0),
-               dofs_per_face(0),
-               total_dofs(0),
-               n_transform_functions(0),
-               n_components(0)
+template <int dim>
+FiniteElementData<dim>::FiniteElementData ()
 {
-  Assert (false, ExcInternalError());
+  Assert (false, ExcNotImplemented());
 };
 
 
-
-FiniteElementData<1>::FiniteElementData (const unsigned int dofs_per_vertex,
-                                        const unsigned int dofs_per_line,
-                                        const unsigned int n_transform_functions,
-                                        const unsigned int n_components) :
+template <int dim>
+FiniteElementData<dim>::FiniteElementData (const unsigned int dofs_per_vertex,
+                                          const unsigned int dofs_per_line,
+                                          const unsigned int dofs_per_quad,
+                                          const unsigned int dofs_per_hex,
+                                          const unsigned int n_transform_functions,
+                                          const unsigned int n_components) :
                dofs_per_vertex(dofs_per_vertex),
                dofs_per_line(dofs_per_line),
-               dofs_per_face(dofs_per_vertex),
-               total_dofs (2*dofs_per_vertex+dofs_per_line),
-               n_transform_functions(n_transform_functions),
+               dofs_per_quad(dofs_per_quad),
+               dofs_per_hex(dofs_per_hex),
+               dofs_per_face(GeometryInfo<dim>::vertices_per_face * dofs_per_vertex+
+                             GeometryInfo<dim>::faces_per_cell * dofs_per_quad),
+               first_line_index(GeometryInfo<dim>::vertices_per_cell * dofs_per_vertex),
+               first_quad_index(first_line_index+
+                                12*dofs_per_line),
+               first_hex_index(first_quad_index+
+                               GeometryInfo<dim>::faces_per_cell * dofs_per_quad),
+               total_dofs (first_hex_index+dofs_per_hex),
+               n_transform_functions (n_transform_functions),
                n_components(n_components)
-{};
-
-
-
-FiniteElementData<1>::FiniteElementData (const FiniteElementData<1> &fe_data) :
-               dofs_per_vertex(fe_data.dofs_per_vertex),
-               dofs_per_line(fe_data.dofs_per_line),
-               dofs_per_face(fe_data.dofs_per_face),
-               total_dofs (fe_data.total_dofs),
-               n_transform_functions(fe_data.n_transform_functions),
-               n_components(fe_data.n_components)
-{};
-
-
-
-bool FiniteElementData<1>::operator== (const FiniteElementData<1> &f) const {
-  return ((dofs_per_vertex == f.dofs_per_vertex) &&
-         (dofs_per_line == f.dofs_per_line) &&
-         (total_dofs == f.total_dofs) &&
-         (n_components == f.n_components));
-};
-
-#endif
-
-
-
-#if deal_II_dimension == 2
-
-
-FiniteElementData<2>::FiniteElementData () :
-               dofs_per_vertex(0),
-               dofs_per_line(0),
-               dofs_per_quad(0),
-               dofs_per_face(0),
-               total_dofs(0),
-               n_transform_functions(0),
-               n_components(0)
 {
-  Assert (false, ExcInternalError());
+  Assert(dim==3, ExcDimensionMismatch(3,dim));
 };
 
-
-
-FiniteElementData<2>::FiniteElementData (const unsigned int dofs_per_vertex,
-                                        const unsigned int dofs_per_line,
-                                        const unsigned int dofs_per_quad,
-                                        const unsigned int n_transform_functions,
-                                        const unsigned int n_components) :
+template <int dim>
+FiniteElementData<dim>::FiniteElementData (const unsigned int dofs_per_vertex,
+                                          const unsigned int dofs_per_line,
+                                          const unsigned int dofs_per_quad,
+                                          const unsigned int n_transform_functions,
+                                          const unsigned int n_components) :
                dofs_per_vertex(dofs_per_vertex),
                dofs_per_line(dofs_per_line),
                dofs_per_quad(dofs_per_quad),
-               dofs_per_face(2*dofs_per_vertex+
-                             dofs_per_line),
-               total_dofs (4*dofs_per_vertex+
-                           4*dofs_per_line+
-                           dofs_per_quad),
+               dofs_per_hex(0),
+               dofs_per_face(GeometryInfo<dim>::vertices_per_face * dofs_per_vertex+
+                             GeometryInfo<dim>::faces_per_cell * dofs_per_line),
+               first_line_index(GeometryInfo<dim>::vertices_per_cell * dofs_per_vertex),
+               first_quad_index(first_line_index+
+                                GeometryInfo<dim>::lines_per_cell * dofs_per_line),
+               first_hex_index(first_quad_index+
+                               GeometryInfo<dim>::quads_per_cell*dofs_per_quad),
+               total_dofs (first_quad_index+dofs_per_quad),
                n_transform_functions (n_transform_functions),
                n_components(n_components)
-{};
+{
+  Assert(dim==2, ExcDimensionMismatch(2,dim));
+};
 
+template <int dim>
+FiniteElementData<dim>::FiniteElementData (const unsigned int dofs_per_vertex,
+                                          const unsigned int dofs_per_line,
+                                          const unsigned int n_transform_functions,
+                                          const unsigned int n_components) :
+               dofs_per_vertex(dofs_per_vertex),
+               dofs_per_line(dofs_per_line),
+               dofs_per_quad(0),
+               dofs_per_hex(0),
+               dofs_per_face(GeometryInfo<dim>::vertices_per_face * dofs_per_vertex),
+               first_line_index(GeometryInfo<dim>::vertices_per_cell * dofs_per_vertex),
+               first_quad_index(first_line_index+
+                                GeometryInfo<dim>::lines_per_cell * dofs_per_line),
+               first_hex_index(first_quad_index+
+                               GeometryInfo<dim>::quads_per_cell*dofs_per_quad),
+               total_dofs (first_line_index+dofs_per_line),
+               n_transform_functions (n_transform_functions),
+               n_components(n_components)
+{
+  Assert(dim==1, ExcDimensionMismatch(1,dim));
+};
 
 
-FiniteElementData<2>::FiniteElementData (const FiniteElementData<2> &fe_data) :
-               dofs_per_vertex(fe_data.dofs_per_vertex),
-               dofs_per_line(fe_data.dofs_per_line),
-               dofs_per_quad(fe_data.dofs_per_quad),
-               dofs_per_face(fe_data.dofs_per_face),
-               total_dofs (fe_data.total_dofs),
-               n_transform_functions (fe_data.n_transform_functions),
-               n_components(fe_data.n_components)
-{};
 
+// FiniteElementData<2>::FiniteElementData (const FiniteElementData<2> &fe_data) :
+//             dofs_per_vertex(fe_data.dofs_per_vertex),
+//             dofs_per_line(fe_data.dofs_per_line),
+//             dofs_per_quad(fe_data.dofs_per_quad),
+//             dofs_per_face(fe_data.dofs_per_face),
+//             total_dofs (fe_data.total_dofs),
+//             n_transform_functions (fe_data.n_transform_functions),
+//             n_components(fe_data.n_components)
+// {};
 
 
-bool FiniteElementData<2>::operator== (const FiniteElementData<2> &f) const {
+template<int dim>
+bool FiniteElementData<dim>::operator== (const FiniteElementData<2> &f) const
+{
   return ((dofs_per_vertex == f.dofs_per_vertex) &&
          (dofs_per_line == f.dofs_per_line) &&
          (dofs_per_quad == f.dofs_per_quad) &&
-         (total_dofs == f.total_dofs) &&
+         (dofs_per_hex == f.dofs_per_hex) &&
+         (n_transform_functions == f.n_transform_functions) &&
          (n_components == f.n_components));
 };
 
-#endif
-
 
 
 /*------------------------------- FiniteElementBase ----------------------*/
@@ -131,7 +124,8 @@ bool FiniteElementData<2>::operator== (const FiniteElementData<2> &f) const {
 
 template <>
 FiniteElementBase<1>::FiniteElementBase (const FiniteElementData<1> &fe_data) :
-               FiniteElementData<1> (fe_data)
+               FiniteElementData<1> (fe_data),
+               system_to_component_table(total_dofs)
 {
   const unsigned int dim=1;
   for (unsigned int i=0; i<GeometryInfo<dim>::children_per_cell; ++i) 
@@ -153,7 +147,8 @@ FiniteElementBase<1>::FiniteElementBase (const FiniteElementData<1> &fe_data) :
 
 template <>
 FiniteElementBase<2>::FiniteElementBase (const FiniteElementData<2> &fe_data) :
-               FiniteElementData<2> (fe_data)
+               FiniteElementData<2> (fe_data),
+               system_to_component_table(total_dofs)
 {
   const unsigned int dim=2;
   for (unsigned int i=0; i<GeometryInfo<dim>::children_per_cell; ++i) 
@@ -520,6 +515,7 @@ void FiniteElement<dim>::get_support_points (const DoFHandler<dim>::cell_iterato
 
 /*------------------------------- Explicit Instantiations -------------*/
 
+template class FiniteElementData<deal_II_dimension>;
 template class FiniteElementBase<deal_II_dimension>;
 template class FiniteElement<deal_II_dimension>;
 
index 94bf7e09f25d2f541b32ac128163db522ce6d99f..40f21263bdc9a4f4395ac02ec58708157db92077 100644 (file)
 template <>
 FECrissCross<1>::FECrissCross () :
                                   // set more or less invalid data
-               FiniteElement<1> (FiniteElementData<1> (0,0,0))
+               FiniteElement<1> (FiniteElementData<1> (0,0,0,0))
 {
   Assert (false, ExcNotUseful());
 };
@@ -464,7 +464,7 @@ void FECrissCross<1>::fill_fe_values (const DoFHandler<1>::cell_iterator &,
 
 template <>
 FECrissCross<2>::FECrissCross () :
-               FiniteElement<2> (FiniteElementData<2> (1,0,1,5))
+               FiniteElement<2> (FiniteElementData<2> (1,0,1,5,1))
 {
   interface_constraints(0,0) = 1./2.;
   interface_constraints(0,1) = 1./2.;
index bbbaad3aa8db26328c1a225da702775b7324292d..a5b47dbce5791c139e5b2a1e2a7e54b4524f8b25 100644 (file)
@@ -24,7 +24,8 @@ FELinearMapping<1>::FELinearMapping (const unsigned int dofs_per_vertex,
                                     const unsigned int dofs_per_quad) :
                FiniteElement<1> (FiniteElementData<1> (dofs_per_vertex,
                                                        dofs_per_line,
-                                                       GeometryInfo<1>::vertices_per_cell))
+                                                       GeometryInfo<1>::vertices_per_cell,
+                                                       1))
 {
   Assert (dofs_per_quad==0, ExcInvalidData());
 };
@@ -146,7 +147,8 @@ FELinearMapping<2>::FELinearMapping (const unsigned int dofs_per_vertex,
                FiniteElement<2> (FiniteElementData<2> (dofs_per_vertex,
                                                        dofs_per_line,
                                                        dofs_per_quad,
-                                                       GeometryInfo<2>::vertices_per_cell))
+                                                       GeometryInfo<2>::vertices_per_cell,
+                                                       1))
 {};
 
 
index 48904594ddc7be47e8d4a22a28ae91b7e4215a05..8b51c2e287e83d9e7c6a6e2cbfec2515f3b165f3 100644 (file)
 template <int dim>
 FEValuesBase<dim>::FEValuesBase (const unsigned int n_q_points,
                                 const unsigned int n_support_points,
-                                const unsigned int n_dofs,
+                                const unsigned int total_dofs,
                                 const unsigned int n_transform_functions,
                                 const unsigned int n_values_arrays,
                                 const UpdateFlags update_flags,
                                 const FiniteElement<dim> &fe) :
                n_quadrature_points (n_q_points),
-               total_dofs (n_dofs),
+               total_dofs (total_dofs),
                n_transform_functions (n_transform_functions),
-               shape_values (n_values_arrays, dFMatrix(n_dofs, n_q_points)),
-               shape_gradients (n_dofs, vector<Tensor<1,dim> >(n_q_points)),
-               shape_2nd_derivatives (n_dofs, vector<Tensor<2,dim> >(n_q_points)),
+               shape_values (n_values_arrays, dFMatrix(total_dofs, n_q_points)),
+               shape_gradients (total_dofs, vector<Tensor<1,dim> >(n_q_points)),
+               shape_2nd_derivatives (total_dofs, vector<Tensor<2,dim> >(n_q_points)),
                weights (n_q_points, 0),
                JxW_values (n_q_points, 0),
                quadrature_points (n_q_points, Point<dim>()),
@@ -350,23 +350,23 @@ void FEValues<dim>::reinit (const typename DoFHandler<dim>::cell_iterator &cell,
 template <int dim>
 FEFaceValuesBase<dim>::FEFaceValuesBase (const unsigned int n_q_points,
                                         const unsigned int n_support_points,
-                                        const unsigned int n_dofs,
+                                        const unsigned int total_dofs,
                                         const unsigned int n_transform_functions,
                                         const unsigned int n_faces_or_subfaces,
                                         const UpdateFlags         update_flags,
                                         const FiniteElement<dim> &fe) :
                FEValuesBase<dim> (n_q_points,
                                   n_support_points,
-                                  n_dofs,
+                                  total_dofs,
                                   n_transform_functions,
                                   n_faces_or_subfaces,
                                   update_flags,
                                   fe),
                unit_shape_gradients (n_faces_or_subfaces,
-                                     vector<vector<Tensor<1,dim> > >(n_dofs,
+                                     vector<vector<Tensor<1,dim> > >(total_dofs,
                                                                   vector<Tensor<1,dim> >(n_q_points))),
                unit_shape_2nd_derivatives(n_faces_or_subfaces,
-                                          vector<vector<Tensor<2,dim> > >(n_dofs,
+                                          vector<vector<Tensor<2,dim> > >(total_dofs,
                                                                           vector<Tensor<2,dim> >(n_q_points))),
                unit_shape_gradients_transform (n_faces_or_subfaces,
                                                vector<vector<Tensor<1,dim> > >(n_transform_functions,
index c1ce677a99cc40215dde75fe3be2ba364be5d8df..097382612d03f51f2fe26c5d93447f591ac3a9ea 100644 (file)
@@ -1009,16 +1009,16 @@ void MGDoFHandler<dim>::make_sparsity_pattern (const unsigned int  level,
   Assert (sparsity.n_cols() == n_dofs(level),
          ExcDifferentDimensions (sparsity.n_cols(), n_dofs(level)));
 
-  const unsigned int total_dofs = selected_fe->total_dofs;
-  vector<int> dofs_on_this_cell(total_dofs);
+  const unsigned int n_dofs = selected_fe->total_dofs;
+  vector<int> dofs_on_this_cell(n_dofs);
   cell_iterator cell = begin_active(level),
                endc = end(level);
   for (; cell!=endc; ++cell) 
     {
       cell->get_mg_dof_indices (dofs_on_this_cell);
                                       // make sparsity pattern for this cell
-      for (unsigned int i=0; i<total_dofs; ++i)
-       for (unsigned int j=0; j<total_dofs; ++j)
+      for (unsigned int i=0; i<n_dofs; ++i)
+       for (unsigned int j=0; j<n_dofs; ++j)
          sparsity.add (dofs_on_this_cell[i],
                        dofs_on_this_cell[j]);
     };
index 9075fc1e9fe52efc1c0ce63bd5c3daa687645226..3f58bea32682f85ffcc9ed4911561d404a112009 100644 (file)
@@ -85,10 +85,10 @@ void MatrixCreator<dim>::create_mass_matrix (const DoFHandler<dim>    &dof,
                                             const FiniteElement<dim> &fe,
                                             const Boundary<dim>      &boundary,
                                             dSMatrix                 &matrix) {
-  const unsigned int total_dofs = fe.total_dofs;
+  const unsigned int n_dofs = fe.total_dofs;
   
-  dFMatrix    local_mass_matrix (total_dofs, total_dofs);
-  vector<int> dofs_on_this_cell (total_dofs);
+  dFMatrix    local_mass_matrix (n_dofs, n_dofs);
+  vector<int> dofs_on_this_cell (n_dofs);
   
   DoFHandler<dim>::active_cell_iterator cell = dof.begin_active(),
                                        endc = dof.end();
@@ -97,8 +97,8 @@ void MatrixCreator<dim>::create_mass_matrix (const DoFHandler<dim>    &dof,
       cell->get_dof_indices (dofs_on_this_cell);
       fe.get_local_mass_matrix (cell, boundary, local_mass_matrix);
       
-      for (unsigned int i=0; i<total_dofs; ++i)
-       for (unsigned int j=0; j<total_dofs; ++j)
+      for (unsigned int i=0; i<n_dofs; ++i)
+       for (unsigned int j=0; j<n_dofs; ++j)
          matrix.add (dofs_on_this_cell[i], dofs_on_this_cell[j],
                      local_mass_matrix(i,j));
     };
@@ -544,13 +544,13 @@ template <int dim>
 void MassMatrix<dim>::assemble (dFMatrix            &cell_matrix,
                                const FEValues<dim> &fe_values,
                                const typename Triangulation<dim>::cell_iterator &) const {
-  const unsigned int total_dofs = fe_values.total_dofs,
+  const unsigned int n_dofs = fe_values.total_dofs,
                     n_q_points = fe_values.n_quadrature_points;
 
-  Assert (cell_matrix.n() == total_dofs,
-         ExcWrongSize(cell_matrix.n(), total_dofs));
-  Assert (cell_matrix.m() == total_dofs,
-         ExcWrongSize(cell_matrix.m(), total_dofs));
+  Assert (cell_matrix.n() == n_dofs,
+         ExcWrongSize(cell_matrix.n(), n_dofs));
+  Assert (cell_matrix.m() == n_dofs,
+         ExcWrongSize(cell_matrix.m(), n_dofs));
   Assert (cell_matrix.all_zero(), ExcObjectNotEmpty());
   
   const dFMatrix       &values    = fe_values.get_shape_values ();
@@ -562,8 +562,8 @@ void MassMatrix<dim>::assemble (dFMatrix            &cell_matrix,
       vector<double> coefficient_values (fe_values.n_quadrature_points);
       coefficient->value_list (fe_values.get_quadrature_points(),
                               coefficient_values);
-      for (unsigned int i=0; i<total_dofs; ++i) 
-       for (unsigned int j=0; j<total_dofs; ++j)
+      for (unsigned int i=0; i<n_dofs; ++i) 
+       for (unsigned int j=0; j<n_dofs; ++j)
          for (unsigned int point=0; point<n_q_points; ++point)
            cell_matrix(i,j) += (values(i,point) *
                                 values(j,point) *
@@ -571,8 +571,8 @@ void MassMatrix<dim>::assemble (dFMatrix            &cell_matrix,
                                 coefficient_values[point]);
     }
   else
-    for (unsigned int i=0; i<total_dofs; ++i) 
-      for (unsigned int j=0; j<total_dofs; ++j)
+    for (unsigned int i=0; i<n_dofs; ++i) 
+      for (unsigned int j=0; j<n_dofs; ++j)
        for (unsigned int point=0; point<n_q_points; ++point)
          cell_matrix(i,j) += (values(i,point) *
                               values(j,point) *
@@ -588,15 +588,15 @@ void MassMatrix<dim>::assemble (dFMatrix            &cell_matrix,
                                const Triangulation<dim>::cell_iterator &) const {
   Assert (right_hand_side != 0, ExcNoRHSSelected());
 
-  const unsigned int total_dofs = fe_values.total_dofs,
+  const unsigned int n_dofs = fe_values.total_dofs,
                     n_q_points = fe_values.n_quadrature_points;
 
-  Assert (cell_matrix.n() == total_dofs,
-         ExcWrongSize(cell_matrix.n(), total_dofs));
-  Assert (cell_matrix.m() == total_dofs,
-         ExcWrongSize(cell_matrix.m(), total_dofs));
-  Assert (rhs.size() == total_dofs,
-         ExcWrongSize(rhs.size(), total_dofs));
+  Assert (cell_matrix.n() == n_dofs,
+         ExcWrongSize(cell_matrix.n(), n_dofs));
+  Assert (cell_matrix.m() == n_dofs,
+         ExcWrongSize(cell_matrix.m(), n_dofs));
+  Assert (rhs.size() == n_dofs,
+         ExcWrongSize(rhs.size(), n_dofs));
   Assert (cell_matrix.all_zero(), ExcObjectNotEmpty());
   Assert (rhs.all_zero(), ExcObjectNotEmpty());
 
@@ -611,9 +611,9 @@ void MassMatrix<dim>::assemble (dFMatrix            &cell_matrix,
       coefficient->value_list (fe_values.get_quadrature_points(),
                               coefficient_values);
       for (unsigned int point=0; point<n_q_points; ++point)
-       for (unsigned int i=0; i<total_dofs; ++i) 
+       for (unsigned int i=0; i<n_dofs; ++i) 
          {
-           for (unsigned int j=0; j<total_dofs; ++j)
+           for (unsigned int j=0; j<n_dofs; ++j)
              cell_matrix(i,j) += (values(i,point) *
                                   values(j,point) *
                                   weights[point] *
@@ -625,9 +625,9 @@ void MassMatrix<dim>::assemble (dFMatrix            &cell_matrix,
     }
   else
     for (unsigned int point=0; point<n_q_points; ++point)
-      for (unsigned int i=0; i<total_dofs; ++i) 
+      for (unsigned int i=0; i<n_dofs; ++i) 
        {
-         for (unsigned int j=0; j<total_dofs; ++j)
+         for (unsigned int j=0; j<n_dofs; ++j)
            cell_matrix(i,j) += (values(i,point) *
                                 values(j,point) *
                                 weights[point]);
@@ -645,10 +645,10 @@ void MassMatrix<dim>::assemble (dVector             &rhs,
                                const Triangulation<dim>::cell_iterator &) const {
   Assert (right_hand_side != 0, ExcNoRHSSelected());
 
-  const unsigned int total_dofs = fe_values.total_dofs,
+  const unsigned int n_dofs = fe_values.total_dofs,
                     n_q_points = fe_values.n_quadrature_points;
 
-  Assert (rhs.size() == total_dofs, ExcWrongSize(rhs.size(), total_dofs));
+  Assert (rhs.size() == n_dofs, ExcWrongSize(rhs.size(), n_dofs));
   Assert (rhs.all_zero(), ExcObjectNotEmpty());
 
   const dFMatrix       &values    = fe_values.get_shape_values ();
@@ -657,7 +657,7 @@ void MassMatrix<dim>::assemble (dVector             &rhs,
   right_hand_side->value_list (fe_values.get_quadrature_points(), rhs_values);
 
   for (unsigned int point=0; point<n_q_points; ++point)
-    for (unsigned int i=0; i<total_dofs; ++i) 
+    for (unsigned int i=0; i<n_dofs; ++i) 
       rhs(i) += values(i,point) *
                rhs_values[point] *
                weights[point];
@@ -682,15 +682,15 @@ void LaplaceMatrix<dim>::assemble (dFMatrix            &cell_matrix,
                                   const Triangulation<dim>::cell_iterator &) const {
   Assert (right_hand_side != 0, ExcNoRHSSelected());
   
-  const unsigned int total_dofs = fe_values.total_dofs,
+  const unsigned int n_dofs = fe_values.total_dofs,
                     n_q_points = fe_values.n_quadrature_points;
 
-  Assert (cell_matrix.n() == total_dofs,
-         ExcWrongSize(cell_matrix.n(), total_dofs));
-  Assert (cell_matrix.m() == total_dofs,
-         ExcWrongSize(cell_matrix.m(), total_dofs));
-  Assert (rhs.size() == total_dofs,
-         ExcWrongSize(rhs.size(), total_dofs));
+  Assert (cell_matrix.n() == n_dofs,
+         ExcWrongSize(cell_matrix.n(), n_dofs));
+  Assert (cell_matrix.m() == n_dofs,
+         ExcWrongSize(cell_matrix.m(), n_dofs));
+  Assert (rhs.size() == n_dofs,
+         ExcWrongSize(rhs.size(), n_dofs));
   Assert (cell_matrix.all_zero(), ExcObjectNotEmpty());
   Assert (rhs.all_zero(), ExcObjectNotEmpty());
 
@@ -706,9 +706,9 @@ void LaplaceMatrix<dim>::assemble (dFMatrix            &cell_matrix,
       coefficient->value_list (fe_values.get_quadrature_points(),
                               coefficient_values);
       for (unsigned int point=0; point<n_q_points; ++point)
-       for (unsigned int i=0; i<total_dofs; ++i) 
+       for (unsigned int i=0; i<n_dofs; ++i) 
          {
-           for (unsigned int j=0; j<total_dofs; ++j)
+           for (unsigned int j=0; j<n_dofs; ++j)
              cell_matrix(i,j) += (gradients[i][point] *
                                   gradients[j][point]) *
                                  weights[point] *
@@ -720,9 +720,9 @@ void LaplaceMatrix<dim>::assemble (dFMatrix            &cell_matrix,
     }
   else
     for (unsigned int point=0; point<n_q_points; ++point)
-      for (unsigned int i=0; i<total_dofs; ++i) 
+      for (unsigned int i=0; i<n_dofs; ++i) 
        {
-         for (unsigned int j=0; j<total_dofs; ++j)
+         for (unsigned int j=0; j<n_dofs; ++j)
            cell_matrix(i,j) += (gradients[i][point] *
                                 gradients[j][point]) *
                                weights[point];
@@ -739,13 +739,13 @@ template <int dim>
 void LaplaceMatrix<dim>::assemble (dFMatrix            &cell_matrix,
                                   const FEValues<dim> &fe_values,
                                   const Triangulation<dim>::cell_iterator &) const {
-  const unsigned int total_dofs = fe_values.total_dofs,
+  const unsigned int n_dofs = fe_values.total_dofs,
                     n_q_points = fe_values.n_quadrature_points;
 
-  Assert (cell_matrix.n() == total_dofs,
-         ExcWrongSize(cell_matrix.n(), total_dofs));
-  Assert (cell_matrix.m() == total_dofs,
-         ExcWrongSize(cell_matrix.m(), total_dofs));
+  Assert (cell_matrix.n() == n_dofs,
+         ExcWrongSize(cell_matrix.n(), n_dofs));
+  Assert (cell_matrix.m() == n_dofs,
+         ExcWrongSize(cell_matrix.m(), n_dofs));
   Assert (cell_matrix.all_zero(), ExcObjectNotEmpty());
   
   const vector<vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
@@ -757,8 +757,8 @@ void LaplaceMatrix<dim>::assemble (dFMatrix            &cell_matrix,
       coefficient->value_list (fe_values.get_quadrature_points(),
                               coefficient_values);
       for (unsigned int point=0; point<n_q_points; ++point)
-       for (unsigned int i=0; i<total_dofs; ++i) 
-         for (unsigned int j=0; j<total_dofs; ++j)
+       for (unsigned int i=0; i<n_dofs; ++i) 
+         for (unsigned int j=0; j<n_dofs; ++j)
            cell_matrix(i,j) += (gradients[i][point] *
                                 gradients[j][point]) *
                                weights[point] *
@@ -766,8 +766,8 @@ void LaplaceMatrix<dim>::assemble (dFMatrix            &cell_matrix,
     }
   else
     for (unsigned int point=0; point<n_q_points; ++point)
-      for (unsigned int i=0; i<total_dofs; ++i) 
-       for (unsigned int j=0; j<total_dofs; ++j)
+      for (unsigned int i=0; i<n_dofs; ++i) 
+       for (unsigned int j=0; j<n_dofs; ++j)
          cell_matrix(i,j) += (gradients[i][point] *
                               gradients[j][point]) *
                              weights[point];
@@ -781,10 +781,10 @@ void LaplaceMatrix<dim>::assemble (dVector             &rhs,
                                   const Triangulation<dim>::cell_iterator &) const {
   Assert (right_hand_side != 0, ExcNoRHSSelected());
 
-  const unsigned int total_dofs = fe_values.total_dofs,
+  const unsigned int n_dofs = fe_values.total_dofs,
                     n_q_points = fe_values.n_quadrature_points;
 
-  Assert (rhs.size() == total_dofs, ExcWrongSize(rhs.size(), total_dofs));
+  Assert (rhs.size() == n_dofs, ExcWrongSize(rhs.size(), n_dofs));
   Assert (rhs.all_zero(), ExcObjectNotEmpty());
 
   const dFMatrix       &values    = fe_values.get_shape_values ();
@@ -793,7 +793,7 @@ void LaplaceMatrix<dim>::assemble (dVector             &rhs,
   right_hand_side->value_list (fe_values.get_quadrature_points(), rhs_values);
    
   for (unsigned int point=0; point<n_q_points; ++point)
-    for (unsigned int i=0; i<total_dofs; ++i) 
+    for (unsigned int i=0; i<n_dofs; ++i) 
       rhs(i) += values(i,point) *
                rhs_values[point] *
                weights[point];

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.