| 762 | } |
| 763 | |
| 764 | int Hessian::refineHessian(int time, int colOfHessian) |
| 765 | { |
| 766 | Vector column(sizeOfHessian); |
| 767 | |
| 768 | double tol = perturbTol; |
| 769 | int ii = colOfHessian; |
| 770 | int success =-1; |
| 771 | int kk=0; |
| 772 | static Vector grad_1(sizeOfHessian); |
| 773 | static Vector grad_2(sizeOfHessian); |
| 774 | static Vector grad_3(sizeOfHessian); |
| 775 | |
| 776 | Vector u = *designPointUSpace; |
| 777 | |
| 778 | /* |
| 779 | theProbabilityTransformation->set_u(u); |
| 780 | int result = theProbabilityTransformation->transform_u_to_x_andComputeJacobian(); |
| 781 | if (result < 0) { |
| 782 | opserr << "Hessian::formHessianByFDM - " << endln |
| 783 | << " could not transform from u to x." << endln; |
| 784 | return -1; |
| 785 | } |
| 786 | Matrix jacobian_x_u = theProbabilityTransformation->getJacobian_x_u(); |
| 787 | */ |
| 788 | Matrix jacobian_x_u; |
| 789 | int result = theProbabilityTransformation->getJacobian_x_to_u(jacobian_x_u); |
| 790 | if (result < 0) { |
| 791 | opserr << "Hessian::formHessianByFDM - " << endln |
| 792 | << " could not transform from u to x." << endln; |
| 793 | return -1; |
| 794 | } |
| 795 | |
| 796 | double u_1, u_2, u_3; |
| 797 | |
| 798 | u_1 =u(ii); |
| 799 | grad_1.addVector(0.0, *standSens,1.0); |
| 800 | |
| 801 | //u_2 = u(ii)*tol; |
| 802 | //grad_2=g(u_2); |
| 803 | |
| 804 | Vector gradientOfgFunction(sizeOfHessian ); |
| 805 | |
| 806 | double u_save = u(ii); |
| 807 | |
| 808 | if (fabs(u(ii))<1.0e-10) { |
| 809 | opserr<<"Warning: u("<<ii<<") is "<<u(ii)<<"!!!!"<<endln; |
| 810 | u(ii)=-tol/100.0; |
| 811 | } |
| 812 | else u(ii) = u(ii)*(1.0-tol); |
| 813 | |
| 814 | u_2=u(ii); |
| 815 | |
| 816 | opserr<<"re-perturbation to get hessian, ii:"<<ii<<". u_2:"<<u_2<<endln; |
| 817 | |
| 818 | |
| 819 | /* |
| 820 | theProbabilityTransformation->set_u(u); |
| 821 | result = theProbabilityTransformation->transform_u_to_x_andComputeJacobian(); |
nothing calls this directly
no test coverage detected