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

Function TclCreateRecorder

SRC/runtime/commands/domain/recorder.cpp:376–1351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

374}
375
376static int
377TclCreateRecorder(ClientData clientData, Tcl_Interp *interp, int argc,
378 TCL_Char ** const argv, Domain &theDomain, Recorder **theRecorder)
379{
380 assert(clientData != nullptr);
381 Domain* domain = static_cast<Domain*>(clientData);
382 // BasicModelBuilder *builder = static_cast<BasicModelBuilder*>(clientData);
383 // Domain* domain = builder->getDomain();
384 G3_Runtime *rt = G3_getRuntime(interp);
385 (*theRecorder) = nullptr;
386
387 // make sure at least one other argument to contain integrator
388 if (argc < 2) {
389 opserr << "WARNING need to specify a Recorder type\n";
390 return TCL_ERROR;
391 }
392
393 //
394 // check argv[1] for type of Recorder, parse in rest of arguments
395 // needed for the type of Recorder, create the object and add to Domain
396 //
397 OPS_Stream *theOutputStream = nullptr;
398
399 // an Element Recorder or ElementEnvelope Recorder
400 if ((strcmp(argv[1], "Element") == 0) ||
401 (strcmp(argv[1], "EnvelopeElement") == 0) ||
402 (strcmp(argv[1], "NormElement") == 0) ||
403 (strcmp(argv[1], "NormEnvelopeElement") == 0)) {
404
405 OutputOptions options;
406 std::vector<int> unused;
407
408 int numEle = 0;
409 int endEleIDs = 2;
410 double dT = 0.0;
411 double rTolDt = 1e-5;
412 bool echoTime = false;
413 int loc = endEleIDs;
414 ID *eleIDs = 0;
415
416 ID *specificIndices = nullptr;
417
418 while (loc < argc) {
419 int consumed;
420 if ((consumed = parseOutputOption(&options, interp, argc-loc, &argv[loc])) != 0) {
421 if (consumed > 0)
422 loc += consumed;
423 else
424 return TCL_ERROR;
425 }
426
427 else if (strcmp(argv[loc], "-rTolDt") == 0) {
428 loc++;
429 if (loc == argc) {
430 opserr << OpenSees::PromptValueError << "flag -rTolDt is missing required argument\n";
431 return TCL_ERROR;
432 }
433 if (Tcl_GetDouble(interp, argv[loc], &rTolDt) != TCL_OK)

Callers 1

TclAddRecorderFunction · 0.70

Calls 15

G3_getRuntimeFunction · 0.85
parseOutputOptionFunction · 0.85
createOutputStreamFunction · 0.85
createNodeRecorderFunction · 0.85
OPS_VTK_RecorderFunction · 0.85
OPS_ElementRecorderRMSFunction · 0.85
OPS_GmshRecorderFunction · 0.85
push_backMethod · 0.80
IDClass · 0.50
OPS_ResetInputNoBuilderFunction · 0.50
getRegionMethod · 0.45
getElementsMethod · 0.45

Tested by

no test coverage detected