On Wed, 9 Mar 2011, John Peterson wrote:

> I've just checked in a change which will hopefully please both the
> people who need to call this->clear() at the end of
> PetscNonlinearSolver::solve and the people who want
> PetscNonlinearSolver::print_converged_reason() to work.  The basic
> idea is just to store the SNESConvergedReason at the end of the solve.
> Then in print_converged_reason() it either re-gets the reason if
> (_snes), otherwise (if SNES has since been destroyed) it uses the most
> recently-stored value.

This sounds like a decent workaround, but I'd like to understand the
problem better.  What causes the failure when the SNES object is kept
around?  Do some of the algorithm parameters get changed and then not
reset?

> I'm not sure yet what to do about the old_dof_object stuff.  Roy, I
> think we could definitely use your insight there.  We have some tests
> here which aren't actually crashing, but do have solution diffs to our
> "gold" files.

That's a surprising problem.  I'm not sure what the solution is except
to throw an assertion in before those new lines and see what's
triggering the continue.  I'd have expected anything that hits the
continue there to already have been dying in debug mode when it
requests old dofs that don't exist.

Wait... is the problem that we're not testing the right thing(s) for
old dofs?  That elem->old_dof_object->has_dofs(system.number()) ought
to be returning false in instances where the FE space being used
doesn't store any Dofs on the Elem because they're all on nodes,
right?  And in that case we definitely do *not* want to continue.

Okay, instead of this:

---

if (!elem->old_dof_object || !elem->old_dof_object->has_dofs(system.number()))
   continue;

---

Try this:

---

bool missing_old_dofs = !elem->old_dof_object || 
(elem->has_dofs(system.number()) && 
!elem->old_dof_object->has_dofs(system.number())); 
for (n = 0; !missing_old_dofs && n != elem->n_nodes(); ++n)
   {
     Node *node = elem->get_node(n);
     missing_old_dofs = !node->old_dof_object || 
(node->has_dofs(system.number()) && 
!node->old_dof_object->has_dofs(system.number()));
   {

if (missing_old_dofs)
   continue;

---

This isn't what we should do, because it's definitely *wrong* in the
case of p refinement, but if it fixes your tests it'll at least
confirm that I'm understanding the problem.
---
Roy

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to