mesh-adaptation / goalie

Goal-oriented error estimation and mesh adaptation for finite element problems solved using Firedrake
Other
1 stars 1 forks source link

Subinterval convergence: only drop out early subintervals #21

Closed ddundo closed 12 months ago

ddundo commented 1 year ago

To recap the issue from today's meeting: I think we should only not adapt a subinterval j whose converged status mesh_seq.converged[j] = True if all previous subintervals have also converged, since adapting those earlier ones will affect the solution field at subinterval j. Ideally we wouldn't even solve those first intervals then (as Joe mentioned in pyroteus/goalie#17 ) since their solution won't change.

Two ways to deal with this:

  1. leaving MeshSeq as it is and modifying the convergence status inside the adaptor function. For example,
    def adaptor(mesh_seq, solutions):
    mesh_seq.converged[np.where(mesh_seq.converged == False)[0][0]:] = False
  2. Change MeshSeq so that this is default behaviour, i.e. just break the loop at L602-L603 here:
      if abs(ne - ne_) <= self.params.element_rtol * ne_:
          self.converged[i] = True
      else:
          break

On the meeting I said that I'd update the demo (i.e. option 1) but I think it would make sense to change the default behaviour (i.e. option 2) since I can't imagine we'd want something else (?). It would also make it straightforward to implement pyroteus/goalie#17 .

Also, in GoalOrientedMeshSeq, I think using check_estimator_convergence and check_element_count_convergence is a bit odd at the moment, since the subinterval convergence status is set to True if either of those two are True. Wouldn't it make more sense to require both of them to be True instead?