MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / OPS_Algorithm

Function OPS_Algorithm

SRC/interpreter/OpenSeesCommands.cpp:1865–1924  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1863}
1864
1865int 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

Callers 2

Tcl_ops_algorithmFunction · 0.85
Py_ops_algorithmFunction · 0.85

Calls 15

OPS_LinearAlgorithmFunction · 0.85
OPS_ModifiedNewtonFunction · 0.85
OPS_KrylovNewtonFunction · 0.85
OPS_RaphsonNewtonFunction · 0.85
OPS_MillerNewtonFunction · 0.85
OPS_SecantNewtonFunction · 0.85
OPS_PeriodicNewtonFunction · 0.85
OPS_ExpressNewtonFunction · 0.85
OPS_BroydenFunction · 0.85
OPS_BFGSFunction · 0.85
OPS_NewtonLineSearchFunction · 0.85

Tested by

no test coverage detected