From 1d6d4da18ec70bfd85f0d2d66d8ef18dccf3d75d Mon Sep 17 00:00:00 2001 From: cvs Date: Fri, 8 Oct 1999 19:06:49 +0000 Subject: [PATCH] First version. git-svn-id: https://svn.dealii.org/trunk@1751 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/grid/intergrid_map.h | 148 ++++++++++++++++ deal.II/deal.II/source/grid/intergrid_map.cc | 176 +++++++++++++++++++ 2 files changed, 324 insertions(+) create mode 100644 deal.II/deal.II/include/grid/intergrid_map.h create mode 100644 deal.II/deal.II/source/grid/intergrid_map.cc diff --git a/deal.II/deal.II/include/grid/intergrid_map.h b/deal.II/deal.II/include/grid/intergrid_map.h new file mode 100644 index 0000000000..ed15c1b4b5 --- /dev/null +++ b/deal.II/deal.II/include/grid/intergrid_map.h @@ -0,0 +1,148 @@ +/*---------------------------- intergrid_map.h ---------------------------*/ +/* $Id$ */ +#ifndef __intergrid_map_H +#define __intergrid_map_H +/*---------------------------- intergrid_map.h ---------------------------*/ + + + +/** + * This class provides a map between two grids which are derived from + * the same coarse grid. For each cell iterator of the source map, it provides + * the respective cell iterator on the destination map, through its + * #operator []#. + * + * Usually, the two grids will be refined differently. Then, the value + * returned for an iterator on the source grid will be either: + * \begin{itemize} + * \item The same cell on the destination grid, if it exists there; + * \item The most refined cell of the destination grid from which the + * pendant of the source cell could be obtained by refinement. This + * cell is always active and has a refinement level less than that + * of the source cell. + * \end{itemize} + * Keys for this map are all cells on the source grid, whether active or + * not. + * + * The implementation of this class is such that not only cell iterators + * into triangulations can be mapped, but also iterators into objects of + * type #DoFHandler# and #MGDoFHandler#. The extension to other classes + * offering iterator functions and some minor additional requirements is + * simple. + * + * In practice, use of this class is as follows: + * \begin{verbatim} + * // have two grids, which are derived from the + * // same coarse grid + * Triangulation tria1, tria2; + * DoFHandler dof_handler_1(tria1), dof_handler_2(tria2); + * ... + * // do something with these objects, e.g. + * // refine the triangulations differently, + * // distribute degrees of freedom, etc + * ... + * // create the mapping + * InterGridMap grid_1_to_2_map; + * grid_1_to_2_map.make_mapping (dof_handler_1, + * dof_handler_2); + * ... + * typename DoFHandler::cell_iterator cell = dof_handler_1.begin(), + * endc = dof_handler_1.end(); + * for (; cell!=endc; ++cell) + * // now do something with the cell of dof_handler_2 + * // corresponding to #cell# (which is one of + * // dof_handler_1 + * f( grid_1_to_2_map[cell]); + * \end{verbatim} + * + * Note that the template parameters to this class have to be given as + * #InterGridMap#, i.e. the dimension is given explicitely and + * no dimension is attributed to the first parameter, which here is + * #DoFHandler# (and could equally well be #Triangulation# or #MGDoFHandler#). + * + * @author Wolfgang Bangerth, 1999 + */ +template