//random refinement. we need to do this since DerivativeApproximation
//isn't really ready yet for hp
-// DerivativeApproximation::approximate_gradient (mapping_collection[0],
-// dof_handler,
-// solution2,
-// gradient_indicator);
-
- for (unsigned int i=0; i<gradient_indicator.size(); ++i)
- gradient_indicator(i) = std::sin(3.14*i/gradient_indicator.size());
+ DerivativeApproximation::approximate_gradient (dof_handler,
+ solution2,
+ gradient_indicator);
// and they are cell-wise scaled by
// the factor $h^{1+d/2}$
// h-refinement.
cell = dof_handler.begin_active ();
for (; cell!=endc; ++cell)
- if (!cell->refine_flag_set ())
+ if (!cell->refine_flag_set ()
+ &&
+ (cell->active_fe_index() < fe_collection.size()-1))
cell->set_active_fe_index (cell->active_fe_index () + 1);
triangulation.execute_coarsening_and_refinement ();
data_out.attach_dof_handler (dof_handler);
data_out.add_data_vector (solution2, "u");
- data_out.build_patches (5);
+ data_out.build_patches (4);
// data_out.write_gnuplot(gnuplot_output);
data_out.write_gmv(gnuplot_output);
template <int dim>
void DGMethod<dim>::run ()
{
- for (unsigned int cycle=0; cycle<5; ++cycle)
+ for (unsigned int cycle=0; cycle<7; ++cycle)
{
deallog << "Cycle " << cycle << ':' << std::endl;