geodynamics / aspect

A parallel, extensible finite element code to simulate convection in both 2D and 3D models.
https://aspect.geodynamics.org/
Other
224 stars 235 forks source link

Fix unclear comment in mesh refinement criteria #2093

Open bangerth opened 6 years ago

bangerth commented 6 years ago

Found while looking at #2091: several of the mesh refinement plugins contain the following test:

    template <int dim>
    void
    CompositionThreshold<dim>::tag_additional_cells () const
    {
      AssertThrow (this->n_compositional_fields() >= 1,
                   ExcMessage ("This refinement criterion can not be used when no "
                               "compositional fields are active!"));

      // tag_additional_cells is executed before the equations are solved
      // for the very first time. If we do not have the finite element, we
      // do not have the compositional fields and just do nothing in this plugin.
      if (this->get_dof_handler().n_locally_owned_dofs() == 0)
        return;

I don't actually know what that comment is supposed to mean. If someone can tell me, I'll fix it in all relevant places.

tjhei commented 6 years ago

We call mesh_refinement_manager.tag_additional_cells () in Simulator<dim>::run before we call setup_dofs, right? Maybe that is the reason?