Re: [petsc-users] TAO: Finite Difference vs Continuous Adjoint gradient issues

2017-11-23 Thread Julian Andrej
It was indeed a mass scaling issue. We have to project the CADJ derived gradient to the corresponding FE space again. Testing hand-coded gradient (hc) against finite difference gradient (fd), if the ratio ||fd - hc|| / ||hc|| is 0 (1.e-8), the hand-coded gradient is probably correct. Run with

Re: [petsc-users] TAO: Finite Difference vs Continuous Adjoint gradient issues

2017-11-22 Thread Zhang, Hong
Hi Julian, If I remember correctly, you have a code that worked fine with discrete adjoint (TSAdjoint). Was it for the same example? If so, how are the differences in the validation output between continuous adjoint and discrete adjoint? Hong (Mr.) > On Nov 22, 2017, at 3:48 AM, Julian

Re: [petsc-users] TAO: Finite Difference vs Continuous Adjoint gradient issues

2017-11-22 Thread Stefano Zampini
Just to add on Emil's answer: being the adjoint ode linear, you may either being not properly scaling the initial condition (if your objective is a final value one) or the adjoint forcing (i.e. the gradient wrt the state of the objective function if you have a cost gradient) 2017-11-22 18:34

Re: [petsc-users] TAO: Finite Difference vs Continuous Adjoint gradient issues

2017-11-22 Thread Smith, Barry F.
> On Nov 22, 2017, at 3:48 AM, Julian Andrej wrote: > > Hello, > > we prepared a small example which computes the gradient via the continuous > adjoint method of a heating problem with a cost functional. Julian, The first thing to note is that the continuous

Re: [petsc-users] TAO: Finite Difference vs Continuous Adjoint gradient issues

2017-11-22 Thread Emil Constantinescu
On 11/22/17 3:48 AM, Julian Andrej wrote: Hello, we prepared a small example which computes the gradient via the continuous adjoint method of a heating problem with a cost functional. We implemented the text book example and tested the gradient via a Taylor Remainder (which works fine). Now

[petsc-users] TAO: Finite Difference vs Continuous Adjoint gradient issues

2017-11-22 Thread Julian Andrej
Hello, we prepared a small example which computes the gradient via the continuous adjoint method of a heating problem with a cost functional. We implemented the text book example and tested the gradient via a Taylor Remainder (which works fine). Now we wanted to solve the optimization