if (cell_face->user_flag_set ())
continue;
- if (! cell->at_boundary (face) )
+ if (! cell_face->at_boundary() )
{
typename DH::cell_iterator neighbor = cell->neighbor(face);
// Refinement edges are
const unsigned int neighbor_face
= cell->neighbor_of_neighbor(face);
- if (neighbor->has_children())
+ if (cell_face->has_children())
{
for (unsigned int sub_nr = 0;
- sub_nr != GeometryInfo<DH::dimension>::subfaces_per_face;
+ sub_nr != cell_face->n_children();
++sub_nr)
{
const typename DH::cell_iterator
if (neighbor->level() < cell->level())
continue;
+ typename DH::face_iterator cell_face = cell->face(face);
const unsigned int
neighbor_face = cell->neighbor_of_neighbor(face);
- if (neighbor->has_children())
+ if (cell_face->has_children())
{
for (unsigned int sub_nr = 0;
- sub_nr != GeometryInfo<DH::dimension>::subfaces_per_face;
+ sub_nr != cell_face->n_children();
++sub_nr)
{
const typename DH::cell_iterator
{
// Set active_fe_index in children to the
// same value as in the parent cell.
- for (unsigned int i = 0; i < GeometryInfo<dim>::children_per_cell; ++i)
+ for (unsigned int i = 0; i < cell->n_children(); ++i)
cell->child (i)->set_active_fe_index (cell->active_fe_index ());
}
}
// typename FEValuesBase<dim>::ExcFEDontMatch());
Assert (face_no < GeometryInfo<dim>::faces_per_cell,
ExcIndexRange (face_no, 0, GeometryInfo<dim>::faces_per_cell));
- Assert (subface_no < GeometryInfo<dim>::subfaces_per_face,
+ // We would like to check for
+ // subface_no < cell->face(face_no)->n_children(),
+ // but unfortunately the current
+ // function is also called for
+ // faces without children (see
+ // tests/fe/mapping.cc). Therefore,
+ // we must use following workaround
+ // of two separate assertions
+ Assert (cell->face(face_no)->has_children() ||
+ subface_no < GeometryInfo<dim>::subfaces_per_face,
ExcIndexRange (subface_no, 0, GeometryInfo<dim>::subfaces_per_face));
+ Assert (!cell->face(face_no)->has_children() ||
+ subface_no < cell->face(face_no)->n_children(),
+ ExcIndexRange (subface_no, 0, cell->face(face_no)->n_children()));
+
Assert (cell->has_children() == false,
ExcMessage ("You can't use subface data for cells that are "
"already refined. Iterate over their children "
typename FEValuesBase<dim>::ExcFEDontMatch());
Assert (face_no < GeometryInfo<dim>::faces_per_cell,
ExcIndexRange (face_no, 0, GeometryInfo<dim>::faces_per_cell));
- Assert (subface_no < GeometryInfo<dim>::subfaces_per_face,
- ExcIndexRange (subface_no, 0, GeometryInfo<dim>::subfaces_per_face));
+ Assert (subface_no < cell->face(face_no)->n_children(),
+ ExcIndexRange (subface_no, 0, cell->face(face_no)->n_children()));
Assert (cell->has_children() == false,
ExcMessage ("You can't use subface data for cells that are "
"already refined. Iterate over their children "
typename FEValuesBase<dim>::ExcFEDontMatch());
Assert (face_no < GeometryInfo<dim>::faces_per_cell,
ExcIndexRange (face_no, 0, GeometryInfo<dim>::faces_per_cell));
- Assert (subface_no < GeometryInfo<dim>::subfaces_per_face,
- ExcIndexRange (subface_no, 0, GeometryInfo<dim>::subfaces_per_face));
+ Assert (subface_no < cell->face(face_no)->n_children(),
+ ExcIndexRange (subface_no, 0, cell->face(face_no)->n_children()));
Assert (cell->has_children() == false,
ExcMessage ("You can't use subface data for cells that are "
"already refined. Iterate over their children "
{
Assert (face_no < GeometryInfo<dim>::faces_per_cell,
ExcIndexRange (face_no, 0, GeometryInfo<dim>::faces_per_cell));
- Assert (subface_no < GeometryInfo<dim>::subfaces_per_face,
- ExcIndexRange (subface_no, 0, GeometryInfo<dim>::subfaces_per_face));
+ Assert (subface_no < cell->face(face_no)->n_children(),
+ ExcIndexRange (subface_no, 0, cell->face(face_no)->n_children()));
// set new cell. auto_ptr will take
// care that old object gets
// grandchild
while (cell->has_children())
{
+ const unsigned int n_children=cell->n_children();
unsigned int c=0;
- for (; c<GeometryInfo<dim>::children_per_cell; ++c)
+ for (; c<n_children; ++c)
if (cell->child(c)->point_inside (p))
break;
// make sure we found a child
// cell
- AssertThrow (c != GeometryInfo<dim>::children_per_cell,
- ExcPointNotFound<dim> (p));
+ AssertThrow (c != n_children, ExcPointNotFound<dim> (p));
// then reset cell to the child
cell = cell->child(c);
// set entries for all children
// of this cell to the one
// dst_cell
- for (unsigned int c=0; c<GeometryInfo<GridClass::dimension>::children_per_cell; ++c)
+ for (unsigned int c=0; c<src_cell->n_children(); ++c)
set_entries_to_cell (src_cell->child(c),
dst_cell);
// else (no cell is refined or
// then do so for the children as well
// if there are any
if (src_cell->has_children())
- for (unsigned int c=0; c<GeometryInfo<GridClass::dimension>::children_per_cell; ++c)
+ for (unsigned int c=0; c<src_cell->n_children(); ++c)
set_entries_to_cell (src_cell->child(c),
dst_cell);
}
set_user_flag ();
if (has_children())
- for (unsigned int c=0; c<4; ++c)
+ for (unsigned int c=0; c<n_children(); ++c)
child(c)->recursively_set_user_flag ();
}
clear_user_flag ();
if (has_children())
- for (unsigned int c=0; c<4; ++c)
+ for (unsigned int c=0; c<n_children(); ++c)
child(c)->recursively_clear_user_flag ();
}
set_user_pointer (p);
if (has_children())
- for (unsigned int c=0; c<4; ++c)
+ for (unsigned int c=0; c<n_children(); ++c)
child(c)->recursively_set_user_pointer (p);
}
clear_user_pointer ();
if (has_children())
- for (unsigned int c=0; c<4; ++c)
+ for (unsigned int c=0; c<n_children(); ++c)
child(c)->recursively_clear_user_pointer ();
}
else
{
unsigned int sum = 0;
- for (unsigned int c=0; c<4; ++c)
+ for (unsigned int c=0; c<n_children(); ++c)
sum += child(c)->number_of_children();
return sum;
};
set_user_flag ();
if (has_children())
- for (unsigned int c=0; c<8; ++c)
+ for (unsigned int c=0; c<n_children(); ++c)
child(c)->recursively_set_user_flag ();
}
clear_user_flag ();
if (has_children())
- for (unsigned int c=0; c<8; ++c)
+ for (unsigned int c=0; c<n_children(); ++c)
child(c)->recursively_clear_user_flag ();
}
set_user_pointer (p);
if (has_children())
- for (unsigned int c=0; c<8; ++c)
+ for (unsigned int c=0; c<n_children(); ++c)
child(c)->recursively_set_user_pointer (p);
}
clear_user_pointer ();
if (has_children())
- for (unsigned int c=0; c<8; ++c)
+ for (unsigned int c=0; c<n_children(); ++c)
child(c)->recursively_clear_user_pointer ();
}
else
{
unsigned int sum = 0;
- for (unsigned int c=0; c<8; ++c)
+ for (unsigned int c=0; c<n_children(); ++c)
sum += child(c)->number_of_children();
return sum;
};
set_material_id (mat_id);
if (this->has_children())
- for (unsigned int c=0; c<4; ++c)
+ for (unsigned int c=0; c<n_children(); ++c)
child(c)->recursively_set_material_id (mat_id);
}
set_material_id (mat_id);
if (this->has_children())
- for (unsigned int c=0; c<8; ++c)
+ for (unsigned int c=0; c<n_children(); ++c)
child(c)->recursively_set_material_id (mat_id);
}
=neighbor_cell->face(face_no_guess);
if (face_guess->has_children())
- for (unsigned int subface_no=0; subface_no<GeometryInfo<dim>::subfaces_per_face; ++subface_no)
+ for (unsigned int subface_no=0; face_guess->n_children(); ++subface_no)
if (face_guess->child(subface_no)==this_face)
return std::make_pair (face_no_guess, subface_no);
const TriaIterator<dim,TriaObjectAccessor<dim-1, dim> > face
=neighbor_cell->face(face_no);
if (face->has_children())
- for (unsigned int subface_no=0; subface_no<GeometryInfo<dim>::subfaces_per_face; ++subface_no)
+ for (unsigned int subface_no=0; subface_no<face->n_children(); ++subface_no)
if (face->child(subface_no)==this_face)
return std::make_pair (face_no, subface_no);
}
{
cell->get_mg_dof_indices (dof_indices_parent);
- for (unsigned int child=0;
- child<GeometryInfo<dim>::children_per_cell; ++child)
+ for (unsigned int child=0; child<cell->n_children(); ++child)
{
// set an alias to the
// prolongation matrix for
{
cell->get_mg_dof_indices (dof_indices_parent);
- for (unsigned int child=0;
- child<GeometryInfo<dim>::children_per_cell; ++child)
+ for (unsigned int child=0; child<cell->n_children(); ++child)
{
// set an alias to the
// prolongation matrix for
{
cell->get_mg_dof_indices (dof_indices_parent);
- for (unsigned int child=0;
- child<GeometryInfo<dim>::children_per_cell; ++child)
+ for (unsigned int child=0; child<cell->n_children(); ++child)
{
// set an alias to the
// prolongation matrix for
{
cell->get_mg_dof_indices (dof_indices_parent);
- for (unsigned int child=0;
- child<GeometryInfo<dim>::children_per_cell; ++child)
+ for (unsigned int child=0; child<cell->n_children(); ++child)
{
// set an alias to the
// prolongation matrix for
// children. find out
// which border to the
// present cell
- for (unsigned int c=0; c<GeometryInfo<dim>::children_per_cell; ++c)
+ for (unsigned int c=0; c<neighbor->n_children(); ++c)
for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
if (neighbor->child(c)->neighbor(f) == cell)
active_neighbors.push_back (neighbor->child(c));
for (unsigned int face_no=0;
face_no<GeometryInfo<dim>::faces_per_cell; ++face_no)
{
+ const typename DoFHandler<dim>::face_iterator
+ face=cell->face(face_no);
+
// make sure we do work
// only once: this face
// may either be regular
// boundary, or if the
// face is irregular,
// then do the work below
- if ((cell->face(face_no)->has_children() == false) &&
+ if ((face->has_children() == false) &&
!cell->at_boundary(face_no) &&
(cell->neighbor(face_no)->level() == cell->level()) &&
(cell->neighbor(face_no)->index() < cell->index()))
// solution vector, as we
// treat them all at the
// same time
- if (face_integrals[cell->face(face_no)][0] >=0)
+ if (face_integrals[face][0] >=0)
continue;
// the list of faces with
// contribution zero.
const unsigned char boundary_indicator
- = cell->face(face_no)->boundary_indicator();
- if (cell->face(face_no)->at_boundary()
+ = face->boundary_indicator();
+ if (face->at_boundary()
&&
neumann_bc.find(boundary_indicator)==neumann_bc.end())
{
for (unsigned int n=0; n<n_solution_vectors; ++n)
- face_integrals[cell->face(face_no)][n] = 0;
+ face_integrals[face][n] = 0;
continue;
}
// the face we presently work
// on? oh is there a face at
// all?
- if (cell->at_boundary(face_no))
+ if (face->at_boundary())
continue;
bool care_for_cell = false;
- if (cell->neighbor(face_no)->has_children() == false)
+ if (face->has_children() == false)
care_for_cell |= ((cell->neighbor(face_no)->subdomain_id()
== subdomain_id) ||
(subdomain_id == deal_II_numbers::invalid_unsigned_int))
(material_id == deal_II_numbers::invalid_unsigned_int));
else
{
- for (unsigned int sf=0;
- sf<GeometryInfo<dim>::subfaces_per_face; ++sf)
+ for (unsigned int sf=0; sf<face->n_children(); ++sf)
if (((cell->neighbor_child_on_subface(face_no,sf)
->subdomain_id() == subdomain_id)
&&
// so now we know that we care for
// this face, let's do something
// about it:
- if (cell->face(face_no)->has_children() == false)
+ if (face->has_children() == false)
// if the face is a regular one,
// i.e. either on the other side
// there is nirvana (face is at
const unsigned int n_q_points = quadrature.n_quadrature_points,
n_components = dof_handler.get_fe().n_components(),
n_solution_vectors = solutions.size();
+ const typename DoFHandler<dim>::face_iterator
+ face=cell->face(face_no);
Assert (neighbor.state() == IteratorState::valid, ExcInternalError());
- Assert (neighbor->has_children(), ExcInternalError());
+ Assert (face->has_children(), ExcInternalError());
// set up a vector of the gradients
// of the finite element function
// on this cell at the quadrature
ExcInternalError());
// loop over all subfaces
- for (unsigned int subface_no=0;
- subface_no<GeometryInfo<dim>::subfaces_per_face;
- ++subface_no)
+ for (unsigned int subface_no=0; subface_no<face->n_children(); ++subface_no)
{
// get an iterator pointing to the
// cell behind the present subface
// subfaces and store them with the
// mother face
std::vector<double> sum (n_solution_vectors, 0);
- typename DoFHandler<dim>::face_iterator face = cell->face(face_no);
- for (unsigned int subface_no=0; subface_no<GeometryInfo<dim>::subfaces_per_face;
- ++subface_no)
+ for (unsigned int subface_no=0; subface_no<face->n_children(); ++subface_no)
{
Assert (face_integrals.find(face->child(subface_no)) !=
face_integrals.end(),
// $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
// coaresen flag, then all should
// have if Tria::prepare_* has
// worked correctly
- for (unsigned int i=1; i<GeometryInfo<dim>::children_per_cell; ++i)
+ for (unsigned int i=1; i<cell->n_children(); ++i)
Assert(cell->child(i)->coarsen_flag_set(),
ExcTriaPrepCoarseningNotCalledBefore());
// $Id$
// Version: $Name$
//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005 by the deal.II authors
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 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
return;
};
- if (old_cell->has_children() && new_cell->has_children())
- for (unsigned int c=0; c<GeometryInfo<dim>::children_per_cell; ++c)
- ::mirror_refinement_flags<dim> (new_cell->child(c), old_cell->child(c));
+ if (old_cell->has_children() && new_cell->has_children())
+ {
+ Assert(old_cell->n_children()==new_cell->n_children(), ExcNotImplemented());
+ for (unsigned int c=0; c<new_cell->n_children(); ++c)
+ ::mirror_refinement_flags<dim> (new_cell->child(c), old_cell->child(c));
+ }
}
if (cell2->has_children() && cell1->has_children())
{
bool grids_changed = false;
-
- for (unsigned int c=0; c<GeometryInfo<dim>::children_per_cell; ++c)
+
+ Assert(cell2->n_children()==cell1->n_children(), ExcNotImplemented());
+ for (unsigned int c=0; c<cell1->n_children(); ++c)
grids_changed |= ::adapt_grid_cells<dim> (cell1->child(c),
cell2->child(c));
return grids_changed;
};
if (!cell2->refine_flag_set())
- for (unsigned int c=0; c<GeometryInfo<dim>::children_per_cell; ++c)
+ for (unsigned int c=0; c<cell1->n_children(); ++c)
if (cell1->child(c)->refine_flag_set() ||
cell1->child(c)->has_children())
{
};
if (!cell1->refine_flag_set())
- for (unsigned int c=0; c<GeometryInfo<dim>::children_per_cell; ++c)
+ for (unsigned int c=0; c<cell2->n_children(); ++c)
if (cell2->child(c)->refine_flag_set() ||
cell2->child(c)->has_children())
{