}
template <int dim> class MGDoFHandler;
class ConstraintMatrix;
-template <template <int> class GridClass, int dim> class InterGridMap;
+template <class GridClass> class InterGridMap;
template <int dim> class Mapping;
const unsigned int coarse_component,
const DoFHandler<dim> &fine_grid,
const unsigned int fine_component,
- const InterGridMap<DoFHandler,dim> &coarse_to_fine_grid_map,
+ const InterGridMap<DoFHandler<dim> > &coarse_to_fine_grid_map,
ConstraintMatrix &constraints);
const unsigned int coarse_component,
const DoFHandler<dim> &fine_grid,
const unsigned int fine_component,
- const InterGridMap<DoFHandler,dim> &coarse_to_fine_grid_map,
+ const InterGridMap<DoFHandler<dim> > &coarse_to_fine_grid_map,
std::vector<std::map<unsigned int, float> > &transfer_representation);
/**
const unsigned int coarse_component,
const DoFHandler<dim> &fine_grid,
const unsigned int fine_component,
- const InterGridMap<DoFHandler,dim> &coarse_to_fine_grid_map,
+ const InterGridMap<DoFHandler<dim> > &coarse_to_fine_grid_map,
std::vector<std::map<unsigned int, float> > &weights,
std::vector<int> &weight_mapping);
static void
compute_intergrid_weights_2 (const DoFHandler<dim> &coarse_grid,
const unsigned int coarse_component,
- const InterGridMap<DoFHandler,dim> &coarse_to_fine_grid_map,
+ const InterGridMap<DoFHandler<dim> > &coarse_to_fine_grid_map,
const std::vector<Vector<double> > ¶meter_dofs,
const std::vector<int> &weight_mapping,
std::vector<std::map<unsigned int, float> > &weights);
static void
compute_intergrid_weights_3 (const DoFHandler<dim> &coarse_grid,
const unsigned int coarse_component,
- const InterGridMap<DoFHandler,dim> &coarse_to_fine_grid_map,
+ const InterGridMap<DoFHandler<dim> > &coarse_to_fine_grid_map,
const std::vector<Vector<double> > ¶meter_dofs,
const std::vector<int> &weight_mapping,
std::vector<std::map<unsigned int, float> > &weights,
* // distribute degrees of freedom, etc
* ...
* // create the mapping
- * InterGridMap<DoFHandler,dim> grid_1_to_2_map;
+ * InterGridMap<DoFHandler<dim> > grid_1_to_2_map;
* grid_1_to_2_map.make_mapping (dof_handler_1,
* dof_handler_2);
* ...
* @endverbatim
*
* Note that the template parameters to this class have to be given as
- * <tt>InterGridMap<DoFHandler,2></tt>, i.e. the dimension is given explicitly and
- * no dimension is attributed to the first parameter, which here is
- * DoFHandler (and could equally well be Triangulation or MGDoFHandler).
+ * <tt>InterGridMap<DoFHandler<2> ></tt>, which here is DoFHandler
+ * (and could equally well be Triangulation, PersistentTriangulation,
+ * hp::DoFHandler or MGDoFHandler).
*
* @ingroup grid
* @author Wolfgang Bangerth, 1999
*/
-template <template <int> class GridClass, int dim>
+template <class GridClass>
class InterGridMap
{
public:
-#ifdef DEAL_II_TEMPLATE_TEMPLATE_TYPEDEF_BUG
- // helper class
- struct GridClass_dim : public GridClass<dim>
- {
- // constructor. will
- // not be implemented,
- // but suppresses compiler
- // warning about non-default
- // constructor of GridClass
- GridClass_dim ();
-
- /**
- * Declare iterator type, for
- * access from outside.
- */
- typedef typename GridClass<dim>::cell_iterator cell_iterator;
- };
-
/**
* Typedef to the iterator type of
* the grid class under consideration.
*/
- typedef typename GridClass_dim::cell_iterator cell_iterator;
+ typedef typename GridClass::cell_iterator cell_iterator;
-#else
-
- /**
- * Typedef to the iterator type of
- * the grid class under consideration.
- */
- typedef typename GridClass<dim>::cell_iterator cell_iterator;
-#endif
/**
* Constructor setting the class
* name arguments in the
* Create the mapping between the two
* grids.
*/
- void make_mapping (const GridClass<dim> &source_grid,
- const GridClass<dim> &destination_grid);
+ void make_mapping (const GridClass &source_grid,
+ const GridClass &destination_grid);
/**
* Access operator: give a cell
* Return a pointer to the source
* grid.
*/
- const GridClass<dim> & get_source_grid () const;
+ const GridClass & get_source_grid () const;
/**
* Return a pointer to the
* destination grid.
*/
- const GridClass<dim> & get_destination_grid () const;
+ const GridClass & get_destination_grid () const;
/**
* Determine an estimate for the
/**
* Store a pointer to the source grid.
*/
- SmartPointer<const GridClass<dim> > source_grid;
+ SmartPointer<const GridClass > source_grid;
/**
* Likewise for the destination grid.
*/
- SmartPointer<const GridClass<dim> > destination_grid;
+ SmartPointer<const GridClass > destination_grid;
/**
* Set the mapping for the pair of
const unsigned int coarse_component,
const DoFHandler<dim> &fine_grid,
const unsigned int fine_component,
- const InterGridMap<DoFHandler,dim> &coarse_to_fine_grid_map,
+ const InterGridMap<DoFHandler<dim> > &coarse_to_fine_grid_map,
ConstraintMatrix &constraints)
{
// store the weights with which a dof
const unsigned int coarse_component,
const DoFHandler<dim> &fine_grid,
const unsigned int fine_component,
- const InterGridMap<DoFHandler,dim> &coarse_to_fine_grid_map,
+ const InterGridMap<DoFHandler<dim> > &coarse_to_fine_grid_map,
std::vector<std::map<unsigned int, float> > &transfer_representation)
{
// store the weights with which a dof
const unsigned int coarse_component,
const DoFHandler<dim> &fine_grid,
const unsigned int fine_component,
- const InterGridMap<DoFHandler,dim> &coarse_to_fine_grid_map,
+ const InterGridMap<DoFHandler<dim> > &coarse_to_fine_grid_map,
std::vector<std::map<unsigned int, float> > &weights,
std::vector<int> &weight_mapping)
{
DoFTools::compute_intergrid_weights_2 (
const DoFHandler<dim> &coarse_grid,
const unsigned int coarse_component,
- const InterGridMap<DoFHandler,dim> &coarse_to_fine_grid_map,
+ const InterGridMap<DoFHandler<dim> > &coarse_to_fine_grid_map,
const std::vector<Vector<double> > ¶meter_dofs,
const std::vector<int> &weight_mapping,
std::vector<std::map<unsigned int,float> > &weights)
Threads::ThreadGroup<> threads;
void (*fun_ptr) (const DoFHandler<dim> &,
const unsigned int ,
- const InterGridMap<DoFHandler,dim> &,
+ const InterGridMap<DoFHandler<dim> > &,
const std::vector<Vector<double> > &,
const std::vector<int> &,
std::vector<std::map<unsigned int, float> > &,
DoFTools::compute_intergrid_weights_3 (
const DoFHandler<dim> &coarse_grid,
const unsigned int coarse_component,
- const InterGridMap<DoFHandler,dim> &coarse_to_fine_grid_map,
+ const InterGridMap<DoFHandler<dim> > &coarse_to_fine_grid_map,
const std::vector<Vector<double> > ¶meter_dofs,
const std::vector<int> &weight_mapping,
std::vector<std::map<unsigned int, float> > &weights,
DoFTools::compute_intergrid_constraints<deal_II_dimension> (
const DoFHandler<deal_II_dimension> &, const unsigned int,
const DoFHandler<deal_II_dimension> &, const unsigned int,
- const InterGridMap<DoFHandler,deal_II_dimension> &,
+ const InterGridMap<DoFHandler<deal_II_dimension> > &,
ConstraintMatrix&);
template
DoFTools::compute_intergrid_transfer_representation<deal_II_dimension>
(const DoFHandler<deal_II_dimension> &, const unsigned int,
const DoFHandler<deal_II_dimension> &, const unsigned int,
- const InterGridMap<DoFHandler,deal_II_dimension> &,
+ const InterGridMap<DoFHandler<deal_II_dimension> > &,
std::vector<std::map<unsigned int, float> > &);
// $Id$
// Version: $Name$
//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
}
-template <template <int> class GridClass, int dim>
-InterGridMap<GridClass,dim>::InterGridMap ()
+template <class GridClass>
+InterGridMap<GridClass>::InterGridMap ()
:
source_grid(0, typeid(*this).name()),
destination_grid(0, typeid(*this).name())
-template <template <int> class GridClass, int dim>
-void InterGridMap<GridClass,dim>::make_mapping (const GridClass<dim> &source_grid,
- const GridClass<dim> &destination_grid)
+template <class GridClass>
+void InterGridMap<GridClass>::make_mapping (const GridClass &source_grid,
+ const GridClass &destination_grid)
{
// first delete all contents
clear ();
-template <template <int> class GridClass, int dim>
+template <class GridClass>
void
-InterGridMap<GridClass,dim>::set_mapping (const cell_iterator &src_cell,
- const cell_iterator &dst_cell)
+InterGridMap<GridClass>::set_mapping (const cell_iterator &src_cell,
+ const cell_iterator &dst_cell)
{
// first set the map for this cell
mapping[src_cell->level()][src_cell->index()] = dst_cell;
// if both cells have children, we may
// recurse further into the hierarchy
if (src_cell->has_children() && dst_cell->has_children())
- for (unsigned int c=0; c<GeometryInfo<dim>::children_per_cell; ++c)
+ for (unsigned int c=0; c<GeometryInfo<GridClass::dimension>::children_per_cell; ++c)
set_mapping (src_cell->child(c),
dst_cell->child(c));
else
// set entries for all children
// of this cell to the one
// dst_cell
- for (unsigned int c=0; c<GeometryInfo<dim>::children_per_cell; ++c)
+ for (unsigned int c=0; c<GeometryInfo<GridClass::dimension>::children_per_cell; ++c)
set_entries_to_cell (src_cell->child(c),
dst_cell);
// else (no cell is refined or
-template <template <int> class GridClass, int dim>
+template <class GridClass>
void
-InterGridMap<GridClass,dim>::set_entries_to_cell (const cell_iterator &src_cell,
- const cell_iterator &dst_cell)
+InterGridMap<GridClass>::set_entries_to_cell (const cell_iterator &src_cell,
+ const cell_iterator &dst_cell)
{
// first set the map for this cell
mapping[src_cell->level()][src_cell->index()] = dst_cell;
// then do so for the children as well
// if there are any
if (src_cell->has_children())
- for (unsigned int c=0; c<GeometryInfo<dim>::children_per_cell; ++c)
+ for (unsigned int c=0; c<GeometryInfo<GridClass::dimension>::children_per_cell; ++c)
set_entries_to_cell (src_cell->child(c),
dst_cell);
}
-template <template <int> class GridClass, int dim>
-typename InterGridMap<GridClass,dim>::cell_iterator
-InterGridMap<GridClass,dim>::operator [] (const cell_iterator &source_cell) const
+template <class GridClass>
+typename InterGridMap<GridClass>::cell_iterator
+InterGridMap<GridClass>::operator [] (const cell_iterator &source_cell) const
{
Assert (source_cell.state() == IteratorState::valid,
ExcInvalidKey (source_cell));
-template <template <int> class GridClass, int dim>
-void InterGridMap<GridClass,dim>::clear ()
+template <class GridClass>
+void InterGridMap<GridClass>::clear ()
{
mapping.clear ();
source_grid = 0;
-template <template <int> class GridClass, int dim>
-const GridClass<dim> &
-InterGridMap<GridClass,dim>::get_source_grid () const
+template <class GridClass>
+const GridClass &
+InterGridMap<GridClass>::get_source_grid () const
{
return *source_grid;
}
-template <template <int> class GridClass, int dim>
-const GridClass<dim> &
-InterGridMap<GridClass,dim>::get_destination_grid () const
+template <class GridClass>
+const GridClass &
+InterGridMap<GridClass>::get_destination_grid () const
{
return *destination_grid;
}
-template <template <int> class GridClass, int dim>
+template <class GridClass>
unsigned int
-InterGridMap<GridClass,dim>::memory_consumption () const
+InterGridMap<GridClass>::memory_consumption () const
{
return (MemoryConsumption::memory_consumption (mapping) +
MemoryConsumption::memory_consumption (source_grid) +
// explicit instantiations
-template class InterGridMap<Triangulation, deal_II_dimension>;
-template class InterGridMap<DoFHandler, deal_II_dimension>;
+template class InterGridMap<Triangulation<deal_II_dimension> >;
+template class InterGridMap<DoFHandler<deal_II_dimension> >;
-template class InterGridMap<MGDoFHandler, deal_II_dimension>;
+template class InterGridMap<hp::DoFHandler<deal_II_dimension> >;
+template class InterGridMap<MGDoFHandler<deal_II_dimension> >;