command invoked to allow the Integrator object to be built
| 4501 | // command invoked to allow the Integrator object to be built |
| 4502 | // |
| 4503 | int |
| 4504 | specifyIntegrator(ClientData clientData, Tcl_Interp *interp, int argc, |
| 4505 | TCL_Char **argv) |
| 4506 | { |
| 4507 | |
| 4508 | OPS_ResetInputNoBuilder(clientData, interp, 2, argc, argv, &theDomain); |
| 4509 | |
| 4510 | // make sure at least one other argument to contain integrator |
| 4511 | if (argc < 2) { |
| 4512 | opserr << "WARNING need to specify an Integrator type \n"; |
| 4513 | return TCL_ERROR; |
| 4514 | } |
| 4515 | |
| 4516 | // check argv[1] for type of Numberer and create the object |
| 4517 | if (strcmp(argv[1],"LoadControl") == 0) { |
| 4518 | double dLambda; |
| 4519 | double minIncr, maxIncr; |
| 4520 | int numIter; |
| 4521 | if (argc < 3) { |
| 4522 | opserr << "WARNING incorrect # args - integrator LoadControl dlam <Jd dlamMin dlamMax>\n"; |
| 4523 | return TCL_ERROR; |
| 4524 | } |
| 4525 | if (Tcl_GetDouble(interp, argv[2], &dLambda) != TCL_OK) |
| 4526 | return TCL_ERROR; |
| 4527 | if (argc > 5) { |
| 4528 | if (Tcl_GetInt(interp, argv[3], &numIter) != TCL_OK) |
| 4529 | return TCL_ERROR; |
| 4530 | if (Tcl_GetDouble(interp, argv[4], &minIncr) != TCL_OK) |
| 4531 | return TCL_ERROR; |
| 4532 | if (Tcl_GetDouble(interp, argv[5], &maxIncr) != TCL_OK) |
| 4533 | return TCL_ERROR; |
| 4534 | } |
| 4535 | else { |
| 4536 | minIncr = dLambda; |
| 4537 | maxIncr = dLambda; |
| 4538 | numIter = 1; |
| 4539 | } |
| 4540 | theStaticIntegrator = new LoadControl(dLambda, numIter, minIncr, maxIncr); |
| 4541 | |
| 4542 | // if the analysis exists - we want to change the Integrator |
| 4543 | if (theStaticAnalysis != 0) |
| 4544 | theStaticAnalysis->setIntegrator(*theStaticIntegrator); |
| 4545 | } else if (strcmp(argv[1],"StagedLoadControl") == 0) { |
| 4546 | double dLambda; |
| 4547 | double minIncr, maxIncr; |
| 4548 | int numIter; |
| 4549 | if (argc < 3) { |
| 4550 | opserr << "WARNING incorrect # args - integrator StagedLoadControl dlam <Jd dlamMin dlamMax>\n"; |
| 4551 | return TCL_ERROR; |
| 4552 | } |
| 4553 | if (Tcl_GetDouble(interp, argv[2], &dLambda) != TCL_OK) |
| 4554 | return TCL_ERROR; |
| 4555 | if (argc > 5) { |
| 4556 | if (Tcl_GetInt(interp, argv[3], &numIter) != TCL_OK) |
| 4557 | return TCL_ERROR; |
| 4558 | if (Tcl_GetDouble(interp, argv[4], &minIncr) != TCL_OK) |
| 4559 | return TCL_ERROR; |
| 4560 | if (Tcl_GetDouble(interp, argv[5], &maxIncr) != TCL_OK) |
nothing calls this directly
no test coverage detected