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

Function specifyAlgorithm

SRC/tcl/commands.cpp:3822–4264  ·  view source on GitHub ↗

command invoked to allow the SolnAlgorithm object to be built

Source from the content-addressed store, hash-verified

3820// command invoked to allow the SolnAlgorithm object to be built
3821//
3822int
3823specifyAlgorithm(ClientData clientData, Tcl_Interp *interp, int argc,
3824 TCL_Char **argv)
3825{
3826 // make sure at least one other argument to contain numberer
3827 if (argc < 2) {
3828 opserr << "WARNING need to specify an Algorithm type \n";
3829 return TCL_ERROR;
3830 }
3831 EquiSolnAlgo *theNewAlgo = 0;
3832 OPS_ResetInputNoBuilder(clientData, interp, 2, argc, argv, &theDomain);
3833
3834 // check argv[1] for type of Algorithm and create the object
3835 if (strcmp(argv[1],"Linear") == 0) {
3836 int formTangent = CURRENT_TANGENT;
3837 int factorOnce = 0;
3838 int count = 2;
3839 while (count < argc) {
3840 if ((strcmp(argv[count],"-secant") == 0) || (strcmp(argv[count],"-Secant") == 0)) {
3841 formTangent = CURRENT_SECANT;
3842 } else if ((strcmp(argv[count],"-initial") == 0) || (strcmp(argv[count],"-Initial") == 0)) {
3843 formTangent = INITIAL_TANGENT;
3844 } else if ((strcmp(argv[count],"-factorOnce") == 0) || (strcmp(argv[count],"-FactorOnce") ==0 )) {
3845 factorOnce = 1;
3846 }
3847 count++;
3848 }
3849 theNewAlgo = new Linear(formTangent, factorOnce);
3850 }
3851
3852 else if (strcmp(argv[1],"Newton") == 0) {
3853 void *theNewtonAlgo = OPS_NewtonRaphsonAlgorithm();
3854 if (theNewtonAlgo == 0)
3855 return TCL_ERROR;
3856
3857 theNewAlgo = (EquiSolnAlgo *)theNewtonAlgo;
3858 if (theTest != 0)
3859 theNewAlgo->setConvergenceTest(theTest);
3860 }
3861
3862 else if ((strcmp(argv[1],"NewtonHallM") == 0) || (strcmp(argv[1],"NewtonHall") == 0)) {
3863 void *theNewtonAlgo = OPS_NewtonHallM();
3864 if (theNewtonAlgo == 0)
3865 return TCL_ERROR;
3866
3867 theNewAlgo = (EquiSolnAlgo *)theNewtonAlgo;
3868 if (theTest != 0)
3869 theNewAlgo->setConvergenceTest(theTest);
3870 }
3871
3872 else if (strcmp(argv[1],"ModifiedNewton") == 0) {
3873 void *theNewtonAlgo = OPS_ModifiedNewton();
3874 if (theNewtonAlgo == 0)
3875 return TCL_ERROR;
3876
3877 theNewAlgo = (EquiSolnAlgo *)theNewtonAlgo;
3878 if (theTest != 0)
3879 theNewAlgo->setConvergenceTest(theTest);

Callers

nothing calls this directly

Calls 8

OPS_NewtonHallMFunction · 0.85
OPS_ModifiedNewtonFunction · 0.85
OPS_ExpressNewtonFunction · 0.85
OPS_ResetInputNoBuilderFunction · 0.50
setConvergenceTestMethod · 0.45
setAlgorithmMethod · 0.45
setAnalysisAlgorithmMethod · 0.45

Tested by

no test coverage detected