From 5278170549d485ce3b78fb457ee4845ee11f2695 Mon Sep 17 00:00:00 2001 From: "daniel.arndt" Date: Mon, 9 Sep 2013 17:03:49 +0000 Subject: [PATCH] VectorTools::point_value and VectorTools::point_difference are now throwing an error if the required point is not available on the current processor git-svn-id: https://svn.dealii.org/trunk@30654 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/dofs/dof_tools.h | 2 +- .../include/deal.II/numerics/vector_tools.h | 55 +++++++++++++++++++ .../deal.II/numerics/vector_tools.templates.h | 10 ++++ 3 files changed, 66 insertions(+), 1 deletion(-) diff --git a/deal.II/include/deal.II/dofs/dof_tools.h b/deal.II/include/deal.II/dofs/dof_tools.h index def3858884..e4d237faf3 100644 --- a/deal.II/include/deal.II/dofs/dof_tools.h +++ b/deal.II/include/deal.II/dofs/dof_tools.h @@ -1132,7 +1132,7 @@ namespace DoFTools * function will be used for which the respective flag was set in the * component mask. * - @ note For DoFHandler objects that are built on a + * @note For DoFHandler objects that are built on a * parallel::distributed::Triangulation object * parallel::distributed::Triangulation::add_periodicity has to be called * before. diff --git a/deal.II/include/deal.II/numerics/vector_tools.h b/deal.II/include/deal.II/numerics/vector_tools.h index 5cb317c497..801e080db9 100644 --- a/deal.II/include/deal.II/numerics/vector_tools.h +++ b/deal.II/include/deal.II/numerics/vector_tools.h @@ -2030,6 +2030,11 @@ namespace VectorTools * using a Q1-mapping for cell * boundaries to call the other * point_difference() function. + * + * @note If the cell in which the point is found + * is not locally owned, an exception of type + * VectorTools::ExcPointNotAvailableHere + * is thrown. */ template void point_difference (const DoFHandler &dof, @@ -2054,6 +2059,11 @@ namespace VectorTools * this function uses an * arbitrary mapping to evaluate * the difference. + * + * @note If the cell in which the point is found + * is not locally owned, an exception of type + * VectorTools::ExcPointNotAvailableHere + * is thrown. */ template void point_difference (const Mapping &mapping, @@ -2077,6 +2087,11 @@ namespace VectorTools * using a Q1-mapping for cell * boundaries to call the other * point_difference() function. + * + * @note If the cell in which the point is found + * is not locally owned, an exception of type + * VectorTools::ExcPointNotAvailableHere + * is thrown. */ template void @@ -2087,6 +2102,11 @@ namespace VectorTools /** * Same as above for hp. + * + * @note If the cell in which the point is found + * is not locally owned, an exception of type + * VectorTools::ExcPointNotAvailableHere + * is thrown. */ template void @@ -2112,6 +2132,11 @@ namespace VectorTools * "Possibilities for extensions" part of * the results section of @ref step_3 * "step-3". + * + * @note If the cell in which the point is found + * is not locally owned, an exception of type + * VectorTools::ExcPointNotAvailableHere + * is thrown. */ template double @@ -2121,6 +2146,11 @@ namespace VectorTools /** * Same as above for hp. + * + * @note If the cell in which the point is found + * is not locally owned, an exception of type + * VectorTools::ExcPointNotAvailableHere + * is thrown. */ template double @@ -2142,6 +2172,11 @@ namespace VectorTools * function of the same name, * this function uses an arbitrary * mapping to evaluate the difference. + * + * @note If the cell in which the point is found + * is not locally owned, an exception of type + * VectorTools::ExcPointNotAvailableHere + * is thrown. */ template void @@ -2153,6 +2188,11 @@ namespace VectorTools /** * Same as above for hp. + * + * @note If the cell in which the point is found + * is not locally owned, an exception of type + * VectorTools::ExcPointNotAvailableHere + * is thrown. */ template void @@ -2174,6 +2214,11 @@ namespace VectorTools * function of the same name, * this function uses an arbitrary * mapping to evaluate the difference. + * + * @note If the cell in which the point is found + * is not locally owned, an exception of type + * VectorTools::ExcPointNotAvailableHere + * is thrown. */ template double @@ -2184,6 +2229,11 @@ namespace VectorTools /** * Same as above for hp. + * + * @note If the cell in which the point is found + * is not locally owned, an exception of type + * VectorTools::ExcPointNotAvailableHere + * is thrown. */ template double @@ -2301,6 +2351,11 @@ namespace VectorTools * Exception */ DeclException0 (ExcNonInterpolatingFE); + + /** + * Exception + */ + DeclException0 (ExcPointNotAvailableHere); } diff --git a/deal.II/include/deal.II/numerics/vector_tools.templates.h b/deal.II/include/deal.II/numerics/vector_tools.templates.h index 8acb1e4eac..0fb214d5ff 100644 --- a/deal.II/include/deal.II/numerics/vector_tools.templates.h +++ b/deal.II/include/deal.II/numerics/vector_tools.templates.h @@ -5326,6 +5326,8 @@ namespace VectorTools const std::pair::active_cell_iterator, Point > cell_point = GridTools::find_active_cell_around_point (mapping, dof, point); + AssertThrow(cell_point.first->is_locally_owned(), + ExcPointNotAvailableHere()); Assert(GeometryInfo::distance_to_unit_cell(cell_point.second) < 1e-10, ExcInternalError()); @@ -5426,6 +5428,8 @@ namespace VectorTools cell_point = GridTools::find_active_cell_around_point (mapping, dof, point); + AssertThrow(cell_point.first->is_locally_owned(), + ExcPointNotAvailableHere()); Assert(GeometryInfo::distance_to_unit_cell(cell_point.second) < 1e-10, ExcInternalError()); @@ -5463,6 +5467,8 @@ namespace VectorTools const std::pair::active_cell_iterator, Point > cell_point = GridTools::find_active_cell_around_point (mapping, dof, point); + AssertThrow(cell_point.first->is_locally_owned(), + ExcPointNotAvailableHere()); Assert(GeometryInfo::distance_to_unit_cell(cell_point.second) < 1e-10, ExcInternalError()); @@ -5499,6 +5505,8 @@ namespace VectorTools const std::pair::active_cell_iterator, Point > cell_point = GridTools::find_active_cell_around_point (mapping, dof, point); + AssertThrow(cell_point.first->is_locally_owned(), + ExcPointNotAvailableHere()); Assert(GeometryInfo::distance_to_unit_cell(cell_point.second) < 1e-10, ExcInternalError()); @@ -5534,6 +5542,8 @@ namespace VectorTools const std::pair::active_cell_iterator, Point > cell_point = GridTools::find_active_cell_around_point (mapping, dof, point); + AssertThrow(cell_point.first->is_locally_owned(), + ExcPointNotAvailableHere()); Assert(GeometryInfo::distance_to_unit_cell(cell_point.second) < 1e-10, ExcInternalError()); -- 2.39.5