> I have a question regarding how to loop over all active cells within a row
> cell.
I'm not sure what exactly you mean. Do you mean to say "a row of cells"?
> I'm trying to implement the multiscale finite element method with dealii.
> The multiscale bases are calculated on a refined mesh, but their supports
> are within cells belonging to a coarser mesh. I'll first construct a grid,
> then refine it with dealii built-in functions. It would be convenient if I
> can loop over all active cells on the refined mesh living in (raw) cells in
> the coarser mesh. Any hints would be appreciated. Thanks in advance.
The easiest way to do these things is to recursively go through the children
of a coarse mesh cell. For example, let's assume your coarse mesh cells belong
to refinement level 3 of your triangulation, then you can do something like
this:
for (coarse_cell = triangulation.begin(3);
coarse_cell != triangulation.end(3); ++coarse_cell)
for (unsigned int c=0; c<coarse_cell->n_children(); ++c)
do_work (coarse_cell, coarse_cell->child(c));
where
void do_work (cell_iterator coarse_cell,
cell_iterator fine_cell)
{
if (fine_cell->has_childen())
{
for (unsigned int c=0; c<fine_cell->n_children(); ++c)
do_work (coarse_cell, fine_cell->child(c));
return;
}
...fine_cell is now an active cell; do whatever you need to
do on it...
}
Hope this helps
W.
-------------------------------------------------------------------------
Wolfgang Bangerth email: [email protected]
www: http://www.math.tamu.edu/~bangerth/
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii