]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Implement previously unimplemented function and fix bug by that way.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 22 Jun 2001 10:35:28 +0000 (10:35 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 22 Jun 2001 10:35:28 +0000 (10:35 +0000)
git-svn-id: https://svn.dealii.org/trunk@4748 0785d39b-7218-0410-832d-ea1e28bc413d

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

index f263da4fa831ce47bc6ccadbcbc562a6e8b8c86f..222b8a10ea72b117f5351d72408bdc0d823c9c83 100644 (file)
@@ -1144,27 +1144,43 @@ template <>
 unsigned int DoFHandler<1>::n_boundary_dofs () const
 {
   Assert (selected_fe != 0, ExcNoFESelected());
-  Assert (false, ExcNotImplemented());
-  return 0;
+  return 2*selected_fe->dofs_per_vertex;
 };
 
 
 
 template <>
-unsigned int DoFHandler<1>::n_boundary_dofs (const FunctionMap &) const
+unsigned int DoFHandler<1>::n_boundary_dofs (const FunctionMap &boundary_indicators) const
 {
   Assert (selected_fe != 0, ExcNoFESelected());
-  return 2*selected_fe->dofs_per_vertex;
+
+                                  // check that only boundary
+                                  // indicators 0 and 1 are allowed
+                                  // in 1d
+  for (FunctionMap::const_iterator i=boundary_indicators.begin();
+       i!=boundary_indicators.end(); ++i)
+    Assert ((i->first == 0) || (i->first == 1),
+           ExcInvalidBoundaryIndicator());
+
+  return boundary_indicators.size()*selected_fe->dofs_per_vertex;
 };
 
 
 
 template <>
-unsigned int DoFHandler<1>::n_boundary_dofs (const std::set<unsigned char> &) const
+unsigned int DoFHandler<1>::n_boundary_dofs (const std::set<unsigned char> &boundary_indicators) const
 {
   Assert (selected_fe != 0, ExcNoFESelected());
-  Assert (false, ExcNotImplemented());
-  return 0;
+
+                                  // check that only boundary
+                                  // indicators 0 and 1 are allowed
+                                  // in 1d
+  for (std::set<unsigned char>::const_iterator i=boundary_indicators.begin();
+       i!=boundary_indicators.end(); ++i)
+    Assert ((*i == 0) || (*i == 1),
+           ExcInvalidBoundaryIndicator());
+
+  return boundary_indicators.size()*selected_fe->dofs_per_vertex;
 };
 
 #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.