From a561014bbcf0172a60bf5b1a218aeafc0039df2c Mon Sep 17 00:00:00 2001 From: bangerth Date: Wed, 27 Feb 2013 04:18:02 +0000 Subject: [PATCH] Move GridGenerator::laplace_transformation to GridTools. git-svn-id: https://svn.dealii.org/trunk@28597 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/grid/grid_generator.h | 7 +++++-- deal.II/include/deal.II/grid/grid_tools.h | 16 ++++++++++++++++ deal.II/source/grid/grid_tools.cc | 13 +++++++++++++ deal.II/source/grid/grid_tools.inst.in | 5 +++++ 4 files changed, 39 insertions(+), 2 deletions(-) diff --git a/deal.II/include/deal.II/grid/grid_generator.h b/deal.II/include/deal.II/grid/grid_generator.h index eabdfd32f6..c152e2afaf 100644 --- a/deal.II/include/deal.II/grid/grid_generator.h +++ b/deal.II/include/deal.II/grid/grid_generator.h @@ -699,10 +699,13 @@ public: * (overwritten). * * In 1d, this function is not currently implemented. + * + * @deprecated This function has been moved to GridTools::laplace_transformation */ template - static void laplace_transformation (Triangulation &tria, - const std::map > &new_points); + static + void laplace_transformation (Triangulation &tria, + const std::map > &new_points) DEAL_II_DEPRECATED; /** * Exception diff --git a/deal.II/include/deal.II/grid/grid_tools.h b/deal.II/include/deal.II/grid/grid_tools.h index 6b270a8bd2..2e2c8cf221 100644 --- a/deal.II/include/deal.II/grid/grid_tools.h +++ b/deal.II/include/deal.II/grid/grid_tools.h @@ -231,6 +231,22 @@ namespace GridTools void rotate (const double angle, Triangulation<2> &triangulation); + /** + * This function transformes the @p Triangulation @p tria smoothly to a + * domain that is described by the boundary points in the map @p + * new_points. This map maps the point indices to the boundary points in the + * transformed domain. + * + * Note, that the @p Triangulation is changed in-place, therefore you don't + * need to keep two triangulations, but the given triangulation is changed + * (overwritten). + * + * In 1d, this function is not currently implemented. + */ + template + void laplace_transformation (const std::map > &new_points, + Triangulation &tria); + /** * Scale the entire triangulation * by the given factor. To diff --git a/deal.II/source/grid/grid_tools.cc b/deal.II/source/grid/grid_tools.cc index a32ac8b8da..909bf9fa22 100644 --- a/deal.II/source/grid/grid_tools.cc +++ b/deal.II/source/grid/grid_tools.cc @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -602,6 +603,18 @@ namespace GridTools } + template + void + laplace_transformation (const std::map > &new_points, + Triangulation &triangulation) + { + //TODO: Move implementation of this function into the current + // namespace + GridGenerator::laplace_transformation(triangulation, new_points); + } + + + template void distort_random (const double factor, diff --git a/deal.II/source/grid/grid_tools.inst.in b/deal.II/source/grid/grid_tools.inst.in index 1d2470bf6c..82a81a16c4 100644 --- a/deal.II/source/grid/grid_tools.inst.in +++ b/deal.II/source/grid/grid_tools.inst.in @@ -155,6 +155,11 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS const Triangulation &triangulation_2, Triangulation &result); #if deal_II_dimension == deal_II_space_dimension + template + void + laplace_transformation (const std::map > &new_points, + Triangulation &triangulation); + template Triangulation::DistortedCellList fix_up_distorted_child_cells -- 2.39.5