Dear AD community,

as the suggestion arose during the
  10th European AD Workshop,  June 3-4, 2010, University of Paderborn
to release my code as example for the AD community to try their codes
on, everyone is invited to test their C/C++ tools on this
example.

Please drop me a line if you are interested in trying this example, so
I can keep you posted on developments related to it. Email:
  rene.schneider@mathematik.tu-chemnitz.de

I have now put the AD prepared code on my webpage: 
  http://www-user.tu-chemnitz.de/~rens/software/feins/feins_AD_elem_release_100607.tgz

General info regarding the code:
  http://www-user.tu-chemnitz.de/~rens/software/feins/

Especially the README.txt gives some information on how to compile
etc. However, some of this is not valid for the released version, as
this version was modified to fit ADOL-C. Thus this version requires
ADOL-C to compile and run.

I have decided to use this version as it contains all the AD relevant
information. This is the "element level" structure exploiting AD I
spoke about in my presentation.

The routines to be differentiated are in file navsto_adj.c:
    navsto_perf_I_t21()
    navsto_Psi_tim_Res_t21()

Both contain already the interface to return the derivatives. Only
small parts of these routines are AD active, those between trace_on
and trace_off. The computations in these parts require quite a few
constants and a lot of general information, which is why I did not
formulate a function for the "computational core" of the routine. I
trust you will do that if the need arises. If anyone does so, please
let me know so I can put that on the website for all.

Differentiation is done wrt. msh->vertex[], see the header of the
routines for a bit more information. If questions arise, I'll be happy
to answer.

Please note that a subdirectory "visual" is expected to exist. I
usually keep this on a local disk, as it is used for relatively large
file writes for the visualisation of the FEM solution and related
stuff. A "mkdir /tmp/feins-visual; ln -s /tmp/feins-visual visual"
should do the trick for you.

If you have ADOL-C available, you can compile and test the code:
------- #check ADOLC is really there echo $ADOLC

#compile the main
make test_navsto_solver

#run it:
./test_navsto_solver cavity_q_t128_Re10.f1m 0 5
#this will overwrite the files "..._crit" "..._grad" "..._sol", see
ls -lh cavity_q_t128_Re10.f1m_*
# the tar contains the files resulting from the call above,
# so you have something to compare to. 
# example output is also available, it was recorded by
(time ./test_navsto_solver cavity_q_t128_Re10.f1m 0 5) &>cavity_q_t128_Re10.f1m_ADOLC_out_0_5.txt
-------

If the problem size of 37 thousand is to slow for testing, you can
lower the level of mesh refinement, i.e. the last argument, 5 in the
example above, to 2 or 1. (Not sure is 0 works as well.)

Looking forward to interesting discussions and results.

Rene Schneider