From 48b2392e1f5b122697654fd27c3909666cfec555 Mon Sep 17 00:00:00 2001 From: bangerth Date: Mon, 31 Jul 2006 21:24:54 +0000 Subject: [PATCH] Check that at least a single thread is going to run git-svn-id: https://svn.dealii.org/trunk@13551 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/numerics/data_out.cc | 6 +++++- deal.II/deal.II/source/numerics/data_out_faces.cc | 2 ++ deal.II/deal.II/source/numerics/data_out_rotation.cc | 2 ++ deal.II/doc/news/changes.html | 11 +++++++++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/deal.II/deal.II/source/numerics/data_out.cc b/deal.II/deal.II/source/numerics/data_out.cc index 1620a513cd..657904c237 100644 --- a/deal.II/deal.II/source/numerics/data_out.cc +++ b/deal.II/deal.II/source/numerics/data_out.cc @@ -557,7 +557,8 @@ template void DataOut::build_patches (const unsigned int n_subdivisions, const unsigned int n_threads_) { - build_patches (StaticMappingQ1::mapping, n_subdivisions, n_threads_); + build_patches (StaticMappingQ1::mapping, + n_subdivisions, n_threads_); } @@ -576,6 +577,9 @@ void DataOut::build_patches (const Mapping &mapping, typedef DataOut_DoFData BaseClass; Assert (this->dofs != 0, typename BaseClass::ExcNoDoFHandlerSelected()); + Assert (!DEAL_II_USE_MT || (n_threads_ >= 1), + ExcMessage ("Must run with at least one thread!")); + const unsigned int n_threads = (DEAL_II_USE_MT ? n_threads_ : 1); // before we start the loop: diff --git a/deal.II/deal.II/source/numerics/data_out_faces.cc b/deal.II/deal.II/source/numerics/data_out_faces.cc index 1b85abb56b..7db06d6390 100644 --- a/deal.II/deal.II/source/numerics/data_out_faces.cc +++ b/deal.II/deal.II/source/numerics/data_out_faces.cc @@ -163,6 +163,8 @@ void DataOutFaces::build_patches (const unsigned int nnnn_subdivisions, typedef DataOut_DoFData BaseClass; Assert (this->dofs != 0, typename BaseClass::ExcNoDoFHandlerSelected()); + Assert (!DEAL_II_USE_MT || (n_threads_ >= 1), + ExcMessage ("Must run with at least one thread!")); const unsigned int n_threads = (DEAL_II_USE_MT ? n_threads_ : 1); // before we start the loop: diff --git a/deal.II/deal.II/source/numerics/data_out_rotation.cc b/deal.II/deal.II/source/numerics/data_out_rotation.cc index aec4a9626f..8b375a3658 100644 --- a/deal.II/deal.II/source/numerics/data_out_rotation.cc +++ b/deal.II/deal.II/source/numerics/data_out_rotation.cc @@ -336,6 +336,8 @@ void DataOutRotation::build_patches ( typedef DataOut_DoFData BaseClass; Assert (this->dofs != 0, typename BaseClass::ExcNoDoFHandlerSelected()); + Assert (!DEAL_II_USE_MT || (n_threads_ >= 1), + ExcMessage ("Must run with at least one thread!")); const unsigned int n_threads = (DEAL_II_USE_MT ? n_threads_ : 1); // before we start the loop: diff --git a/deal.II/doc/news/changes.html b/deal.II/doc/news/changes.html index 1d98958f8b..a0fa92c332 100644 --- a/deal.II/doc/news/changes.html +++ b/deal.II/doc/news/changes.html @@ -741,6 +741,17 @@ inconvenience this causes.

deal.II

    +
  1. + Fixed: The DataOut::build_patches and similar + functions in the related DataOut* classes allowed to pass + zero as the second argument (denoting the number of threads to use if + multithreading is enabled). This led to no output being created at + all. This is now fixed by throwing an exception in this case. +
    + (WB 2006/07/31) +

    +
  2. New: The new function FiniteElementBase::n_dofs_per_object returns either -- 2.39.5