next up previous contents
Next: conj() Up: Infrastructure Previous: ``physics2.c''

get_grad_and_E()

pvector get_grad_and_E(double& E,const pvector& u,const pvector& Vtilde);

Return value:

Output:

Input:

To make the transition to the Kohn-Sham equations easier, it helps to isolate the algorithm (conjugate-gradients) from the physics (computation of E and grad). To do this, make a copy of your ``sch.C'' program called ``sch2.C'' and add a function of the above prototype to it.

Debugging: Write ``sch2.C'' so that it calls get_grad_and_E() to do all of the energy and gradient calculations, and verify that it produces exactly the same output as your original ``sch.C.''



Tomas Arias
Thu Apr 26 18:07:33 EDT 2001