]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add one assertion.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 28 Mar 2006 22:54:31 +0000 (22:54 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 28 Mar 2006 22:54:31 +0000 (22:54 +0000)
git-svn-id: https://svn.dealii.org/trunk@12730 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/numerics/vectors.templates.h

index 30daa10fd6e13a21d70475a6ff0ab53b65ef1371..315069c2f2bea01e405211daca35e2320aeb62bd 100644 (file)
@@ -887,7 +887,31 @@ interpolate_boundary_values (const Mapping<dim>            &mapping,
         ++face_no)
       {
         const FiniteElement<dim> &fe = cell->get_fe();
-        
+
+                                        // we can presently deal only with
+                                        // primitive elements for boundary
+                                        // values. this does not preclude
+                                        // us using non-primitive elements
+                                        // in components that we aren't
+                                        // interested in, however. 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>::face_iterator face = cell->face(face_no);
        const unsigned char boundary_component = face->boundary_indicator();
        if (function_map.find(boundary_component) != function_map.end()) 
@@ -928,7 +952,7 @@ interpolate_boundary_values (const Mapping<dim>            &mapping,
                 for (unsigned int i=0; i<fe.dofs_per_face; ++i)
                   if (component_mask[fe.face_system_to_component_index(i).first]
                       == true)
-                unit_support_points[i] = fe.unit_face_support_point(i);
+                   unit_support_points[i] = fe.unit_face_support_point(i);
               };
 
             Quadrature<dim-1> aux_quad (unit_support_points);

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.