]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
no reason to be so picky about non-primitive elements
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 18 Oct 2010 15:54:44 +0000 (15:54 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 18 Oct 2010 15:54:44 +0000 (15:54 +0000)
git-svn-id: https://svn.dealii.org/trunk@22366 0785d39b-7218-0410-832d-ea1e28bc413d

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

index bedc72bb028e51624cc22ce0a573026634970212..60fd39120d3d7f61048febc0764daa0a9d3caa56 100644 (file)
@@ -1861,7 +1861,23 @@ class DoFTools
                                      /**
                                      * Make a constraint matrix for the
                                      * constraints that result from zero
-                                     * boundary values. This function is used
+                                     * boundary values.
+                                     *
+                                     * This function constrains all
+                                     * degrees of freedom on the
+                                     * boundary. Optionally, you can
+                                     * add a component mask, which
+                                     * restricts this functionality
+                                     * to a subset of an FESystem.
+                                     *
+                                     * For non-@ref GlossPrimitive "primitive"
+                                     * shape functions, any degree of freedom
+                                     * is affected that belongs to a
+                                     * shape function where at least
+                                     * one of its nonzero components
+                                     * is affected.
+                                     *
+                                     * This function is used
                                      * in step-36, for
                                      * example.
                                      *
index 574a8044f9f7010c85f954a8e74189d02a8b22b5..2a85824601e02f92caa73820fc42b4a40553ed5a 100644 (file)
@@ -5770,27 +5770,7 @@ DoFTools::make_zero_boundary_constraints (const DH<dim, spacedim> &dof,
         ++face_no)
       {
         const FiniteElement<dim,spacedim> &fe = cell->get_fe();
-
-                                  // we can presently deal only with
-                                  // primitive elements for boundary
-                                  // values. make sure that all shape
-                                  // functions that are non-zero for
-                                  // the components we are interested
-                                  // in, are in fact primitive
-       for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
-         {
-           const std::vector<bool> &nonzero_component_array
-             = cell->get_fe().get_nonzero_components (i);
-           for (unsigned int c=0; c<n_components; ++c)
-             if ((nonzero_component_array[c] == true)
-                 &&
-                 (component_mask[c] == true))
-               Assert (cell->get_fe().is_primitive (i),
-                       ExcMessage ("This function can only deal with requested boundary "
-                                   "values that correspond to primitive (scalar) base "
-                                   "elements"));
-         }
-
+       
        typename DH<dim,spacedim>::face_iterator face = cell->face(face_no);
        if (face->boundary_indicator () == 0)
                                   // face is of the right component
@@ -5804,8 +5784,25 @@ DoFTools::make_zero_boundary_constraints (const DH<dim, spacedim> &dof,
                                             // that match the component
                                             // signature.
            for (unsigned int i=0; i<face_dofs.size(); ++i)
-             if (component_mask[fe.face_system_to_component_index(i).first])
-               zero_boundary_constraints.add_line (face_dofs[i]);
+             {
+                                                // Find out if a dof
+                                                // has a contribution
+                                                // in this component,
+                                                // and if so, add it
+                                                // to the list
+               const std::vector<bool> &nonzero_component_array
+                 = cell->get_fe().get_nonzero_components (i);
+               bool nonzero = false;
+               for (unsigned int c=0; c<n_components; ++c)
+                 if (nonzero_component_array[c] && component_mask[c])
+                   {
+                     nonzero = true;
+                     break;
+                   }
+               
+               if (nonzero)
+                 zero_boundary_constraints.add_line (face_dofs[i]);
+             }
          }
       }
 }

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.