fg_flux function

Flux-gradient method