| 1863 | } |
| 1864 | |
| 1865 | int OPS_Algorithm() |
| 1866 | { |
| 1867 | if (OPS_GetNumRemainingInputArgs() < 1) { |
| 1868 | opserr << "WARNING insufficient args: algorithm type ...\n"; |
| 1869 | return -1; |
| 1870 | } |
| 1871 | |
| 1872 | const char* type = OPS_GetString(); |
| 1873 | |
| 1874 | // create algorithm |
| 1875 | EquiSolnAlgo* theAlgo = 0; |
| 1876 | if (strcmp(type, "Linear") == 0) { |
| 1877 | theAlgo = (EquiSolnAlgo*) OPS_LinearAlgorithm(); |
| 1878 | |
| 1879 | } else if (strcmp(type, "Newton") == 0) { |
| 1880 | theAlgo = (EquiSolnAlgo*) OPS_NewtonRaphsonAlgorithm(); |
| 1881 | |
| 1882 | } else if (strcmp(type, "ModifiedNewton") == 0) { |
| 1883 | theAlgo = (EquiSolnAlgo*) OPS_ModifiedNewton(); |
| 1884 | |
| 1885 | } else if (strcmp(type, "KrylovNewton") == 0) { |
| 1886 | theAlgo = (EquiSolnAlgo*) OPS_KrylovNewton(); |
| 1887 | |
| 1888 | } else if (strcmp(type, "RaphsonNewton") == 0) { |
| 1889 | theAlgo = (EquiSolnAlgo*) OPS_RaphsonNewton(); |
| 1890 | |
| 1891 | } else if (strcmp(type, "MillerNewton") == 0) { |
| 1892 | theAlgo = (EquiSolnAlgo*) OPS_MillerNewton(); |
| 1893 | |
| 1894 | } else if (strcmp(type, "SecantNewton") == 0) { |
| 1895 | theAlgo = (EquiSolnAlgo*) OPS_SecantNewton(); |
| 1896 | |
| 1897 | } else if (strcmp(type, "PeriodicNewton") == 0) { |
| 1898 | theAlgo = (EquiSolnAlgo*) OPS_PeriodicNewton(); |
| 1899 | |
| 1900 | } else if (strcmp(type, "ExpressNewton") == 0) { |
| 1901 | theAlgo = (EquiSolnAlgo*) OPS_ExpressNewton(); |
| 1902 | |
| 1903 | } else if (strcmp(type, "Broyden") == 0) { |
| 1904 | theAlgo = (EquiSolnAlgo*)OPS_Broyden(); |
| 1905 | |
| 1906 | } else if (strcmp(type, "BFGS") == 0) { |
| 1907 | theAlgo = (EquiSolnAlgo*)OPS_BFGS(); |
| 1908 | |
| 1909 | } else if (strcmp(type, "NewtonLineSearch") == 0) { |
| 1910 | theAlgo = (EquiSolnAlgo*)OPS_NewtonLineSearch(); |
| 1911 | |
| 1912 | } else { |
| 1913 | opserr<<"WARNING unknown algorithm type "<<type<<"\n"; |
| 1914 | } |
| 1915 | |
| 1916 | // set algorithm |
| 1917 | if (theAlgo != 0) { |
| 1918 | if (cmds != 0) { |
| 1919 | cmds->setAlgorithm(theAlgo); |
| 1920 | } |
| 1921 | } |
| 1922 |
no test coverage detected