It turns out that the call to prepare_for_use was unnecessary.... somewhere along the line I screwed up my cause and effect ;-)

I do get negative Jacobians sometimes.... well... I don't think they're actually negative as much as they are possibly -0...

It happens when the smoother pushes points too close together... which is of course not good, but that's what I'm working on....

I thought I was getting this error prematurely, but it looks like I wasn't... so false alarm...

Thanks for the reply,

On 6/7/06, Roy Stogner <> wrote:
On Tue, 6 Jun 2006, Derek Gaston wrote:

> So I've implemented Larisa's smoother inside libmesh (well... I've
> shoehorned her code into a mesh_smoother based class and hooked everything
> up so it works... there is still a _lot_ of improvement left to be done) and
> now I'm trying to use it... I was trying to use it in mid-iteration during
> an explicit solve (modified example10)... and after doing the smooth I was
> getting an error of:
> ERROR: negative Jacobian!
> [0] src/fe/fe_map.C, line 312, compiled Jun  5 2006 at 20:27:59
> After thinking about it for a while I decided to run mesh.prepare_for_use().
> This seems to work.... but I'm kind of in the dark as to why.  What is it
> about moving the mesh nodes that needs prepare_for_use?  Further, is this
> really what I should be doing, or is there another function I should be
> using instead?

If you just change the node positions, then it's of course possible to
accidentally invert an element and get a negative Jacobian error from
fe_map.C... but there shouldn't be anything that prepare_for_use()
does that would affect that.

Have you run this through the debugger yet, to see why you're getting
a negative Jacobian on one of your elements?