If you forget to initialize a DoFHandler with a Triangulation,
distribute_dofs() gives an unhelpful Assert() somewhere deep in the
code. Fix this.
template <int dim, int spacedim>
void DoFHandler<dim,spacedim>::distribute_dofs (const FiniteElement<dim,spacedim> &ff)
{
+ Assert(tria!=nullptr,
+ ExcMessage("You need to set the Triangulation in the DoFHandler using initialize() or "
+ "in the constructor before you can distribute DoFs."));
+ Assert (tria->n_levels() > 0,
+ ExcMessage("The Triangulation you are using is empty!"));
+
fe_collection = std_cxx14::make_unique<hp::FECollection<dim, spacedim>>(ff);
// delete all levels and set them
template <int dim, int spacedim>
void DoFHandler<dim,spacedim>::distribute_dofs (const hp::FECollection<dim,spacedim> &ff)
{
- Assert (tria->n_levels() > 0, ExcInvalidTriangulation());
+ Assert(tria!=nullptr,
+ ExcMessage("You need to set the Triangulation in the DoFHandler using initialize() or "
+ "in the constructor before you can distribute DoFs."));
+ Assert (tria->n_levels() > 0,
+ ExcMessage("The Triangulation you are using is empty!"));
finite_elements = &ff;
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams