// try to interpolate from the active cell onto the coarsest cell,
// which is definitely not active. this can't work, so expect an
- // exception
+ // exception for both the call to cell->get_fe() and the call to
+ // cell->get_interpolated_dof_values
typename hp::DoFHandler<dim>::cell_iterator cell=dof_handler.begin(0);
- Vector<double> local (cell->get_fe().dofs_per_cell);
+
+ unsigned int dofs_per_cell = 4;
+ try
+ {
+ dofs_per_cell = cell->get_fe().dofs_per_cell;
+ }
+ catch (const ExceptionBase &e)
+ {
+ deallog << "Yes, exception 1!" << std::endl;
+ deallog << e.get_exc_name() << std::endl;
+ }
+ Vector<double> local (dofs_per_cell);
try
{
}
catch (const ExceptionBase &e)
{
- deallog << "Yes, exception!" << std::endl;
+ deallog << "Yes, exception 2!" << std::endl;
deallog << e.get_exc_name() << std::endl;
}
}
-DEAL::Yes, exception!
+DEAL::Yes, exception 1!
+DEAL::ExcMessage ("In hp::DoFHandler objects, finite elements are only associated " "with active cells. Consequently, you can not ask for the " "active finite element on cells with children.")
+DEAL::Yes, exception 2!
DEAL::ExcMessage ("You cannot call this function on non-active cells " "of hp::DoFHandler objects unless you provide an explicit " "finite element index because they do not have naturally " "associated finite element spaces associated: degrees " "of freedom are only distributed on active cells for which " "the active_fe_index has been set.")
-DEAL::Yes, exception!
+DEAL::Yes, exception 1!
+DEAL::ExcMessage ("In hp::DoFHandler objects, finite elements are only associated " "with active cells. Consequently, you can not ask for the " "active finite element on cells with children.")
+DEAL::Yes, exception 2!
DEAL::ExcMessage ("You cannot call this function on non-active cells " "of hp::DoFHandler objects unless you provide an explicit " "finite element index because they do not have naturally " "associated finite element spaces associated: degrees " "of freedom are only distributed on active cells for which " "the active_fe_index has been set.")
-DEAL::Yes, exception!
+DEAL::Yes, exception 1!
+DEAL::ExcMessage ("In hp::DoFHandler objects, finite elements are only associated " "with active cells. Consequently, you can not ask for the " "active finite element on cells with children.")
+DEAL::Yes, exception 2!
DEAL::ExcMessage ("You cannot call this function on non-active cells " "of hp::DoFHandler objects unless you provide an explicit " "finite element index because they do not have naturally " "associated finite element spaces associated: degrees " "of freedom are only distributed on active cells for which " "the active_fe_index has been set.")
// try to interpolate from the active cell onto the coarsest cell,
// which is definitely not active. this can't work, so expect an
- // exception
+ // exception for both the call to cell->get_fe() and the call to
+ // cell->get_interpolated_dof_values
typename hp::DoFHandler<dim>::cell_iterator cell=dof_handler.begin(0);
- Vector<double> local (cell->get_fe().dofs_per_cell);
+ unsigned int dofs_per_cell = 4;
try
{
- cell->get_interpolated_dof_values (solution, local);
+ dofs_per_cell = cell->get_fe().dofs_per_cell;
+ }
+ catch (const ExceptionBase &e)
+ {
+ deallog << "Yes, exception 1!" << std::endl;
+ deallog << e.get_exc_name() << std::endl;
+ }
+ Vector<double> local (dofs_per_cell);
+
+ try
+ {
+ cell->set_dof_values_by_interpolation (local, solution);
}
catch (const ExceptionBase &e)
{
+DEAL::Yes, exception 1!
+DEAL::ExcMessage ("In hp::DoFHandler objects, finite elements are only associated " "with active cells. Consequently, you can not ask for the " "active finite element on cells with children.")
DEAL::Yes, exception!
DEAL::ExcMessage ("You cannot call this function on non-active cells " "of hp::DoFHandler objects unless you provide an explicit " "finite element index because they do not have naturally " "associated finite element spaces associated: degrees " "of freedom are only distributed on active cells for which " "the active_fe_index has been set.")
+DEAL::Yes, exception 1!
+DEAL::ExcMessage ("In hp::DoFHandler objects, finite elements are only associated " "with active cells. Consequently, you can not ask for the " "active finite element on cells with children.")
DEAL::Yes, exception!
DEAL::ExcMessage ("You cannot call this function on non-active cells " "of hp::DoFHandler objects unless you provide an explicit " "finite element index because they do not have naturally " "associated finite element spaces associated: degrees " "of freedom are only distributed on active cells for which " "the active_fe_index has been set.")
+DEAL::Yes, exception 1!
+DEAL::ExcMessage ("In hp::DoFHandler objects, finite elements are only associated " "with active cells. Consequently, you can not ask for the " "active finite element on cells with children.")
DEAL::Yes, exception!
DEAL::ExcMessage ("You cannot call this function on non-active cells " "of hp::DoFHandler objects unless you provide an explicit " "finite element index because they do not have naturally " "associated finite element spaces associated: degrees " "of freedom are only distributed on active cells for which " "the active_fe_index has been set.")