]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Should run the test suite next time...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 15 Oct 2002 14:21:12 +0000 (14:21 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 15 Oct 2002 14:21:12 +0000 (14:21 +0000)
git-svn-id: https://svn.dealii.org/trunk@6652 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/numerics/error_estimator.cc

index 36eea502fc96abec409aeecca4949a72e2448696..e2ef71adb95c511de5f1db64a6975fa08f251933 100644 (file)
@@ -171,8 +171,11 @@ estimate (const Mapping<1>                    &mapping,
        i!=neumann_bc.end(); ++i)
     Assert (i->second->n_components == n_components, ExcInvalidBoundaryFunction());  
   
-  Assert (component_mask_.size() == n_components, ExcInvalidComponentMask());
-  Assert (std::count(component_mask_.begin(), component_mask_.end(), true) > 0,
+  Assert ((component_mask_.size() == 0) ||
+          (component_mask_.size() == n_components), ExcInvalidComponentMask());
+  Assert ((component_mask_.size() == 0) ||
+          (std::count(component_mask_.begin(), component_mask_.end(),
+                      true) > 0),
          ExcInvalidComponentMask());
 
   Assert ((coefficient == 0) ||
@@ -548,7 +551,7 @@ KellyErrorEstimator<dim>::estimate (const Mapping<dim>                  &mapping
                                     const typename FunctionMap<dim>::type &neumann_bc,
                                     const std::vector<const Vector<double>*> &solutions,
                                     std::vector<Vector<float>*>              &errors,
-                                    const std::vector<bool>                  &component_mask,
+                                    const std::vector<bool>                  &component_mask_,
                                     const Function<dim>                 *coefficients,
                                     const unsigned int                   n_threads_)
 {
@@ -564,8 +567,11 @@ KellyErrorEstimator<dim>::estimate (const Mapping<dim>                  &mapping
        i!=neumann_bc.end(); ++i)
     Assert (i->second->n_components == n_components, ExcInvalidBoundaryFunction());  
   
-  Assert (component_mask.size() == n_components, ExcInvalidComponentMask());
-  Assert (std::count(component_mask.begin(), component_mask.end(), true) > 0,
+  Assert ((component_mask_.size() == 0) ||
+          (component_mask_.size() == n_components), ExcInvalidComponentMask());
+  Assert ((component_mask_.size() == 0) ||
+          (std::count(component_mask_.begin(), component_mask_.end(),
+                      true) > 0),
          ExcInvalidComponentMask());
 
   Assert ((coefficients == 0) ||
@@ -577,6 +583,13 @@ KellyErrorEstimator<dim>::estimate (const Mapping<dim>                  &mapping
     Assert (solutions[n]->size() == dof_handler.n_dofs(),
            ExcInvalidSolutionVector());
   
+                                  // if no mask given: treat all components
+  std::vector<bool> component_mask ((component_mask_.size() == 0)    ?
+                                   std::vector<bool>(n_components, true) :
+                                   component_mask_);
+  Assert (component_mask.size() == n_components, ExcInvalidComponentMask());
+  Assert (count(component_mask.begin(), component_mask.end(), true) > 0,
+         ExcInvalidComponentMask());
          
                                   // if NOT multithreaded, set n_threads to one
   unsigned int n_threads = n_threads_;

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.