From: wolf Date: Tue, 15 Oct 2002 14:21:12 +0000 (+0000) Subject: Should run the test suite next time... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31c6972b698ce29b98a362f7abb774c7e9e60bd6;p=dealii-svn.git Should run the test suite next time... git-svn-id: https://svn.dealii.org/trunk@6652 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/numerics/error_estimator.cc b/deal.II/deal.II/source/numerics/error_estimator.cc index 36eea502fc..e2ef71adb9 100644 --- a/deal.II/deal.II/source/numerics/error_estimator.cc +++ b/deal.II/deal.II/source/numerics/error_estimator.cc @@ -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::estimate (const Mapping &mapping const typename FunctionMap::type &neumann_bc, const std::vector*> &solutions, std::vector*> &errors, - const std::vector &component_mask, + const std::vector &component_mask_, const Function *coefficients, const unsigned int n_threads_) { @@ -564,8 +567,11 @@ KellyErrorEstimator::estimate (const Mapping &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::estimate (const Mapping &mapping Assert (solutions[n]->size() == dof_handler.n_dofs(), ExcInvalidSolutionVector()); + // if no mask given: treat all components + std::vector component_mask ((component_mask_.size() == 0) ? + std::vector(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_;