| 3799 | } |
| 3800 | |
| 3801 | int OPS_sensitivityAlgorithm() |
| 3802 | { |
| 3803 | if (cmds == 0) return 0; |
| 3804 | |
| 3805 | int analysisTypeTag = 1; |
| 3806 | Integrator* theIntegrator = 0; |
| 3807 | if(cmds->getStaticIntegrator() != 0) { |
| 3808 | theIntegrator = cmds->getStaticIntegrator(); |
| 3809 | } else if(cmds->getTransientIntegrator() != 0) { |
| 3810 | theIntegrator = cmds->getTransientIntegrator(); |
| 3811 | } |
| 3812 | |
| 3813 | // 1: compute at each step (default); 2: compute by command; |
| 3814 | if (OPS_GetNumRemainingInputArgs() < 1) { |
| 3815 | opserr << "ERROR: Wrong number of parameters to sensitivity algorithm." << "\n"; |
| 3816 | return -1; |
| 3817 | } |
| 3818 | if (theIntegrator == 0) { |
| 3819 | opserr << "The integrator needs to be instantiated before " << "\n" |
| 3820 | << " setting sensitivity algorithm." << "\n"; |
| 3821 | return -1; |
| 3822 | } |
| 3823 | |
| 3824 | const char* type = OPS_GetString(); |
| 3825 | if (strcmp(type,"-computeAtEachStep") == 0) |
| 3826 | analysisTypeTag = 1; |
| 3827 | else if (strcmp(type,"-computeByCommand") == 0) |
| 3828 | analysisTypeTag = 2; |
| 3829 | else { |
| 3830 | opserr << "Unknown sensitivity algorithm option: " << type << "\n"; |
| 3831 | return -1; |
| 3832 | } |
| 3833 | |
| 3834 | theIntegrator->setComputeType(analysisTypeTag); |
| 3835 | theIntegrator->activateSensitivityKey(); |
| 3836 | |
| 3837 | return 0; |
| 3838 | } |
| 3839 | // Sensitivity:END ///////////////////////////////////////////// |
no test coverage detected