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

Function OPS_printModel

SRC/interpreter/OpenSeesCommands.cpp:2476–2561  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2474int printIntegrator(OPS_Stream& output);
2475
2476int OPS_printModel()
2477{
2478 int res = 0;
2479
2480 int flag = OPS_PRINT_CURRENTSTATE;
2481
2482 FileStream outputFile;
2483 OPS_Stream *output = &opserr;
2484 bool done = false;
2485
2486 Domain* theDomain = OPS_GetDomain();
2487 if (theDomain == 0) return -1;
2488
2489 // if just 'print' then print out the entire domain
2490 if (OPS_GetNumRemainingInputArgs() < 1) {
2491 opserr << *theDomain;
2492 return 0;
2493 }
2494
2495 while (done == false && OPS_GetNumRemainingInputArgs() > 0) {
2496
2497 const char* arg = OPS_GetString();
2498
2499 // if 'print ele i j k..' print out some elements
2500 if ((strcmp(arg, "-ele") == 0) || (strcmp(arg, "ele") == 0)) {
2501 res = printElement(*output);
2502 done = true;
2503 }
2504 // if 'print node i j k ..' print out some nodes
2505 else if ((strcmp(arg, "-node") == 0) || (strcmp(arg, "node") == 0)) {
2506 res = printNode(*output);
2507 done = true;
2508 }
2509
2510 // if 'print integrator flag' print out the integrator
2511 else if ((strcmp(arg, "integrator") == 0) || (strcmp(arg, "-integrator") == 0)) {
2512 res = printIntegrator(*output);
2513 done = true;
2514 }
2515
2516 // if 'print algorithm flag' print out the algorithm
2517 else if ((strcmp(arg, "algorithm") == 0) || (strcmp(arg, "-algorithm") == 0)) {
2518 res = printAlgorithm(*output);
2519 done = true;
2520 }
2521
2522 // if 'print -JSON' print using JSON format
2523 else if ((strcmp(arg, "JSON") == 0) || (strcmp(arg, "-JSON") == 0)) {
2524 flag = OPS_PRINT_PRINTMODEL_JSON;
2525 }
2526
2527 else {
2528
2529 if ((strcmp(arg, "file") == 0) || (strcmp(arg, "-file") == 0)) {}
2530
2531 if (OPS_GetNumRemainingInputArgs() < 1) break;
2532 const char* filename = OPS_GetString();
2533

Callers 2

Tcl_ops_printFunction · 0.85
Py_ops_printFunction · 0.85

Calls 11

OPS_GetDomainFunction · 0.70
OPS_GetStringFunction · 0.70
printElementFunction · 0.70
printNodeFunction · 0.70
printIntegratorFunction · 0.70
printAlgorithmFunction · 0.70
setFileMethod · 0.45
PrintMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected