On Apr 30, 2010, at 12:29 PM, Roy Stogner wrote:

> Ah, I see.  I guess Ben just assumed that nobody would be reusing the
> same residual function for multiple systems, but then
> dial-an-operator type frameworks break that assumption.

Exactly.

> Personally I'd prefer turning residual/jacobian/matvec into functor
> objects over adding a System* or void* state argument.

Hmmm.... I think I prefer the object-oriented approach over this... but I'm not 
married to it.

> One other possibility that Ben pointed out the other day, though: 
> The DiffSolver framework originally was written to only work for
> DiffSystem because it relied on being able to call assembly(bool,bool)
> to request calculation of residuals, jacobians, or both at once, and
> the other existing System subclasses couldn't do that.  But when all
> the adjoint work required assembly(bool,bool) too, I moved the
> definition up to ImplicitSystem and added implementations (sometimes
> suboptimally efficient for backwards compatibility...) for
> LinearImplicitSystem and NonlinearImplicitSystem.  So now we could
> make DiffSolver work with any ImplicitSystem, you could use
> PetscDiffSolver (or NewtonSolver) instead of PetscNonlinearSolver, and
> since the assembly calls from there are class methods you'd have all
> the state you need.

Well... I think I just need to move over to DiffSystem.... but that's not 
happening soon enough.

I think for now I'm just going to modify the signatures of the callback to 
provide the System being solved... and think about grander ideas later.

Objections?

Derek
------------------------------------------------------------------------------
_______________________________________________
Libmesh-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to