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

Function printA

SRC/runtime/commands/analysis/analysis.cpp:480–639  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

478}
479
480static int
481printA(ClientData clientData, Tcl_Interp *interp, Tcl_Size argc, TCL_Char ** const argv)
482{
483 // printA <filename> - m <double> -c <double> -k <double>
484 assert(clientData != nullptr);
485 BasicAnalysisBuilder *builder = (BasicAnalysisBuilder*)clientData;
486
487 int res = 0;
488
489 enum class Format {
490 None
491 } format = Format::None;
492
493 FileStream outputFile;
494 OPS_Stream *output = &opserr;
495 LinearSOE *oldSOE = builder->getLinearSOE();
496
497
498 // Cant allocate theSolver on stack because theSOE is going to
499 // delete it
500 FullGenLinLapackSolver *theSolver = new FullGenLinLapackSolver();
501 FullGenLinSOE theSOE(*theSolver);
502
503 builder->set(&theSOE, false);
504 // invoke domainChange which constructs a graph and passes
505 // it to the SOE. Otherwise, getA() returns null
506 builder->domainChanged();
507
508
509 bool ret = false;
510 double m = 0.0, c = 0.0, k = 0.0;
511 bool do_mck = false;
512 int currentArg = 1;
513 while (currentArg < argc) {
514 if ((strcmp(argv[currentArg], "file") == 0) ||
515 (strcmp(argv[currentArg], "-file") == 0)) {
516 currentArg++;
517 if (currentArg == argc) {
518 opserr << G3_WARN_PROMPT << "-file missing argument\n";
519 return TCL_ERROR;
520 }
521
522 if (outputFile.setFile(argv[currentArg]) != 0) {
523 opserr << "failed to open file: "
524 << argv[currentArg] << "\n";
525 return TCL_ERROR;
526 }
527 output = &outputFile;
528 }
529 else if ((strcmp(argv[currentArg], "ret") == 0) ||
530 (strcmp(argv[currentArg], "-ret") == 0)) {
531 ret = true;
532
533 } else if ((strcmp(argv[currentArg], "-m") == 0)) {
534 currentArg++;
535 if (Tcl_GetDouble(interp, argv[currentArg], &m) != TCL_OK) {
536 opserr << OpenSees::PromptValueError << "failed to read float following flag -m\n";
537 return TCL_ERROR;

Callers

nothing calls this directly

Calls 14

getLinearSOEMethod · 0.45
setMethod · 0.45
domainChangedMethod · 0.45
setFileMethod · 0.45
formTangentMethod · 0.45
revertToLastStepMethod · 0.45
getStaticIntegratorMethod · 0.45
getAMethod · 0.45
noRowsMethod · 0.45
noColsMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected